"4674885","1","4674948","","2011-01-12 22:47:01","0","4874","<p>I'm trying to use a ListView inside of a RelativeLayout but when I run my app I get a runtimeexception with the message:</p><p>Binary XML file line #2: You must supply a layout_width attribute.</p><p>I tried putting layout_width attributes in every conceivable place in the xml resource files but so far no luck.</p><p>I attempt to populate the listview with this line of code:</p><pre><code>   setListAdapter(new ArrayAdapter(this,           R.layout.tablerow3, R.id.label,           items));</code></pre><p>Here's the tablerow3.xml contents:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""&gt;          android:layout_width=""20dp""          android:layout_height=""5dp""          android:id=""@+id/tablerow01""&gt;      &lt;Label android:id=""@+id/label01""      android:layout_width=""5dp""  android:layout_height=""5dp""      android:textColor=""@color/solid_white""         android:singleLine=""true""/&gt;      &lt;Label android:id=""@+id/label02""      android:layout_width=""5dp""  android:layout_height=""5dp""         android:textColor=""@color/solid_white""         android:singleLine=""true""/&gt;      &lt;/LinearLayout&gt;</code></pre><p>Here's the xml that contains the RelativeLayout(forex2.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=""fill_parent""&gt;   &lt;Button android:text=""Static Button""      android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentLeft=""true""        android:layout_alignParentTop=""true""        android:id=""@+id/button_id""&gt;      &lt;/Button&gt;        &lt;Spinner android:id=""@+id/spinner1""            android:layout_width=""match_parent""            android:layout_toRightOf=""@id/button_id""            android:layout_alignParentTop=""true""            android:layout_height=""wrap_content""            android:drawSelectorOnTop=""true""        /&gt;    &lt;ListView android:id=""@android:id/list""   android:layout_width=""5dp""  android:layout_height=""5dp""  android:layout_alignParentBottom=""true""   /&gt;   &lt;!--  android:layout_width=""wrap_content""  android:layout_height=""wrap_content"" --&gt; &lt;/RelativeLayout&gt;</code></pre>","549226","","","","","2012-06-05 22:31:17","Getting message in android app: Binary XML file line #2: You must supply a layout_width attribute","<java><android>","3","0","","",""
"4674919","1","8869515","","2011-01-12 22:50:10","0","2632","<p>I'm trying to create a class that can be added to a Layout file, have an adapter set and then update from a DataSetObserver.</p><p>On the Nexus One this generally seems to work fine, however on the G1 I get some odd behaviour.</p><p>So the Layout File for the Activity is:</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:layout_width=""fill_parent""  android:layout_height=""wrap_content"" android:id=""@+id/ActionBarInclude""  layout=""@layout/action_bar""&gt;&lt;/include&gt;  &lt;LinearLayout android:layout_width=""fill_parent""   android:layout_height=""fill_parent"" android:orientation=""vertical""   android:background=""@drawable/action_bar_drop_shadow""&gt;   &lt;TextView android:layout_height=""wrap_content""    android:layout_width=""fill_parent"" android:gravity=""center""    android:id=""@+id/AccountSummaryAppTitleTextView"" android:text=""""    style=""@style/titleTextView""&gt;&lt;/TextView&gt;   &lt;co.uk.gauntface.android.admob.views.TabBarScrollView    android:id=""@+id/AccountSummaryTabBarScrollView""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:scrollbars=""none""&gt;   &lt;/co.uk.gauntface.android.admob.views.TabBarScrollView&gt;   &lt;co.uk.gauntface.android.admob.views.SlidingLayout android:layout_width=""fill_parent""    android:id=""@+id/AccountSummarySlidingLayout"" android:layout_weight=""1""    android:layout_height=""wrap_content"" android:scrollbars=""none"" android:fadingEdge=""none""    android:fillViewport=""true""&gt;            &lt;/co.uk.gauntface.android.admob.views.SlidingLayout&gt;  &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Now the reason I've set FillViewPort to true is because of a similar issue here: <a href=""http://stackoverflow.com/questions/2599837/linearlayout-not-expanding-inside-a-scrollview"">LinearLayout not expanding inside a ScrollView</a>although this hasn't fixed my issue.</p><p>The source code for the Activity is:</p><pre><code>package co.uk.gauntface.android.admob;import java.util.ArrayList;import co.uk.gauntface.android.admob.models.RawSite;import co.uk.gauntface.android.admob.models.SiteStat;import co.uk.gauntface.android.admob.networking.AdmobDownloadListener;import co.uk.gauntface.android.admob.networking.SiteStatService;import co.uk.gauntface.android.admob.views.AccountSummaryAdapter;import co.uk.gauntface.android.admob.views.SlidingLayout;import co.uk.gauntface.android.admob.views.TabBarScrollView;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.util.Log;import android.view.View;import android.widget.TextView;public class AccountSummary extends AdmobActivity{  private final static String TAG = ""admob""; public static final String ACCOUNT_SUMMARY_INTENT_EXTRA_ID = ""AccountSummaryIntentExtraID""; private String mAccountID; private RawSite mRawSiteData; private Handler mHandler; private SiteStatService mSiteStatService; private ArrayList&lt;SiteStat&gt; mSiteStatData; private ActionBarHelper mActionBarHelper; private TextView mAppTitleTextView; private TabBarScrollView mTabBarScrollView; private SlidingLayout mSlidingLayout; private AccountSummaryAdapter mAdapter; /** Called when the activity is first created. */ public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.account_summary);  mAccountID = getIntent().getExtras().getString(ACCOUNT_SUMMARY_INTENT_EXTRA_ID);  mSiteStatService = new SiteStatService(getApplicationContext());  //mChartAdapter = new PointPositionAdapter(getApplicationContext());  initActivity();  setUpUI();  if(getLastNonConfigurationInstance() != null) {   mSiteStatData = (ArrayList&lt;SiteStat&gt;) getLastNonConfigurationInstance();   mAdapter.setSiteStatData(mSiteStatData);  } else {   updateSiteStatData();  } } /**public void onConfigurationChanged (Configuration newConfig) {  super.onConfigurationChanged(newConfig);  setContentView(R.layout.account_summary);  setUpUI(); }**/ @Override public Object onRetainNonConfigurationInstance() {  return mSiteStatData; } private void initActivity() {  mHandler = new Handler() {   public void handleMessage(Message msg) {    switch(msg.arg1) {    default:     break;    }   }  };  mAdapter = new AccountSummaryAdapter(getApplicationContext(), new Integer[]{   R.string.revenue,   R.string.ecpm,   R.string.requests,   R.string.impressions,   R.string.fill_rate,   R.string.ctr  });  DatabaseManager dbManager = new DatabaseManager(getApplicationContext());  dbManager.open();  mRawSiteData = dbManager.getSite(mAccountID);  dbManager.close(); } private void setUpUI() {  mActionBarHelper = new ActionBarHelper(this);  mAppTitleTextView = (TextView) findViewById(R.id.AccountSummaryAppTitleTextView);  mAppTitleTextView.setText(mRawSiteData.getSiteName());  mTabBarScrollView = (TabBarScrollView) findViewById(R.id.AccountSummaryTabBarScrollView);  mTabBarScrollView.setAdapter(mAdapter.getTabBarAdapter());  mTabBarScrollView.setOnItemOnClickListener(mAdapter);  mSlidingLayout = (SlidingLayout) findViewById(R.id.AccountSummarySlidingLayout);  mSlidingLayout.setAdapter(mAdapter.getSlidingLayoutAdapter());  mSlidingLayout.setOnDisplayChangeListener(mAdapter); } private void updateSiteStatData() {  mActionBarHelper.incrementRequests();  int daysToGet = getResources().getInteger(R.integer.account_summary_days);  mSiteStatService.downloadDailySiteStats(daysToGet, mRawSiteData.getSiteID(), new AdmobDownloadListener() {   public void onDownloadSuccess(Object obj) {    mActionBarHelper.decrementRequests();    mSiteStatData = (ArrayList&lt;SiteStat&gt;) obj;    //mAdapter.setSiteStatData(mSiteStatData);   }   public void onDownloadError(int errorCode, String errorMsg) {    mActionBarHelper.decrementRequests();    displayErrorMessage(errorCode, errorMsg);   }  }); } public void onClick(View v) {  switch(v.getId())  {  case R.id.ActionBarRefreshImageButton:   updateSiteStatData();   break;  } }}</code></pre><p>Which will display the views fine, however the SlidingLayout will actually appear blank (i.e it will not inflate the views contained in the LinearLayout.</p><p>The Source code for the SlidingLayout is:</p><pre><code>package co.uk.gauntface.android.admob.views;import co.uk.gauntface.android.admob.R;import android.content.Context;import android.database.DataSetObserver;import android.util.AttributeSet;import android.util.Log;import android.view.MotionEvent;import android.view.View;import android.view.ViewConfiguration;import android.widget.Adapter;import android.widget.HorizontalScrollView;import android.widget.LinearLayout;public class SlidingLayout extends HorizontalScrollView { private static final String TAG = ""admob""; private int mSelectedPosition; private int mNewSelectedPosition; private LinearLayout mContainerLinearLayout; private int mScaledTouchSlop; private float mPrevX; private int mItemCount; private boolean mIsTouchEventScroll; private SlidingLayoutAdapter mAdapter; private DataSetObserver mDataSetObserver; private OnDisplayChangeListener mDisplayChangeListener; public SlidingLayout(Context context) {  super(context);  constructor(); } public SlidingLayout(Context context, AttributeSet attrs) {  super(context, attrs);  constructor(); } public SlidingLayout(Context context, AttributeSet attrs, int defStyle) {  super(context, attrs, defStyle);  constructor(); } private void constructor() {  Log.v(TAG, ""SlidingLayout: constructor()"");  mSelectedPosition = 0;  mNewSelectedPosition = 0;  mItemCount = 0;  mScaledTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop(); } @Override public boolean onTouchEvent(MotionEvent event) {  Log.v(TAG, ""SlidingLayout: onTouchEvent()"");  int action = event.getAction();  switch (action) {  case MotionEvent.ACTION_DOWN:   break;  case MotionEvent.ACTION_MOVE:   int deltaX = (int) (mPrevX - event.getX());   scrollBy(deltaX, 0);   break;  case MotionEvent.ACTION_UP:   animateToPosition();  }  mPrevX = event.getX();  return true; } private void animateToPosition() {  Log.v(TAG, ""SlidingLayout: animateToPosition()"");  double scrollX = getScrollX();  int screenWidth = getWidth();  double ratio = scrollX / (double) screenWidth;  int whichScreen = (int) Math.round(ratio);  if(whichScreen &gt;= 0 &amp;&amp; whichScreen &lt; mItemCount) {   int newX = whichScreen * screenWidth;   //int screenDiff = whichScreen - mDisplayedView;   int screenDiff = whichScreen - mSelectedPosition;   switch(screenDiff) {   case -1:    mNewSelectedPosition = mSelectedPosition - 1;    break;   case 0:    mNewSelectedPosition = mSelectedPosition;    break;   case 1:    mNewSelectedPosition = mSelectedPosition + 1;    break;   }   if(mNewSelectedPosition &lt; 0) {    mNewSelectedPosition = 0;   } else if(mNewSelectedPosition &gt;= mItemCount) {    mNewSelectedPosition = mItemCount - 1;   }   mIsTouchEventScroll = true;   smoothScrollTo(newX, 0);  } } public void setOnDisplayChangeListener(OnDisplayChangeListener changeListener) {  mDisplayChangeListener = changeListener; } public void setAdapter(SlidingLayoutAdapter adapter) {  Log.v(TAG, ""SlidingLayout: setAdapter()"");  if(mContainerLinearLayout == null) {   mContainerLinearLayout = new LinearLayout(getContext());   mContainerLinearLayout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));   mContainerLinearLayout.setOrientation(LinearLayout.HORIZONTAL);   mContainerLinearLayout.setBackgroundColor(getContext().getResources().getColor(R.color.admob_color));   addView(mContainerLinearLayout);  }  if(mAdapter != null) {   mAdapter.unregisterDataSetObserver(mDataSetObserver);  }  mAdapter = adapter;  if(mAdapter != null) {   mDataSetObserver = new SlidingLayoutDataSetObserver();   mAdapter.registerDataSetObserver(mDataSetObserver);   mItemCount = mAdapter.getCount();   mSelectedPosition = mAdapter.getSelectedPosition();  } else {   mItemCount = 0;   mSelectedPosition = 0;   return;  }  populateLayout(); } // l is horizontal scroll origin, t is vertical /**protected void onScrollChanged (int l, int t, int oldl, int oldt) {  super.onScrollChanged(l, t, oldl, oldt);  if(mIsTouchEventScroll) {   if(l % getWidth() == 0) {    mIsTouchEventScroll = false;    mSelectedPosition = mNewSelectedPosition;    if(mDisplayChangeListener != null) {     mDisplayChangeListener.onDisplayChange(l/getWidth());    }   }  } }**/ private void populateLayout() {  Log.v(TAG, ""SlidingLayout: populateLayout() - itemCount = ""+mItemCount);  if(mContainerLinearLayout != null) {   mContainerLinearLayout.removeAllViews();  }  for(int i = 0; i &lt; mItemCount; i++) {   View v = mAdapter.getView(i, null, null);   v.setMinimumWidth(getWidth());   mContainerLinearLayout.addView(v);  }  invalidate();  scrollTo(mSelectedPosition * getWidth(), 0);  //View childView = mContainerLinearLayout.getChildAt(mSelectedPosition);  //mContainerLinearLayout.invalidate();  //childView.invalidate();  Log.v(TAG, ""SlidingLayout: populateLayout() scrollX - ""+getScrollX());  //Log.v(TAG, ""SlidingLayout: populateLayout() childView.width() - ""+childView.getWidth());  Log.v(TAG, ""SlidingLayout: populateLayout() getWidth() - ""+getWidth());  Log.v(TAG, ""SlidingLayout: populateLayout() getHeight() - ""+getHeight());  //Log.v(TAG, ""SlidingLayout: populateLayout() container.getWidth() - ""+mContainerLinearLayout.getWidth());  //Log.v(TAG, ""SlidingLayout: populateLayout() container.getHeight() - ""+mContainerLinearLayout.getHeight()); } protected void onSizeChanged(int w, int h, int oldw, int oldh) {  super.onSizeChanged(w, h, oldw, oldh);  if(mAdapter != null) {   mItemCount = mAdapter.getCount();   mSelectedPosition = mAdapter.getSelectedPosition();  }  populateLayout(); } public interface OnDisplayChangeListener {  abstract void onDisplayChange(int position); } public interface SlidingLayoutAdapter extends Adapter {  abstract int getSelectedPosition(); } public class SlidingLayoutDataSetObserver extends DataSetObserver {  public SlidingLayoutDataSetObserver() {   super();  }  @Override  public void onChanged() {   Log.v(TAG, ""SlidingLayout: onChanged()"");   mItemCount = mAdapter.getCount();   mSelectedPosition = mAdapter.getSelectedPosition();   populateLayout();  }  @Override  public void onInvalidated() {   // Data is invalid so we should reset our state   //mItemCount = 0;   //mSelectedPosition = 0;//mAdapter.getSelectedPosition();   //Log.v(TAG, ""SlidingLayout: onInvalidated() removeAllViews"");   //mContainerLinearLayout.removeAllViews();   //invalidate();   //populateLayout();   //requestLayout();   Log.v(TAG, ""SlidingLayout: onInvalidated()"");   mItemCount = mAdapter.getCount();   mSelectedPosition = mAdapter.getSelectedPosition();   populateLayout();  } }}</code></pre><p>Now what actually happens is the LinearLayout (Colored red) fills the entire view, but any calls to getWidth() and getHeight() on the LinearLayout return 0 (odd enough in it's own right).</p><p>But if I touch a separate HorizontalScrollView (the mTabBarScrollView in the main activity), the SlidingLayout will actually resize / redraw / layout itself out. The same also occurs  when a web service updates the adapter with data, which calls notifyDataSetChanged() (causing the resize / redraw / layout), however calling notifydatasetchanged() in the onCreate method of the activity doesn't have the same effect. </p><p>The log on android shows no errors what so ever.</p><p>I'm at a loss as to what it could be / what I can do to force the layouts to update / inflate.</p><p>Any ideas / suggestions would be very welcome.</p><p>Cheers,Matt</p><p>p.s. congratulations if you made it this far in the post :)</p>","295996","","","","","2012-01-15 12:11:34","Inflating Views and adding them to a LinearLayout within a HorizontalScrollView - Odd Behaviour","<android>","1","0","1","",""
"4674940","1","","","2011-01-12 22:51:30","0","3757","<p>I have button_focused, button_pressed, and button_normal images. When I press the button, the button_pressed image is displayed and the action related to the button pressing begins. </p><p>When I quit pressing the button, the action continues but the button returns to button_normal image being displayed.</p><p>How can I set the button image being displayed to button_pressed during the entire action then reset to the button_normal image?</p><p>Thank you for your time</p>","527405","","","","","2014-03-25 10:15:57","Android. How do I keep a button displayed as PRESSED until the action created by that button is finished?","<android><button><set><pressed>","4","2","","",""
"4675144","1","4693714","","2011-01-12 23:17:16","0","199","<p>What events do I need to listen to imitate rollover and rollout on a listview item. I want to change the colour of some text on rollover and change it back on rollover.</p>","553462","","","","","2011-01-14 17:00:27","Listview RollOver RollOut","<java><android>","1","3","","",""
"4675226","1","4675923","","2011-01-12 23:29:17","2","3891","<p>I have a gridview that just needs to hold 4 buttons, how ever I keep getting an operation not supported in AdapterView error when executing. Can you even fill a gridview through xml?</p><p>~Aedon</p><pre><code>01-12 16:26:40.362: ERROR/AndroidRuntime(12216): FATAL EXCEPTION: main01-12 16:26:40.362: ERROR/AndroidRuntime(12216): java.lang.RuntimeException: Unable to start activity ComponentInfo{android.appion.ResourceManager.UI/android.appion.ResourceManager.UI.ARMHomescreen}: java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2787)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2803)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.app.ActivityThread.access$2300(ActivityThread.java:135)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.os.Handler.dispatchMessage(Handler.java:99)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.os.Looper.loop(Looper.java:144)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.app.ActivityThread.main(ActivityThread.java:4937)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at java.lang.reflect.Method.invokeNative(Native Method)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at java.lang.reflect.Method.invoke(Method.java:521)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at dalvik.system.NativeStart.main(Native Method)01-12 16:26:40.362: ERROR/AndroidRuntime(12216): Caused by: java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.widget.AdapterView.addView(AdapterView.java:461)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:622)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.app.Activity.setContentView(Activity.java:1654)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.appion.ResourceManager.UI.ARMHomescreen.onCreate(ARMHomescreen.java:123)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2751)01-12 16:26:40.362: ERROR/AndroidRuntime(12216):     ... 11 more</code></pre>","480691","","","","","2011-01-13 01:28:30","How to fill a gridview in XML","<android><xml><gridview><view><adapter>","1","1","1","",""
"4675257","1","","","2011-01-12 23:32:51","4","1474","<p>I'm currently writing an Android App and it should open Files with the ending .meetme</p><p>Actually it should open them directly from Gmail, but I don't think that is possible.</p><p>This is the Code of my AndroidManifest.xml:</p><pre><code>&lt;activity android:name="".MeetingRequest"" android:label=""Meeting Request""&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=""file"" /&gt;        &lt;data android:mimeType=""*/*"" /&gt;        &lt;data android:host=""*"" /&gt;        &lt;data android:pathPattern="".*\\.meetme"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>I've tried quite a few variations, if I open the file in Astro wit h a long click and open as text, my app shows up and can open it normally.Would be grateful for any help.</p><p>Markus</p>","551380","","","","","2011-01-13 17:48:10","Custom Filetype in Android not working","<android><android-manifest><file-type>","1","3","","",""
"4675293","1","4675388","","2011-01-12 23:37:28","0","702","<p>I've got a ListActivity with a onClickListener which succesfully captures the item's position index which I then use to grab objects of my feeding ArrayList of Document objects. I would also like to be able to grab this position int when opening a Context Menu. How do I do that? Code snippets:My successfuly working onListItemClick</p><pre><code>    @Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    SearchResult sr = searchResults.get(position); // this is how I grab my document    Toast.makeText(this, sr.toString(), Toast.LENGTH_SHORT).show();}</code></pre><p>Is there a way to grab this integer by these methods?</p><pre><code>public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) {</code></pre><p>OR</p><pre><code>public boolean onContextItemSelected(MenuItem item) {</code></pre><p>Thanks guys!</p>","561498","","","","","2011-01-12 23:52:41","grab ListActivity's item position when creating a Context Menu","<android><listactivity>","1","0","","",""
"4675333","1","","","2011-01-12 23:43:32","0","2990","<p>i'm trying to fix this problem for more than 2 days now and have become quite desperate.</p><p>I want to write a 'Checkers-like' board game for android. The game engine itself is kinda complete but i have problems with updating the views.</p><p>I wrote a little example class to demonstrate my problem:</p><pre><code>public class GameEngineView extends View {private static final String TAG = GameEngineView.class.getSimpleName();private int px;private int py;private int cx;private int cy;private boolean players_move;private int clickx;private int clicky;Random rgen;private RefreshHandler mRedrawHandler = new RefreshHandler();class RefreshHandler extends Handler {    @Override    public void handleMessage(Message msg) {                    GameEngineView.this.update();        GameEngineView.this.invalidate();        Log.d(TAG, ""invalidate()"");                }    public void sleep(long delayMillis) {        this.removeMessages(0);        sendMessageDelayed(obtainMessage(0), delayMillis);    }};public GameEngineView(Context context) {    super(context);    setFocusable(true);    players_move = true;    rgen = new Random();}public void update() {    updateGame();    Log.d(TAG, ""update -&gt; sleep handler"");    mRedrawHandler.sleep(100);}public void updateGame() {    if(players_move) {        px = clickx;        py = clicky;    } else {        calcAIMove();        switchMove();    }        }public void switchMove() {    players_move = !players_move;}public void calcAIMove() {    for(int i = 0; i &lt; 20000; i++) {        cx = rgen.nextInt(getWidth());        cy = rgen.nextInt(getHeight());    }}@Overridepublic boolean onTouchEvent(MotionEvent event) {    Log.d(TAG, ""event"");    int eventaction = event.getAction();    if(eventaction == MotionEvent.ACTION_DOWN) {        Log.d(TAG, ""action_down"");        clickx = (int) event.getX();        clicky = (int) event.getY();        switchMove();        update();    }    return super.onTouchEvent(event);}@Overridepublic void onDraw(Canvas canvas) {    super.onDraw(canvas);    Paint green = new Paint();    green.setColor(Color.GREEN);    Paint red = new Paint();    red.setColor(Color.RED);    canvas.drawColor(Color.BLACK);    canvas.drawCircle(px, py, 25, green);    canvas.drawCircle(cx, cy, 25, red);}</code></pre><p>}</p><p>The function calcAIMove() just burns time to simulate a real evaluation of the position in a board game.</p><p>Now my Problem is: If the player clicks(makes a move) the green ball is first drawn when the ai move calculation has been complete. So both moves are drawn at the same time.</p><p>I wonder HOW to accomplish this:-Player clicks-green Ball is drawn-AI calculates-red ball is drawn -and so on..</p><p>When searching the web i found a lot of game loop examples but they all need a Thread with constant polling.. it should be possible without this since the whole program runs sequentially .. right?</p><p>Hoping for advice.</p><p>thanks,Dave</p>","573487","","","","","2011-01-13 08:26:28","Problem with View Invalidate() and Handler","<android><view><handler><invalidate>","3","3","","",""
"4675405","1","4676967","","2011-01-12 23:56:55","2","1095","<p>Is there a way to detect that a phone has a default application chosen for an intent such as <code>android.intent.action.SEND</code> ?</p><p>Is there a way to clear the default application via code?</p><p>I'd like to give the user an option to remove the default or at least show a screen telling them how to do it manually, if I can detect it.</p>","432209","","","","","2011-01-13 05:05:44","Android Intent defaults - detect and clear","<android><android-intent><default>","1","0","2","",""
"4675441","1","12879251","","2011-01-13 00:02:33","2","2859","<p>I have an activity Let's say A</p><p>it is defined in a given application and it's corresponding manifest. This activity loads a contentView which it just loads via a static R index. Let's say R.layout.foo. That layout happens to have a component in there that looks on something that isn't the base android attrs. I am seeing that when a Test app runs this activity the theme and the styles within the theme are not filled with anything.</p><p><strong>Sample Manifest</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.foo.bar""        android:versionCode=""1""        android:versionName=""Test""        android:installLocation=""auto""&gt;       &lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""8"" /&gt;       &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;       &lt;application                   android:icon=""@drawable/app_icon""              android:label=""@string/app_name""              android:description=""@string/description""              android:theme=""@style/Theme.Custom""              android:name="".MyApplicationObject""&gt;          &lt;activity android:name="".activity.A""/&gt;          &lt;supports-screens              android:smallScreens=""true""                  android:normalScreens=""true""                  android:largeScreens=""true""                  android:anyDensity=""true"" /&gt;    &lt;/manifest&gt;</code></pre><p><strong>Activity A</strong> </p><pre><code>public class A extends Activity {   public void onCreate(Bundle a) {     setContentView(R.layout.foo);   }}</code></pre><p><strong>A Layout, foo.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=""wrap_content""&gt;   &lt;com.foo.bar.CustomView      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""    /&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>CustomView</strong></p><pre><code>public class CustomView extends RelativeLayout {  public CustomView(Context context, AttributeSet set) {     this(context, set, R.attr.CustomViewStyle);  }  public CustomView(Context c, AttributeSet set, int defStyle) {    super(c, set, defStyle);    TypedArray array = c.obtainStyledAttributes(set, R.styleable.CustomViewAttrs, defStyle, defStyle);    final int layout = array.getResourceId(R.styleable.CustomViewAttrs_layout, 0);    final Drawable icon = array.getDrawable(R.styleable.CustomViewAttrs_icon);    array.recycle();    if (layout == null) {      throw new IllegalStateException(""WTF"");    }    if (icon == null) {      throw new IllegalStateException(""For real, WTF"");    }  }}</code></pre><p><strong>Some Resources in a Values file</strong> </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;!-- Used to define a namespace for our special types --&gt;    &lt;declare-styleable name=""CustomTypes""&gt;        &lt;attr name=""CustomViewStyle"" format=""reference""/&gt;    &lt;/declare-styleable&gt;    &lt;!-- Used to define Attributes specific to our new View, ""CustomView"" --&gt;    &lt;declare-styleable name=""CustomViewAttrs""&gt;        &lt;attr name=""layout"" format=""reference""/&gt;        &lt;attr name=""anotherOne"" format=""reference""/&gt;    &lt;/declare-styleable&gt;    &lt;!-- A usable style that we can reference later to pass to an instance of CustumView --&gt;    &lt;style name=""CustomView""&gt;         &lt;item name=""layout""&gt;@layout/foo&lt;/item&gt;         &lt;item name=""AnotherOne""&gt;@drawable/icon&lt;/item&gt;    &lt;/style&gt;    &lt;!-- A Style to act as our Theme, referenced in our Manifest as the Theme for all activities --&gt;    &lt;style name=""Theme.Custom"" parent=""android:Theme""&gt;        &lt;item name=""CustomViewStyle""&gt;@style/CustomView&lt;/item&gt;    &lt;/style&gt;&lt;resources&gt;</code></pre><p>This works fine, but when I use an ActivityUnitTest to load up an instance of A the values inside of the TypedArray are empty.</p><p><strong>Some Test Class</strong></p><pre><code>public class ActivityTester extends ActivityUnitTestCase&lt;A&gt; {   public ActivityTester() {     super(A.class);   }   public void testOne() {      Intent intent = new Intent(getInstrumentation().getTargetContext(), A.class);      // This fails with my IllegalStateException       startActivity(intent, null, null);   }}</code></pre><p>Any idea how/if the target Application get's it's manifest parsed? It seems like the theme isn't even getting loaded. The documentation for startActivity() states that it will start the activity the same way that context.startActivity() would. I don't see that happening as it doesn't seem to respect the manifest data of the activity.</p>","307990","","307990","","2011-02-08 01:09:36","2012-10-14 04:31:18","How does Android ActivityUnitTestCase incorporate the target App's AndroidManifest.xml?","<android><testing>","2","3","2","",""
"4675527","1","4675983","","2011-01-13 00:18:53","-1","298","<p>As fas as I understand from here <a href=""http://stackoverflow.com/questions/4664067/can-android-app-be-embedded-in-web-page-like-old-plain-java-applet"">Can Android App be embedded in Web page like old plain java applet ?</a> I cannot use java in web page for Android. So the left choice is only flash lite can you confirm ? (I exclude javascript/html5 here).</p>","310291","","","","","2011-01-13 01:39:07","Only flash lite can be embedded in webpage on Android not java?","<android>","1","1","","",""
"4675558","1","","","2011-01-13 00:24:01","1","2045","<p>I am currently developing an android app. The app has 2 activities. Activity 1 is a ListActivity. ListActivity calls a standard Activity. When the 2nd activity is finished, I use the finish() method to close the activitity which returns to the ListActivity. I need the ListActivity to now refresh with the new dat</p>","499448","","","","","2014-03-18 06:34:10","Refresh ListView when returned to activity on android","<android>","3","0","1","",""
"4675750","1","","","2011-01-13 00:54:36","60","103991","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1512045/how-to-disable-orientation-change-in-android"">How to disable orientation change in Android?</a>  </p></blockquote><p>I'm writing an android application that uses tabs with different contents (activities).In one of these activities, I would like to lock the screen orientation to ""Landscape""-mode,but in the other activities, I want the normal orientation (according to sensor).</p><p>What I'm doing now is that I'm calling </p><pre><code>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);</code></pre><p>when I switch to the landscape mode activity, and </p><pre><code>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);</code></pre><p>when I switch back to the other activities. However, this doesn't seem to work,the whole application locks up. What is the normal approach to this problem?</p>","573536","","492624","","2011-11-18 10:14:32","2012-10-11 23:20:40","Lock screen orientation (Android)","<android><orientation>","3","1","15","2012-10-12 02:28:44",""
"4675762","1","4675816","","2011-01-13 00:56:12","2","3619","<p>I created a DBTest class SQLiteOpenHelper</p><p>Then I called this from my main UI.</p><p>It crashes when I hit the DB.GetReadableDatabase () and the log is no help, just says null pointer, but I don't know where to look.</p><p>Everything works if I use </p><pre><code>SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);</code></pre><p>Same database</p><p>Here is the Class for the helper and below the error:</p><pre><code>   public class DBTest extends SQLiteOpenHelper {            private static String DB_NAME = ""DB"";            private SQLiteDatabase myDataBase;             private final Context myContext;            public DBTest(Context context) {                super(context,   DB_NAME, null, 1);                this.myContext = context;            }            @Override            public void onCreate(SQLiteDatabase db) {                // TODO Auto-generated method stub            }            @Override            public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {                // TODO Auto-generated method stub            }    }</code></pre><p>Below is where the error happens:</p><pre><code>public class Main extends Activity {    DataBaseHelper db = new DataBaseHelper(null);    static SQLiteDatabase Db;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        SQLiteDatabase Db;        DBTest db1 = new DBTest(null);        Db = db1.getReadableDatabase(); &lt;&lt;&lt;  blow up here        }}</code></pre>","528130","","","","","2011-01-13 01:06:07","GetReadableDatabase error android","<android><database><sqlite>","1","1","","",""
"4675781","1","","","2011-01-13 01:00:23","2","4357","<p>I am currently developing an Android application. I want to be able to access MySQL from my website directory without needing to use JSON, SOAP or PHP in order to access MySQL. Is it possible to to import a MySQL connector into an android app.</p><p>Thanks for the help</p>","499448","","","","","2012-08-09 00:51:46","Accessing MySQL Directly from Android","<android><mysql>","3","1","2","",""
"4675787","1","","","2011-01-13 01:01:22","4","3511","<p>I was looking for a candlestick lib chart solution for android, and couldnt find one for a couple of months now.</p><p>Im looking for a smooth scrolling, zomming, tooltip, option to polt in a new candle without the need to render the entire chart.</p><p>i did come across all the normal options for native code charting:DriodCharts, AchartEngine, ChartDroid, none of which support candlesticks.I also used 5 free Javascript and html solutions, all of which are very very slow, and most dont support adding a data tick after the chart has been plotted.</p><p>I have seen many free android applications with decent charts and have tried contacting the developers hoping they can at least point me to somewhere, or even sell their lib.</p><p>My question is does anyone here know of a native solution for candlesticks in android that supports what i mentioned?</p><p>Thanks,   Totem</p>","274180","","165674","","2013-02-07 14:36:12","2013-02-07 14:36:12","Candlestick charts component for android","<android><charts><candlestick-chart>","3","0","4","",""
"4675796","1","","","2011-01-13 01:02:55","4","9188","<p>I want create a layout, with a horizontal LinearLayout(s) on top and bottom, a ListView fill in middle.</p><p>How can I define the main.xml.</p><p>I tried to create a layout with horizontal LinearLayout on top, TextView on bottom, a ListView fill in middle; is ok. But after I modified the bottom TextView to LinearLayout, the bottom LinearLayout disappear.</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:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:orientation=""horizontal""        &gt;        &lt;TextView             android:textSize=""12px""             android:text=""something here""             android:layout_width=""50px""             android:layout_height=""wrap_content""            /&gt;         &lt;TextView             android:textSize=""12px""             android:text=""something here""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            /&gt;    &lt;/LinearLayout&gt;     &lt;LinearLayout         android:orientation=""vertical""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""         android:gravity=""bottom""         &gt;        &lt;ListView             android:id=""@+id/listbody""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            /&gt;        &lt;LinearLayout             android:orientation=""horizontal""             android:layout_height=""wrap_content""             android:layout_width=""fill_parent""             &gt;             &lt;TextView                 android:layout_height=""wrap_content""                 android:layout_width=""0dip""                 android:layout_weight=""1""                 android:textSize=""12px""                 android:text=""50%""                 /&gt;             &lt;TextView                 android:layout_height=""wrap_content""                 android:layout_width=""0dip""                 android:layout_weight=""1""                 android:textSize=""12px""                 android:text=""50%""                 /&gt;         &lt;/LinearLayout&gt;     &lt;/LinearLayout&gt; &lt;/LinearLayout&gt;</code></pre><p>Anybody can tell advise?Please help.</p>","573528","","321697","","2011-01-13 01:41:31","2012-10-10 21:59:32","Layout problem: how to place something on top and bottom?","<android><layout><android-linearlayout>","4","0","2","",""
"4675904","1","","","2011-01-13 01:25:39","0","67","<p>I add breakpoints at the first line in <code>onCreate(Bundle savedInstanceState)</code>.I debug this the code. The code stops at  this breakpoint,The program has not excuted the <code>installDecor()</code> function. But it has had tile yet on screen. <strong>I want to know When title appears ?</strong></p><p>Thanks very much !</p>","573564","","298053","","2011-01-13 01:27:31","2013-03-25 14:10:48","android title question","<android>","2","1","","",""
"4675992","1","","","2011-01-13 01:40:55","0","33","<p>I am refactoring my code, and I am organizing my classes into packages. But I find that my program doesn't run when I create my own subpackages (Java, not android, packages). Is there anything special I need to do if I have several internal packages in my code?</p>","573573","","573573","","2011-01-13 01:49:10","2011-01-13 01:49:10","Do I need to do anything when I create my own internal packages for my Android code?","<android>","1","2","","",""
"4676056","1","4676392","","2011-01-13 01:54:18","1","105","<p>I see that <code>AbstractWindowedCursor</code> has methods to check the type of a column.  This is a great convenience!  But when I look at the <code>CursorWindow</code> class, I see that the documentation for <code>isBlob()</code> says:</p><blockquote>  <p>Checks if a field contains either a blob or is null.</p></blockquote><p>So, does this mean that if I run this check on, say, a String column that contains a NULL value, will it return <code>true</code>?  If so, this means I can't rely on that method as a guaranteed type check.</p>","213525","","","","","2011-01-13 03:10:26","In Android, is AbstractWindowedCursor.isBlob() guaranteed to be correct?","<android><sqlite>","1","0","","",""
"4676075","1","4676199","","2011-01-13 01:56:45","0","1908","<p>This question sounds so easy I can't believe I can't find information on it (maybe I have the wrong key words in mind...)</p><p>I'm looking for a way to change the delay before the phone is put to sleep when my app is running.</p><p>I was using wake locks until now to prevent my app from being closed to frequently (its and opengl app and the loading time is a killer specially on slow phones).I don't like the idea of indefinitely leaving the phone on (mainly because it empties the battery fast to have a full opengl app running).</p><p>Is there a way then to change the delay before the phones goes to sleep to 2~3min ?</p><p>I would also like to add that I do not wish to change the settings of the phone (that is only the users decision)</p><p>Jason </p><p>edited to correct the term ""application going to sleep"" which was pointed out as being incorrect.</p>","440336","","440336","","2011-01-13 02:28:25","2011-01-13 02:37:46","Android: Change delay before the phone is put to sleep while my app is running","<android><sleep>","1","8","","",""
"4676153","1","4676176","","2011-01-13 02:14:44","0","972","<p>I am seeing a problem with reusing my http-client after an HttpPost's execute fails.  It can be a timeout or service not available (maybe others).  The request might throw a socket-timeout and when i later use the client (with a new HttpPost object) it will throw an illegal state exception.  My research indicates that this occurs when the socket is not marked for ""reuse"" as in the case that naturally occurs if you have two threads and one is in the middle of processing its request before the second thread tries to use the http-client (hence its socket).</p><p>I think there is a bug in the http-client code, but there could be either some 'best practises' that I am not following correctly or some known work around.</p><p>Any help on this would be appreciated.</p>","157804","","","","","2011-01-13 02:20:15","On Android, does the DefaultHttpClient properly cleanup the HttpPost when an exception is thrown?","<android><exception><httpclient><http-post>","1","0","","",""
"4676178","1","4677997","","2011-01-13 02:21:15","14","17929","<p>Ok so here is what I have so far. I have built FFmpeg on android and am able to use it fine. I have been able to load a video into FFmpeg after passing the chosen filename from the java side. To save on performance I am writing video player in the NDK rather than passing frames from FFmpeg to java through JNI. I want to send frames from the video to an OpenGL surface. I am having trouble figuring out how to get each frame of video and render it onto the OpenGL surface. I have been stuck trying to figure this out for a couple weeks now with no luck. Hopefully someone can point me in the right direction.</p><p>Thanks!</p>","573595","","44729","","2011-01-13 04:17:06","2011-07-29 10:42:48","Android Video Player Using NDK, OpenGL ES, and FFmpeg","<android><opengl-es><ffmpeg><android-ndk><android-video-player>","1","3","27","",""
"4676221","1","4676947","","2011-01-13 02:28:40","2","3152","<p>I create a context menu like this:</p><blockquote><pre><code>@Overridepublic void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {  if(v.getId() == R.id.ListView01) {      getMenuInflater().inflate(R.menu.add_contextmenu, menu);  }  super.onCreateContextMenu(menu, v, menuInfo);}</code></pre></blockquote><p>How can I now set a generated title?</p>","570168","","","","","2011-01-13 05:01:37","Android: How to set a generated contextMenu title?","<android><contextmenu><title><auto-generate>","1","1","","",""
"4676266","1","","","2011-01-13 02:37:11","0","272","<p>i'm wanting to display the stream of a facebook fan page within an iphone app. i know it's possible to do this with a twitter stream, but wasn't sure if it was available to do w/ facebook fan page stream.</p>","569070","","","","","2011-01-14 01:52:49","post fan page stream to iphone app","<iphone><android><facebook><appcelerator>","1","0","","",""
"4676272","1","","","2011-01-13 02:38:09","0","459","<p>I've implemented a search in my application using The quick search box, now i want the search results to show on the fly as the user types.<br />Is it possible?</p>","181915","","","","","2011-01-13 03:44:34","On the fly android search using quick search box","<java><android><search>","1","0","","",""
"4676464","1","","","2011-01-13 03:16:27","1","1694","<p>I have image resources <code>img1,img2,...img10</code>,how to reference them dynamically in the code below?</p><pre><code>    for (int r=1; r&lt;=10; r++){        TableRow tr = new TableRow(this);        ImageView im = new ImageView (this);        im.setImageDrawable(getResources().getDrawable(R.raw.img1));     ...</code></pre><p>What I want to do is to get reference to <code>'R.raw.img' + r</code>...</p>","572173","","467090","","2011-01-13 03:29:58","2011-01-13 03:44:35","How to get to resource 'R.raw.img' + r in java?","<java><android><resources>","3","5","","",""
"4676485","1","","","2011-01-13 03:20:40","6","9692","<p>After some hours of searching I'm so confused, so I'll tell now what I learned, so please correct me if I was wrong :</p><p>Light Sensor: surrounding light</p><p>Magnetic Sensor: I can get the north location.</p><p>Accelerometer Sensor: the gravity X Y Z , earth gravity or what ever acceleration .</p><p>Proximity Sensor: just like the parking car sensors.</p><p>Orientation Sensor: Tells the X Y Z degrees form their axis.</p><p>I've tried those sensors using some apps from android market like ""My sensors"", and I can confirm that <strong>accelerometer Sensor can't feel if you rotate your phone</strong> in position over a table. While orientation Sensor seems to catch all the moves. Now I can conclude that compass app uses the magnetic sensor to see where is the north, then orientation sensor to know where are you heading with your device, right?</p><p>switching between portrait and landscape modes use ""Accelerometer Sensor"" and checks the earth gravity on which axis.right?</p><p>Q1:so if everything is ok, what is ""Gyroscope""? is it same as ""Orientation Sensor""?</p><p>Q2:is Orientation Sensor avalible on most of the devices?</p><p>Q3:what other uses of Orientation Sensor?</p><p><strong>Q4</strong>:why most of the websites <strong>even wikipedia</strong> says thet Orientation Sensor == Accelerometer Sensor?</p><p>-Rami</p>","566271","","566271","","2011-02-01 14:58:01","2012-02-17 12:59:46","mobile phone sensors!","<android><orientation><sensor><gyroscope><magnetic>","2","0","2","",""
"4676530","1","4676900","","2011-01-13 03:31:56","0","657","<p>Well I am learning Android RSS Feeds parsing, and I have a question. Consider I am using Goal.com RSS feed and displaying on my Android phone. </p><p><a href=""http://www.goal.com/en-us/feeds/news?fmt=rss"" rel=""nofollow"">Goal.com RSS Feed : <a href=""http://www.goal.com/en-us/feeds/news?fmt=rss"" rel=""nofollow"">http://www.goal.com/en-us/feeds/news?fmt=rss</a></a></p><p>But as you can see from the Rss feeds, they are only the headlines of the article containing 2 - 3 lines of the description. I was wondering is there any way I can get the complete article from it after parsing the feeds. Any pointers to guide me would be helpful . Thanks</p>","435597","","","","","2011-01-13 05:00:33","Android -- How to get complete article from the RSS feeds?","<android><parsing><xml-parsing><rss>","2","0","1","",""
"4676623","1","","","2011-01-13 03:55:49","10","9918","<p>I read several other posts and using input.setInputType(TYPE_NUMBER_FLAG_DECIMAL); does open the keyboard but its not the numeric keyboard</p><p>Is there a trick to this?</p>","528130","","","","","2012-05-29 09:50:08","How to show the numeric keypad","<android><text><edittext>","3","0","4","",""
"4676708","1","","","2011-01-13 04:15:29","1","428","<p>i have painted canvas for maze using two dimensional array.now i want to know</p><p>1.how i can show pacman animated(in j2me we can fill the circles by some degrees)?</p><p>2.how the pacman moves and eat the food means when pacman moves the screen will be repainted?</p><p>thankx </p>","411359","","","","","2011-11-20 23:27:06","help for pacman in android?","<android>","2","0","","",""
"4676859","1","","","2011-01-13 04:43:07","0","330","<p>I was wondering about integrating ZK application with Android, I browsed through few articles but in vain, I am not getting much idea. Can anyone help me about this ?</p><p>Also Please let me know about *.hil files.</p><p>Thanks!</p>","564844","","","","","2011-01-13 04:43:07","Integrating ZK with Android !","<android>","0","3","","",""
"4676865","1","","","2011-01-13 04:44:16","0","484","<p>I have a question. Is it possible to either redirect incoming messages to another application or allow the other application to receive the sms as well? If there is, can someone post up a link or a tutorial? Couldn't find anything on the internet pertaining to my question.</p>","504864","","","","","2011-01-13 04:56:14","Possible to redirect incoming messages to another application?","<android><sms>","1","0","1","",""
"4676897","1","4676920","","2011-01-13 04:52:47","6","4979","<p>I'm running the following test Java script from the <a href=""http://developer.android.com/reference/java/net/HttpURLConnection.html"">Android HttpURLConnection docs</a>:</p><pre><code>URL url = new URL(""http://www.android.com/"");HttpURLConnection urlConnection = (HttpURLConnection)url.openConnection();urlConnection.connect();</code></pre><p>Eclipse (on my Mac) is telling me there's a system error when I run this in the Android Emulator:</p><p><code>01-13 13:44:32.767: WARN/System.err(1382): java.net.SocketException: Permission denied</code></p><p>(Incidentally when I do the equivalent in Objective-C/Cocoa there's no problem at all.)</p><p>What is the problem?</p>","283311","","114066","","2011-12-13 08:05:35","2011-12-13 08:05:35","android, httpurlconnection error","<android><httpurlconnection>","1","0","1","",""
"4676923","1","4734880","","2011-01-13 04:56:36","0","399","<p>I am new to Android development. I have created an Activity with the ListView like interface, but without using ListView as each item(row) in the list might have different elements. I have successfully created it by including LinearLayouts inside the ScrollView, but the XML looks messy. I have also added onClickListener to each of the inner LinearLayouts. </p><p>Is there a better way of doing this?</p><p>Thanks.</p><p>Regards,</p><p>dezull</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  android:layout_height=""fill_parent""  android:orientation=""vertical""   android:layout_width=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt; &lt;ScrollView   android:id=""@+id/ScrollView01""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   android:layout_weight=""1""&gt;  &lt;LinearLayout    android:id=""@+id/LinearLayout02""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""&gt;   &lt;LinearLayout     android:id=""@+id/wo_status_layout""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:orientation=""vertical""    android:background=""@color/desc_button""    android:focusable=""true""    android:padding=""3dp""&gt;    &lt;TextView     android:id=""@+id/wo_status""     android:text=""@string/wo_status""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content"" /&gt;    &lt;TextView     android:id=""@+id/wo_status""     android:text=""Waiting for Parts""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content"" /&gt;   &lt;/LinearLayout&gt;   &lt;LinearLayout     android:id=""@+id/wo_prob_desc_layout""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:orientation=""vertical""    android:background=""@color/desc_button""    android:focusable=""true""    android:padding=""3dp""&gt;    &lt;TextView     android:id=""@+id/wo_prob_desc""     android:text=""@string/wo_status""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content"" /&gt;    &lt;TextView     android:id=""@+id/wo_prob_desc""     android:text=""New problem""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content"" /&gt;   &lt;/LinearLayout&gt;  &lt;/LinearLayout&gt; &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre>","573719","","573719","","2011-01-13 05:01:50","2011-01-19 11:50:46","Creating a list with each item containing different elements in Android","<android><android-layout>","2","0","","",""
"4676948","1","4677021","","2011-01-13 05:01:44","0","1285","<p>I have a layout with at least 40 controls, including TextView, Spinners .. etc. ..</p><p>I need some function to hide all controls.</p><p>can be iterated with a control loop in a given layout? Set the visibility to an invisible?</p><p>for example something like:</p><pre><code>For Each ctl AS Control in Layout      ctl.Setvisibility(View.INVISIBLE)Next</code></pre><p>Thanks in advance.</p>","518657","","","","","2011-01-13 05:17:28","Hide All Controls in a layout","<java><android><layout><controls><visibility>","2","0","1","",""
"4677027","1","","","2011-01-13 05:18:08","0","386","<p>I want to fetch DTMF in my application using AT Commands.I have a T Mobile G1 android 2.2.so How can I Use AT Commands in my application and from where can i get list of AT Commands for T Mobile G1?</p><p>Thank You.</p>","533863","","","","","2011-11-08 20:49:51","AT Commands For T-Mobile G1","<android>","1","0","","",""
"4677032","1","4677286","","2011-01-13 05:19:25","0","791","<p>I want to perform some touch operations in my app.When I touch on the screen and perform any move actions, I want to get the coordinates.i.e the starting point x &amp; y coordinate and the ending point x &amp; y coordinate.How can I perform it in onTouch()?</p>","504162","","","","","2011-01-13 07:58:50","how to get the coordinates when we perform ACTION_MOVE","<android>","1","0","","",""
"4677048","1","","","2011-01-13 05:22:02","0","97","<p>Am running a project on android using eclipse IDE , on trying to run the map view i could do that enabling the google map view and using the uses library . But when it comes to the AVD it shows an error. saying the target API is not ssupporting maps (I did try creating a new AVD). Please help me out</p>","573746","","","","","2011-01-13 05:32:33","Problem running google map in an android project","<android>","2","0","","",""
"4677124","1","","","2011-01-13 05:36:54","0","500","<p>I am creating a event using </p><pre><code>        Intent intent = new Intent(Intent.ACTION_EDIT);        intent.setType(""vnd.android.cursor.item/event"");</code></pre><p>And invoking the intent using</p><pre><code>startActivityForResult(intent, Constants.LINK_CALENDER);</code></pre><p>There is nothing returned to call in </p><pre><code>onActivityResult(int requestCode, int resultCode, Intent data)</code></pre><p>It always returns data=null ie., returned intent result is always null.</p><p>I am trying to retrieve the ""Done/Revert"" state of calender event just created and some identity so that i can open the event again in future from elsewhere in code.</p>","119031","","119031","","2011-01-13 07:40:56","2011-01-13 07:50:24","Why does Event intent in android not return a result?","<java><android><events><calendar><android-intent>","1","3","","",""
"4677139","1","","","2011-01-13 05:39:41","0","746","<p>I am trying with no success to modify the code example from:</p><p><a href=""http://www.inter-fuser.com/2009/08/android-animations-3d-flip.html"" rel=""nofollow"">http://www.inter-fuser.com/2009/08/android-animations-3d-flip.html</a></p><p>so it will rotate the images in a loop, when clicking on the image once. (second click should pause).</p><p>I tried using Handler and threading but cannot update the view since only the main thread can update UI.</p><p>Exception I get from the code below:</p><p>android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</p><p>[in 'image1.startAnimation(rotation);' ('applyRotation(0, 90);' from the main thread)]</p><pre><code>package com.example.flip3d;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.animation.AccelerateInterpolator;import android.widget.ImageView;public class Flip3d extends Activity {private ImageView image1;private ImageView image2;private boolean isFirstImage = true;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);image1 = (ImageView) findViewById(R.id.image01);image2 = (ImageView) findViewById(R.id.image02);image2.setVisibility(View.GONE);image1.setOnClickListener(new View.OnClickListener() {   public void onClick(View view) {    if (isFirstImage) {            applyRotation(0, 90);     isFirstImage = !isFirstImage;    } else {         applyRotation(0, -90);     isFirstImage = !isFirstImage;    }   }});          }private void applyRotation(float start, float end) {// Find the center of imagefinal float centerX = image1.getWidth() / 2.0f;final float centerY = image1.getHeight() / 2.0f;// Create a new 3D rotation with the supplied parameter// The animation listener is used to trigger the next animationfinal Flip3dAnimation rotation =       new Flip3dAnimation(start, end, centerX, centerY);rotation.setDuration(500);rotation.setFillAfter(true);rotation.setInterpolator(new AccelerateInterpolator());rotation.setAnimationListener(new DisplayNextView(isFirstImage, image1, image2));if (isFirstImage){image1.startAnimation(rotation);} else {image2.startAnimation(rotation);}}}</code></pre><p>How can I manage to update the UI and control the rotation within onClick listener?</p><p>Thank you,</p><p>Oakist</p>","573736","","573736","","2011-01-13 05:50:32","2011-01-13 05:52:28","Android: roatating images in a loop","<java><android>","1","1","2","",""
"4677144","1","","","2011-01-13 05:40:32","0","3727","<p>I want to save  a log of method calls.Traceview supports that function and I can get .trace file format.</p><p>but, I need to open .trace file format without DDMS.</p><p>If I can't open .trace file without DDMS, How can I get a log of method calls?(The best is .txt file format.)  </p><p>thanks.</p>","573767","","","","","2011-04-05 06:57:38","How can i open .trace file format(traceview) without DDMS?","<android><profiling><trace><ddms>","2","1","1","",""
"4677220","1","4732761","","2011-01-13 05:55:24","0","1775","<p>i am developing chat client for my app.now i am testing it on gtalk,facebook,yahoo.iam using smack api for that.i am now successfully tested it on gtalk.But in case of facebook i got error </p><hr><pre><code> 01-13 10:53:05.938: INFO/XMPPClient(389): [SettingsDialog] Connected to chat.facebook.com01-13 10:53:07.178: ERROR/XMPPClient(389): [SettingsDialog] Failed to log in as chikka0305@chat.facebook.com01-13 10:53:07.178: ERROR/XMPPClient(389): SASL authentication failed using mechanism DIGEST-MD5: </code></pre><hr><p>as you can see ican connect but cant login .i already saw same question here:http://stackoverflow.com/questions/3750547/facing-problem-using-smack-on-android.</p><hr><p>but answer of that dont work for me.</p><hr><p>pls help me to get out of this prob.</p>","544537","","","","","2012-06-14 04:32:39","facebook chat cant work in smack api with android","<android><api><smack>","2","0","","",""
"4677385","1","4677472","","2011-01-13 06:21:25","0","1012","<p>I'm looking to figure out a solution for helping a user enter some configuration data during the first time it's executed.  I have a main activity that shows a list of photos in a grid.</p><p>During the onCreate method for the main activity, if I find that a user has not configured the app before, I switch to a series of two activities.  The user fills out the required data in those two activities (think wizard-style, one after another).  Once they have entered data on the second activity, they are shown the original main activity.</p><p>Is this a standard, or preferred way to do things?  I couldn't find an easier way to do this, or a built-in way.  </p><p>Instead of using onCreate, is there a way to programatically choose the first activity based on whether it's the first time the app has been run or not?</p><p>Thanks,Kevin</p>","271177","","","","","2011-01-13 06:40:48","Android app startup wizard","<android>","1","0","","",""
"4677401","1","4677737","","2011-01-13 06:23:25","3","10279","<p>I am using eclipse for android where my API level is 8, i tried project->properties->android-> but here it it showing me only one checkbox for API level 8. please guide me what to do??</p>","573776","","65977","","2011-01-13 07:36:42","2011-01-13 16:25:38","How to change API level 8 to 3 in Eclipse","<android><eclipse>","3","0","","",""
"4677441","1","","","2011-01-13 06:33:12","1","137","<p>I want to built a plug-in to filter Email by mail Address and sent it to Spam How can I buit a plug-in for Email Application Built-in Android?  and APIs??</p>","573820","","1108213","","2012-03-14 16:47:35","2012-03-14 16:47:35","How can I buit a plug-in for Email Application Built-in Android?","<android>","1","0","1","",""
"4677444","1","4677754","","2011-01-13 06:34:41","1","9310","<p>i need to customise the Listview...esspecialy like reduce the font size... bcz it occupies more space..how can i reduce listview size... kindly assist me asap...</p>","569553","","","","","2011-01-13 07:31:25","how to change the Font size of Listview content","<android>","1","2","","",""
"4677545","1","4677597","","2011-01-13 06:54:24","0","124","<p>while using googleMaps i am getting error on console i.e</p><p>Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY</p><p>please guide me what to do i changed sdk version in manifest file.</p>","573776","","","","","2011-03-09 07:26:12","I am getting following error in android","<android>","3","1","","",""
"4677548","1","","","2011-01-13 06:54:43","0","3410","<p>Any one help to display the NMEA sentence like $GPRMC .....I am using the below code:</p><pre><code>public class SampleNMEA extends Activity implements LocationListener, GpsStatus.Listener,GpsStatus.NmeaListener{    LocationManager lm;    TextView output;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        output = (TextView)findViewById(R.id.out);        lm = (LocationManager) getSystemService(LOCATION_SERVICE);        lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 60000,10,this);        final Location location=lm.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);        output.append(""\nBelow Data is about the your location:"");        output.append(""\n\n\nLatit:""+location.getLatitude());        output.append(""\n\nLongitude:""+location.getLongitude());        output.append(""\n\nTime: ""+location.getTime());    }    public void onLocationChanged(Location location)     {        output.append(""\n\n\nLatitude:""+location.getLatitude());        output.append(""\n\nLongitude:""+location.getLongitude());        output.append(""\n\nTime: ""+location.getTime());    }    public void onProviderDisabled(String arg0) {        // TODO Auto-generated method stub    }    public void onProviderEnabled(String arg0) {        // TODO Auto-generated method stub    }    public void onStatusChanged(String arg0, int arg1, Bundle arg2)     {         lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 60000,10,this);        final Location location=lm.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);        output.append(""\n\n\nLatitude:""+location.getLatitude());        output.append(""\n\nLongitude:""+location.getLongitude());        output.append(""\n\nTime: ""+location.getTime());}    public void onGpsStatusChanged(int event)     {    }    public void onNmeaReceived(long timestamp, String nmea)     {        output.append(""NMEA Sentence: ""+nmea);    }    }</code></pre><p>Any one help I added permissions in manifest.xml</p><pre><code>    &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION""&gt;&lt;/uses-permission&gt;</code></pre>","546107","","1578199","","2013-04-05 01:50:15","2013-08-03 06:55:23","Display the NMEA sentence?","<android>","5","1","1","",""
"4677577","1","","","2011-01-13 06:59:57","0","1174","<p><br>ListView selector disappears when I set background color to listitem . But when I used android:drawSelectorOnTop=""true"" the selector appears but over writes list item content.I want selector to be appeared though I change background color of Listitem and also the selector should not over write list item content.<br>can anyone help me in sorting out this issue?</p><p>thanks in Advance</p>","429501","","","","","2011-01-13 07:03:29","ListView selector disappears when set background color to listitem in android","<android>","1","0","","",""
"4677617","1","4680474","","2011-01-13 07:07:05","0","775","<p>When i am calling the url (http://staging-nsw.tatainteractive.com/Admin/FlashCards/FlashCard_Android.html) in my Android app webview. </p><p>Whenever i tap on textbox the layout get shrink while it didn't shrink on default browser. and keyboard popup on top of browser. </p><p>How can i message to keyboard to popup on top of browser or browser should not shrink itself?</p>","573847","","","","","2011-01-13 13:18:53","Android Web View get shrink when keyboard popups","<android><flash><webview>","1","0","","",""
"4677684","1","4872945","","2011-01-13 07:19:18","2","2069","<p>I am developing an android app in which phone connects to a wifi network or acts as a wifi access point. I need to get the correct interface name.When phone connects to a wifi network on a mac, interface name is 'eth0' and when it acts as an access point it is 'wl0.1'.</p><p>I find this using NetworkInterface.getNetworkInterfaces() which lists all interfaces. I want to get active wifi interface name only.Any help on this?</p>","550982","","","","","2013-09-06 12:15:28","wifi network interface name","<android><networking><wifi>","2","0","3","",""
"4677729","1","4678502","","2011-01-13 07:27:40","2","1358","<p>I followed some tutorials but got confused with ""Activity stack"" and ""Task"". </p><ul><li>Because both starts when a new activity is created.</li><li>Activity stack keeps a navigation history of activities, and Task is a sequence of activities.</li></ul><p>Is this is only difference that Activity stack made up of one or more task(S)? </p><p>Give some example please. </p>","550966","","1287476","","2014-01-31 04:34:31","2014-01-31 04:34:31","Task and Activity stack : what is difference between both.","<android>","1","0","0","",""
"4677758","1","4677770","","2011-01-13 07:31:49","0","883","<p>I have a <code>public class FriendMaps extends MapActivity</code> that gets called from a menu item when selected, and at the end of that I have <code>private abstract class DownloadFilesTask extends AsyncTask&lt;Void, Void, Void&gt;</code> in there I do some server calls and put data into local arrays etc.</p><p>But in my <code>public void onCreate(Bundle savedInstanceState)</code> of the FriendMaps activity I call <code>new DownloadFilesTask().execute();</code> and get the following error:</p><blockquote>  <p>Error: Cannot instantiate the type  FriendMaps.DownloadFilesTask</p></blockquote><p>From the documentation:</p><blockquote>  <p>AsyncTask must be subclassed to be used.</p></blockquote><p>That would be accomplished  <code>DownloadFilesTask extends AsyncTask</code> there.</p><blockquote>  <p>The task instance must be created on the UI thread</p></blockquote><p>Maybe this is where I am confused?  To my understanding the UI thread is the current activity being displayed - if so then the onCreate of the FriendMaps activity is the correct place to execute();</p><p>If full code spinets are required for further help, please comment and I'll add where needed.</p>","570509","","","","","2011-01-13 07:37:36","AsyncTask not working - cannot instantiate the type error","<java><android><android-asynctask>","2","0","","",""
"4677980","1","","","2011-01-13 08:13:35","1","1411","<p>I am new to android.I what to know how to apply round corner to imageview.</p><p>I have applied border for the imageview but it does not draw round corner for the image.If any one knows Please help me.Thanks in advance......</p><p><img src=""http://i.stack.imgur.com/MFswQ.png"" alt=""alt text""></p>","366916","","","","","2011-01-13 08:17:24","Android-RoundCorner for a imageView","<android>","1","2","0","2013-03-17 01:11:52",""
"4678030","1","4689007","","2011-01-13 08:23:19","3","911","<p>I have an AccountAuthenticator and associated SyncService that are working when I test via Dev Tools -> Sync Tester on the emulator. I also have a preferences intent working on the Account screen.</p><p>However, I have been unable to figure out how to get my Sync Service listed under the ""Data &amp; Synchronization"" area on the account page. (There's a screenshot of this area at the bottom of: <a href=""http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-1/"" rel=""nofollow"">http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-1/</a> )</p><p>So, for instance, if it were Contacts I were syncing, I would expect to be able to put a ""Sync Contacts"" checkbox there. How do I achieve this for my custom data model/sync service?</p>","349003","","","","","2011-01-14 07:57:01","Android AccountAuthenticator and Sync Service: Display under ""Synchronization and Data""","<android>","1","0","1","",""
"4678051","1","4678136","","2011-01-13 08:26:16","11","12152","<p>I have a theme that derives from Android's default light theme. My ListViews are configured with a white background, and I guess as a side-effect of this, the color of the fading edge is white, which is not something that I want - I'd like them to be black. </p><p>It seems impossible to simply change the color of the edge (although I can control the length and other factors), and the usual suggestion of using a black color for listview's hint color results in some pretty horrible side-effects when the list scrolls. </p><p>Can anyone advise a reliable way of changing the color of the fading edge to an arbitrary color? </p>","132628","","","","","2013-12-09 19:11:39","Controlling the color of the fading edge in ListViews","<android><listview>","5","0","","",""
"4678169","1","4910048","","2011-01-13 08:48:37","5","4626","<p>For fun, I'd like to edit (or add a custom) language pack for my android phone.</p><p>I've read a lot about it using google but no real solution.</p><p>Is there any way to achieve this? maybe a way to get in to the language files google use and edit them, or add a new translation for the OS?</p><p>Any help would be appriciated :)</p><p>(additional info: I'm running android 2.2, HTC Legend)</p>","192310","","","","","2011-02-05 22:13:43","How to create a custom language pack for android?","<android><language-packs>","1","5","2","",""
"4678191","1","","","2011-01-13 08:51:05","1","230","<p>Is it possible to start the application on the Android phone (starting with Froyo), when there is an incoming voice call? In other words, the incoming voice call should trigger the application startup.</p><p>In such a case the application should not be full-screen, but should cover only part of the screen to not hide the native controls for accepting or rejecting the call.</p><p>If it is not supported now - is anybody aware about some plans to support such a feature in future releases?</p>","384115","","995926","","2012-05-22 08:15:08","2012-05-22 08:15:08","Android non-full screen app startup during voice call","<android><call><startup><voice><android-2.2-froyo>","0","1","","",""
"4678192","1","4678262","","2011-01-13 08:51:07","1","957","<p>In the Maps application (at least version 5) for Android the tiles are loading in a different way, than when using a MapView in my own application, when for example zooming in or out. In the MapView displays a gray checkered image until the tile is fully loaded an than the map is displayed. In Maps application this it not the case all the time. Tiles that are not fully loaded are still showing a map but it is blurry. The Maps application way of showing the map when zooming is much prettier for the eye.</p><p>Is it possible to have this ""feature"" in a MapView in my own application as well?</p><p>Best regards</p><p>P</p>","274426","","","","","2012-10-04 08:13:55","MapView tiles loading in Android","<android><maps><android-mapview>","2","0","","",""
"4678287","1","","","2011-01-13 09:04:02","1","1070","<p>in an android expandable listview, i need to make thechildren displayed, only on pressing the expand collapse nodes..ie; i do notwant to show the children on pressing the row of the expandable listview..how can i accomplish it?</p><p>Regards,Rony</p>","264953","","","","","2012-05-18 09:00:42","Android expandable listview","<android><android-widget>","1","2","1","",""
"4678294","1","","","2011-01-13 09:04:53","0","184","<p>Can we kill one of the activities with same sharedUserId on platform 2.1?Just the one.</p>","493162","","","","","2011-02-28 08:34:49","Can we kill one of the activities with same sharedUserId?","<android>","2","0","","",""
"4678305","1","4678420","","2011-01-13 09:05:44","0","1438","<p>I have a problem in getting the user's location (my location). My code is</p><pre><code>double lat;double lng;LocationManager locationManager;String context = Context.LOCATION_SERVICE; locationManager = (LocationManager)getSystemService(context);String provider = LocationManager.GPS_PROVIDER;Location location = locationManager.getLastKnownLocation(provider);if(!locationManager.isProviderEnabled(provider)){ locationManager.setTestProviderEnabled(provider, true);}boolean enabled = locationManager.isProviderEnabled(provider);if(enabled){        Toast.makeText(LoginActivity.this,""provider enabled"",Toast.LENGTH_LONG).show();}else{    Toast.makeText(LoginActivity.this,""provider disabled"",Toast.LENGTH_LONG).show();}if(location!=null){  lat = location.getLatitude();  lng = location.getLongitude();  AlertDialog.Builder ab=new AlertDialog.Builder(LoginActivity.this);  ab.setMessage(Html.fromHtml(""&lt;b&gt;&lt;font color=#ff0000&gt;Location"" +""&lt;/font&gt;&lt;/b&gt;&lt;br&gt;""            +location.toString()+""&lt;br&gt;Latitude: ""+lat                +""&lt;br&gt;Longitude ""+lng));  ab.setPositiveButton(""ok"",null );  Toast.makeText(LoginActivity.this,""You are at     ""+location.toString(),Toast.LENGTH_LONG).show();}else{    Toast.makeText(LoginActivity.this,""Location not found"",Toast.LENGTH_LONG).show();} </code></pre><p>My problem is I am getting the location as <code>null</code> while application give message provider is enabled. I have not found any problem in this code. I have also tested it on device, it shows the provider is enabled and the location isn't found.</p><p>I have not implemented the location listner in the class.Is it necessary to implement location listner in my class?</p>","567776","","56338","","2011-04-21 11:20:31","2011-04-21 11:20:31","Showing User's Location in Android","<android><location><provider>","1","0","","",""
"4678321","1","4678395","","2011-01-13 09:08:16","0","126","<p>I'm very much a beginner in android environment.I am trying to create a simple application with very few controls.I arranged all the controls in UI and its looking good when I'm running in Samsung Galaxy phone.But when I'm running the same application in Nexus, there's much gap at the bottom of the controls. Functionality is same.</p><p>How can I create the application that will adjust the controls as per the resolution of the phone?Can some one guide me on this.</p>","265341","","","","","2011-01-13 09:18:49","Android - UI creation problem","<android><gui>","3","1","","",""
"4678331","1","","","2011-01-13 09:09:25","5","7329","<p>I am working in a map project in android. It contains larger image of 10000x10000 resolution. Using this image with <code>Bitmap</code> it gives <code>OutOfMemoryError</code>. So I want to tile and scroll this image. When I scroll image, only visible screen must have tiles and other invisible tiles must be recycled. I spent lots of time but didn't find anything.</p><p>Any help will be appreciated.Provide me better solutions or idea.</p>","474419","","35060","","2011-01-13 09:16:00","2014-01-05 15:35:05","How to tile and scroll a large image (10000x10000) in android","<android>","5","4","7","",""
"4678441","1","","","2011-01-13 09:22:08","1","1083","<p><br />Is anyone getting a <code>Service Not Available</code> Exception for every request sent to the Google Geocoder on devices running Gingerbread?</p>","389262","","","","","2011-01-13 09:36:41","Google Geocoder unavailable on Android 2.3.1?","<android><google-geocoder>","1","0","","",""
"4678473","1","4678512","","2011-01-13 09:27:05","1","2826","<pre><code> private void createSpinner() {ll.addView(s);SQLiteDatabase db = dbs.getReadableDatabase();         String SQL = ""SELECT * FROM Test where password = 'S'"";     final Cursor cursor = db.rawQuery(SQL, null);     startManagingCursor(cursor);    final int l = cursor.getCount();    array_spinner = new String[l];int i = 0;while (cursor.moveToNext()) {  array_spinner[i]= cursor.getString(1);   i ++; }    final ArrayAdapter adapter = new ArrayAdapter(this,   android.R.layout.simple_spinner_item, array_spinner);    s.setAdapter(adapter);    cursor.close();ll.addView(submit);submit.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {        for(int i = 0; i &lt; l; i++) {        }     }});}</code></pre><p>In this code i want the user to select the value in the spinner which is sent from the database. And then when the user clicks on the submit button i want that value selected to be saved to the database...i am wondering what the selected spinner option function is...is there a adapter.selected() r checked or a spinner.selected function available? hope i am explaining it correctly thanks   </p>","569654","","","","","2011-01-13 09:33:14","Android Dynamic Spinner","<android>","1","0","","",""
"4678495","1","","","2011-01-13 09:30:37","1","389","<p>I want to generate exact same values using SQLite <code>strftime()</code> or any other function as that of System.currentTimeMillis() function in java. Is there a possible way ?</p><pre><code>SELECT strftime('%s','now'); </code></pre><p>generates the current time but does not consider milliseconds but seconds. I want precision to miliseconds.</p><p><strong>EDIT</strong> based on Axarydax answer</p><pre><code>SELECT strftime('%s%f','now');</code></pre><p>returns <code>129491124808.428</code>where %f returning <code>08.428</code> can I round this of to <code>129491124808</code></p><p><strong>EDIT 2</strong></p><pre><code>ROUND(strftime('%s%f','now'))</code></pre><p>returns 129491124808.0 I dont want <code>.0</code> at the end</p>","447238","","447238","","2011-01-13 09:48:11","2013-08-06 07:01:25","SQLite3 and System.currentTimeMillis()","<java><android><datetime><sqlite3><microsoft>","2","0","1","",""
"4678536","1","4678729","","2011-01-13 09:35:58","0","971","<p>What does the Android MapView.preLoad() method really do? ""The API states Preload the tiles at the map's current center"". What does this mean and can I somehow use it to speed up loading of the map in my MapView?</p><p>Best regards</p><p>P</p>","274426","","","","","2011-01-13 09:59:08","MapView.preLoad() does what exactly?","<android><android-mapview><preload>","1","0","1","",""
"4678544","1","4679649","","2011-01-13 09:36:56","1","4675","<p>In my app I save an XML file to the users SD-card by doing <code>File newxmlfile = new File(Environment.getExternalStorageDirectory() + ""/Message.xml"");</code></p><p>But not all users have SD-cards in their phone and therefore my app is likely to crash.</p><p>How must I change my File creating method in order to save the file to the phone's memory instead of the SD-card?</p><p>Also, how must I change the loading of the file? (currently: <code>new InputSource(new FileInputStream(Environment.getExternalStorageDirectory() + ""/Message.xml""))</code>)</p><p>EDIT: I don't think you got the question right. I know the Data-Storage page of the Android Docs and I've read it. I just want to know how I should it adjust it to match my current way of saving and loading a file.</p>","517460","","517460","","2011-01-13 09:59:35","2012-06-07 02:56:40","Saving file to phone in stead of SD-card","<android><file><saving>","4","1","","",""
"4678594","1","","","2011-01-13 09:43:35","0","424","<p>can we use tcp for socket programming in android?</p>","574027","","70795","","2011-01-13 09:53:27","2011-01-13 10:39:05","Android Socket progamming","<android><sockets>","1","1","","2012-08-17 07:37:51",""
"4678607","1","","","2011-01-13 09:44:52","0","262","<pre><code>dy_path = Environment.getExternalStorageDirectory()  + ""\5.jpg"";  </code></pre><p>Instead of that i want how to give dynamic path automatically picture saved based on current time.</p><p>I am new to Android. Plz answer my question</p>","574028","","276052","","2011-01-13 09:49:27","2011-01-13 09:49:27","android programming question","<android>","1","1","","",""
"4678633","1","4711862","","2011-01-13 09:47:23","0","808","<p>I'm having a button in a sliding drawer in a Android Application. The problem is it does not seem to react to any clicks as normal buttons do.</p><p>I'm guessing the problem is that it's a different view than buttons on the normal view.If I implement a button the normal way like this</p><p><code>        myAgenda = (Button)findViewById(R.id.BtnMyAgenda);        myAgenda.setOnClickListener(this);</p><pre><code>public void onClick(View v) {    switch(v.getId()){    case R.id.BtnMyAgenda:        test.setAnimation(leftLeft);        test.startAnimation(leftLeft);        break;</code></pre><p>} </code></p><p>I'm guessing there is something wrong with the above code since the button is in a SlidingDrawer and not in the ""normal"" view.Any ideas how to fix the problem?</p>","525016","","","","","2011-02-20 12:34:36","Button in slidingdrawer!","<android>","2","0","","",""
"4678674","1","4697211","","2011-01-13 09:51:34","1","6042","<p>I am trying to create a simple program which displays a ""shoppingcart"" list of items, along with a few buttons below it to manage thecart.</p><p>The biggest problem is that items are getting duplicate entries in thelist view.  That is, for every item I want to enter I see it appeartwo times in the list view.  What's the problem?  Also, the scrollablearea of my cart is not big enough.  How do I set it so that it isbigger but I can still see my buttons?  Perhaps I should put thebuttons above the cart?</p><p>Here is my shopping cart's 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""&gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Shopping Cart"" /&gt;    &lt;ScrollView android:id=""@+id/ScrollView01""        android:layout_width=""fill_parent""        android:layout_height=""110px""&gt;        &lt;ListView            android:id=""@+id/BookList""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;        &lt;/ListView&gt;    &lt;/ScrollView&gt;    &lt;Button android:text=""Add Another Book""        android:id=""@+id/AddAnother""        android:layout_width=""250px""        android:textSize=""18px""        android:layout_height=""55px""&gt;    &lt;/Button&gt;    &lt;Button android:text=""Checkout""        android:id=""@+id/Checkout""        android:layout_width=""250px""        android:textSize=""18px""        android:layout_height=""55px""&gt;    &lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>Here is the layout for individual row items:   </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=""?android:attr/listPreferredItemHeight""    android:padding=""8dip""&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""0dip""        android:layout_weight=""1""        android:layout_height=""fill_parent""&gt;        &lt;TextView            android:id=""@+id/BookTitle""            android:layout_width=""fill_parent""            android:layout_height=""0dip""            android:layout_weight=""1""            android:singleLine=""true""            android:gravity=""center_vertical""        /&gt;        &lt;TextView            android:id=""@+id/BookPrice""            android:layout_width=""fill_parent""            android:layout_height=""0dip""            android:layout_weight=""1""            android:singleLine=""true""            android:ellipsize=""marquee""        /&gt;    &lt;/LinearLayout&gt;    &lt;Button        android:id=""@+id/buttonLine""        android:gravity=""center""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:layout_alignParentRight=""true""        android:text=""Delete""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>here is the java code for the shopping cart activity:</p><pre><code>package com.sellbackyourbook.sellback;import java.io.IOException;import java.util.ArrayList;import java.util.Iterator;import android.app.Activity;//import android.app.ListActivity;import android.content.Context;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.ListView;import android.widget.TextView;public class cart extends Activity {    private ListView m_bookListView;    private BookAdapter m_adapter;    //private static String[] data = new String[] = { """"    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState)     {        ShoppingCartSingleton shoppingCart = ShoppingCartSingleton.getInstance();        super.onCreate(savedInstanceState);        setContentView(R.layout.shoppingcart);        this.m_adapter = new BookAdapter(this, R.layout.cartitem,            shoppingCart.m_books);        m_bookListView = (ListView) findViewById(R.id.BookList);        m_bookListView.setAdapter(this.m_adapter);        //setListAdapter(this.m_adapter);        if (shoppingCart.m_books != null &amp;&amp; shoppingCart.m_books.size() &gt; 0)        {            //m_adapter.notifyDataSetChanged();            try            {            //m_adapter.clear();                //for(int i=0;i&lt;1;i++)            Log.i(""ARRAY"", ""m_books.size() before loop"" + shoppingCart.m_books.size());            int size = shoppingCart.m_books.size();            for(int i=0;i&lt;size;i++)            {                   Log.i(""ARRAY"", ""size in loop"" + size);                Log.i(""ARRAY"", ""adding item to adapter"" + i);                m_adapter.add(shoppingCart.m_books.get(i));            }        } catch (RuntimeException e) {            e.printStackTrace();        }        //m_adapter.notifyDataSetChanged();        }        Button buttonAddAnother = (Button) findViewById(R.id.AddAnother);        buttonAddAnother.setOnClickListener(new View.OnClickListener()         {            public void onClick(View view)             {                Intent intent = new Intent();                setResult(RESULT_OK, intent);                finish();            }        });        // TODO: only show this button if the shopping cart is not empty        Button buttonCheckout = (Button) findViewById(R.id.Checkout);        buttonCheckout.setOnClickListener(new View.OnClickListener()         {            public void onClick(View view)             {                // TODO: open sellbackyourbook website using book ISBNs                ShoppingCartSingleton shoppingCart = ShoppingCartSingleton.getInstance();                String isbnList = """";                String checkoutURL = ""http://www.sellbackyourbook.com/androidcart.php?isbn="";                for (Iterator&lt;Book&gt; i = shoppingCart.m_books.iterator(); i.hasNext();  )                {                    Book currentBook = (Book) i.next();                    isbnList = isbnList + currentBook.getBookISBN() + "","";                 }                checkoutURL = checkoutURL + isbnList;                Log.i(""CHECKOUT URL"", ""checkout URL to submit: "" + checkoutURL);                Intent myIntent = new Intent(Intent.ACTION_VIEW);                myIntent.setData(Uri.parse(checkoutURL));                startActivity(myIntent);            }        });    }    private class BookAdapter extends ArrayAdapter&lt;Book&gt; {        private ArrayList&lt;Book&gt; books;        public BookAdapter(Context _context, int _textViewResourceId, ArrayList&lt;Book&gt; _books)         {                super(_context, _textViewResourceId, _books);                this.books = _books;        }        @Override        public View getView(int position, View convertView, ViewGroup parent)         {            System.out.println(""getView "" + position + "" "" + convertView);            View v = convertView;                if (v == null) {                    LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);                    v = vi.inflate(R.layout.cartitem, null);                }                Book b = books.get(position);                if (b != null)                 {                    TextView bTitle = (TextView) v.findViewById(R.id.BookTitle);                    TextView bPrice = (TextView) v.findViewById(R.id.BookPrice);                        if (bTitle != null)                         {                            bTitle.setText(b.getBookTitle());                          }                        if (bPrice != null)                        {                            bPrice.setText(b.getBookPrice());                        }                }                return v;        }    }   }</code></pre><p>Here is the Java code for my shopping cart.  Am I using the singleton correctly? I really just wanted a quick and dirty way to allow multiple activities access to the shopping cart, as a different activity actually grabs the books from the user and this activity displays them in the cart. </p><p>I had an issue iterating through the books in <code>onCreate()</code> as well.  the <code>size()</code> function kept increasing in the loop for some reason, so I changed the code and added a ""size"" variable to avoid making the size() call in the loop itself.  I'm not really sure what that was all about.</p>","267702","","935779","","2012-08-18 18:13:03","2012-08-18 18:13:03","Android: duplicate items in ListVew. Maybe getView() called too many times?","<android><listview><listadapter>","3","4","1","",""
"4678691","1","","","2011-01-13 09:54:34","1","323","<p>in an Android application I develop, I have to use a provided Adapter (e.g. Adapter1) that only implements android.widget.Adapter and android.widget.ListAdapter (it does not extend BaseAdapter). This adapter is used in many ListViews of the application.</p><p>I would like to have the auto filtering feature in the ListViews to which I attach the adapter,  so I decided to create new class (e.g. Adapter2) that extends Adapter1 and implements the Filterable interface. But after I filter my data based on the user input I cannot notify the attached view to redraw itself since there is no notifyDataSetChanged() method provided, since as I noted the provided Adapter does not extend BaseAdapter.</p><p>How can I create a similar method in my class that does the work?Is there any other suggestion?</p><p>Thank you in advance,Bill</p>","574016","","","","","2011-01-13 09:54:34","Create my own notifyDataSetChanged in an Adapter that does not extend BaseAdapter","<android>","0","0","0","",""
"4678706","1","","","2011-01-13 09:56:29","2","153","<p>I have this Layout:</p><pre><code>&lt;HorizontalScrollView android:id=""@+id/card_images_horizontalscroll""   android:layout_height=""wrap_content""   android:layout_width=""wrap_content""   android:scrollbars=""none""   android:visibility=""invisible""   &gt;    &lt;LinearLayout android:id=""@+id/card_images_layout""        android:orientation=""horizontal""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""    &gt;     &lt;ImageButton       android:id=""@+id/card_image""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""       android:background=""@drawable/icona""      android:     /&gt;    &lt;/LinearLayout&gt;  &lt;/HorizontalScrollView&gt;</code></pre><p>But I meet this issues: the image are enclose by a frame which I don't want, what's wrong?!</p><p>Like this:<img src=""http://i.stack.imgur.com/OP2em.png"" alt=""alt text""></p><p>Thanks so much!</p><p>I tried to change XML with this runtime code but I have the same issues:</p><pre><code>b = new ImageButton(this);            b.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT));            b.startAnimation(alpha_animation);            b.setImageBitmap(myBitmap);</code></pre><p>I tried also to follow the suggestion for change ImageButton in Button, but can I set at runtime the image source? </p>","554892","","554892","","2011-01-13 10:18:00","2011-03-24 19:21:30","ImageButton in an HorizontalSrollView have a frame","<android>","2","1","","",""
"4678739","1","4679971","","2011-01-13 10:00:12","11","5954","<p>Can someone please explain the steps I need to take in order to add anew codec to Android?</p><p>Also, I would like the codec to be installed as part of an applicationinstallation (or first launch) and NOT as part of a full Android OSbuild.</p><p>The reason I want to do this is that I have an application that needsto show a video of a non supported codec (HLS or TS), but I wouldn'twant to build a full blown video player - just integrate with theexisting, built-in, player.</p><p>Thanks, Alik.</p>","435605","","","","","2011-01-13 12:25:08","Adding video codec to Android","<android><video><codec><http-live-streaming><mpeg2-ts>","1","0","4","",""
"4678761","1","","","2011-01-13 10:02:18","1","933","<p>I'm trying to develop an application capable to detect malicious application for Android platform using Support Vector Machines (SVM).I can get many system information from ""logcat"" and ""strace"" tools but I don't now how to manage to detect real malicious applications. Does anyone know how to stablish/record normal behavior use of the device using those tools, I mean, get information from the device and set a behaviour pattern.</p><p>Best regards</p>","574044","","","","","2013-03-07 16:39:18","Detecting Android Malware using Support Vector Machines (SVM)","<android><malware>","4","2","3","",""
"4678774","1","","","2011-01-13 10:03:16","1","655","<p>I have a edit text inside an alert Dialog for some user input. But when i click on the edit text it does not show the soft keyboard .</p><p>Where as if the same edit text is placed inside a dialog it show the keyboard when the edit text is focused  </p><p>Please help...</p><pre><code>public class LaunchingActivity extends Activity {    Button addSubList = null;    TableLayout tabLayToDoList;    int textViewId = StaticContents.textViewId;    int edtTxtViewId = StaticContents.edtTxtViewId;    int ImgViewId = StaticContents.ImgViewId;    int relLayViewId = StaticContents.relLayViewId;    int count = StaticContents.count;    CustomDialog share;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        System.out.println(textViewId + "" "" + edtTxtViewId + "" "" + ImgViewId                           + "" "" + relLayViewId);        addSubList = (Button) findViewById(R.id.btnAddSubItem);        tabLayToDoList = (TableLayout) findViewById(R.id.tabLayToDoList);    }    public void showSublistDialog() {        Dialog subList = new Dialog(this);        Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE))            .getDefaultDisplay();        int width = display.getWidth();        int height = display.getHeight();        System.out.println(""Display Width and Height :"" + ""width "" + width                           + "" height "" + height);        subList.show();        // rel.setLayoutParams(layoutPrams);    }    @Override    protected void onPostResume() {        addSubList.setOnClickListener(new OnClickListener() {                public void onClick(View arg0) {                    count = 0;                    share = new CustomDialog(LaunchingActivity.this);                    share.show();                }            });        super.onPostResume();    }    private class CustomDialog extends Dialog {        public CustomDialog(Context context) {            super(context);            // TODO Auto-generated constructor stub        }        RelativeLayout relLayParent;        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.addsubitem);            Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE))                .getDefaultDisplay();            int width = display.getWidth();            int height = display.getHeight();            LayoutParams params = getWindow().getAttributes();            if(height&gt;width){                //potrait mode                params.height = height - 150;                params.width = width-60;            }else{                params.height = height - 100;                params.width = width-100;               }            getWindow().setAttributes(                                      (android.view.WindowManager.LayoutParams) params);            relLayParent = (RelativeLayout) findViewById(R.id.relLayParent);            addDesScription(relLayParent, R.id.relLaySubListContent);            addDesScription(relLayParent, R.id.relLaySubListContent);        }        public void addDesScription(RelativeLayout relParent, int relLayoutId) {            TextView txtDescription = new TextView(LaunchingActivity.this);            EditText edtDescription = new EditText(LaunchingActivity.this);            ImageView imgaddDescription = new ImageView(LaunchingActivity.this);            edtDescription.setInputType(262144);            RelativeLayout relLay = new RelativeLayout(LaunchingActivity.this);            textViewParams(txtDescription);            edttxtDescriptionParams(edtDescription);            imageViewParams(imgaddDescription);            relLaySubListDescription(relLay, relLayoutId);            relLay.addView(txtDescription);            relLay.addView(edtDescription);            relParent.addView(relLay);            if (count != 0) {                relLay.addView(imgaddDescription);            } else {                relLay.setVisibility(View.GONE);            }            incrementIds();        }        public void textViewParams(TextView txtDescription) {            txtDescription.setText(""Description:"");            txtDescription.setTextColor(getResources().getColor(R.color.Blue));            txtDescription.setId(textViewId);            txtDescription.setMinLines(1);            RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(                                                                                 android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT,                                                                                 android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT);            params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);            params.addRule(RelativeLayout.CENTER_VERTICAL);            txtDescription.setLayoutParams(params);        }        public void imageViewParams(ImageView addSubListDescription) {            addSubListDescription                .setImageResource(R.drawable.add_description_icon);            addSubListDescription.setId(ImgViewId);            RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(                                                                                 android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT,                                                                                 android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT);            params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);            params.addRule(RelativeLayout.CENTER_VERTICAL);            addSubListDescription.setOnTouchListener(new OnTouchListener() {                    public boolean onTouch(View arg0, MotionEvent arg1) {                        addDesScription(relLayParent, relLayViewId - 1);                        return false;                    }                });            addSubListDescription.setLayoutParams(params);        }        public void edttxtDescriptionParams(EditText edtDescription) {            edtDescription.setId(edtTxtViewId);            edtDescription.setMinLines(1);            edtDescription.setHint(""Description"");            RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(                                                                                 android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT,                                                                                 android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT);            params.addRule(RelativeLayout.LEFT_OF, ImgViewId);            params.addRule(RelativeLayout.RIGHT_OF, textViewId);            params.addRule(RelativeLayout.CENTER_VERTICAL);            edtDescription.setLayoutParams(params);        }        public void incrementIds() {            ImgViewId++;            textViewId++;            edtTxtViewId++;            relLayViewId++;            count++;        }        public void relLaySubListDescription(                                             RelativeLayout relLaySubListDescription, int relLayoutId) {            RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(                                                                                 android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT,                                                                                 android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT);            params.width = android.widget.RelativeLayout.LayoutParams.FILL_PARENT;            relLaySubListDescription.setId(relLayViewId);            params.addRule(RelativeLayout.BELOW, relLayoutId);            relLaySubListDescription.setLayoutParams(params);        }    }}</code></pre>","548546","","71034","","2011-01-13 19:06:27","2011-01-13 19:06:27","EditText inside a alertDialogue is not showing softkeyboard android...please Help Urgent","<android><edittext>","1","3","","",""
"4678901","1","4679024","","2011-01-13 10:15:05","0","6748","<p>I am having a couple of problems recording sound on a device. The code I am using if from the android dev site (<a href=""http://developer.android.com/reference/android/media/MediaRecorder.html"" rel=""nofollow"">Site Link</a>) and is as follows:</p><pre><code>    public void onClickStart(View v) throws IllegalStateException, IOException{        startRecord();    }    public void onClickStop(View v) throws IllegalStateException, IOException{        stopRecord();    }    private void startRecord() throws IllegalStateException, IOException{        recorder = new MediaRecorder();         recorder.setAudioSource(MediaRecorder.AudioSource.MIC);  //ok so I say audio source is the microphone, is it windows/linux microphone on the emulator?         recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);         recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);         recorder.setOutputFile(""/sdcard/test.3gpp"");         recorder.prepare();         recorder.start();      }    private void stopRecord(){        recorder.stop();//      recorder.release();    }</code></pre><p>With 2 buttons in the main layout which it turn both stop and start the recording (in theory that is).</p><p>But from LogCat when trying this out on my device (really cant be bothered with trying on the emulator) I get the following errors:</p><pre><code>Error 1:ERROR/MediaRecorder(14541): start called in an invalid state: 4java.lang.IllegalStateException: Could not execute method of the activityCaused by: java.lang.reflect.InvocationTargetExceptionError 2:Caused by: java.io.FileNotFoundException: /sdcard/test.3gpp (Permission denied)</code></pre><p>And I also have the following permissions set in my Manifest.xml file:</p><pre><code>&lt;uses-permission android:name=""android.permission.RECORD_AUDIO"" /&gt;&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;</code></pre>","400406","","","","","2013-01-31 05:25:37","Permission problems for sound recording","<java><android><media><audio-recording>","5","0","","",""
"4678987","1","4679061","","2011-01-13 10:23:39","1","987","<p>I have a widget where I need to display some text on one row. If the text does not fit, I would like to show as much as possible and end the text with ""..."" to show that not all text is displayed. Is there a way to discover how long the displayed text will be before rendering the widget, so that I can replace the last part of the text with ""...""?</p><p>Cheers,</p>","249871","","","","","2011-01-13 10:32:54","Measure text length before rendering","<android><textview>","1","2","0","",""
"4679022","1","4686138","","2011-01-13 10:28:04","4","3405","<p>I want to create a shortcut in an android app, it lead to another activity which is not launcher of the app. </p>","484432","","","","","2013-12-12 05:51:43","how to create a shortcut which leads to a non-launcher activity?","<android><shortcut>","2","0","3","",""
"4679182","1","4679367","","2011-01-13 10:47:23","0","3115","<p>I have stored an Image to Database. I can get the blob but unable to find its correct height and width and hard coding each image width and height is not a good idea. kindly help me out</p>","185022","","","","","2013-02-23 16:57:45","android How to get width and height of the image blob?","<android><image><height><width><blob>","2","1","0","",""
"4679185","1","","","2011-01-13 10:47:42","1","581","<p>Description Resource    Path    Location    TypeUnparsed aapt error(s)! Check the console for output.   CAS     Unknown Android Packaging Problem</p><p>This is from Eclipse </p>","574095","","","","","2011-01-13 10:47:42","How can I solve this error for android application","<android>","0","1","","",""
"4679192","1","","","2011-01-13 10:48:20","0","358","<p>I have stored an Image to Database. I can get the blob but unable to find its correct height and width and hard coding each image width and height is not a good idea. kindly help me out</p>","185022","","","","","2011-01-13 11:07:48","android How to get width and height of the image blob?","<android><image><height><width><blob>","0","0","0","",""
"4679194","1","4679993","","2011-01-13 10:48:27","0","539","<p>I have a listview with different layouts for all the listitems. My first listitem contains an edittext. Whenever I click on this, keyboard shows up. But this keyboard displaces all the listitems in the listview. Whenever I click that edittext, the items change their positions. I'm really confused about this.  </p><p>This' my code:</p><pre><code> public View getView(int position, View convertView, ViewGroup parent) {         ViewHolder holder;         if (convertView == null) {             if(position == 0)             {                 convertView = mInflater.inflate(R.layout.remindertitle, null);                  edttxtForTitle = (EditText) convertView.findViewById(R.id.edittext);                 convertView.setMinimumHeight(60);             }             else if(position == 1)             {                 convertView = mInflater.inflate(R.layout.reminderfrom, null);                     TextView txtTitle = (TextView) convertView.findViewById(R.id.txtvwFrom);                 txtTitle.setText(""From"");                 mPickDate = (Button) convertView.findViewById(R.id.btnDate);                 mPickDate.setText(                            new StringBuilder()                                    // Month is 0 based so add 1                                    .append(mDays[mDay].substring(0, 3)).append("", "")                                    .append(mDay).append("" "")                                    .append(mMonths[mMonth]).append("" "")                                    .append(mYear).append("" ""));                 mPickDate.setOnClickListener(new View.OnClickListener() {                        public void onClick(View v) {                            settingValueForFromOrTo = true;                            showDialog(DATE_DIALOG_ID);                        }                    });                 strDateFrom = new StringBuilder()                 // Month is 0 based so add 1                .append(mDays[mDay].substring(0, 3)).append("", "")                .append(mDay).append("" "")                 .append(mMonths[mMonth]).append("" "")                 .append(mYear).append("" "");                 mPickTime = (Button) convertView.findViewById(R.id.btnTime);                 mPickTime.setText(                         new StringBuilder()                            .append(pad(mHour)).append("":"")                            .append(pad(mMinute)));                 mPickTime.setOnClickListener(new View.OnClickListener() {                        public void onClick(View v) {                            settingValueForFromOrTo = true;                            showDialog(TIME_DIALOG_ID);                        }                    });                 strTimeFrom = new StringBuilder()                .append(pad(mHour)).append("":"")                .append(pad(mMinute));             }             else if(position == 2)             {                 convertView = mInflater.inflate(R.layout.reminderto, null);                     TextView txtTitle = (TextView) convertView.findViewById(R.id.txtvwTo);                 txtTitle.setText(""To"");                 mPickDateForFinalDate = (Button) convertView.findViewById(R.id.btnDatefinal);                 mPickDateForFinalDate.setText(                            new StringBuilder()                                    // Month is 0 based so add 1                                    .append(mDays[mfinalDay].substring(0, 3)).append("", "")                                    .append(mfinalDay).append("" "")                                    .append(mMonths[mfinalMonth]).append("" "")                                    .append(mfinalYear).append("" ""));                 mPickDateForFinalDate.setOnClickListener(new View.OnClickListener() {                        public void onClick(View v) {                            settingValueForFromOrTo = false;                            showDialog(DATE_DIALOG_ID_FINAL);                        }                    });                 strDateFrom = new StringBuilder()                 // Month is 0 based so add 1                .append(mDays[mfinalDay].substring(0, 3)).append("", "")                .append(mfinalDay).append("" "")                 .append(mMonths[mfinalMonth]).append("" "")                 .append(mfinalYear).append("" "");                 mPickTimeForFinalTime = (Button) convertView.findViewById(R.id.btnTimefinal);                 mPickTimeForFinalTime.setText(                         new StringBuilder()                            .append(pad(mfinalHour)).append("":"")                            .append(pad(mfinalMinute)));                 mPickTimeForFinalTime.setOnClickListener(new View.OnClickListener() {                        public void onClick(View v) {                            settingValueForFromOrTo = false;                            showDialog(TIME_DIALOG_ID_FINAL);                        }                    });                 strTimeFrom = new StringBuilder()                .append(pad(mfinalHour)).append("":"")                .append(pad(mfinalMinute));                 }             else if(position == 3)             {                 convertView = mInflater.inflate(R.layout.allday, null);                    convertView.setMinimumHeight(60);             }             else if(position == 4)             {                 convertView = mInflater.inflate(R.layout.alarm, null);                 txtAlarm = (TextView) convertView.findViewById(R.id.txtAlarmValue);                 convertView.setMinimumHeight(60);             }             else if(position == 5)             {                 convertView = mInflater.inflate(R.layout.repeat_view, null);                   txtRepeat = (TextView)convertView.findViewById(R.id.txtRepeatValue);                 convertView.setMinimumHeight(60);             }             else if(position == 6)             {                 convertView = mInflater.inflate(R.layout.submitbutton_view, null);                   Button btnSubmit = (Button)convertView.findViewById(R.id.btnSubmit);                 btnSubmit.setOnClickListener(new View.OnClickListener() {                        public void onClick(View v) {                            String title = edttxtForTitle.getText().toString();                            Log.v("""",""all the values title"" + title);                            Log.v("""",""all the values datefrom"" + strDateFrom.toString());                            Log.v("""",""all the values dateto"" + strDateTo.toString());                            Log.v("""",""all the values timefrom"" + strTimeFrom.toString());                            Log.v("""",""all the values timeto"" + strTimeTo.toString());                            Log.v("""",""all the values allday"" + allDay);                            Log.v("""",""all the values alarm"" + strAlarm);                            Log.v("""",""all the values repeat"" + strRepeat);                        }                    });                 convertView.setMinimumHeight(60);             }             holder = new ViewHolder();                   holder.btnFromDate = (Button) convertView.findViewById(R.id.btnDate);             holder.btnFromTime = (Button) convertView.findViewById(R.id.btnTime);             holder.txtLabelTitle = (TextView) convertView.findViewById(R.id.txtvwFrom);             holder.btnFromDatefinal = (Button) convertView.findViewById(R.id.btnDatefinal);             holder.btnFromTimefinal = (Button) convertView.findViewById(R.id.btnTimefinal);             holder.txtLabelTitlefinal = (TextView) convertView.findViewById(R.id.txtvwTo);             convertView.setTag(holder);             } else {             holder = (ViewHolder) convertView.getTag();         }         return convertView;     }      class ViewHolder {         Button btnFromDate;          Button btnFromTime;          TextView txtLabelTitle;         Button btnFromDatefinal;          Button btnFromTimefinal;          TextView txtLabelTitlefinal;       }</code></pre><p>Am I messing around with LayoutInflator?</p><p>Can anybody please help?</p><p>Thanx in advance.</p>","227943","","","","","2011-01-13 12:27:20","Keyboard for ediitext in listview moving other listitems in android","<android><listview><edittext>","1","0","","",""
"4679232","1","","","2011-01-13 10:53:07","1","638","<p>I have android phone and I am trying to run following public Shoutcast stream <strong><a href=""http://core.crystalone.net:9000/listen.pls"" rel=""nofollow"">http://core.crystalone.net:9000/listen.pls</a></strong> in my phone. However, it is not working and when I open it; it gives me error “File Is Not Supported”.</p><p>This is very strange since In Android 2. 2 and higher, I think shoutcast streaming is default and does not require any additional application to play them. I have searched through net and have following questions.</p><p>1) Is android by default play shoutcast stream in browser and does not require any additional app or anything? If anything required then can anyone please provide details?</p><p>2) Any settings required in my phone to play it by default since if it is required then I can do it? Like make sure that .pls files are played in default media player or something? </p><p>3) I have heard a lot about “Tunewiki” and “Streamfurious” so do I need it to install in my latest phone before I can play this shoutcast streams? </p><p>4) Any settings required in shoutcast stream creation in order to get it played in android?</p><p>I am out of clue right now and any help will be greatly appreciated.  Also can anyone check this URL in their android and let me know if it runs and if yes, then it runs in browser or in some other way?</p><p>Thanks in advance.</p><p>Jeff</p>","574104","","","","","2011-01-13 10:53:07","Shoutcast Stream not running in Android Browser - File Is Not Supported Error","<android><shoutcast>","0","1","","",""
"4679238","1","4679484","","2011-01-13 10:53:41","1","479","<p>I have to exit from application when user is some in middle of application. I have use finish() and System.exit(0) method but it only exits current activity.If any one know about this please let me know.</p><p>Thank You</p><p>Vikram</p>","395627","","","","","2011-01-13 11:21:20","Exit from application in android","<android>","2","0","0","",""
"4679247","1","","","2011-01-13 10:54:18","0","11275","<p>Ok this may seem like a pointless example but if I can figure this out then the program I am trying to make will work.  So I have two activities test and test two each with one button. </p><p>Test 1: </p><pre><code>package thompson.cameron.com;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;public class Test extends Activity implements OnClickListener {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        View button = findViewById(R.id.testButton);        button.setOnClickListener(this);    }    public void onClick(View v){     Intent i = new Intent(this, Test2.class);     startActivity(i);     }}</code></pre><p>and test2</p><pre><code>package thompson.cameron.com;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;public class Test2 extends Activity implements OnClickListener { @Override public void onCreate(Bundle savedInstanceState){  super.onCreate(savedInstanceState);  setContentView(R.layout.main2);  View test = findViewById(R.id.testButton);  test.setOnClickListener(this); } public void onClick(View v){  switch (v.getId()){  case R.id.testButton:   System.exit(1);  } }}</code></pre><p>When I click the button on Test it is supposed to launch test2 however it is at this point I get an null pointer exception that I have narrowed down to <code>test.setOnClickListener(this);</code> line of code.  Below are my two xml files for the <code>layout</code>.  I can get the button to work when I only have one activity but as soon as I add a second <code>activity</code> with a different <code>layout</code> file it all falls apart</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;Button android:id=""@+id/testButton"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""TEST TEST TEST""/&gt;&lt;/LinearLayout&gt;</code></pre><p>main2.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;Button android:id=""@+id/testButton"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""TEST2 TEST2 TEST2""/&gt;&lt;/LinearLayout&gt;</code></pre><p>I'm still new at Android programming so thanks for all your help.</p>","574108","","106092","","2013-10-25 09:23:11","2013-10-25 09:29:02","Android Null Pointer Exception Button","<android><button><nullpointerexception>","10","0","1","",""
"4679291","1","","","2011-01-13 10:59:27","1","7198","<p>I have ""BackUpContacts.db"" database in SQLiteDatabase, it has a table named ""ContactInfo"" with column names ContactId, ContactName, MobilePhone1, MobilePhone2, OfficePhone1, OfficePhone2, OfficePhone3, HomePhone1, HomePhone2 and TokenId. </p><p>What i want is to transfer all data of ""ContactInfo"" table to the mysql database system at some server (means server has also a table similar to ""ContactInfo"", where all data of ""ContactInfo"" will be copied). </p><p>The last important thing which i want is that, whenever i want to get contacts(of a specified TokenId) i can backup all those from server to the mobile device in an xml file.</p><p>in short, can here anyone help me how to transfer sqlite db to a web server?</p>","574114","","52546","","2011-01-13 11:50:43","2011-01-18 09:52:22","How to transfer SQLite db to web server on android phone (android)","<android><mysql><sqlite>","3","1","1","",""
"4679344","1","","","2011-01-13 11:04:52","0","366","<p>I am an android developer. I am developing one application for a samsung device which supports hard keyboard. In this application, I have to change the orientation of my application only when hard keyboard is popped out as well as Editview is focused.</p><p>Can anyone please help me to find the solution of it.</p><p>Thanks in advance.</p>","519846","","","","","2011-09-27 12:25:57","How to find programatically that hard keyboard is popped out in android device","<android>","1","0","","",""
"4679379","1","","","2011-01-13 11:09:11","-1","853","<p>tried following code to download zip to sd card, i get NullpointerException. when tried some interrogations i come to know that the zip file is not getting downloaded actually. So would you please help whether code needs some changes or anything wrong with zip? M stuck on that point only. Please help... my code as follows...</p><pre><code>    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        String from = ""http://192.168.1.63/ZipFile/Text.zip"" ;        String to = Environment.getExternalStorageDirectory() + ""/newunzip/"";        try {            ((TextView) findViewById(R.id.display)).append(""\n in try after function :"");            downloadFile(from, to);        } catch (Exception e) {            // TODO Auto-generated catch block            e.printStackTrace();            ((TextView) findViewById(R.id.display)).append(""\n \n Exception occured :"");            ((TextView) findViewById(R.id.display)).append(""\n \n Exception message is :""+e.getMessage());            ((TextView) findViewById(R.id.display)).append(""\n \n Exception is :""+e.toString());        }    }    private void downloadFile(String from, String to) throws Exception     {        ((TextView) findViewById(R.id.display)).append(""\n \n in function call :"");        HttpURLConnection conn = (HttpURLConnection)new URL(from).openConnection();        conn.setDoInput(true);        conn.setConnectTimeout(100000); // timeout 100 secs        conn.connect();        ((TextView) findViewById(R.id.display)).append(""\n \n Connecting to url :""+ conn);        InputStream input = conn.getInputStream();        byte[] b = null;        input.read(b);        ((TextView) findViewById(R.id.display)).append(""\n \n input method :""+ b);        FileOutputStream fOut = new FileOutputStream(to);        byte[] b1 = null;        input.read(b1);        ((TextView) findViewById(R.id.display)).append(""\n \n output method :""+ b1);        int byteCount = 0;        byte[] buffer = new byte[4096];        int bytesRead = -1;        while ((bytesRead = input.read(buffer)) != -1)         {            ((TextView) findViewById(R.id.display)).append(""\n \n reading/writing files :"");            fOut.write(buffer, 0, bytesRead);            byteCount += bytesRead;        }        fOut.flush();        ((TextView) findViewById(R.id.display)).append(""\n \n flush &amp; close :"");        fOut.close();    }}</code></pre>","553051","","","","","2012-11-20 15:42:18","Android Download Zip to SD card, zip not getting read","<java><android><web-services><sd-card><read-write>","1","0","0","",""
"4679420","1","4724921","","2011-01-13 11:14:45","1","1552","<p>I have a directory /sdcard/audio in the project. This directory contains some audio (wav) files.<br>Here is what I am trying to do:<br>1. Read from the directory.<br>2. Play the wav files. </p><p>The code I have written for accessing the directory is as follows:  </p><pre><code>String path_to_media = ""/sdcard/audio/"";File dirEffectFiles = new File(path_to_media);   //gets a handle to the directory of effect files.Log.v(this.toString(), ""Getting into path = "" + path_to_media);Log.v(this.toString(), ""Some details about the directory: path = "" + dirEffectFiles.getPath()                + "" Can read: "" + dirEffectFiles.canRead() + "" list:"" + dirEffectFiles.list()                + "" absolute path:"" + dirEffectFiles.getAbsolutePath() + "" is absolute:"" + dirEffectFiles.isAbsolute()); </code></pre><p>The output I get for the above is:</p><blockquote>  <p>01-13 16:23:34.941: Some details about  the directory: path = /sdcard/audio  Can read: false list:null absolute  path:/sdcard/audio is absolute:true  </p></blockquote><p>I have the following questions:<br>1. How can I make the above folder readable? By setting <code>dirEffectFiles.setReadable(true)</code>?<br>2. Also, please note that <code>path_to_media</code> above is /sdcard/audio/. When it is printed, the last ""/"" disappears. Is that a normal effect of some internal parsing or should I be worried about that??  </p><p>Any help is most welcome,<br>Thanks,<br>Sriram.</p>","350685","","","","","2011-01-18 13:59:11","Cannot read files from a directory - android","<android><audio><directory><media-player><directory-permissions>","2","0","","",""
"4679524","1","13452404","","2011-01-13 11:27:06","1","2232","<p>Good afternoon everyone. There is my problem:</p><p>I have got a TableLayout, which fills a half of device's screen widht. And I want to adjust it's TableRows height, depending on a size of a text, which I place in the TableRow. </p><p>Can anybody tell me what attribute should I use to do it in my XML description, because android:layout_height=""wrap_content"" doesn't help me.</p>","556337","","","","","2012-11-19 11:00:21","Adjusting TableRow Height","<android><android-layout>","2","3","","",""
"4679540","1","4681528","","2011-01-13 11:29:23","0","3637","<p>I hope this is a simple problem.</p><p>I have a seekbar that I want to limit the range it can be set to. This range can change depending on other factors (the values of other seekbars, etc.)</p><p>The seekbar is a simple 0 to 100 range and defines a percentage. I need this value to be a minimum which can range from 0% (normal seekbar operation) to a higher value (let's say 50% for example).</p><p>The code does its calculation and determines the minimum value depending on other variables.</p><p>When I drag the seekbar below this threshold I want it to reset its value to that minimum. Here's some sample code</p><pre><code>seek6.setOnTouchListener( new OnTouchListener() { @Overridepublic boolean onTouch(View v, MotionEvent event) {    if(event.getAction() == MotionEvent.ACTION_UP) {                int CurrentLevel = seek6.getProgress();        if (CurrentLevel &lt; 30) CurrentLevel = 30;        seek6.setProgress(CurrentLevel);            }    return false;    }        });</code></pre><p>So in this sample if I drag below 30, the value will be set back up to 30.</p><p>If I drag above 30 everything is fine. If I drag below the 30 mark, then the seekbar GetValue() is coming back as 30, but the seekbar shows the lower value.</p><p>For example, if I drag it all the way down to 0 the return value is 30, but it shows 0 on screen.</p><p>How can I get the seekbar to re-display at the 30 position automatically?</p><p>I've tried to change the focus, update the seekbar from another method. Nothing has worked so far.</p><p>Any ideas?</p>","447123","","","","","2012-07-25 00:25:14","How do I make a seekbar update itself after touch","<android><refresh><seekbar>","2","0","","",""
"4679557","1","4679811","","2011-01-13 11:32:39","1","2806","<p>i'm getting this error when i run the ddms in android sdk tools:</p><p><img src=""http://i.stack.imgur.com/0imWu.png"" alt=""alt text""></p><p>From adb i change some settings from the Preferences > misc and i set the logging level as debbug.</p><p><img src=""http://i.stack.imgur.com/pxcup.jpg"" alt=""alt text""></p><p>and now i getting this:</p><p><img src=""http://i.stack.imgur.com/Kfutu.jpg"" alt=""alt text""></p><p>Can you please help me to find out what the problem is?</p><p>Thank you</p>","495296","","","","","2011-01-13 12:06:27","android ddms error","<android><ddms>","1","0","","",""
"4679575","1","","","2011-01-13 11:33:49","1","975","<p><img src=""http://i.stack.imgur.com/HJFTu.jpg"" alt=""alt text""></p><p>As you can see, a linearlayout is on top of the tabs. What I want is to align the LinearLayout bottom to the tabs top.</p><p>Alternatively aligning the RelativeLayout to the top of tabs may also work.</p><p>Here's the corresponding code for the view above:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;RelativeLayout android:id=""@+id/RelativeLayout01"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;LinearLayout android:layout_width=""fill_parent"" android:orientation=""vertical"" android:layout_height=""wrap_content"" android:id=""@+id/LinearLayout02"" android:layout_alignParentBottom=""true""&gt;        &lt;FrameLayout android:id=""@+id/FrameLayout02"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:paddingTop=""20sp"" android:paddingBottom=""20sp""&gt;            &lt;ImageButton android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:src=""@drawable/record"" android:layout_gravity=""center_horizontal"" android:id=""@+id/RecordImageButton""&gt;&lt;/ImageButton&gt;        &lt;/FrameLayout&gt;        &lt;SeekBar android:id=""@+id/SeekBar01"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:paddingBottom=""5sp"" android:paddingLeft=""10sp"" android:paddingRight=""10sp""&gt;&lt;/SeekBar&gt;        &lt;FrameLayout android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:id=""@+id/FrameLayout03""&gt;            &lt;LinearLayout android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:id=""@+id/LinearLayout02"" android:layout_gravity=""center_horizontal""&gt;                &lt;ImageButton android:layout_width=""wrap_content"" android:id=""@+id/ImageButton01"" android:layout_height=""wrap_content"" android:src=""@drawable/play_rev""&gt;&lt;/ImageButton&gt;                &lt;ImageButton android:layout_width=""wrap_content"" android:id=""@+id/ImageButton02"" android:layout_height=""wrap_content"" android:src=""@drawable/play_stop""&gt;&lt;/ImageButton&gt;                &lt;ImageButton android:layout_width=""wrap_content"" android:id=""@+id/ImageButton03"" android:layout_height=""wrap_content"" android:src=""@drawable/play""&gt;&lt;/ImageButton&gt;            &lt;/LinearLayout&gt;        &lt;/FrameLayout&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>Here is the code for the tabs:</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;RelativeLayout        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_alignParentBottom=""true"" /&gt;        &lt;FrameLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:id=""@android:id/tabcontent"" /&gt;    &lt;/RelativeLayout&gt;&lt;/TabHost&gt;</code></pre><p>MainActivity, which sets an activity for each tab:</p><pre><code>public void initTabs(){    Resources res = getResources(); // Resource object to get Drawables    TabHost tabHost = getTabHost();  // The activity TabHost    TabHost.TabSpec spec;  // Resusable TabSpec for each tab    Intent intent;  // Reusable Intent for each tab    intent = new Intent().setClass(this, FirstActivity.class);    spec = tabHost.newTabSpec(""tab1"").setIndicator(""Tab"",                      res.getDrawable(R.drawable.ic_tab_artists))                  .setContent(intent);    tabHost.addTab(spec);    intent = new Intent().setClass(this, SecondActivity.class);    spec = tabHost.newTabSpec(""tab2"").setIndicator(""Tab 2"",                      res.getDrawable(R.drawable.ic_tab_artists))                  .setContent(intent);    tabHost.addTab(spec);    intent = new Intent().setClass(this, ThridActivity.class);    spec = tabHost.newTabSpec(""tab3"").setIndicator(""Tab 3"",                      res.getDrawable(R.drawable.ic_tab_artists))                  .setContent(intent);    tabHost.addTab(spec);    tabHost.setCurrentTab(0);}</code></pre>","566615","","566615","","2011-01-14 07:41:15","2013-07-08 13:05:38","Android: Layout on top of tabs","<android><layout>","2","0","","",""
"4679654","1","4681228","","2011-01-13 11:43:53","8","9008","<p>i recently coded a Android Widget and tested it on Emulator as well as my Galaxy S , it worked fine on both, after i posted the same to android market now i am getting some error reports.</p><p>i am stating a service in the onUpdate of Widget Class like this:</p><pre><code>if (appWidgetIds != null) {    final int N = appWidgetIds.length;    // Perform this loop procedure for each App Widget that belongs to    // this    // provider    for (int i = 0; i &lt; N; i++) {        // Start Service for each instance        int appWidgetId = appWidgetIds[i];        Intent active = new Intent(context, DialerService.class);        active.setAction(""Start"");        active.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,                appWidgetId);        context.startService(active);    }}</code></pre><p>the error which some people are getting is:</p><pre><code>java.lang.RuntimeException: Unable to start service dialer.impact.DialerService@45f926f0 with null: java.lang.NullPointerExceptionat android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3282)at android.app.ActivityThread.access$3600(ActivityThread.java:135)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2211)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)Caused by: java.lang.NullPointerException**at dialer.impact.DialerService.onStart(DialerService.java:18)**at android.app.Service.onStartCommand(Service.java:420)at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3267)... 10 more</code></pre><p>error states a <code>NullPointerException</code> on line 18 of the <code>ServiceClass</code> which is this:</p><pre><code>@Overridepublic void onStart(Intent intent, int startId) {    //Line 18th             String command = intent.getAction();    int appWidgetId = intent.getExtras().getInt(            AppWidgetManager.EXTRA_APPWIDGET_ID);    RemoteViews remoteView = new RemoteViews(getApplicationContext()            .getPackageName(), R.layout.main);    AppWidgetManager appWidgetManager = AppWidgetManager            .getInstance(getApplicationContext());}</code></pre><p>Line 18 is the <code>String command = intent.getAction();</code></p><p>what could be the reason for intent being null please help</p>","536051","","1438733","","2012-09-12 18:56:10","2012-09-12 18:56:10","Unable to start service [service name] with null","<android><android-widget><nullpointerexception><android-service>","2","0","7","",""
"4679676","1","4680033","","2011-01-13 11:46:11","1","1016","<p>Thanks at all for all your help for now.I have another little issues </p><p>This is a portion of my layout which give me some problems:</p><pre><code>&lt;RelativeLayout android:id=""@+id/card_address_layout""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:visibility=""visible""            &gt;                 &lt;TextView                    style=""@style/card_field""                    android:id=""@+id/card_indirizzo""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_weight=""1""                    android:layout_gravity=""left|center_vertical""                                         android:layout_marginTop=""8dp""                                     android:maxLength=""35""                    android:ellipsize=""marquee""                 /&gt;                  &lt;ImageButton                     android:id=""@+id/card_address_button""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_gravity=""right|center_vertical""                    android:layout_toRightOf=""@id/card_indirizzo""                    android:src=""@drawable/map_selector""                    android:onClick=""startMap""                    android:padding=""0dp""  /&gt;         &lt;/RelativeLayout&gt;</code></pre><p>The image button src is a selector, in this case this one:</p><pre><code> &lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt; &lt;item android:state_pressed=""true"" android:drawable=""@drawable/map_b"" /&gt; &lt;!-- pressed --&gt; &lt;item android:drawable=""@drawable/map_a"" /&gt;                 &lt;!-- default --&gt;</code></pre><p></p><p>This is the result and I really don't understand why, why the image button has padding??!!!</p><p><img src=""http://i.stack.imgur.com/n4koz.png"" alt=""alt text""></p><p>Help meeeee!</p><p>This is the FULL xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>    &lt;HorizontalScrollView android:id=""@+id/card_images_horizontalscroll""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:scrollbars=""none""        android:visibility=""invisible""        &gt;            &lt;LinearLayout android:id=""@+id/card_images_layout""                            android:orientation=""horizontal""                            android:layout_width=""wrap_content""                            android:layout_height=""80dp""                            android:layout_marginRight=""4dp""            &gt;            &lt;/LinearLayout&gt;    &lt;/HorizontalScrollView&gt;    &lt;TextView        android:id=""@+id/card_images_footer""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:singleLine=""true""        android:background=""@drawable/click_it""     /&gt;&lt;ScrollView android:id=""@+id/card_data_verticalscroll""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_marginLeft=""5dp""            &gt;        &lt;LinearLayout android:id=""@+id/main_vertical_scroll_layout""            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""        &gt;            &lt;TextView                style=""@style/card_title""                android:id=""@+id/card_name""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:singleLine=""true""                android:layout_weight=""1""            /&gt;              &lt;TextView                style=""@style/card_category""                android:id=""@+id/card_categoria""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:singleLine=""true""                android:layout_marginBottom=""30dp""             /&gt;          &lt;RelativeLayout android:id=""@+id/card_address_layout""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:visibility=""visible""            &gt;                 &lt;TextView                    style=""@style/card_field""                    android:id=""@+id/card_indirizzo""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_weight=""1""                    android:layout_gravity=""left|center_vertical""                                         android:layout_marginTop=""8dp""                                     android:maxLength=""35""                    android:ellipsize=""marquee""                 /&gt;                  &lt;ImageButton                     android:id=""@+id/card_address_button""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_gravity=""right|center_vertical""                    android:layout_toRightOf=""@id/card_indirizzo""                    android:src=""@drawable/map_selector""                    android:onClick=""startMap""                    android:padding=""0dp""  /&gt;         &lt;/RelativeLayout&gt;         &lt;RelativeLayout android:id=""@+id/card_phone_layout""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:visibility=""gone""            &gt;                &lt;TextView                         style=""@style/card_field""                        android:id=""@+id/card_telefono""                        android:layout_width=""wrap_content""                        android:layout_height=""wrap_content""                        android:layout_alignParentLeft=""true""                        android:maxLength=""35""                        android:ellipsize=""marquee""                        android:layout_gravity=""center_vertical""                        android:layout_marginTop=""8dp""                     /&gt;                 &lt;ImageButton android:text=""call""                        android:id=""@+id/card_telefono_button""                        android:layout_width=""wrap_content""                        android:layout_height=""wrap_content""                        android:layout_alignParentRight=""true""                        android:layout_gravity=""right|center_vertical""                        android:src=""@drawable/call_selector""                        android:onClick=""startCall""                    /&gt;        &lt;/RelativeLayout&gt;        &lt;RelativeLayout android:id=""@+id/card_mail_layout""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:visibility=""gone""            &gt;                &lt;TextView                        style=""@style/card_field""                        android:id=""@+id/card_mail""                        android:layout_width=""fill_parent""                        android:layout_height=""wrap_content""                        android:layout_alignParentLeft=""true""                        android:maxLength=""35""                        android:ellipsize=""marquee""                        android:layout_gravity=""center_vertical""                        android:layout_marginTop=""8dp""                     /&gt;                 &lt;ImageButton android:text=""mail""                        android:id=""@+id/card_mail_button""                        android:layout_width=""wrap_content""                        android:layout_height=""wrap_content""                        android:layout_alignParentRight=""true""                        android:layout_gravity=""right|center_vertical""                        android:onClick=""startMailClient""                        android:src=""@drawable/mail_selector""                    /&gt;        &lt;/RelativeLayout&gt;         &lt;RelativeLayout android:id=""@+id/card_www_layout""            android:orientation=""horizontal""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:visibility=""gone""            &gt;                &lt;TextView                        style=""@style/card_field""                        android:id=""@+id/card_www""                        android:layout_width=""wrap_content""                        android:layout_height=""wrap_content""                        android:layout_alignParentLeft=""true""                        android:maxLength=""35""                        android:ellipsize=""marquee""                        android:layout_gravity=""center_vertical""                        android:layout_marginTop=""8dp""                     /&gt;                 &lt;ImageButton android:text=""www""                        android:id=""@+id/card_www_button""                        android:layout_width=""wrap_content""                        android:layout_height=""wrap_content""                        android:layout_alignParentRight=""true""                        android:layout_gravity=""right|center_vertical""                        android:onClick=""startDefaultBrowser""                        android:src=""@drawable/www_selector""                    /&gt;        &lt;/RelativeLayout&gt;        &lt;TextView            style=""@style/card_description""            android:id=""@+id/card_descrizione""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:singleLine=""false""            android:layout_marginTop=""30dp""         /&gt;          &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p></p>","554892","","554892","","2011-01-13 12:13:34","2011-01-13 12:31:20","Again ImageButton issues","<android><padding><relativelayout>","1","3","1","",""
"4679767","1","","","2011-01-13 11:59:18","0","145","<p>I have this clickable <code>LinearLayout</code> view, im trying to have it change <code>Activity</code> when clicked by every time i click the object i get a error.</p><pre><code>final LinearLayout lindet = (LinearLayout) findViewById(R.id.detials);lindet.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {        Intent i = new Intent(SellingActivity.this, DetailsActivity.class);        startActivity(i);        finish();    }});</code></pre>","574173","","119895","","2011-01-13 12:34:47","2011-01-13 12:41:20","Changing Activity on a clickable layout","<android><android-widget>","2","3","","",""
"4679768","1","","","2011-01-13 11:59:21","0","88","<p>I am writing a questionairre app in android. </p><ul><li><p>Question is populated from databaseto textview01 while answers are inthe form of buttons.</p></li><li><p>Buttons are created dynamically foreach answer based on number ofanswers in the database.Suppose thereare 4 answers.4 buttons are created.</p></li></ul><p>I am able to do this successfully,there is an image button as well for next.When I press next button i want the question and answers to change.Any hints or previously answered queries on this ?</p><p>Basically what i want is a new set of question and answers be delivered on my view everytime next button is pressed.Regards,Anderson</p>","569668","","","","","2011-01-13 12:11:11","How to use listeners for changing data when I click Next Button In Android?","<android>","1","1","","",""
"4679852","1","","","2011-01-13 12:11:58","1","1084","<p>When an exception occurs , an alert dialog with force close &amp; wait is showing. Can we redirect it to another page, by tracking the exception, without showing that force close.. Because after foece close the application will close.. How can we prevent that.</p>","548218","","","","","2011-01-13 17:35:42","Track Force Close Alert(Exception)","<android>","3","0","2","",""
"4679929","1","4680319","","2011-01-13 12:20:44","0","355","<p>In my SQL database table there are colums _id, int dayofweek, String text ...I now, do a SQL query on that table to get a cursor to the results.The results then are shown in a listView:   </p><pre><code>private void showBlocks(){    Cursor blocks = ttDB.getBlocks();    startManagingCursor(blocks);    int[] key = new int []{            android.R.id.text1,            android.R.id.text2     };    SimpleCursorAdapter blockAdapter = new SimpleCursorAdapter(            this,             android.R.layout.simple_list_item_2,            blocks,             new String[] {                    ""day"",                    ""text""                },             key);    lv1.setAdapter(blockAdapter); }</code></pre><p>How (and where) can I now replace the integer values of dayofweek by the corresponding strings? I thought about joining two tables while querying but then it will not be multilingual any more.</p>","570168","","316646","","2011-08-17 17:15:00","2011-08-17 17:15:00","Android: replace values of a cursor/sql query","<java><android><sql><replace><adapter>","2","0","","",""
"4679939","1","4679975","","2011-01-13 12:21:48","3","3075","<p>I want to send HTML content via email. I open gmail via intent and shows compose page using below code.</p><pre><code>Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);emailIntent.setType(""text/html"");emailIntent.setPackage(""com.google.android.gm"");                    emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""subject here"");emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(""html &lt;b&gt;content&lt;/b&gt;""));startActivity(Intent.createChooser(emailIntent, ""Email to Friend""));</code></pre><p>But the problem with this is that, I cant send inline images. How can do that?</p>","490031","","","","","2011-03-23 09:36:18","Sending inline HTML images in email","<android><html><email><inline-images>","1","0","","",""
"4679945","1","4679989","","2011-01-13 12:22:09","1","523","<p>I'm developing an Android 2.2 application.</p><p>I want to catch and re throw the same exception. I want to do this because I have to close a cursor before exit the method (a finally statement, isn't it?)</p><p>Can I do that? How?</p><p>Thanks</p>","68571","","","","","2011-01-13 12:26:41","Rethrowing an exception in Android","<android><try-catch><sqlexception>","2","0","","",""
"4680065","1","","","2011-01-13 12:34:40","6","8236","<p>I am having 4 buttons in my layout, now whenever i click any button, after the click event, button should be highlighed showing that it was clicked last.</p><p>For making such thing, i have tried the following:</p><p>code:</p><pre><code>btn1.setOnClickListener(new button_click_listener());btn2.setOnClickListener(new button_click_listener());class button_click_listener implements Button.OnClickListener{    @Override    public void onClick(View v)     {       if(v==btn1)       {            btn1.requestFocus();       }       if(v==btn2)       {            btn2.requestFocus();       }        .......    }}</code></pre><p>XML Layout:</p><pre><code>&lt;Button    android:text=""Click 1""    android:id=""@+id/btnClick1""    android:layout_width=""70dp""    android:layout_height=""wrap_content""   style=""@android:style/Widget.Button.Small""   android:padding=""10dp""   android:focusableInTouchMode=""true""&gt;&lt;/Button&gt;</code></pre><p><strong>How do i show clicked highlight on the button that was clicked last?Please, show me a way and give suggestions.</strong></p><h2>Update:</h2><p>If i set <strong><code>android:focusable=""true""</code></strong> then button is highlighted and focused, but then at the same time, i need to click twice on the button to perform the actual click event.</p>","379693","","21234","","2011-01-13 15:07:42","2013-03-22 22:39:17","Android - Set Clicked focus on Button","<android><button>","3","2","1","",""
"4680167","1","4680238","","2011-01-13 12:44:41","0","1853","<p>I have created an <code>Activity</code> where i have a <code>Button</code>.</p><p>By pressing the button an android <code>Gallery</code> opens. When i choose an image from the gallery it is shows it in an <code>ImageView</code> of my <code>Activity</code> but after choosing second time the following error occuring</p><pre><code>01-13 17:55:25.323: ERROR/AndroidRuntime(14899): java.lang.OutOfMemoryError: bitmap size exceeds VM budget</code></pre><p>Here is the source code i am using:</p><pre><code>public class MyImage extends Activity {    /** Called when the activity is first created. */    Gallery gallery;     private Uri[] mUrls;      String[] mFiles=null;      @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);          File images = Environment.getDataDirectory();                   File[] imagelist = images.listFiles();                    mFiles = new String[imagelist.length];                            for(int i= 0 ; i&lt; imagelist.length; i++)                            {                                mFiles[i] = imagelist[i].getAbsolutePath();                            }                            mUrls = new Uri[mFiles.length];                            for(int i=0; i &lt; mFiles.length; i++)                            {                                mUrls[i] = Uri.parse(mFiles[i]);                               }                               Gallery g = (Gallery) findViewById(R.id.Gallery01);                            g.setAdapter(new ImageAdapter(this));                            g.setFadingEdgeLength(40);      }     public class ImageAdapter extends BaseAdapter{                   int mGalleryItemBackground;                   public ImageAdapter(Context c)  {                          mContext = c;                      }                   public int getCount(){                       return mUrls.length;                   }                   public Object getItem(int position){                       return position;                   }                   public long getItemId(int position) {                       return position;                   }                  public View getView(int position, View convertView, ViewGroup parent){                       ImageView i = new ImageView(mContext);                       i.setImageURI(mUrls[position]);                       i.setScaleType(ImageView.ScaleType.FIT_XY);                       i.setLayoutParams(new Gallery.LayoutParams(260, 210));                       return i;                   }                      private Context mContext;                   }     }</code></pre>","489762","","24054","","2011-01-13 12:48:26","2011-01-13 12:52:22","retrieve image from gallery in android","<android>","3","0","","",""
"4680174","1","4680975","","2011-01-13 12:45:19","5","3990","<p>Is there a method or something to scroll de WebView at the bottom of the page..I am using a WebView in a chat client as chatboard, and I want to scroll the page down as the user writes some text...</p><p>Thank you very much.</p>","449310","","","","","2013-01-27 21:00:40","Android WebView scroll down","<android><scrolling><webview><scroll>","1","2","1","",""
"4680201","1","4680283","","2011-01-13 12:47:50","1","409","<p>A call to the delete() command  in a database helper class is causing a lag in the UI of my android application. I did a timer test on it and the simple command   this.db.delete(""tonightSets"", ""id = ""+item_id, null); takes ages to return.Here are the speeds I got for executing the same query repeatedly (in milliseconds)1229ms287ms779ms2604ms  !817msWhy is this so slow? The table only has 30 records in it and each row has about ten columns. I'm doing far more complicated multiple select and count functions on the same table that return in less than 9msHow can I fix this? is there a way to do it asynchronously so it doesn't create a lag in the UI?Many Thanks</p>","493466","","135152","","2011-05-25 03:01:50","2011-05-25 03:01:50","simple Delete() command on sqlite takes nearly a second?","<android><sqlite>","1","0","","",""
"4680285","1","","","2011-01-13 12:55:13","24","3661","<p>I have a huge android project with many strings declared in strings.xml. I wanted to remove un-used strings in strings.xml. Is there any easy way to do so?</p><p>Thanks</p>","556956","","21234","","2011-01-13 12:59:58","2014-04-14 15:25:52","is there any simple way to find out unused strings in android project?","<android>","6","0","4","",""
"4680396","1","4680518","","2011-01-13 13:08:06","1","722","<p>hiBeen working all morning trying to placethe progressbar under the text ""simulation in progress"".Can anyone give me help me?Adding picture:<img src=""http://i.stack.imgur.com/8B8iX.gif"" alt=""alt text""></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=""3dp""          &gt;&lt;ImageView android:id=""@+id/image""          android:layout_width=""wrap_content""          android:layout_height=""fill_parent""          android:layout_marginRight=""10dp""          /&gt;&lt;TextView android:id=""@+id/text""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:textColor=""#000""          /&gt; &lt;ProgressBar          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          style=""?android:attr/progressBarStyleHorizontal""          android:id=""@+id/status_progress""          android:max=""100""          /&gt;&lt;/LinearLayout&gt;</code></pre>","538837","","538837","","2011-01-13 13:14:17","2011-01-13 13:24:19","android remoteView layout is not working","<android>","2","0","","",""
"4680414","1","4683160","","2011-01-13 13:10:36","6","2084","<p>Hey guys, does anyone has an experience with Android development with intelliJ IDEA IDE? Does it suit all the needs?</p>","397991","","472270","","2011-01-13 18:19:11","2011-01-13 18:19:11","IntelliJ IDEA IDE for Android development","<java><android><ide><intellij-idea>","4","1","1","",""
"4680489","1","4682774","","2011-01-13 13:20:21","0","500","<p>I have simple 2D puzzle game earlier I created it extending view and everything goes fine unless I tested it on smaller device. My half of the game doesnt appear on device someone told me to use surface view I tried that also but of no use can anybody tell me whats the problem I placed various graphics object like this </p><pre><code>bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ring);canvas.drawBitmap(bitmap, 45, 250, paint);canvas.drawBitmap(bitmap, 135, 250, paint);canvas.drawBitmap(bitmap, 225, 250, paint);</code></pre><p>i.e. I used static values is this not the correct way or what I am doing wrong?</p>","517247","","","","","2013-03-07 21:47:25","Android Game Programming","<android><views>","5","0","1","",""
"4680499","1","4680660","","2011-01-13 13:21:27","104","41865","<pre><code>+----------------------------------------------+   ^¦ ImageView    +--------------+                ¦   |¦              ¦              ¦                ¦   |¦              ¦ Actual image ¦                ¦   |¦              ¦              ¦                ¦   |60px height of ImageView¦              ¦              ¦                ¦   |¦              ¦              ¦                ¦   |¦              +--------------+                ¦   |+----------------------------------------------+   &lt;------------------------------------------------&gt;                   90px width of ImageView</code></pre><p>I have an image view with some default height and width, images are stored in db and I want to scale Image according to imageview height width. As I don't want t give default values because when ever I change its height and width I also have to change it in code.</p><p>I am trying to get the height and width of ImageView but 0 is returned to me in both cases.please help me</p><pre><code>int height = ((ImageView) v.findViewById(R.id.img_ItemView)).getHeight();</code></pre><p>this returns me 0 even it has default height and width</p>","185022","","2872712","","2014-02-18 20:22:37","2014-03-31 21:07:23","How to get the width and height of an android.widget.ImageView?","<android><image><height><width>","5","7","31","",""
"4680543","1","","","2011-01-13 13:27:14","0","1447","<p>hii every one ,,,in the following code snippet am parsing a xml file which in on internet, using url am accessing,,But i need to parse a local xml( say file which is stored in xml folder in the project)please can any one give me the syntax to load the path of local xml in the place of URL,,,     (i am brand new to android),,thanx in advance</p><p>public class XMLComplaint extends Activity {    private int window=0;    private String s1,s2,s3,s4,s5,s6;    String str1,str2,str3,str4,str5,str6,str7,str8,str9,str10,str11,str12,str13,str14,sidsize;    private ArrayList notedetails = new ArrayList();            ArrayList problemdetails = new ArrayList();            ArrayList totaldetails = new ArrayList();</p><pre><code>private ImageButton left,right;private TextView Gid;        ListView notelist = null,problemlist=null,totallist=null;private ArrayAdapter&lt;String&gt; totaladapter = null;private List&lt;GroupInfo&gt; commonlist ;private GroupInfo gi ;MyHandler myhandler=new MyHandler();@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Gid=(TextView)findViewById(R.id.Gid);    left=(ImageButton)findViewById(R.id.left);    right=(ImageButton)findViewById(R.id.right);    totallist = (ListView) this.findViewById(R.id.Listview1);    try {        URL myurl=new URL(""http://www.compliantbox.com/docprocessor/sync.php"");        SAXParserFactory spf=SAXParserFactory.newInstance();        SAXParser sp=spf.newSAXParser();        XMLReader xr=sp.getXMLReader();        xr.setContentHandler(myhandler);        xr.parse(new InputSource(myurl.openStream()));        commonlist=myhandler.getGroups();    } catch (MalformedURLException e) {        e.printStackTrace();    } catch (ParserConfigurationException e) {        e.printStackTrace();    } catch (SAXException e) {        e.printStackTrace();    } catch (IOException e) {        e.printStackTrace();    }    if(commonlist != null){        gi= commonlist.get(window);        Gid.setText(gi.getGroupName());        notedetails.addAll(gi.getNoteNameList());        problemdetails.addAll(gi.getProblemNameList());        totaldetails.addAll(notedetails);        totaldetails.addAll(problemdetails);        totaladapter = new ArrayAdapter&lt;String&gt;(getApplicationContext(), R.layout.datalook,totaldetails);        totallist.setAdapter(totaladapter);        left.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                right.setEnabled(true);                window--;                if(window&gt;=0){                    notedetails.clear();                    problemdetails.clear();                    totaldetails.clear();                    gi= commonlist.get(window);                    Gid.setText(gi.getGroupName());                    notedetails.addAll(gi.getNoteNameList());                    problemdetails.addAll(gi.getProblemNameList());                    totaldetails.addAll(notedetails);                    totaldetails.addAll(problemdetails);                    totaladapter = new ArrayAdapter&lt;String&gt;(getApplicationContext(), R.layout.datalook,totaldetails);                    totallist.setAdapter(totaladapter);                }else{                    left.setEnabled(false);                    window++;                    }            }});</code></pre>","571256","","","","","2011-01-13 14:34:08","changing URL path to local xml path in android xml parser","<android><xml><xml-parsing>","1","0","1","",""
"4680550","1","","","2011-01-13 13:27:42","1","528","<p>Hallo,</p><p>In Android, the Listview has a ""fastScroll"" feature. In combination with an alphabeticindexer, you can directly scroll to certain letter in your list. But i would like to implent, that you can do the same thing with a ""two finger"" scrolling:When you touch the display with two finger, the Listview scolls directly to the according letter. When you now scroll with two fingers, you scroll alphabeticly in the Listview.</p><p>My HTC Desire has this feature in the contacts list, so it must be possible somehow :-)</p><p>I have already searched a lot, but didn't find anything, that helps me. Does anybody know of a sample program or can give me some help, how to do that?</p><p>Thanks in advance!!</p><p>Harald</p>","574282","","","","","2011-01-13 13:27:42","Listview with Multitouch for alphabetic scrolling","<android><listview>","0","2","","",""
"4680576","1","4680623","","2011-01-13 13:31:20","0","2494","<pre><code>        public void draw(GL10 gl) {        gl.glFrontFace(GL10.GL_CCW);        gl.glEnable(GL10.GL_CULL_FACE);        gl.glCullFace(GL10.GL_BACK);        gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);        /*        gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);        gl.glEnable(GL10.GL_BLEND);        gl.glEnable(GL10.GL_LINE_SMOOTH);*/        gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);        gl.glLineWidth(3.0f);        gl.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);        gl.glDrawArrays(GL10.GL_LINE_STRIP, 0, list.size()/3);        gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);        gl.glDisable(GL10.GL_CULL_FACE);        //gl.glDisable(GL10.GL_BLEND);        //gl.glDisable(GL10.GL_LINE_SMOOTH);    }</code></pre><p>my code is the following. </p><p>if i add this code</p><pre><code>gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);gl.glEnable(GL10.GL_BLEND);gl.glEnable(GL10.GL_LINE_SMOOTH);</code></pre><p>then i get a very thin (1px) line, and not an antialised line. what is the best way to do its correctly?</p>","472537","","44729","","2011-01-13 15:34:17","2011-01-13 15:34:17","Android OpenGL ES Line antialiase","<android><opengl-es>","1","0","","",""
"4680637","1","","","2011-01-13 13:39:04","31","23756","<p><a href=""http://www.androidcentral.com/what-adb""><code>adb devices</code></a> was working fine last year, but after upgrades and new software installs,<code>adb devices</code> no longer recognizes USB attached Android devices.</p><p>Here is what I have tried:</p><pre><code>adb kill-serveradb devicesadb usb  error: Device not found</code></pre>","574298","","110358","","2013-02-07 23:05:19","2014-03-27 23:37:34","OS X 10.6.6 and ""adb devices"" fails to list android devices","<android><osx><adb>","16","6","23","",""
"4680655","1","4826409","","2011-01-13 13:41:03","2","1579","<p>I asked a <a href=""http://stackoverflow.com/questions/4670359/android-2-1-browser-javascript-jquery-metadata-problem"">question</a> yesterday that has gone unanswered.  So I will just ask this:</p><p>What advice can you give me about Android 2.1 Web Browser and Javascript?  How do you debug errors?  What things do you avoid doing?  What things do you make sure to do?</p><p>In a lot of ways, the Browser behaves like Mobile Safari on iOS devices.  I need help with what makes it different from iOS devices.</p>","512453","","405143","","2011-01-13 13:57:14","2011-01-28 08:56:07","Android 2.1 Browser Javascript Problems and Suggestions","<javascript><android><browser>","2","1","","",""
"4680697","1","4849193","","2011-01-13 13:45:27","0","733","<p>I have a list with items, some items can be in 'viewed' status. i want those items to have different background color then the rest.</p><p>list view basically has a single selector for the whole list, setting a background color on one of the items prevent wont do the trick since the selector is drawn below my item's layout as background and counts on them being transparent.</p><p>is there a way to define more then one selector for a list ? if not is it possible to create a selector that has an extra state ? basically all i want is the regular list selector plus an extra state that it's ColorDrawable is defined in my colors.xml.(since i can't inherit from a drawable and the list_selector drawables of android are not visible in the SDK for me to use i wanted just to add a state, but then how do i enforce using the extra state ?)</p>","312288","","","","","2011-01-31 09:17:51","different color for certain item in my list","<android><state><add><drawable><states>","2","1","","",""
"4680803","1","4952654","","2011-01-13 13:56:55","2","13201","<p>i use this a s surface view in my application and now i want to add text view to this programmatically. How can i do that.</p><pre><code>""&lt;com.csfcse.udrawer.UdrawerDrawingSurface  android:layout_width=""fill_parent""   android:layout_height=""fill_parent""  android:id=""@+id/drawingSurface""         android:layout_gravity=""left"" /&gt;""</code></pre><p>Thanks......</p>","559715","","","","","2011-04-26 12:30:40","Adding text view to surface view","<android><layout><textview><surfaceview>","3","0","","",""
"4680833","1","","","2011-01-13 13:59:43","0","428","<p>I use this code to copy my sqlite database from ""Assets"" directory to Android-phone ""/data/data/my_packname/databases/"" directory. </p><pre><code>public class DataBaseHelper extends SQLiteOpenHelper{       private SQLiteDatabase myDataBase;     private final Context myContext;    public DataBaseHelper(Context context) {     super(context, DATABASE_NAME, null, DATABASE_VERSION);        this.myContext = context;    }   ...    private void copyDataBase() throws IOException{     //Open your local db as the input stream     AssetManager am = this.myContext.getAssets();     InputStream myInput = am.open(DATABASE_NAME);     // Path to the just created empty db     String outFileName = DATABASE_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();    }       ...}</code></pre><p>But in line </p><pre><code> while ((length = myInput.read(buffer)) &gt; 0){</code></pre><p>i have <strong>IOException</strong>!</p><p>Can anyone tell me what i'm doing wrong?</p>","574318","","","","","2011-05-18 12:38:06","Problem with using my own sqlite database","<android><database><sqlite>","1","3","","",""
"4680870","1","4681002","","2011-01-13 14:02:33","0","2883","<p>I am calling a .net web service from my android app with no luck.Here is my code:</p><p>package com.reza;</p><p>import android.app.Activity;import android.os.Bundle;import org.ksoap2.SoapEnvelope;import org.ksoap2.serialization.SoapObject;import org.ksoap2.serialization.SoapSerializationEnvelope;import org.ksoap2.transport.HttpTransportSE;import android.widget.TextView;</p><p>public class callWebservice extends Activity {     private static final String METHOD_NAME = ""HelloWorld"";</p><pre><code> private static final String NAMESPACE = ""http://tempuri.org/""; private static final String URL = ""http://service.screwedmind.com/LocalBusiness.asmx""; private static final String SOAP_ACTION = null; TextView tv;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    tv=(TextView)findViewById(R.id.text1);    call();}public void call(){        try {        SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);        envelope.dotNet=true;        envelope.setOutputSoapObject(request);        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);        androidHttpTransport.call(SOAP_ACTION, envelope);        String result=(String)envelope.getResponse();        tv.setText(result);        }         catch (Exception e) {            tv.setText(""error occured.."");        }}</code></pre><p>}</p><p>when I run this program, I see my error text which is ""error occured..""can anybody plz guide me what i am doing wrong.</p>","574308","","","","","2011-01-13 15:19:40","calling .net web service from android not working","<.net><android><web-services>","2","1","","",""
"4680875","1","4680987","","2011-01-13 14:02:57","2","2244","<p>When using a transparent PNG image which has a fine fading shadow always there is an edge line around the shadow on the Android screen. It does not show this in emualator or Exclipse. See photo.</p><p>I wonder if there is way to improve on this. Is this something to do with inability of Android screen to show all 24 bit colours or the fact that is scaling and resampling image?</p><p>In this example the image is loaded into an ImageButton view. I tried it as source or background and it is the same quality.</p><p><img src=""http://i.stack.imgur.com/42pDS.jpg"" alt=""alt text""></p>","562497","","","","","2011-01-13 14:13:48","Quality of rendering shadow in transparent png on Android","<android><png>","1","0","6","",""
"4680912","1","","","2011-01-13 14:06:38","0","606","<p>my alertdialog wont display the textview from my listview. when i click on the listview it only displays the first list of the list view string. could someone please help me!</p><pre><code>package com.example.taxime;import android.app.AlertDialog;import android.app.ListActivity;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.AdapterView.OnItemClickListener;import android.widget.ArrayAdapter;import android.widget.ListView;public class FindTaxi extends ListActivity { @Override  public void onCreate(Bundle savedInstanceState) {   super.onCreate(savedInstanceState);   final String[] number = getResources().getStringArray(R.array.number);   setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,number));   final String[] taxi = getResources().getStringArray(R.array.taxi);   setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, taxi));   ListView lv = getListView();   lv.setTextFilterEnabled(true);   lv.setOnItemClickListener(new OnItemClickListener() {     public void onItemClick(AdapterView&lt;?&gt; parent, View view,         int position, long id) {      AlertDialog.Builder adb=new AlertDialog.Builder(FindTaxi.this);       int selectedPosition = 0;       adb.setTitle(""""+taxi[selectedPosition]);       adb.setMessage(""Phone Number: ""+number[selectedPosition]);       adb.setPositiveButton(TELEPHONY_SERVICE, null);              adb.setNegativeButton(""Cancel"", null);       adb.show();     }   }); }}</code></pre>","574311","","750987","","2011-05-28 13:39:57","2011-05-28 13:39:57","how can i get my alertdialog to display listview info?","<android><android-listview>","1","0","","",""
"4680939","1","4683908","","2011-01-13 14:08:48","0","1812","<p>I've got a project in which I'm trying to do some refactoring of my existing TabHosts.  I've got a bunch of very simple TabHost files that look like the class below.  Some actually only have one tab, some 3, etc - so the only real difference in them is the number of tabs and the activity class loaded in each one.  I'd like to just create a single TabHost that could get the info out of a passed in Bundle to determine how many tabs and the info needed (spec, indicator, content) to build/add each tab.  It seems like the items I can place in the bundle are pretty basic and I'm not familiar with the Parcelable or Serializable features.  Any suggestions?</p><pre><code>public class   SomeTabHost       extends ActivityGroup{      @Override   public void onCreate(Bundle savedInstanceState)   {      super.onCreate(savedInstanceState);      // Inflate ourselves into the layout ViewStub      ViewStub vs = (ViewStub) findViewById(R.id.theViewStub);      vs.setLayoutResource(R.layout.my_tabhost);       vs.inflate();      TabHost host = (TabHost) findViewById(android.R.id.tabhost);      host.setup(getLocalActivityManager());      host.addTab(host.newTabSpec(""Tab1"")                      .setIndicator(""Tab1"")                      .setContent(new Intent(this, SomeActivity.class)));      host.addTab(host.newTabSpec(""Tab2"")                      .setIndicator(""Tab2"")                      .setContent(new Intent(this, SomeOtherActivity.class)));      int numChildren = host.getTabWidget().getChildCount();      for ( int i=0; i  &lt;numChildren; i++ )      {         host.getTabWidget().getChildAt(i).getLayoutParams().height = 35;      }   }// end onCreate}// end class</code></pre>","418714","","","","","2011-01-13 18:45:20","Android - creating a Generic TabHost, passing info using Bundle problem","<android><android-tabhost>","1","0","2","",""
"4681083","1","4681316","","2011-01-13 14:25:36","0","862","<pre><code> &lt;FrameLayout    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@color/white""&gt;&lt;RelativeLayout    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;&lt;TextView    android:id=""@+id/summary""    android:text=""Summary   ""    android:textSize=""25px""    android:textColor=""@color/black""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""/&gt;&lt;ImageView    android:id=""@+id/summary_btn""    android:src=""@drawable/next""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_below=""@id/summary""    android:layout_toRightOf=""@id/summary""    android:layout_alignBaseline=""@id/summary""/&gt;&lt;/RelativeLayout&gt;&lt;FrameLayout&gt;</code></pre><p>I don't want to make this image a button .But i don't see the error.</p>","439058","","","","","2011-01-13 14:46:48","when i want to put a small image to the right of a text, it doesn't work","<android><image><button><alignment>","2","2","","",""
"4681108","1","","","2011-01-13 14:28:52","0","167","<p>Hi guys i am trying to develop<img src=""http://i.stack.imgur.com/eat2A.png"" alt=""alt text""> a calendar day view similar to the android calendar one where you can scroll through different hours in a list and if there is an event,  a bubble with the event title is drawn in the appropriate hour.</p><p>to better understand what i am trying to achieve, here is a image of the view i need to create.</p>","444668","","","","","2011-09-07 15:54:03","How can i create this android view?","<android>","0","3","0","",""
"4681168","1","4995755","","2011-01-13 14:34:01","0","2467","<p>I've got this Table layout with 3 EditText fields &amp; a button that performs a calculation.</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/lbl_fuel_order""  android:textSize=""18dp""  android:gravity=""center_horizontal""/&gt; &lt;TableLayout  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:layout_gravity=""center""  android:stretchColumns=""*""&gt;  &lt;TableRow&gt;   &lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:text=""@string/lbl_arr_kgs""    android:textSize=""12dp""    android:layout_weight=""1""/&gt;   &lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:text=""@string/lbl_sg""    android:textSize=""12dp""    android:layout_weight=""1""/&gt;  &lt;/TableRow&gt;  &lt;TableRow&gt;   &lt;EditText    android:id=""@+id/arr_fuel""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_weight=""1""    android:lines=""1""    android:inputType=""number""    android:imeOptions=""actionNext""/&gt;   &lt;EditText    android:id=""@+id/sg""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_weight=""1""    android:lines=""1""    android:inputType=""numberDecimal""    android:imeOptions=""actionNext""/&gt;  &lt;/TableRow&gt;   &lt;TableRow&gt;   &lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:text=""@string/lbl_req_tanks_kgs""    android:textSize=""12dp""    android:layout_weight=""1""/&gt;  &lt;/TableRow&gt;  &lt;TableRow&gt;   &lt;EditText    android:id=""@+id/req_tanks_fuel""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_weight=""1""    android:lines=""1""    android:inputType=""number""    android:imeOptions=""actionNext""/&gt;   &lt;Button    android:id=""@+id/btn_calc_fuel_order""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_weight=""1""    android:text=""@string/lbl_calc""/&gt;  &lt;/TableRow&gt;  &lt;TableRow&gt;   &lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:text=""@string/lbl_uplift_kgs""    android:textSize=""12dp""    android:layout_weight=""1""/&gt;   &lt;TextView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:text=""@string/lbl_uplift_l""    android:textSize=""12dp""    android:layout_weight=""1""/&gt;  &lt;/TableRow&gt;  &lt;TableRow&gt;   &lt;TextView    android:id=""@+id/req_weight""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_weight=""1""    android:gravity=""left""    android:lines=""1""    android:text=""000000""    android:textSize=""24dp""    android:textColor=""#ff0000""/&gt;   &lt;TextView    android:id=""@+id/req_volume""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_weight=""1""    android:gravity=""left""    android:lines=""1""    android:text=""111111""    android:textSize=""24dp""    android:textColor=""#00ff00""/&gt;  &lt;/TableRow&gt; &lt;/TableLayout&gt;    &lt;/LinearLayout&gt;</code></pre><p>The left-hand EditText, in the top row of the table layout, has focus when the activity starts. However, when I click next on the soft keyboard the cursor moves to the left-hand EditText in the bottom row rather than the EditText to the right (in the top row). I've tested the right-hand EditText, in the top row, which sends the cursor to the left-hand EditText in the bottom row as I would wish.</p><p>Is there any way of making the cursor go right from the left-hand EditText in the top row first &amp; then from there to the left-hand EditText in the bottom row?</p><p>If that is possible, can I also arrange for it to then move focus to the button which is in the right-hand side of the bottom row?</p><p>Thanks</p>","574364","","","","","2011-02-14 18:20:15","Problem using android:imeOptions=""actionNext"" in Table Layout","<android><tablelayout><ime>","1","0","","",""
"4681209","1","","","2011-01-13 14:37:16","-5","1633","<p>I want to develop an music player app for android with multitasking so dat i can use differtent apps without closing music player......help out plzz..</p>","553915","","","","","2011-01-13 14:57:18","I want to develop an music player app for android with multitasking so dat i can use differtent apps without closing music player......help out plzz","<android><multitasking><background-music>","1","2","","2011-01-13 16:25:46",""
"4681231","1","6509273","","2011-01-13 14:39:41","3","2995","<p>I have an Android widget that has a configure activity.  I also have an ImageView ""button"" set up on the widget to launch the configure activity, in case the user wants to change his/her preferences after initializing them.</p><p>So, basic lifecycle:</p><ol><li>User adds the widget</li><li>Configure activity pops up, user fills in fields and clicks ""Submit""</li><li>Widget is added on screen</li><li>User taps the ImageView to launch the configure activity</li><li>Configure activity pops up, user edits fields</li><li>After either hitting ""Submit"" or backing out, the widget is updated</li><li>User can continue to go through steps 5 and 6 as needed.</li></ol><p>My problem is at step 5.  The <em>very first</em> and <strong>only</strong> the first time that the user taps the ImageView, it looks like two configure activities are launched.  That is, when I back out of the first one, there's still another one ""behind"" it.  On all subsequent launches of the configure activity, however, only one is launched and everything works great.</p><p>What could be the problem?  I'll post relevant code below.</p><p><strong>AndroidManifest.xml</strong></p><pre><code>    &lt;activity        android:name="".ConfigActivity""        android:label=""@string/app_name"" &gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.appwidget.action.APPWIDGET_CONFIGURE"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;receiver        android:name="".Widget""        android:label=""Widget"" &gt;        &lt;intent-filter&gt;            &lt;action                android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;        &lt;/intent-filter&gt;        &lt;intent-filter&gt;            &lt;action                android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;                &lt;data android:scheme=""sample_widget"" /&gt;        &lt;/intent-filter&gt;        &lt;intent-filter&gt;            &lt;action                android:name=""com.this.that.WIDGET_CONTROL"" /&gt;            &lt;data                android:scheme=""sample_widget"" /&gt;        &lt;/intent-filter&gt;        &lt;meta-data            android:name=""android.appwidget.provider""            android:resource=""@xml/widget"" /&gt;    &lt;/receiver&gt;</code></pre><p><strong>AppWidget-Provider widget.xml</strong></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:updatePeriodMillis=""5000""    android:minWidth=""294dp""    android:minHeight=""220dp""    android:initialLayout=""@layout/widgetlayout""    android:configure=""com.this.that.ConfigActivity"" &gt;&lt;/appwidget-provider&gt;</code></pre><p><strong>ConfigActivity.java</strong></p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Get the data we were launched with    Intent launchIntent = getIntent();    Bundle extras = launchIntent.getExtras();    if (extras != null) {        appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);        Intent cancelResultValue = new Intent();        cancelResultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);        setResult(RESULT_CANCELED, cancelResultValue);    } else {        // Only launch if it's for configuration        finish();    }    setContentView(R.layout.myconfig);    // Create Buttons/EditTexts    SubmitBTN = (Button) findViewById(R.id.BTNSubmit);    SampleET= (EditText) findViewById(R.id.ETSample);    SubmitBTN.setOnClickListener(submitListener);    loadPreferences(ConfigActivity.this, appWidgetId);}private OnClickListener submitListener = new OnClickListener() {    public void onClick(View v) {        final Context context = PriorityViewConfig.this;        // Save strings in our prefs        String sample = SampleET.getText().toString();        SharedPreferences.Editor prefs = context.getSharedPreferences(PREFS_NAME, 0).edit();        prefs.putString(PREF_PREFIX_KEY + appWidgetId + ""sample"", sample);        prefs.commit();        if (appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID) {            // Tell the AppWidgetManager that we're now configured            Intent resultValue = new Intent();            //resultValue.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);            resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);            setResult(RESULT_OK, resultValue);            // Get an instance of the AppWidgetManager            AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);            // Update the App Widget with the layout            RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widgetlayout);            Widget.updateDisplayState(context, appWidgetId);        }        // Activity is now done        finish();    }};private void loadPreferences(Context context, int appWidgetId) {    SharedPreferences prefs = context.getSharedPreferences(PREFS_NAME, 0);    String sample = prefs.getString(PREF_PREFIX_KEY + appWidgetId + ""sample"", null);    if (sample != null) {        SampleET.setText(sample);    } else {        // Nothing stored, don't need to do anything    }}</code></pre><p><strong>Widget.java</strong></p><pre><code>@Overridepublic void onReceive(Context context, Intent intent) {    final String action = intent.getAction();    Log.d(LOG_TAG, ""OnReceive:Action: "" + action);    if (ACTION_WIDGET_CONTROL.equals(action)) {        // Pass this on to the action handler where we'll figure out what to do and update the widget        final int appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);        if (appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID) {            this.onHandleAction(context, appWidgetId, intent.getData());        }               }    super.onReceive(context, intent);}public static void updateDisplayState(Context context, int appWidgetId) {    Intent configIntent = new Intent(context, ConfigActivity.class);    configIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);    // Make this unique for this appWidgetId    configIntent.setData(Uri.withAppendedPath(Uri.parse(Widget.URI_SCHEME + ""://widget/id/""), String.valueOf(appWidgetId)));    PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, configIntent, PendingIntent.FLAG_UPDATE_CURRENT);    views.setOnClickPendingIntent(R.id.IVConfig, pendingIntent);    AppWidgetManager.getInstance(context).updateAppWidget(appWidgetId, views);}private void onHandleAction(Context context, int appWidgetId, Uri data) {    String controlType = data.getFragment();            // Nothing here yet    updateDisplayState(context, appWidgetId);}</code></pre><p>I think these are the most relevant sections.  The places I'm going to be looking further into are in ConfigActivity.java in the submitListener and in the updateDisplayState method in Widget.java</p><p>Any help would be awesome!  Thanks!</p>","255394","","","","","2012-07-12 20:31:56","Android: Widget Config Activity Getting Launched Twice?","<android><activity><android-widget><android-intent>","2","0","","",""
"4681245","1","","","2011-01-13 14:40:44","0","903","<p>Hi the time has come to stream video and the search have began ;) i'm thinking of using this: <a href=""http://stackoverflow.com/questions/4567078/android-2-2-code-for-playing-a-video-from-sd-card-streaming-from-web"">link text</a> to start but i need an address with a video to play. Does anyone know of a URL with a video that i can test in my app? </p>","526924","","","","","2011-01-13 14:40:44","how to stream video android","<android>","0","2","","",""
"4681287","1","4681725","","2011-01-13 14:44:11","0","1615","<p>I am trying to build a listview with a header row anchored to the top of the listview and scrolls with the listview. I know I'm not supposed to embed a listview within a scrollableview, but how else can I achieve this effect. I want it to look like the News Feeds screen on the stock Facebook app for Android where the ""What's on your mind..."" EditText scrolls away when you scroll down to read the feeds.</p><p>My pseudo-code looks like this which works but when I launch the app, it always scrolls down a bit hiding the button until I touch-scroll back up:</p><pre><code>&lt;ScrollView&gt;  &lt;LinearLayout orientation=""vertical""&gt;    &lt;Button /&gt;    &lt;ListView /&gt;  &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre>","574350","","","","","2011-01-13 15:25:26","Android ListView with an non-sticky header row that can scroll off screen","<android><facebook><listview><scrollview>","1","0","","",""
"4681340","1","","","2011-01-13 14:48:57","5","1537","<p>I have some *.cpp source files and some *.s ARM assembler files I want to assemble and link in my Android.mk file (by running ndk-build script).</p><p>My Android.mk file looks like this:</p><pre><code>LOCAL_PATH:= $(call my-dir)include $(CLEAR_VARS)LOCAL_ARM_MODE := armLOCAL_MODULE    := libTestJNILOCAL_SRC_FILES := Test.cpp TestAS_gas4.s LOCAL_CFLAGS := -DHAVE_CONFIG_H -DFPM_ARM -ffast-math -O3 -DOPT_ARMLOCAL_LDLIBS    += -lloginclude $(BUILD_SHARED_LIBRARY)</code></pre><p>Unfortunately the *.s file is not recognized. ndk-build says:</p><pre><code>Gdbserver      : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserverGdbsetup       : libs/armeabi/gdb.setupmake: *** No rule to make target `/cygdrive/c/projects/TestAS_gas4.s', needed by `/cygdrive/c/projects/obj/local/armeabi/objs-debug/libTestJNI/TestAS_gas4.o'.  Stop.</code></pre><p>In a ""normal"" makefile I would have to assemble by using ""as"" in a rule. How is it done in the Android.mk files?</p><p>/Kim </p>","574390","","149841","","2011-08-04 08:19:59","2011-08-04 08:19:59","Android.mk - How to assemble and link ARM assembler files","<android><gcc><assembly><android-ndk>","2","0","","",""
"4681348","1","4681457","","2011-01-13 14:50:12","1","3594","<p>I my application I have one large PNG file containg hi-res image. Depending on situation I would like to use this image either as icon or as placeholder for <code>ImageView</code>.</p><p>For MenuItem this image is too large, so I need to scale-down it to suitable size. I mean if it has to be displayed on large enough device like Samsung Galaxy Tab - I need to use one scale, for in small ones another, etc. I just noticed that for small-sized devices MenuItem icon is not scaled just cut - which is ugly.</p><p>So the question is how should detect which is preferred size? </p>","472270","","","","","2011-01-13 15:01:14","How to know preferred icon size for MenuItem?","<android><icons><menuitem>","1","0","","",""
"4681360","1","4682819","","2011-01-13 14:51:40","2","903","<p>Inside my Configuration activity i need to create a preference screen with a fixed View at the top showing a preview of content configured in the page. I don't want to change the main preference screen (i have already a separate activity for that) i want a different layout for a  ""nested"" preferencescreen.</p><p>What i've tried is specifying an Intent inside the preference screen however when i click on this options nothing happens and activity goes into timeout... Activity is correctly configured on the manifest (and extends ConfigureActivity as the main one does).</p><pre><code>  &lt;PreferenceScreen     android:key=""inner""    android:title=""Title""     android:summary=""Summary""    &gt;    &lt;intent       android:action=""android.appwidget.action.APPWIDGET_CONFIGURE""       android:targetPackage=""my.package.lib""       android:targetClass=""my.package.lib.ConfigureClass""       /&gt;  &lt;/PreferenceScreen&gt;</code></pre><p>Another idea could be creating a custom ""preference"" that launches another configuration activity, could this work? Would be correct/acceptable to have multiple configuration activities?</p>","376579","","376579","","2011-01-13 16:24:10","2011-01-13 16:58:59","Starting custom PreferenceActivity INSIDE another PreferenceActivity","<android><android-intent><screen><preferences><preferenceactivity>","1","0","","",""
"4681388","1","","","2011-01-13 14:53:58","0","228","<p>I want to develop an Android application that uses a c file from Android source code. I know I can use NDK for using C/C++ files. But, I don't know whether I can use a c file from Android source or not. I want to use it because I want to use a function of it. Is it possible to use system functions with java application?</p>","511853","","","","","2011-01-13 15:40:11","How to Develop An Application That Uses a C File from Android Source Code","<java><android><c><android-ndk>","1","0","1","",""
"4681561","1","","","2011-01-13 15:10:28","1","2279","<p>i want to put a framelayout in the bottom by doing this :</p><pre><code> &lt;FrameLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_gravity=""bottom""    android:background=""@color/darkblue""    &gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Bottom""        android:textSize=""30px""        android:textColor=""@color/white""        android:layout_gravity=""center""       /&gt;  &lt;/FrameLayout&gt;</code></pre><p>But it doesn't work . It's staying in the middle of my application.</p><p>This is the whole thing : </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=""@color/white""    &gt;    &lt;FrameLayout        android:id=""@+id/first""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:background=""@color/darkblue""        &gt;        &lt;ImageView            android:id=""@+id/btn1""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_gravity=""left""            android:src=""@drawable/back4""            /&gt;        &lt;TextView              android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:text=""Title""            android:textSize=""30px""            android:textColor=""@color/white""            android:layout_gravity=""center""            /&gt;    &lt;/FrameLayout&gt;    &lt;FrameLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:background=""@color/white""        android:id=""@+id/second""        android:layout_below=""@id/first""        &gt;        &lt;ImageView            android:id=""@+id/banner""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:src=""@drawable/chuck""            /&gt;    &lt;/FrameLayout&gt;    &lt;FrameLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:background=""@color/white""        android:id=""@+id/third""        android:layout_below=""@id/second""        &gt;        &lt;RelativeLayout            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            &gt;            &lt;TextView                android:id=""@+id/sum""                android:text=""Summary ""                android:textSize=""25px""                android:textColor=""@color/black""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;ImageView                android:id=""@+id/s_btn""                android:src=""@drawable/next""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:layout_toRightOf=""@id/sum""                android:layout_alignTop=""@id/sum""                /&gt;            &lt;TextView                android:id=""@+id/blank""                android:text="" ""                android:textSize=""25px""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:layout_below=""@id/sum""                /&gt;            &lt;TextView                android:id=""@+id/airdate""                android:text=""Air Date : ""                android:textSize=""25px""                android:textColor=""@color/black""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:layout_below=""@id/blank""                /&gt;            &lt;TextView                android:id=""@+id/blank2""                android:text="" ""                android:textSize=""25px""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:layout_below=""@id/airdate""                /&gt;            &lt;TextView                android:id=""@+id/airtime""                android:text=""Air Time : ""                android:textSize=""25px""                android:textColor=""@color/black""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:layout_below=""@id/blank2""                /&gt;        &lt;/RelativeLayout&gt;    &lt;/FrameLayout&gt;    &lt;FrameLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:background=""@color/darkblue""        android:id=""@+id/fourth""        android:layout_below=""@id/third""        android:layout_alignParentBottom=""true""        &gt;        &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""Bottom""            android:textSize=""30px""            android:textColor=""@color/white""            android:layout_gravity=""center""            /&gt;    &lt;/FrameLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","439058","","321697","","2011-01-13 16:46:11","2012-11-09 19:02:28","how can i put the framelayout in the bottom of the application?","<android><frame>","2","0","1","",""
"4681594","1","4708309","","2011-01-13 15:14:27","0","355","<p>Assuming you built a page for each specific mobile browser (Android/iOS/BB/etc.), is it possible to have a web application capture an image and send it to the server for processing?</p><p>I'd like there to be ""Nothing to install"" for my application, but if I need to reach out to the hardware at all, I fear it's not possible.</p>","194586","","","","","2011-01-16 21:50:52","Is it possible for a mobile webpage to capture a picture?","<iphone><android><web-applications><mobile>","1","0","","",""
"4681697","1","4682241","","2011-01-13 15:23:28","93","17000","<p>Now I have to download and install the Android SDK abd AVD Manager, and then install the the APIs, tools through the UI. Is there a way to automate this process?</p>","428024","","255","","2013-04-02 18:17:00","2014-02-20 14:03:51","Is there a way to automate the android sdk installation?","<android>","4","0","53","",""
"4681743","1","4683894","","2011-01-13 15:27:11","5","4824","<p>I'm writing an Android game that runs in fullscreen landscape mode, and has buttons placed at the bottom left and bottom right of the window. The problem is that one of these buttons is (on many phones) right next to the Menu button, so the player might accidentally press Menu instead.</p><p>If it is pressed briefly, I simply pause the game and show the in-game menu. No problem there.</p><p>But if the button is held down longer, Android opens up the soft keyboard on the bottom half of the screen. Since it gets in the way, and is completely useless in this Activity, I would like to disable it.</p><p>I tried the following approaches.</p><h2>Via InputMethodManager</h2><p>From: <a href=""http://stackoverflow.com/questions/3922718/hide-soft-keyboard-on-activity-without-any-keyboard-operations"">Hide soft keyboard on activity without any keyboard operations</a></p><p>Since I have only one view (a <code>GLSurfaceView</code>) I tried this in my <code>Activity.onCreate()</code>:</p><pre><code>InputMethodManager imm = ((InputMethodManager)getSystemService(INPUT_METHOD_SERVICE));imm.hideSoftInputFromInputMethod(glSurfaceView.getApplicationWindowToken(), 0);</code></pre><p>It doesn't work: the soft keyboard still comes up on Menu long-press.</p><h2>Via the AndroidManifest.xml</h2><p>From: <a href=""http://stackoverflow.com/questions/2429595/how-to-stop-the-android-soft-keyboard-from-ever-coming-up-in-my-entire-applicatio"">How to stop the android soft keyboard from ever coming up in my entire application</a></p><p>I added this to my manifest:</p><pre><code>&lt;activity     android:windowSoftInputMode=""stateAlwaysHidden""&gt;</code></pre><p>Does a great deal of nothing as well.</p><p>So... is there even a way? How?</p>","14637","","","","","2011-11-16 06:46:16","How to prevent the soft keyboard from ever appearing in my Activity?","<android><soft-keyboard>","4","0","2","",""
"4681744","1","4681774","","2011-01-13 15:27:12","4","2046","<p>Does anyone know the SQL to get a list of table names via code in Android? I know <code>.tables</code> does it through command shell but this doesn't work through code. Is it anything to do with the meta-data, etc.?</p>","569654","","40342","","2011-09-02 06:15:01","2011-09-02 06:15:14","Android get list of tables","<android><database>","2","0","","",""
"4681820","1","","","2011-01-13 15:33:44","0","930","<p>Ok, new to Android development. I'm using eclipse and starting a new project in accordance with the Android tutorials. When I create the project it says: proguard.cfg no such file or directory and the gen folder is empty, and the project has no default.properties. </p><p>Some suggestions say that the proguard thing can be solved by modifying default.properties but as I say this is not there in the project to begin with.</p><p>Others say to regenerate R.java I should delete the gen folder and rebuild (or do a clean). This does nothing. I am going mad trying to get this to work. I'm trying to build against 2.1 (SDK 7)</p><p>Any help greatly appreciated. </p>","574469","","","","","2011-05-20 21:18:30","Android Eclipse Proguard fail - can't build project, no R.java generated","<android><eclipse><proguard>","2","2","","",""
"4681846","1","","","2011-01-13 15:36:12","0","323","<p>Is there any way to relate a received SMS to a sent SMS?  For example, an Android application that sends out a question that requires a yes/no answer.  The recipient would simply ""reply"" to the SMS with their answer and the original sending application would no that the answer was related to the particular question.  If it's only a single SMS message, it's easy because the sender is only waiting for a single response.  However, for example, if three questions were sent to the recipient, would it be possible to determine which message was being replied to?  </p><p>My gut instinct is that it is not possible and that each SMS is essentially sent or received in isolation and without a receiving application to parse some ""tag"" in the original message, this would not be possible.</p>","459783","","","","","2011-01-17 19:52:32","Can Sent SMS Messages have a Relationship to a Received SMS in Android?","<android><sms>","1","0","","",""
"4681902","1","4683047","","2011-01-13 15:41:44","2","8577","<p>I have a custom radiobutton with a 9-patch image as background. I use a Selector to determine the background.I also have some text i want to put over the background of the image, but the text is aligning next to the button.</p><p>This is the RadioGroup</p><pre><code>&lt;LinearLayout    android:id=""@+id/segmented""    android:layout_width=""fill_parent""     android:layout_height=""50sp""    android:gravity=""center""    android:layout_below=""@+id/header""&gt;    &lt;RadioGroup android:layout_width=""fill_parent""        android:layout_height=""wrap_content""         android:orientation=""horizontal""        android:id=""@+id/group1""        android:gravity=""center""&gt;        &lt;RadioButton             android:checked=""false""            android:layout_width=""90sp""            android:id=""@+id/rbVerzekeringen""            android:text=""Verzekeringen""            android:textSize=""10sp""            android:button=""@drawable/checkbox_theme"" /&gt;        &lt;RadioButton             android:checked=""false""            android:layout_width=""90sp""            android:id=""@+id/rbPersoonlijk""            android:text=""Persoonlijk""            android:textSize=""10sp""            android:button=""@drawable/checkbox_theme"" /&gt;        &lt;RadioButton             android:checked=""false""            android:layout_width=""90sp""            android:id=""@+id/rbNotities""            android:text=""Notities""            android:textSize=""10sp""            android:button=""@drawable/checkbox_theme"" /&gt;    &lt;/RadioGroup&gt;&lt;/LinearLayout&gt;</code></pre><p>This is the Selector:</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_checked=""true"" android:state_window_focused=""false""        android:drawable=""@drawable/bt_filter_active"" /&gt;    &lt;item android:state_checked=""false"" android:state_window_focused=""false""        android:drawable=""@drawable/bt_filter"" /&gt;    &lt;item android:state_checked=""true"" android:state_pressed=""true""        android:drawable=""@drawable/bt_filter_active"" /&gt;    &lt;item android:state_checked=""false"" android:state_pressed=""true""        android:drawable=""@drawable/bt_filter"" /&gt;    &lt;item android:state_checked=""true"" android:state_focused=""true""        android:drawable=""@drawable/bt_filter_active"" /&gt;    &lt;item android:state_checked=""false"" android:state_focused=""true""        android:drawable=""@drawable/bt_filter"" /&gt;    &lt;item android:state_checked=""false"" android:drawable=""@drawable/bt_filter"" /&gt;    &lt;item android:state_checked=""true"" android:drawable=""@drawable/bt_filter_active"" /&gt;&lt;/selector&gt;</code></pre><p>And this is what it lookes like:</p><p><img src=""http://i.stack.imgur.com/oxG7N.png"" alt=""alt text""></p><p>As you can figure out I want 3 large buttons with the text over it.</p><p>How can I do this?</p><p><strong>EDIT:</strong></p><p>I set the selector at background in stead of button and set the button to null.</p><p>The code looks like this now:</p><pre><code>&lt;LinearLayout    android:id=""@+id/segmented""    android:layout_width=""fill_parent""     android:layout_height=""50sp""    android:gravity=""center""    android:layout_below=""@+id/header""&gt;    &lt;RadioGroup android:layout_width=""fill_parent""        android:layout_height=""wrap_content""         android:orientation=""horizontal""        android:id=""@+id/group1""        android:gravity=""center""&gt;        &lt;RadioButton             android:checked=""false""            android:layout_width=""100sp""            android:layout_height=""40sp""            android:id=""@+id/rbVerzekeringen""            android:text=""Verzekeringen""            android:textSize=""13sp""            android:orientation=""vertical""            android:background=""@drawable/checkbox_theme""            android:button=""@null""            android:gravity=""center""/&gt;        &lt;RadioButton             android:checked=""false""            android:layout_width=""100sp""            android:layout_height=""35sp""            android:id=""@+id/rbPersoonlijk""            android:text=""Persoonlijk""            android:textSize=""35sp""            android:background=""@drawable/checkbox_theme""            android:button=""@null""             android:gravity=""center""/&gt;        &lt;RadioButton             android:checked=""false""            android:layout_width=""100sp""            android:layout_height=""30sp""            android:id=""@+id/rbNotities""            android:text=""Notities""            android:textSize=""13sp""            android:background=""@drawable/checkbox_theme""            android:button=""@null""             android:gravity=""center""/&gt;    &lt;/RadioGroup&gt;&lt;/LinearLayout&gt;</code></pre><p>But now when I make the buttons larger or smaller the text in it just disappears like this (height of the first image is 40sp, the second is 35sp and the last one is 30sp): <img src=""http://i.stack.imgur.com/NI2C7.png"" alt=""height of the first image is 40sp, the second is 35sp and the last one is 30sp""></p><p>How can I make the background image smaller without cutting the text in it?</p>","517460","","517460","","2011-01-17 08:58:20","2011-01-17 23:48:15","Custom RadioButton image not filling space","<android><radio-button><selectors>","1","1","","",""
"4681951","1","","","2011-01-13 15:45:53","-1","886","<p>I've tried everything but i can't figure it out what Javabeans i need for this:</p><pre><code>""poitypes"":{  ""2"":{     ""name"":""Info"",     ""icon"":""info.png""  },  ""1"":{     ""name"":""Toilets"",     ""icon"":""toilets.png""  }}</code></pre><p>Does anyone have a clue?</p>","574496","","","","","2011-01-13 16:20:56","How To parse this using GSON?","<java><android><gson>","2","0","","",""
"4682000","1","","","2011-01-13 15:49:13","1","352","<p>My app sets wallpaper correctly on HTC Incredible, but crashes on Galaxy S. This occurs only when installed through an APK file. When the app is installed through the Eclipse environment it works correctly on both the HTC Incredible and Samsung SCH-1500. When I export the app as an APK file it seems to install correctly, and all of the other functions work correctly. It is only the setting of the wallpaper that crashes. When I run using the debugger all is well - no problem. Could this be a permission issue? Why no issue on the HTC but crash on the Samsung?  </p><p>Thanks for your help!Kurt Reindel</p>","574462","","21234","","2011-01-13 16:12:49","2011-01-13 16:12:49","Application crashes upon setting wallpaper on Galaxy S when installed from APK - works from Eclipse","<android><crash><install><apk><wallpaper>","0","3","","",""
"4682079","1","","","2011-01-13 15:55:38","4","860","<p>I use SurfaceView for play video. I use Samsung Galaxy Tab to test. I set size:</p><pre><code>LinearLayout.LayoutParams videoViewParams = new   LinearLayout.LayoutParams(m_mainView.getPictureWidth(), m_mainView.getPictureHeight());       mPreview = (SurfaceView) videoView.findViewById(R.id.surface); mPreview.setLayoutParams(videoViewParams);</code></pre><p>When mainView.getPictureWidth() or mainView.getPictureHeight() is higer then 1024 - i get message in logcat:</p><blockquote>  <p>01-12 11:49:15.839: ERROR/SurfaceFlinger(2491): LayerBuffer init temp buff failed with w=1210, h=922, exp max=1024x1024 on 0</p></blockquote><p>and i see only black screen.</p><p>Why?In my application I use video scaling, and sometimes I need to get a video of a size greater than 1024.</p>","574475","","","","","2011-11-10 06:49:44","Why max size of SurfaceView(Android) for play video is 1024x1024?","<android>","2","1","2","",""
"4682125","1","4682243","","2011-01-13 15:59:28","4","1405","<p>I have a 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;LinearLayout android:orientation=""horizontal""                  android:layout_width=""fill_parent""                  android:layout_height=""wrap_content""                  android:padding=""5dp""                  android:id=""@+id/acquiring_signal_layout""&gt;        &lt;ProgressBar android:id=""@+id/ProgressBar01""                     android:layout_width=""wrap_content""                     android:layout_height=""wrap_content""/&gt;        &lt;TextView android:id=""@+id/acquiring_signal_label""                  android:text=""@string/acquiring_signal""                  android:layout_width=""fill_parent""                  android:textAppearance=""?android:attr/textAppearanceLarge""                  android:layout_height=""wrap_content""                  android:layout_gravity=""center_vertical""                  android:paddingLeft=""5dp""/&gt;    &lt;/LinearLayout&gt;    &lt;com.google.android.maps.MapView        xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/mapview""        android:clickable=""true""        android:layout_height=""wrap_content""        android:layout_width=""fill_parent""        android:apiKey=""...""        android:layout_weight=""1""/&gt;    &lt;Button        android:text=""@string/send_button""        android:id=""@+id/SendButton""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;    &lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>It works fine, except when it renders, the button at the bottom appears to have several (roughly 5, I'd guess) pixels of black margin/space around it. Setting the margin of the button doesn't seem to have any affect. What's going on?</p>","170431","","","","","2011-01-13 16:40:51","Where does the extra space around my button come from?","<android><layout>","2","0","","",""
"4682251","1","","","2011-01-13 16:11:27","0","649","<p>I need to send a text to this device: <a href=""http://www.techdigest.tv/assets_c/2009/02/bluetooth-bracelet-thumb-480x318-78581.png"" rel=""nofollow"">http://www.techdigest.tv/assets_c/2009/02/bluetooth-bracelet-thumb-480x318-78581.png</a>from an android phone. I have it paired with the phone. In my code, I just showed its mac address and confirmed that it's paired then I stopped. I don't know what to do next! but I gotta do it.Please help.......</p>","574520","","","","","2013-07-03 03:41:46","How can I send a text to a bluetooth bracelet?","<android><bluetooth>","1","1","1","",""
"4682376","1","","","2011-01-13 16:23:57","0","745","<p>Android extracts the ID3 tags and displays in the native Music player app.I wish to know if it is possible to access the ID3 tags that have already been extracted by Android.</p><p>I am writing a media-player application and wish to use MediaScanner to scan the media and use the ID3/artists/etc extracted by Android</p>","574546","","","","","2011-07-04 15:19:09","ID3 Android MediaScanner","<android><music><media-player><music-player>","1","0","","",""
"4682457","1","4682975","","2011-01-13 16:30:48","0","368","<p>At the moment I have the code from this site (<a href=""http://eurodev.blogspot.com/2009/09/raw-audio-manipulation-in-android.html"" rel=""nofollow"">link text</a>) working great. In the example on the site it starts the recording for 10 seconds and then immediately plays the audio back in reverse. I have modified the code to start recording when a button is pressed, but can only get it to record for the 10 seconds and then save that file. I want to be able to start the recording by pressing a button and then stop the recording on a different button press. I have an idea that it could be an interrupt to the wait() method of the thread object but have no idea how to implement this. My code is as follows:</p><pre><code>public void onClickRecord(View v){        text.setText(""Recording"");        Thread thread = new Thread(new Runnable() {            public void run() {                record();            }        });        thread.start();        synchronized(this) {        try {            wait(10000); //This is the 10 second waiting period while recording        }         catch (InterruptedException e) {        }        }        isRecording = false;        try {            thread.join();        } catch (InterruptedException e) {        }    }    public void onClickStop(View v){        //Here is what needs to be implemented to stop the recording.    }</code></pre><p>There is quite a bit of code so I have only posted the bits I think are relevant. If any more is needed just ask.</p><p>Thanks.</p>","400406","","1534123","","2012-10-26 15:51:53","2012-10-26 15:51:53","Stop button when recording audio with AudioRecord","<java><android><audiorecord><android-audiorecord>","1","0","","",""
"4682473","1","4682551","","2011-01-13 16:32:07","1","1229","<p>I have been doing some work with Java's SecureRandom class to generate salts for later encryption and password hashing (I am generating separate salts for each task).  The code I have been using is as follows:</p><pre><code>//Init random number generatorsecureRandom = SecureRandom.getInstance(""SHA1PRNG"");secureRandom.setSeed(System.nanoTime());//Create saltssecureRandom.nextBytes(bytAuthSalt);secureRandom.nextBytes(bytEncryptionSalt);</code></pre><p>Now, all was going fine until I started to actually verify the values that I got.  For several sequential executions of the application my salts were:</p><pre><code>[B@43d55dd8[B@43d55b58[B@43d55b50[B@43bd0cc8[B@43db0b08[B@43bd0f50</code></pre><p>I am disturbed by the fact that the numbers all appear to be roughly sequential.  After some searching on the web, I repeated the runs again without seeding it myself to the same results.</p><p>My only guess as to what may be causing this comes from the fact that I am developing for the Android platform.  I know that they have their own cryptographic providers but I do not get any exceptions.  any ideas?</p><p>Thanks in advance.</p>","481075","","","","","2011-01-13 18:10:00","Java and Cryptographically Strong Random Numbers","<java><android><encryption><salt>","3","0","","",""
"4682486","1","","","2011-01-13 16:32:40","0","1166","<p>I have a video view to stream a video, it works fine but the size of the video is too small, I tried streaming in the API demos and the size of the same video is normal. What have I done wrong? Here is some code:</p><p><strong>main.xml:</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01""        android:layout_height=""fill_parent""         xmlns:android=""http://schemas.android.com/apk/res/android""        android:paddingLeft=""2px""         android:paddingRight=""2px""        android:paddingTop=""2px""         android:paddingBottom=""2px""        android:layout_width=""fill_parent""         android:orientation=""vertical""&gt;        &lt;VideoView             android:id=""@+id/VideoView""            android:layout_height=""fill_parent""            android:layout_width=""fill_parent""             /&gt;    &lt;/LinearLayout&gt;</code></pre><p><strong>Main.java</strong></p><pre><code> public void onCreate(Bundle savedInstanceState) {                super.onCreate(savedInstanceState);                setContentView(R.layout.video);                VideoView videoView = (VideoView) findViewById(R.id.VideoView);                MediaController mediaController = new MediaController(this);                mediaController.setAnchorView(videoView);                Uri video = Uri.parse(""http://www.free-3gp-video.com/download.php?do-beer-not-drugs.3gp"");                videoView.setMediaController(mediaController);                videoView.setVideoURI(video);                videoView.start();}</code></pre>","526924","","527702","","2012-12-12 05:05:33","2012-12-12 05:05:33","Video view too small (Android)","<android>","1","0","","",""
"4682585","1","4683574","","2011-01-13 16:40:33","2","7476","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4583484/how-to-implement-android-pull-to-refresh"">How to implement Android Pull-to-Refresh</a>  </p></blockquote><p>I have implemented pull to refresh in my app which works fine in 2.2, but in 2.0 it doesn't.</p><p>I couldn't find the method 'smoothScrollBy()' in 2.0.</p><p>Can anyone please give me the solution for this issue or any other alternative? How can I acheive pull to refresh functionality like in iphone?</p><p>Thanks..</p>","435025","","50776","","2012-01-07 03:56:11","2012-04-01 21:56:47","pull to refresh in android","<android><android-2.2-froyo><android-2.0-eclair>","3","0","3","2012-04-01 21:58:15",""
"4682835","1","","","2011-01-13 17:00:09","0","1580","<p>I'm developing an Android 2.2 application.</p><p>I'm very new on Android, and I see that if Iaunch a new Intent from an activity, this activity goes to paused state.</p><p>If I want that user can't goes back to this previous activity, what must I do? May I kill this previous activity with finish?</p><p><strong>UPDATE</strong><br/>An example:</p><p>A, B C and D are activities. A is the first activity.</p><p>A launches B, and B launches C, and C launches D.</p><p>I want to close or kill activity B and C when D is launched.</p><p>Thanks.</p>","68571","","68571","","2011-01-13 18:58:12","2013-07-25 11:59:28","Moving between activities: killing two previous activities","<android><activity><navigation>","3","3","","",""
"4682859","1","4689397","","2011-01-13 17:03:23","8","7010","<p>I have a TextView with android:autoLink=""email"".</p><p>If I put my email address in there then a link appears that I can click.</p><p>How do I have different text appear (for example 'Send Feedback') instead of the email address but still behave the same when clicked?</p><p>Thanks</p>","67419","","","","","2014-04-19 14:21:44","TextView to send email when clicked","<android>","4","0","3","",""
"4682868","1","","","2011-01-13 17:04:12","1","1123","<p>Helloi need to get the list of the languages defined on an Android device and would like to populate a Spinner with language code and language name. How can i do that?</p><p>Thanks in advance and greetingsc.</p>","339500","","339500","","2011-01-14 13:07:46","2011-01-14 13:11:01","How to get languages list in Android","<android><localization><internationalization>","1","2","","",""
"4682953","1","4683298","","2011-01-13 17:10:47","3","773","<p>I hope to make an android version of my iphone app.Cocoa touch has UINavigationaController wich can control the navigation of views(controller)It is special for the mobile device which has the small size screen.Is there an ui class on android like UINavigationController?</p><p>Welcome any comment</p><p>Thanks</p><p>interdev</p>","262325","","","","","2013-11-08 17:11:54","Is there an ui class on android like UINavigationController on cocoa touch?","<android>","3","0","","",""
"4683063","1","4683268","","2011-01-13 17:20:52","2","3549","<p>I would like to take an existing <code>ScrollView</code> with a view in it, and add more views, dynamically (at runtime) to the <code>ScrollView</code> container. </p><p>Is it possible to add these views without having to create a new layout and inflate it? If so, what's the general process for adding these views dynamically? </p><p>For the sake of this question, assume the views are <code>TextView</code>... </p><p>Thanks!</p>","268803","","","","","2011-01-13 17:43:20","Can I add views to a scrollview without inflating/re-inflating layouts?","<android><layout><view>","1","0","","",""
"4683064","1","","","2011-01-13 17:21:02","1","1826","<p>Is it possible, in Android or any other mobile OS, to access the encrypted information passed from the SIM card to the cellular network? I mean the mobile signature, or the TMSI number. I need this data after it is encripted by the sim. I mean the IMSI after it is encrypted by the SIM to be sent to the network.Thanks :)</p>","574606","","","","","2013-04-19 05:54:07","Getting the TMSI from the SIM card","<android><sim-card>","3","0","1","",""
"4683084","1","4683254","","2011-01-13 17:23:30","1","1014","<p>I'm creating an android app that will share content through twitter and i'm facing some trouble with twitter oauth . I'm using twitter4j . I've seen some tutorials but all of than open the browser for autorization. Is there some way to autorize  without open the browser?some sort of : dialog pops up and the user type his id and password , and the api autorize it without open the browser , webView , etc...</p>","569873","","","","","2011-01-13 17:41:46","twitter oauth authorization on android , without open browser .. how to?","<android><twitter><twitter-oauth><twitter4j>","1","1","","",""
"4683270","1","","","2011-01-13 17:43:24","0","221","<p>so I'm extremely new to Android development.  The only thing that I've actually coded is Hello World.  Then I used Google App Inventor but realized that that was not what I needed.  I've also read through the developer's guide.  Anyway, I'm working on a project where we use various sensors (accelerometers by means of a wiimote and strain gauges converted to a digital signal through an Arduino microcontroller) and process the data on an Android tablet which will display the data for the user.  Then the processed data will be uploaded to a website.  Before I do anything else I need to plan out how to build this using Application Components and I wanted to make sure my general ideas are correct before I start trying to code and run into complications.  So below is a list of how I think this application should user each of the application components.</p><p><strong>Activities</strong>The user display</p><p><strong>Services</strong>Timer</p><p><strong>Broadcast Receivers</strong>Listen for new accelerometer dataListen for new strain gauge data </p><p><strong>Content Providers</strong>Send the data to a website.</p><p>Sorry for asking such a basic question, but I find it's best to understand a tool well before I use it and I've been told that this place is noob-friendly.  Thanks for your time.</p>","574603","","","","","2011-01-13 17:57:23","Android - New to Android, is this use of Application Components is correct?","<android><activity><service><broadcastreceiver><android-contentprovider>","1","0","","",""
"4683348","1","","","2011-01-13 17:52:34","0","1391","<p>I am considering developing an Iphone/Android application but I want the information on it to be live and uniform between platforms... Therefore it seemed logical to me to make it web based. I would however like to be able to achieve certain non web based functions such as adding events to the calendar and gps locations on the the mapping sortware.</p><p>My questions are:</p><ol><li><p>Can I make a web basedapplication that does not visuallyshow in a browser? </p></li><li><p>Can I add additional functions  thatare not natively available in abrowser e.g &lt;a href=""#""title=""adddate:110911""/>Add toCalendar&lt;/a></p></li><li><p>Would it be a lot of work to makesuch an app as the majority is webbased (I mostly progam in PHP socoding for Android and Iphone willtake me some time to get my headaround).</p></li></ol><p>All of the questions are for both Iphone and Android.</p><p>Thanks</p>","440137","","436641","","2011-09-19 18:06:33","2011-09-20 08:56:56","Web based Iphone / Android app","<iphone><android><web-applications>","2","0","","",""
"4683416","1","4684321","","2011-01-13 17:58:29","0","723","<p>Hey I want to create a layout like this for my application. Of course the functionalities will be differents. I'm studying the source code for this, and I found the xml files that does that. I just dont know how to implement that in the activity, how to call, what to create, a listview, etc.</p><p><img src=""http://i.stack.imgur.com/whY67.jpg"" alt=""alt text""></p><p>I mean, I just want to list the name with a bigger font and the date like in the image, with a small font but aligned to the right.</p><p>Because, I want to get the data from the database I've created and print it like this list of CallLog.</p><p>I mean, how Android makes the date with that icon align in the right, with a small font size?</p><p>So this is my activity, I just dont know what xml file from the source code to use, or what method to implement so I can print the data like the image example.</p><pre><code>   public class RatedCalls extends ListActivity {private static final String LOG_TAG = ""RatedCalls"";private TableLayout table;private CallDataHelper cdh;private TableRow row;private TableRow row2;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.recent_calls);    Log.i(LOG_TAG, ""calling from onCreate()"");    cdh = new CallDataHelper(this);    startService(new Intent(this, RatedCallsService.class));    Log.i(LOG_TAG, ""Service called."");    Log.i(LOG_TAG, ""before call fillList"");    /*     * mAdapter = new RecentCallsAdapter();     * getListView().setOnCreateContextMenuListener(this);     * setListAdapter(mAdapter);     */    fillList();    Log.i(LOG_TAG, ""after call fillList"");}public void onResume() {    super.onResume();    fillList();}public void fillList() {    Log.i(LOG_TAG, ""entered on fillList"");    List&lt;String&gt; ratedCalls = new ArrayList&lt;String&gt;();    ratedCalls = this.cdh.selectTopCalls();     //setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.recent_calls_list_item,     //ratedCalls));    ListView lv = getListView();    lv.setTextFilterEnabled(true);    getListView().setOnCreateContextMenuListener(this);    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_LONG).show();        }    });} }</code></pre><p>Thanks.</p>","399459","","399459","","2011-01-13 18:05:58","2011-01-13 19:27:42","How to create a layout like Android CallLog's layout","<android><android-layout><android-source>","2","4","","",""
"4683503","1","4683538","","2011-01-13 18:06:52","48","30369","<p>I am new to phonegap and android development. May I know how can I debug javascript error on the emulator? I have heard about ADB may I know how can I use and install it on windows 7 system? I have an ajax called with jsonp but no response on emulator. However, I can call that ajax with browser on windows. May I know what went wrong?</p>","324850","","","","","2014-02-17 03:58:45","debug javascript in android emulator with phonegap","<javascript><android><android-emulator><phonegap>","13","0","13","",""
"4683619","1","4683655","","2011-01-13 18:15:31","1","714","<p>One of my Activities starts an <code>AsyncTask</code> and adds an ongoing notification to the notification area. This notification receives updates from within the <code>AsyncTask</code>.</p><p>I did this so the users are able to leave the Activity with the Home button and still receive progress updates during a long running operation.</p><p>Clicking the notification should return the user to this activity. The problem is that no matter what, it seems that the old activity is never used again, but instanciated new (while the <code>AsyncTask</code> still runs). The <code>onCreate</code> method of this activity gets called every time the notification gets clicked.</p><p>I tried using the <code>FLAG_NO_CREATE</code> and <code>FLAG_UPDATE_CURRENT</code> options, but it doesn't make any difference.</p><p>What is the correct way to handle this situation? I'm developing for API level 4.</p>","227532","","227532","","2011-01-13 18:59:23","2011-01-13 18:59:23","Why does a PendingIntent trigger onCreate even though FLAG_NO_CREATE is set","<android><notifications><android-pendingintent>","1","0","","",""
"4683662","1","4683831","","2011-01-13 18:20:19","0","935","<p>I have the following code. I set up and alarm in HelloAndroid2.java, and after 2 seconds, AlarmReceiver.java shows me a Toast message. I wanted to add some audio to the app but I’m having some problems.</p><p>HelloAndroid2.java:</p><pre><code>public class HelloAndroid2 extends Activity {  @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);    Intent intent = new Intent(this, AlarmReceiver.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_ONE_SHOT); AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE); alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + (2 * 1000), pendingIntent); Toast.makeText(this, ""Alarm set"", Toast.LENGTH_LONG).show();}}</code></pre><p>AlarmReceiver.java:</p><pre><code>public final class AlarmReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) {     Toast.makeText(context, ""Alarm worked."", Toast.LENGTH_LONG).show();}}</code></pre><p>Q1: If I put this code into HelloAndroid2.java:</p><pre><code> MediaPlayer mp = MediaPlayer.create(getBaseContext(), R.raw.onlyyou); `mp.start();`</code></pre><p>It works fine.</p><p>How can I add an mp.stop() to the AlarmReceiver.java? It doesn’t know what mp is.</p><p>Q2: If i put the code in the AlarmReceiver.java file, there is a problem with getBaseContext() (says: undefined for the type AlarmReceiver)</p><p>Should I use some other context?</p><p>I hope it's okay that i raised to questions in one topic.</p>","571648","","14606","","2011-01-13 18:31:50","2011-01-13 18:37:50","Android MediaPlayer question","<android><media-player><broadcastreceiver>","1","0","","",""
"4683694","1","4684563","","2011-01-13 18:22:49","5","10723","<p>I'm getting a byte array from a JNI call, and trying to construct a Bitmap object with it.</p><p>My problem is, the following code, returns null.</p><pre><code>    byte[] image = services.getImageBuffer(1024, 600);    Bitmap bmp = BitmapFactory.decodeByteArray(image, 0, image.length);</code></pre><p>Any tips about it?</p><p>PS: The pixel layout is BGR, not a RGB.</p>","558433","","","","","2011-08-30 03:48:01","Render a byte[] as Bitmap in Android","<java><android>","2","2","3","",""
"4683698","1","4683733","","2011-01-13 18:23:11","0","713","<p>I have created an android application using eclipse, but when i run it, i get the following message [2011-01-13 18:15:55 - BookSwap] No Launcher activity found![2011-01-13 18:15:55 - BookSwap] The launch will only sync the application package on the device!however my manifest file has defined a launcher:      </p><pre><code>&lt;application android:icon= ""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".bookswap""              android:label=""@string/app_name""&gt;    &lt;activity android:name="".BuyActivity""              android:label=""@string/app_name""&gt;    &lt;activity android:name="".SellActivity""              android:label=""@string/app_name""&gt;    &lt;activity android:name="".FreecycleActivity""              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&gt;            &lt;/activity&gt;                &lt;/activity&gt;&lt;/application&gt;</code></pre><p>can anyone help me please?</p>","574693","","","","","2011-01-13 18:26:28","why does my application not appear on my emulator?","<android><activity><emulator><launcher>","1","0","","",""
"4683727","1","4683753","","2011-01-13 18:25:21","0","1239","<p>I am attempting to create a tab based activity with seven tabs.  Tabhost won't allow me to scroll multiple tabs so i created a HorizontalScrollView containing seven buttons at the top of the page.</p><p>I am now stuck trying to figure out the best method to allow for incorporating the different listview activities i need to display depending on which button is pressed.</p><p>I'm just looking for a push in the right direction.  I have researched utilizing activityGroups but I can't seem to figure out how to get that to display under the hroizontal listview.</p><p>Thank you.</p>","574699","","","","","2011-01-13 18:29:26","Utilizing Horizontal Scroll View with a listview below","<android>","2","0","","",""
"4683732","1","4804670","","2011-01-13 18:26:25","0","402","<p>I want to add an image to <code>TabHost</code>.<br>This is my code:</p><pre><code>tabHost.addTab(tabHost.newTabSpec(""tab1"").setContent(new Intent(this, DealCities.class)).setIndicator(""Deals""));</code></pre>","555221","","905906","","2012-05-10 16:39:53","2012-05-10 16:39:53","Android Tab Host","<android>","1","2","","",""
"4683741","1","4683829","","2011-01-13 18:27:12","1","841","<p>I want to present my data in a better way (instead of a simple list). Is it in Android possible to present a list with data (for example tweet-messages) in a special way like this:</p><p><img src=""http://i.stack.imgur.com/N3UCB.jpg"" alt=""enter image description here""></p><p>Any other kind of visualization is also welcome!</p>","574687","","709202","","2011-08-08 22:28:30","2011-08-08 22:28:30","Android and data visualization : How to present data in a better way?","<android><list><data><twitter><visualization>","2","0","","",""
"4683766","1","5234298","","2011-01-13 18:29:52","0","855","<p>This might be a simple question, but I've had a hard time pinning down a direct answer. </p><p>I have created a content provider in its own separate package in a project using the Eclipse Android ADT. This package is included in the src of the overall project. When modifying AndroidManifest.xml I included this as a child of <code>&lt;application</code>>:</p><pre><code> &lt;provider android:name=""JobProvider""      android:authorities=""dsndata.sds2Mobile.provider.JobProvider"" /&gt;</code></pre><p>The code that will be using the provider is in a separate package also in src</p><p>Where would be the best place to store the provider? In the same package as the source using it? Also, What are the correct values for android:name and android:authorities? I'm sure they vary depending on where the provider is stored.</p>","543677","","","","","2013-08-01 19:34:59","Where is a content provider stored in an Android project?","<android><content><provider><android-contentprovider>","2","1","","",""
"4683777","1","4683791","","2011-01-13 18:31:23","3","1563","<p>Is there such a thing as a ""translator"" (for lack of a better word in my mind now) that translates Python code directly to JVM / Dalvik bytecode?</p><p>Would be great for writing Android applications in Python!</p><p><strong>NOTE</strong>: I know about the scripting capabilities of the Android platform but I am looking for something that would generate a '.apk' without having to install the 'scripting' package... annoying for end-users.</p>","171461","","","","","2011-01-13 18:49:05","Python code translation to JVM","<java><python><android><jvm><dalvik>","4","0","","",""
"4683812","1","","","2011-01-13 18:35:43","1","5339","<p>Are there any Telnet client source Samples or Tutorials that help Beginners (ME) understand how to open Sockets and develop apps using sockets.</p><p>I went through all the samples using Eclipse and various Tutorials online but none of them that I have found seem to work correctly - either old or dead code or just missing information.</p><p>I assume I will need to include a java.net jar file but where is it and how do I include it?</p><p>using Eclipse I went through the few tutorials but none of them did much more than Hello World and show me how to drag and drop buttons and edit text.</p><p>Thanks in advance for any help</p>","574694","","","","","2013-03-29 11:40:22","Android Telnet tutorial","<android><sockets><tcp><ssh><telnet>","4","0","","",""
"4683854","1","","","2011-01-13 18:39:54","3","6640","<p>I want to create a Server and a Client in 2 Emulator to write and read data.I write code for Server :</p><pre><code>public class ServerActivity extends Activity {    /** Called when the activity is first created. */ private ServerSocket serverSocket = null; private TextView tv; public static final int SERVERPORT = 4444;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        tv= (TextView) findViewById(R.id.myTextView);        try {   Connect();  } catch (IOException e) {   // TODO Auto-generated catch block   tv.setText(""Not connected"");   e.printStackTrace();  }    }    public void Connect() throws IOException    {     serverSocket = new ServerSocket();     serverSocket.bind(new InetSocketAddress(""10.0.2.15"", 4444));     while(true)     {      Socket socket = serverSocket.accept();      tv.setText(""Connected..."");     }    }</code></pre><p>And code for Client</p><pre><code>public class ClientActivity extends Activity {    /** Called when the activity is first created. */ private Button bt; private TextView tv;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        bt = (Button) findViewById(R.id.myButton);        tv = (TextView) findViewById(R.id.myTextView);        bt.setOnClickListener(new OnClickListener() {   public void onClick(View v) {    // TODO Auto-generated method stub    try {     Socket socket  = new Socket(""10.0.2.2"", 4445);    } catch (UnknownHostException e) {     // TODO Auto-generated catch block     tv.setText(""Error1"");     e.printStackTrace();    } catch (IOException e) {     // TODO Auto-generated catch block     tv.setText(""Error2"");     e.printStackTrace();    }   }  });    }}</code></pre><p>I set up a redirection :</p><pre><code>telnet localhost 5554redir add tcp:4445:4444</code></pre><p>But it's not connecting....Please help me. I appreciate it.</p>","574714","","","","","2012-02-21 18:53:20","Connecting 2 Emulator instances In Android","<android>","2","2","8","",""
"4683863","1","4683914","","2011-01-13 18:40:44","0","2275","<p>Hey, I want to know how do I do to create a ListView in Android like this, not exactly, but with multiple text, and the text with different font size? Because the one I've created just worked for one text line for each line. Thanks.</p><p><img src=""http://i.stack.imgur.com/WYRDW.png"" alt=""alt text""></p>","399459","","","","","2011-01-13 18:45:29","How to create a ListView with multiple text","<android><android-layout><android-listview>","2","0","","",""
"4683917","1","4865207","","2011-01-13 18:45:39","1","1173","<p>Soo, I think this might be early, but I have a need for usb debugging drivers for this Creative Ziio 7"" tablet I have in front of me. </p>","266486","","","","","2011-02-01 16:32:02","Creative Ziio and android development, adb","<android><windows><driver><adb><tablet>","1","0","","",""
"4683965","1","","","2011-01-13 18:50:06","1","2499","<p>I've got 2 radio buttons and i want to put them next to each other. Right now theyre like</p><pre><code>Radio button 1Radio button 2</code></pre><p>i want to make it</p><pre><code>Radio button 1    Radio button 2</code></pre><p>This is my code for the radio buttons, any help?</p><pre><code>    &lt;RadioGroup  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:orientation=""vertical""&gt;  &lt;RadioButton android:id=""@+id/radio_male""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:text=""Male""       android:layout_below=""@id/gender""/&gt;  &lt;RadioButton android:id=""@+id/radio_female""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:text=""Female"" /&gt;&lt;/RadioGroup&gt;</code></pre>","574728","","234039","","2011-01-13 19:05:36","2011-01-13 19:05:36","Need to change layout of radio buttons","<android><xml><android-widget><radio-button>","2","1","","",""
"4683966","1","","","2011-01-13 18:50:07","4","5913","<p>I tried to get the address of a particular location by giving static geocordinates. I was not able to fetch the address. Can someone please help. I just need to check whether this function works for me.</p><p>Here is my snippet.</p><pre><code>Geocoder geocoder = new Geocoder(AddressSimulator.this, Locale.getDefault());        List&lt;Address&gt; addresses = geocoder.getFromLocation(1.352566007, 103.78921587, 1);        System.out.println(""Addresses size""+addresses.size());</code></pre><p>Address size is obtained as zero. I tried with few other geocordinates also, but address size is always returned as 0. Experts, kindly help me resolve this.</p><p>Looking forward for your valuable help/suggestions,</p><p>Best Regards,Rony</p>","264953","","","","","2012-03-13 03:34:16","Get address using Geocoder in android","<android><android-emulator><android-widget>","3","2","2","",""
"4684024","1","","","2011-01-13 18:55:35","0","249","<p>I have followed this tutorial: </p><p><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>to write the code, changing some names to suit my own application, however when I run it on the emulator it appears as one page saying ""this is the freecycle tab"" but nothing else.  Can anyone help me figure out where I have gone wrong?</p><p><strong>Code:</strong></p><pre><code>bookswap.java file:package com.example.bookswap;import android.app.TabActivity;import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.widget.TabHost;public class bookswap 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        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, BuyActivity.class);        // Initialize a TabSpec for each tab and add it to the TabHost        spec = tabHost.newTabSpec(""artists"").setIndicator(""Artists"",                 res.getDrawable(R.drawable.ic_tab_buy_grey))             .setContent(intent);        tabHost.addTab(spec);        // Do the same for the other tabs        intent = new Intent().setClass(this, SellActivity.class);        spec = tabHost.newTabSpec(""albums"").setIndicator(""Albums"",                 res.getDrawable(R.drawable.ic_tab_buy_grey))             .setContent(intent);        tabHost.addTab(spec);        intent = new Intent().setClass(this, FreecycleActivity.class);        spec = tabHost.newTabSpec(""songs"").setIndicator(""Songs"",                 res.getDrawable(R.drawable.ic_tab_buy_grey))             .setContent(intent);        tabHost.addTab(spec);        tabHost.setCurrentTab(2);    }}</code></pre><p>I have three classes named BuyActivity, SellActivity and FreecycleActivity, they have identical code, just the names in the code have been changed:</p><pre><code>package com.example.bookswap;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class BuyActivity extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        TextView textview = new TextView(this);        textview.setText(""This is the Buy tab"");        setContentView(textview);    }}</code></pre><p>I have saved pictures to use as icons in my res/drawable folder.  This is the code for my XML file in the <em>Drawable</em> folder:</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 grey --&gt;    &lt;item android:drawable=""@drawable/ic_tab_buy_grey""          android:state_selected=""true"" /&gt;    &lt;!-- When not selected, use white--&gt;    &lt;item android:drawable=""@drawable/ic_tab_buy_white"" /&gt;&lt;/selector&gt;</code></pre><p>I would really appreciate any help, thanks.</p>","574693","","1001985","","2012-06-03 04:02:19","2012-06-03 04:02:19","creating a page with tabs, as a basic layout for my application","<java><android><tabs><emulator>","0","4","","",""
"4684062","1","4684113","","2011-01-13 18:58:53","0","2136","<p>I am following this question:<a href=""http://stackoverflow.com/questions/4050766/how-to-get-rss-feeds-android"">How to get rss feeds android?</a>And I'm using the code from Mathias Lin.</p><p>Notice that in the top, it says:</p><pre><code>import org.developerworks.android.FeedParser;import org.developerworks.android.FeedParserFactory;import org.developerworks.android.Message;import org.developerworks.android.ParserType;import org.xmlpull.v1.XmlSerializer;</code></pre><p>I managed to find out how to import an external .jar file (the xmlpull one). Now we have the 4 remaining lines, from org.developerworks.android. I managed to find these 4 files online here: <a href=""https://www.assembla.com/code/churchmobile/subversion/nodes/FeedParser/trunk/src/org/developerworks/android?rev=25"" rel=""nofollow"">https://www.assembla.com/code/churchmobile/subversion/nodes/FeedParser/trunk/src/org/developerworks/android?rev=25</a> (I don't know if this is the correct way of doing it).</p><p>Now I need my Eclipse project to import these external .java files - how do I do this? Now I have red lines underneath these 4 lines because Eclipse can't find them, obviously.</p>","554002","","","","","2011-01-13 19:03:37","Importing external java files to Eclipse","<java><android><external>","1","1","","",""
"4684226","1","","","2011-01-13 19:16:42","0","282","<p>I have an application that deals with DRM ringtones and it's working just fine on most phones but not on the Garmin A50 (1.6). It looks like a permission issue.Here's the log I get when the application is running on the Garmin:</p><pre><code>01-13 11:40:37.783: WARN/PackageManager(1419): Unknown permission android.permission.INSTALL_DRM in package com.application01-13 11:40:37.783: WARN/PackageManager(1419): Not granting permission android.permission.ACCESS_DRM to package com.application (protectionLevel=3 flags=0x4446)</code></pre><p>Any ideas?</p><p>Thanks</p>","574750","","186558","","2011-01-13 19:34:22","2011-01-13 19:34:22","Android permissions not granted on Garmin Phone A50","<android><permissions>","0","3","","",""
"4684477","1","4692803","","2011-01-13 19:43:57","0","904","<p>Hey I want to make a view appear below the last that has been created.</p><p>It is showing like this:</p><p><img src=""http://i.stack.imgur.com/8pIoi.png"" alt=""alt text""></p><p>I want to make the next view show below the last one, so for each new view added, it shows below. Understand?</p><p>Here is my code. The xml file and the java file.</p><p><strong>listitem.xml</strong></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""    android:id=""@+id/linearId""     android:padding=""6dip""    &gt;    &lt;ImageView         android:id=""@+id/icon""         android:layout_width=""wrap_content""        android:layout_height=""fill_parent""         android:layout_marginRight=""6dip""        android:src=""@drawable/icon""         /&gt;    &lt;LinearLayout         android:orientation=""vertical""        android:layout_width=""0dip"" android:layout_weight=""1""        android:layout_height=""fill_parent""        &gt;        &lt;TextView             android:id=""@+id/txt1""             android:layout_width=""fill_parent""            android:layout_height=""0dip""             android:layout_weight=""1""            android:textSize=""20sp""             android:gravity=""center_vertical""            android:text=""My Application""             /&gt;        &lt;TextView             android:id=""@+id/txt2""             android:layout_width=""fill_parent""            android:layout_height=""0dip""             android:layout_weight=""1""            android:singleLine=""true""             android:ellipsize=""marquee""            android:text=""Simple application that shows how to use RelativeLayout""            android:textSize=""10sp""             /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>RatedCalls.java</strong></p><pre><code>public class RatedCalls extends Activity {private static final String LOG_TAG = ""RatedCalls"";private TableLayout table;private CallDataHelper cdh;private TableRow row;private TableRow row2;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.listitem);    Log.i(LOG_TAG, ""calling from onCreate()"");    cdh = new CallDataHelper(this);    startService(new Intent(this, RatedCallsService.class));    Log.i(LOG_TAG, ""Service called."");    Log.i(LOG_TAG, ""before call fillList"");    List&lt;String&gt; ratedCalls = new ArrayList&lt;String&gt;();    ratedCalls = this.cdh.selectTopCalls();    LayoutInflater inflater = (LayoutInflater) this            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);    LinearLayout ll = (LinearLayout) this.findViewById(R.id.linearId);    for (int i = 0; i &lt; 1; i++) {        View item = inflater.inflate(R.layout.listitem, null);        TextView x = (TextView) item.findViewById(R.id.txt1);        x.setText(ratedCalls.get(0));        TextView ht = (TextView) item.findViewById(R.id.txt2);        ht.setText(ratedCalls.get(1));        ll.addView(item, ViewGroup.LayoutParams.WRAP_CONTENT);    }}</code></pre>","399459","","321697","","2011-01-13 20:16:35","2011-01-14 15:40:06","How to make a view appear below","<android><android-layout><android-listview>","4","0","","",""
"4684508","1","","","2011-01-13 19:47:04","1","1317","<p>How can i launch a process from with my android app? I am wanting to launch the default music player to play a selected song. I can play the song from within my own app, but i want to let the default player play the song. How would i go about doing this? </p><p>Thanks. This is what i got to work using your example.</p><pre><code>Intent intent = new Intent(android.content.Intent.ACTION_VIEW);             Uri data = Uri.parse(""file://"" + pathtofile);             intent.setDataAndType(data,""audio/mp3"");             try {                       startActivity(intent);                } catch (ActivityNotFoundException e) {                       e.printStackTrace();                }</code></pre>","356494","","356494","","2011-01-13 20:51:31","2011-07-14 14:08:33","Launch app or file with android app","<android>","2","1","","",""
"4684600","1","4686453","","2011-01-13 19:55:59","0","504","<p>So I have a Map that displays markers for all my friends based their coordinates.  Right now when you click a marker it pops up an overlay and gives their details.  What I need to figure out is how to have that overlay include a clickable link that will forward them to my webview.</p><p>The current code for plotting my coordinates:</p><pre><code>        fID = Integer.toString(aFriendid[i]);        GeoPoint point = new GeoPoint((int)(aLongitude[i] * 1E6),                 (int)(aLatitude[i] * 1E6));        OverlayItem overlayitem = new OverlayItem(point, ""Friend: "", fID);        itemizedoverlay.addOverlay(overlayitem);        mapOverlays.add(itemizedoverlay);</code></pre><p>The above gets looped through n times.  The fID is the value I need to append to the forwarded web address.</p><p>So the desired effect is in that overlay theres a link ""click to view friend details"" and that opens my webview with the address: ""example.com/fid?=fID"".</p><p>Any help would be appreciated, thanks.</p>","570509","","","","","2011-01-13 23:20:42","MapView overlay item needs to be a link to a webview","<java><android><webview><overlayitem>","1","0","0","",""
"4684610","1","","","2011-01-13 19:57:25","4","1112","<p>I'm stumped here.  I've been using the same HttpUrlConnection code to retrieve JSON from my server since Android 1.5.  Suddenly, with 2.3 it won't work and I can't understand why.</p><p>Here's my code:</p><pre><code>        try {                    HttpURLConnection conn =             (HttpURLConnection)(new URL(Constants.SERVER_URL + path)).openConnection();        conn.setAllowUserInteraction(false); // no user interact [like pop up]        conn.setDoOutput(true); // want to send        conn.setDoInput(true);        conn.setRequestMethod( ""POST"" );        conn.setRequestProperty( ""Content-type"", ""application/x-www-form-urlencoded"" );        conn.setRequestProperty( ""Accept"", ""application/json,text/html,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"" );        conn.setRequestProperty( ""Accept-Charset"", ""UTF-8"" );        conn.setRequestProperty(""Connection"", ""Keep-Alive"");        DataOutputStream pw = new DataOutputStream (conn.getOutputStream());        pw.writeBytes(requestString);        pw.flush();        pw.close();         if (conn.getResponseCode() == 200) {            InputStream in = new BufferedInputStream(conn.getInputStream());            BufferedReader br = new  BufferedReader(new InputStreamReader(in));            StringBuffer stringBuffer = new StringBuffer();            while(br.ready()){                stringBuffer.append(br.readLine());            }            br.close();            in.close();            return stringBuffer.toString();        } else {            return badResponse;        }    } catch (Exception ioe) {        return ERROR_MAKING_CONNECTION;    }</code></pre><p>The response comes back with a code of 200, however, when I run conn.getInputStream().available() the result is -1.  On every other android api besides 2.3 the conn.getInputStream().available() returns a significant response.</p><p>Any ideas?</p>","574806","","","","","2011-01-13 19:57:25","HttpUrlConnection behaving different in Android 2.3 Gingerbread","<android>","0","2","","",""
"4684737","1","","","2011-01-13 20:11:45","3","3265","<p>How can I set one layout components height to the same as another component:example:Can I set android:layout_height=""@+id/info_box.height"" or do something similar?</p><p>I want the height of the ImageView to match that of my LinearLayout</p><pre><code>ImageView android:id=""@+id/border""  android:src=""@drawable/frame""android:layout_below=""@+id/title""android:layout_width=""fill_parent""android:layout_height=""????""    android:scaleType=""fitXY"" android:drawingCacheQuality=""auto""/&gt;&lt;LinearLayoutandroid:id=""@+id/info_box""android:orientation=""vertical""android:layout_below=""@+id/title""android:background=""@layout/my_bg""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;... other stuff . . &lt;/LinearLayout&gt;</code></pre><p>thanks,steve</p>","524140","","","","","2012-11-23 17:40:10","How to set height of one layout component to the same height of another component?","<android><height><android-layout>","2","6","","",""
"4684741","1","4687560","","2011-01-13 20:12:17","0","167","<p>When a user selects an item in a ListView, I display a new list based on their selection using a new ListAdapter in the same activity.  Do I need to release the previous ListAdapter, or will the ListView handle that automatically?</p><p>I'm allocating ListAdapters like this:</p><pre><code>            ListAdapter adapter=new SimpleCursorAdapter(this,                R.layout.row, tempCursor,                new String[] {""name""},                new int[] {R.id.name});        setListAdapter(adapter);</code></pre>","561534","","","","","2011-01-14 02:55:49","Do ListAdapters need to be released, or is that handled automatically?","<android><listadapter>","2","1","0","",""
"4684784","1","","","2011-01-13 20:16:42","0","436","<p>In android, I am loading a large United States map from the web inside a webview.</p><p>The map is very large and what I would like to do is have the page pre-centered and possibly even pre-zoomed in on a certain part of the map.</p><p>For example, in an earlier part of my app the user types in a zip code.  I would like thewebview to be autofocused on that area of the map.</p><p>Please don't suggest using google maps!</p>","487840","","","","","2011-01-13 23:14:20","How do you set the initial viewing position of a webview?","<android><webview><zoom>","1","1","","",""
"4684802","1","4685310","","2011-01-13 20:19:09","0","1278","<p>How can my app ask the user to choose a file and then upload that file to the server? The file will either come from a browser based download or it will come from the camera stored it.</p><p>I expect that the user will choose the file using whatever file browser will check the folder that these two things write to. Then I will store the path to the file and make the upload at the time the email is sent.</p><p>Please tell me how to choose the file and if there is a way to upload the file using <code>HttpPost</code>. (if not, I will write separate upload code, but I will still need to be able to get the user to choose the file.)</p><p><strong>Edit: Found the file chooser</strong> code from the <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Email.git;a=tree;hb=master"" rel=""nofollow"">Android Email App Source Code</a>. There is some kind of built in file chooser that uses IDs instead of the regular file system. The app had it filtered to image/* type, but if you remove that filter it will ask if it should use gallery (which has a menu link to camera) or if it should use a Sound file or record a new sound file. The starting place is <code>src/com/android/email/activity/MessageCompose.java</code>. The method is <code>onOptionsItemSelected</code> and it has a <code>switch</code> <code>case:</code> for attachments.</p><h2>Edit: Solution</h2><p>It turns out that the Android SDK includes only part of the apache library and therefor HttpClient does not exist. I will get the data to be uploaded instead with multiple requests and put in Base64 data in one of the POST parameters.</p>","463304","","463304","","2011-01-14 20:53:49","2011-01-14 20:53:49","Android attachment upload via HTTPS","<java><android><http><file-upload><apache-commons>","2","0","2","",""
"4684883","1","4685141","","2011-01-13 20:26:28","0","281","<p>I'm trying my strength in developing an application in android and I have the following question:</p><p>My android device comes with a built in google map (oddly enough it's called maps). I'd like to develop on top of that platform. The requirements are:</p><ul><li>Querying the map for points based on names of streets I give (and numbers perhaps)</li><li>Highlighting lines or roads drawn between the highlighted points I gave</li></ul><p>Does android's map support it? If not, is there any platform (free or commercial) that will make such a thing possible?</p><p>Thank you very much~!</p>","126015","","","","","2011-01-13 20:55:09","How can I highligh roads in android gps","<android><gps><maps>","1","0","","",""
"4685037","1","4702954","","2011-01-13 20:43:21","0","938","<p>I have an activity that I can declare as Launcher category and it launches just fine from the home screen.  However, when I try to hook-up the same activity into my SyncAdapter's settings activity and open it from the Accounts &amp; Sync page -> MySyncAdapter -> (touch account listing) it aborts with a system fatal error (reboots phone).</p><p>Meanwhile, my SyncAdapter is working other respects.</p><p>Here is the log at point of impact:</p><pre><code>01-13 12:31:00.976  5024  5038 I ActivityManager: Starting activity: Intent { act=android.provider.Settings.ACTION_SYNC_SETTINGS flg=0x10000000 cmp=com.myapp.android.syncadapter.ui/SyncAdapterSettingsActivity.class (has extras) }01-13 12:31:00.985  5024  5038 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: android.server.ServerThread01-13 12:31:00.985  5024  5038 E AndroidRuntime: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myapp.android.syncadapter.ui/SyncAdapterSettingsActivity.class}; have you declared this activity in your AndroidManifest.xml?01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.app.ContextImpl.startActivity(ContextImpl.java:622)01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.preference.Preference.performClick(Preference.java:828)01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:190)01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.widget.AdapterView.performItemClick(AdapterView.java:284)01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.widget.ListView.performItemClick(ListView.java:3382)01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.widget.AbsListView$PerformClick.run(AbsListView.java:1696)01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:587)01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:92)01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:123)01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at com.android.server.ServerThread.run(SystemServer.java:517)01-13 12:31:00.985  5024  5038 I Process : Sending signal. PID: 5024 SIG: 901-13 12:31:01.005  5019  5019 I Zygote  : Exit zygote because system server (5024) has terminated01-13 12:31:01.015  1211  1211 E installd: eof</code></pre><p>Here is a snippet from my manifest file:</p><pre><code>   &lt;activity android:name=""com.myapp.android.syncadapter.ui.SyncAdapterSettingsActivity""              android:label=""@string/title_settings""               android:windowSoftInputMode=""stateAlwaysHidden|adjustPan""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;action android:name=""android.provider.Settings.ACTION_SYNC_SETTINGS""/&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><p>I forgot about the XML resource file (account_preferences.xml) that is referenced.  It provides another level of indirection-reference to the activity's name.  I can manipulate it to get the log entry to change accordingly.  So, I think that is a hint to the solution.  The target package and target class get concatenated together to define the name of the activity to start.  What I noticed in the log is that there is a slash (/) in the path name and I think that is why it is unable to find the activity.  For example, if I take the (<strong>.ui</strong>) out of the package and put it in the target-activity, then the slash moves to be before the <strong>.ui</strong> in the path.</p><p>account_preferences.xml:</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;PreferenceCategory android:title=""@string/format_auth_preferences"" /&gt;    &lt;PreferenceScreen         android:key=""key_syncadapter_auth""         android:title=""@string/key_syncadapter_auth_action""         android:summary=""@string/key_syncadapter_auth_summary""&gt;         &lt;intent             android:action=""android.provider.Settings.ACTION_SYNC_SETTINGS""             android:targetPackage=""com.myapp.android.syncadapter.ui""             android:targetClass="".SyncAdapterSettingsActivity"" /&gt;     &lt;/PreferenceScreen&gt; &lt;/PreferenceScreen&gt;</code></pre><p>log snippet:</p><pre><code>01-14 14:34:34.270 E/AndroidRuntime( 6374): *** FATAL EXCEPTION IN SYSTEM PROCESS: android.server.ServerThread01-14 14:34:34.270 E/AndroidRuntime( 6374): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myapp.android.syncadapter.ui/.SyncAdapterSettingsActivity}; have you declared this activity in your AndroidManifest.xml?</code></pre>","157804","","157804","","2011-01-14 22:45:45","2011-01-16 00:15:57","Why does Android Account & Sync reboot when trying to find my settings activity?","<android><activity><fatal-error><android-syncadapter>","1","3","","",""
"4685094","1","4685926","","2011-01-13 20:50:46","0","328","<p>I'm changing the background drawable for my buttons when they're clicked (as they trigger functions such as play/record). While playing/recording, the button glows (a different 9-patch is set as the background) and turns into a stop button. My problem is that currently I'm using:</p><pre><code>b.setBackgroundResource(R.drawable.btn_default_normal);</code></pre><p>to set the background back again afterwards. This works, but the normal behaviour when I use <code>setEnabled(false)</code> is lost. After a button has been used, and reset to normal, it retains the normal background (rather than the dimmed one) when disabled. The text still changes colour though. Is there a way of 'resetting' the background of the button to default, so that it retains its normal behaviour? </p>","319618","","","","","2011-01-13 22:13:34","'Unset' Button background","<android><button><drawable>","1","0","","",""
"4685122","1","4696101","","2011-01-13 20:53:26","3","1644","<p>There are some apps that require login. May I know how the app manage user session on android? For example, once the user has sign in to the app, the next time user start the app, it will straight go to the home page instead of the login page. While if user start the app for the first time or before login, the app will start with the login page. Can phonegap handle this? Thank you.</p>","324850","","","","","2012-04-18 14:21:43","Android app login","<javascript><android><android-emulator><phonegap>","3","0","1","",""
"4685174","1","4729258","","2011-01-13 20:58:47","5","5908","<p>I have an Activity that contains a ViewFlipper.  The ViewFlipper includes 2 layouts, both of which are essentially just ListViews.</p><p>So the idea here is that I have two lists and to navigate from one to the other I would use a horizontal swipe.</p><p>I have that working.  However, what ever list item your finger is on when the swipe begins executing, that item will also be long-clicked.</p><p>Here is the relevant code I have:</p><pre><code>public class MyActivity extends Activity implements OnItemClickListener, OnClickListener {    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 GestureDetector mGestureDetector;    View.OnTouchListener mGestureListener;    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) {                    if (mCurrentScreen != SCREEN_SECONDLIST) {                        mCurrentScreen = SCREEN_SECONDLIST;                        mFlipper.setInAnimation(inFromRightAnimation());                        mFlipper.setOutAnimation(outToLeftAnimation());                        mFlipper.showNext();                        updateNavigationBar();                    }                }                else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                    if (mCurrentScreen != SCREEN_FIRSTLIST) {                        mCurrentScreen = SCREEN_FIRSTLIST;                        mFlipper.setInAnimation(inFromLeftAnimation());                        mFlipper.setOutAnimation(outToRightAnimation());                        mFlipper.showPrevious();                        updateNavigationBar();                    }                }            } catch (Exception e) {                // nothing            }            return true;        }    }    @Override    public boolean onTouchEvent(MotionEvent event) {        if (mGestureDetector.onTouchEvent(event))            return true;        else            return false;    }    ViewFlipper mFlipper;    private int mCurrentScreen = SCREEN_FIRSTLIST;    private ListView mList1;    private ListView mList2;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.layout_flipper);        mFlipper = (ViewFlipper) findViewById(R.id.flipper);        mGestureDetector = new GestureDetector(new MyGestureDetector());        mGestureListener = new View.OnTouchListener() {            public boolean onTouch(View v, MotionEvent event) {                if (mGestureDetector.onTouchEvent(event)) {                    return true;                }                return false;            }        };        // set up List1 screen        mList1List = (ListView)findViewById(R.id.list1);        mList1List.setOnItemClickListener(this);        mList1List.setOnTouchListener(mGestureListener);        // set up List2 screen        mList2List = (ListView)findViewById(R.id.list2);        mList2List.setOnItemClickListener(this);        mList2List.setOnTouchListener(mGestureListener);    }    …}</code></pre><p>If I change the ""return true;"" statement from the GestureDetector to ""return false;"", I do not get long-clicks.  Unfortunately, I get regular clicks.</p><p>Does anyone know how I can get around this?</p>","406790","","406790","","2011-01-13 21:36:49","2011-01-20 09:15:53","Trouble with detecting gestures over ListView","<android><listview><gesture><viewflipper><gesturedetector>","5","0","3","",""
"4685269","1","4685336","","2011-01-13 21:07:40","0","1901","<p>I have developed an application that does require to do constant network activity. This  Activity does the network connections thru an AsyncTask, sometime this work being done in background (application not having focus). My application sometimes gets killed after 30 mins, even if the system does not seem to lack resources (memory).</p><p>I have read the Activity life cycle in the <a href=""http://developer.android.com/guide/topics/fundamentals.html"" rel=""nofollow""> Application Fundamentals section on developer.android.com</a>, but can't find an answer. What would be the proper way to programmatically prevent my Activty to get killed.</p><p>Thank you.</p>","574885","","","","","2011-01-13 21:13:57","How to prevent an android activity to get killed","<android><background><kill>","3","0","","",""
"4685313","1","","","2011-01-13 21:11:49","3","497","<p>The SQLite C library has a method, <code>sqlite3_column_decltype()</code>.  But I cannot find any place where the Android SQLite API makes this method available.  Is there any way to get the declared type of a column without running any SQL (i.e. can I avoid using <code>PRAGMA table_info</code>)?</p><p>I could have used <code>AbstractWindowedCursor.isBlob()</code>, but it says that it will also return true if the field is NULL.  I need something that will guarantee me a value equal to the column's declared type.</p>","213525","","","","","2011-01-14 00:47:06","Get the affinity of a SQLite column on Android","<android><sqlite>","1","0","","",""
"4685475","1","4690322","","2011-01-13 21:28:01","0","886","<p>What steps do I need to take to draw an arrow on top of my mapview so that it will rotate in a manner so that it is always pointing towards my destination?</p>","180825","","","","","2011-01-14 11:28:19","Overlaying an arrow to always point to my direction in Android MapView","<android><overlay><android-mapview>","1","2","","",""
"4685534","1","4692780","","2011-01-13 21:33:50","2","13498","<p>Can anybody offer a solution to the above?</p><p>For now, all i want to do is send a JSON request to my server (for example: {picture:jpg, color:green}), have the PHP access the database and then return a filename from the server's database (then get android to download the file - not an issue)</p><p>Can anybody suggest firstly an Android Framework that will help me with this. - POST JSON to a php file on my server</p><p>And secondly a php script that will turn the JSON into php readable format (accessing the database is not an issue either but i cannot get the JSON into an object to then match with the database)</p><p>thanks</p><p><strong>EDIT</strong></p><p>Thanks for the links below but i'm not asking this out of laziness, it's out of annoyance at my seeming inability to send a JSON string and get out the correct answer.</p><p>So let me show some code and find out why what i think should happen isn't happening:</p><p>GET URL (Using GET so i can show the working)</p><pre><code>http://example.com/process/json.php?service=GOOGLE&lt;?php// decode JSON string to PHP object$decoded = json_decode($_GET['json']);// I'm not sure of which of the below should work but i've tried both.$myService = $decoded-&gt;service; //$service should equal: GOOGLE$myService = $decoded-&gt;{'service'}; //$service should equal: GOOGLE// but the result is always $myService = null - why??&gt;</code></pre>","381258","","381258","","2011-01-14 14:13:26","2011-01-14 15:37:41","Android JSON to PHP Server and back","<php><android><json>","2","2","2","",""
"4685595","1","","","2011-01-13 21:40:34","0","1373","<p>i  have used game loop as given in tutorial </p><p><a href=""http://www.droidnova.com/playing-with-graphics-in-android-part-vii,220.html"" rel=""nofollow"">http://www.droidnova.com/playing-with-graphics-in-android-part-vii,220.html</a></p><p>when i press home button and comes again to surfaceview , onclickview  doesnt works after that</p>","182699","","","","","2011-01-14 02:54:59","Android Surfaceview onClick Event doesnt work after pressing HOME","<android><surfaceview>","1","0","","",""
"4685643","1","","","2011-01-13 21:45:08","0","493","<p>I have developed an app to communicate with my own server and published it. However, sometimes the app force closes. I know there is no bug in the code because the app works properly most of the time, but sometimes it is waiting for an answer from the server forever. I think this is due to the fact that so many people are using the app, and the app refreshes every 1 second or so, so this heavy traffic causes the server to take a large amount of time to respond. So how do you take care of such a use case? should I have a use case where if the server does not respond after some time you just stop the app and throw a message saying that the server is not responding or something like that?</p>","522559","","321731","","2014-02-21 04:35:05","2014-02-21 04:35:05","Heavy traffic on server causes app to force close","<android>","2","3","","",""
"4685741","1","","","2011-01-13 21:55:42","5","8103","<p>I'm new to Android and I'am struggling to make a call to an SSL web service for an Android Application. My code is as follows:</p><pre><code>Log.v(""fs"", ""Making HTTP call..."");HttpClient http = new DefaultHttpClient();HttpGet request = new HttpGet(""https://example.com/api"");try {    String response = http.execute(request, new BasicResponseHandler());    Log.v(""fs"", response);} catch (Exception e) {    Log.v(""fs"", e.toString());}</code></pre><p>The Output is:</p><pre><code>Making HTTP call...javax.net.SSLPeerUnverifiedException: No peer certificate</code></pre><p>Any suggestions to make this work would be great.</p><p>I should note that this is a valid cert. It is signed by an official CA.</p>","1638","","600500","","2011-08-16 20:45:11","2012-09-08 13:08:41","How do I call a secure (SSL) webservice in Android, when Android does not see the certificate?","<java><android><httpclient>","5","5","1","",""
"4685749","1","4700522","","2011-01-13 21:56:08","0","951","<p>Firstly, I am new to both android and Java.</p><p>I have two classes, my main.class and Note.class.</p><p>I am calling the notification method from my Note.class in my main.class when i press a button.</p><p>The issue is with this line from the Note.class :</p><pre><code>PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);</code></pre><p>When the method is called it force closes. I believe the problem to be with the ""this"" in PendingIntent.getActivity(this, 0, notificationIntent, 0);, but I am unsure what to change it to.</p><p>The notification code works fine if it's in the main class.</p><p>I would be very grateful for any guidance.</p><p><strong>Edit:</strong>Main class : <a href=""http://pastebin.com/05Yx0a48"" rel=""nofollow"">http://pastebin.com/05Yx0a48</a></p><p>Note.class :</p><pre><code>package com.adamblanchard.remindme.com.adamblanchard;import com.adamblanchard.remindme.R;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;public class Note extends Activity {public CharSequence note = ""not changed"";int HELLO_ID = 1;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    setTitle(""Remind Me!"");}//Notification Methodpublic void callNotification() {    // TODO Auto-generated method stub    String ns = Context.NOTIFICATION_SERVICE;    final NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);    int icon = R.drawable.launcher;    CharSequence tickerText = ""Remind Me!"";    long when = System.currentTimeMillis();    final Notification notification = new Notification(icon, tickerText, when);notification.flags |= Notification.FLAG_AUTO_CANCEL;final Context context = getApplicationContext();CharSequence contentTitle = ""Remind Me!"";CharSequence contentText = note;Intent notificationIntent = new Intent(context, AndroidNotifications.class);PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);        mNotificationManager.notify(HELLO_ID, notification);        HELLO_ID++;} }</code></pre><p>Debug Output : </p><blockquote>  <p>Thread [&lt;1> main] (Suspended (exception IllegalStateException))<br>      Note(Activity).getSystemService(String) line: 3536<br>      Note.callNotification() line: 37<br>      remindme$1$1.onClick(DialogInterface, int) line: 72       AlertDialog(AlertController$ButtonHandler).handleMessage(Message) line: 159       AlertController$ButtonHandler(Handler).dispatchMessage(Message) line: 99<br>      Looper.loop() line: 123       ActivityThread.main(String[]) line: 3647<br>      Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]<br>      Method.invoke(Object, Object...) line: 507<br>      ZygoteInit$MethodAndArgsCaller.run() line: 839<br>      ZygoteInit.main(String[]) line: 597       NativeStart.main(String[]) line: not available [native method]  </p></blockquote><p>This is the debug output I get, plus a force close popup on the device.</p><p><strong>Edit2:</strong>  </p><p>Manifest 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.adamblanchard.remindme""  android:versionCode=""3""  android:versionName=""0.7""&gt;&lt;application android:label=""@string/app_name"" android:icon=""@drawable/ic_launcher72""&gt;&lt;activity android:name="".com.adamblanchard.remindme"" 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="".Note""&gt;&lt;intent-filter&gt;&lt;action android:name=""Note"" /&gt;&lt;category android:name=""android.intent.category.DEFAULT""/&gt;&lt;/intent-filter&gt;&lt;/activity&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""1""&gt;&lt;/uses-sdk&gt;&lt;/manifest&gt; </code></pre><p>Stack traces (Are these what you mean?):</p><pre><code>Thread [&lt;1&gt; main] (Suspended (exception ActivityNotFoundException)) Instrumentation.checkStartActivityResult(int, Object) line: 1404    Instrumentation.execStartActivity(Context, IBinder, IBinder, Activity, Intent, int) line: 1378  remindme(Activity).startActivityForResult(Intent, int) line: 2827   remindme(Activity).startActivity(Intent) line: 2933 remindme$1$1.onClick(DialogInterface, int) line: 82 AlertDialog(AlertController$ButtonHandler).handleMessage(Message) line: 159 AlertController$ButtonHandler(Handler).dispatchMessage(Message) line: 99    Looper.loop() line: 123 ActivityThread.main(String[]) line: 3647    Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  Method.invoke(Object, Object...) line: 507  ZygoteInit$MethodAndArgsCaller.run() line: 839  ZygoteInit.main(String[]) line: 597 NativeStart.main(String[]) line: not available [native method]  </code></pre><p>or:</p><pre><code>01-15 00:56:18.167: WARN/dalvikvm(14887): threadid=1: thread exiting with uncaught exception (group=0x40015560)01-15 00:56:18.217: ERROR/AndroidRuntime(14887): FATAL EXCEPTION: main01-15 00:56:18.217: ERROR/AndroidRuntime(14887): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.adamblanchard.remindme/com.adamblanchard.remindme.com.adamblanchard.Note}; have you declared this activity in your AndroidManifest.xml?01-15 00:56:18.217: ERROR/AndroidRuntime(14887):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)01-15 00:56:18.217: ERROR/AndroidRuntime(14887):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)01-15 00:56:18.217: ERROR/AndroidRuntime(14887):     at android.app.Activity.startActivityForResult(Activity.java:2827)01-15 00:56:18.217: ERROR/AndroidRuntime(14887):     at android.app.Activity.startActivity(Activity.java:2933)01-15 00:56:18.217: ERROR/AndroidRuntime(14887):     at com.adamblanchard.remindme.com.adamblanchard.remindme$1$1.onClick(remindme.java:82)01-15 00:56:18.217: ERROR/AndroidRuntime(14887):     at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:159)01-15 00:56:18.217: ERROR/AndroidRuntime(14887):     at android.os.Handler.dispatchMessage(Handler.java:99)01-15 00:56:18.217: ERROR/AndroidRuntime(14887):     at android.os.Looper.loop(Looper.java:123)01-15 00:56:18.217: ERROR/AndroidRuntime(14887):     at android.app.ActivityThread.main(ActivityThread.java:3647)01-15 00:56:18.217: ERROR/AndroidRuntime(14887):     at java.lang.reflect.Method.invokeNative(Native Method)01-15 00:56:18.217: ERROR/AndroidRuntime(14887):     at java.lang.reflect.Method.invoke(Method.java:507)01-15 00:56:18.217: ERROR/AndroidRuntime(14887):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)01-15 00:56:18.217: ERROR/AndroidRuntime(14887):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)01-15 00:56:18.217: ERROR/AndroidRuntime(14887):     at dalvik.system.NativeStart.main(Native Method)01-15 00:56:18.237: WARN/ActivityManager(156):   Force finishing activity com.adamblanchard.remindme/.com.adamblanchard.remindme01-15 00:56:18.747: WARN/ActivityManager(156): Activity pause timeout for HistoryRecord{40a15868 com.adamblanchard.remindme/.com.adamblanchard.remindme}01-15 00:56:18.777: DEBUG/Launcher(10740): -- loadPreferences()01-15 00:56:19.177: INFO/ActivityManager(156): No longer want com.facebook.katana (pid 14395): hidden #1601-15 00:56:29.177: WARN/ActivityManager(156): Activity destroy timeout for HistoryRecord{40a15868 com.adamblanchard.remindme/.com.adamblanchard.remindme}</code></pre>","574940","","574940","","2011-01-15 01:00:40","2011-01-15 15:54:52","Calling Status Bar notification from method from other class","<java><android>","2","2","","",""
"4685791","1","","","2011-01-13 21:59:31","2","2637","<p>I have a simple app with 2 edittext boxes. When input is typed into the 1st box one set of calculations are performed. If input is put into the other instead, a different set of calc's occurs.</p><p>So, if a number is typed into the first box etBox1, and the user leaves the box, the data from the first box is used to calculate a reesult and put it into the second box. If a number is typed into the second box etBox2, the data is used to calculate a value for the first box.</p><p>I tried:</p><pre><code>final EditText etBox1 = (EditText) findViewById(R.id.etBox1) final EditText etBox2 = (EditText) findViewById(R.id.etBox2)etBox1.setOnFocusChangeListener(new View.OnFocusChangeListener(){    @override   public void onFocusChange(View v, boolean lostfocus)   {       if (lostFocus == true)       { //do my calculations....}</code></pre><p>This fires when the focus given to etBox1 instead of waiting for the box to loose focus. This crashes the app because the user hasn't had the chance to input a number into the box. Any ideas why this behaves as a ""hasFocus"" instead of a ""lostFocus""? There is no documentation available on lostFocus at Android's site.</p>","493998","","493998","","2011-01-13 22:49:18","2011-12-13 22:42:28","editbox lostfocus fires on the wrong edittext box","<android>","2","2","1","",""
"4685916","1","4686000","","2011-01-13 22:12:43","3","592","<p>I notice that (too) many applications on my Android phone require full internet access. In some cases, it seems like they just want to connect to some service. In other cases, it is clear they are phoning home. However, it seems like users have no easy way of checking which one is the case.</p><p>I realize that in the manifest permissions for Android there is a ""android.permission.INTERNET"", but is there a way to say ""this application will only access some.domain.org"", and maybe specify which protocols will be used, or something like that? Could the Android system enforce that somehow?</p>","375646","","","","","2011-01-13 22:28:29","Internet access of an Android application -- but restricted to a single domain","<android><security>","1","0","","",""
"4685924","1","4763926","","2011-01-13 22:13:23","2","6395","<p>I've setup Netbeans using nbandroid (http://kenai.com/projects/nbandroid) which has been working just fine for the last few days. I've already made a small app which runs in the emulator and even on my phone.</p><p>The thing I can't get to work is the debugger console in netbeans.If I add these lines of code to my app nothing appears in any of the output screens in netbeans.</p><pre><code>System.out.println(""blaat"");Log.d(""info"", ""blaat"")</code></pre><p>Even though I'm 100% sure the code should run. Any suggestions on what I might have missed?</p>","534386","","","","","2011-01-21 21:20:37","Debugging Android on Netbeans","<android><netbeans>","2","1","","",""
"4686050","1","","","2011-01-13 22:26:28","0","986","<p>Basically, I want to associate a ""selected"" option with an id, so instead of doing this (my current way):</p><pre><code>            Vector spinnerList = new Vector();            spinnerList.addElement(""No"");            spinnerList.addElement(""Yes"");</code></pre><p>I'd be doing something like this (the Hashtable/Vector is just for Blackberry compatability):</p><pre><code>            String id = ""3"";            Hashtable spinnerMap = new Hashtable();            spinnerMap.put(id, ""No"");            spinnerMap.put(id, ""Yes"");</code></pre><p>Currently, a selected ""option"" from the spinner prints out 0 or 1 (based on the ""No"", ""Yes""). So, my question is, if I'm setting the spinners programatically from a map whose values I don't know (I just know ids), how do I do this?</p><pre><code>            Spinner spinner = new Spinner(this);            ArrayAdapter spinnerArrayAdapter = new ArrayAdapter(this,                    android.R.layout.simple_spinner_dropdown_item, spinnerList);            spinner.setAdapter(spinnerArrayAdapter);            spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {                public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,                        int arg2, long arg3) {                    System.out.println(""Selected: "" + arg2);                }                public void onNothingSelected(AdapterView&lt;?&gt; arg0) {                    System.out.println(""Nothing selected: "" + arg0);                }            });</code></pre>","375566","","375566","","2011-01-14 04:00:04","2011-01-14 04:00:04","Android 2.2 SDK - Create Spinner from Map?","<java><android><mobile><android-sdk-2.2>","2","0","","",""
"4686171","1","4691651","","2011-01-13 22:42:09","0","297","<p>the way i'm using db4o is really just read-only.  I will package a db with the application and do some background updating to it every now and again which i can handle differently.  But for my activities that are displaying data from the db, i don't need to do any updates, so for this reason i would just like to get data out of the db and have that data be ""deactivated"" so when the activity has a configurationChange due to the screen orientation changing or something, i can quickly layout the activity again.  What is the proper way to deactivate objects so they are still usable to my activity .  Currently i have code something like </p><pre><code>List&lt;MyObject&gt; mList = db().queryByExample(persistentClass);  // db just gets my ObjectContainer</code></pre><p>I have tried doing something like this</p><pre><code>db().ext().deactivate(mList);</code></pre><p>but it has not seemed to work.Do i need to iterate through each item of the list to deactivate it?  </p><p>when you change the screen orientation on the android, it hits my activity close method where i close the database. but then starts back up and I don't want to populate the mList again.  </p><p>so i keep getting a ""<code>com.db4o.ext.DatabaseClosedException</code>"" exception because in my layout of the activity i do things like</p><pre><code>mList.size()</code></pre><p>I really just want to deactivate the objects b/c i never have to update them, how can i do this?</p>","202064","","","","","2011-01-14 13:45:46","android db4o deactivate object properly","<java><android><db4o><onconfigurationchanged>","1","0","","",""
"4686218","1","","","2011-01-13 22:46:51","1","411","<p>I'm extremely new at Android development so please be patient.</p><p>I have an ASP.NET web site that will be accessed by an Android phone. On the site I want the user to be able to add a contact or an event to the calendar by clicking on a button. I take it I need to use intents. I saw in the documentation that I can make a phone call by using ""tel"" in the html, but do I do the same thing for calendar events and contact information?</p><p>If someone could point me to the proper documentation, or better yet, provide me with a simple sample, it would be greatly appreciated.</p><p>Thanks,</p><p>Carlo.</p>","574990","","","","","2011-01-14 00:04:29","How do I call intents from a web site","<android><website><android-intent>","1","0","1","",""
"4686227","1","4686785","","2011-01-13 22:47:58","3","3657","<p>I am trying to bind an event in Javascript to either the orientationchange or resize events in Android in order to change the width/height of some elements for my web app. In the event, I use window.innerHeight and window.innerWidth to get the current height and width of the window.</p><p>This works great on iOS and desktop devices, but on Android it seems that it calls this event before changing the values in the window variable. Therefore, when someone switches from portrait to landscape, I still get the values for portrait and therefore cannot resize correctly. Does anyone know what the problem is, and how I can fix it?</p>","383289","","","","","2013-08-05 22:30:48","Resize HTML elements on Android orientation change","<javascript><android>","5","0","","",""
"4686263","1","4729815","","2011-01-13 22:51:08","3","7437","<p>Is there a way to change the IMEI that will be returned by the emulator's <code>TelephonyManager</code>?  Also, is there a way to change the ID returned by <code>Settings.Secure.ANDROID_ID</code>?</p><p>I use these IDs to distinguish my users from one another when storing their data on the server side.  It would be nice if my QA team could change these IDs so that they are not all using the same set of user data.</p>","213525","","","","","2014-03-13 23:38:52","Change the device ID on an Android emulator?","<android><android-emulator>","2","0","0","",""
"4686425","1","4688070","","2011-01-13 23:16:56","1","1016","<p>I would like to be able to retrieve contents of a .txt file from the internet, and load it in an EditText. I tried using the code on this page: <a href=""http://stackoverflow.com/questions/2922210/reading-text-file-from-server-on-android"">Reading Text File From Server on Android</a></p><p>It didn't work, as you might have guessed. I've read on numerous sites about this type of problem, but I can't get anything to work. Someone suggested <a href=""http://developer.android.com/reference/android/net/http/AndroidHttpClient.html"" rel=""nofollow"">AndroidHttpClient</a> but I simply can't find any examples with this. </p><p>As I'm a newbie in Android programming, I would love if someone could please give me a small example.</p>","554002","","418183","","2011-01-14 19:45:53","2011-01-14 19:45:53","Retrieving content of a txt file from URL to Android","<java><android><text-files><retrieve>","1","2","","",""
"4686436","1","","","2011-01-13 23:18:31","0","373","<p>I have a jar file I use it to use TOC protocol (AOL servers).That jar file works fine totaly fine with my java application but when I use it in my android app,it never runs.I don't know the problem at all and I ma newbie to android development.plz help and guide me on how to debug android app or get console prints from android app IF YOU PLEASE.Best regards</p>","575013","","","","","2011-02-02 15:31:53","android and 3rd party jars","<java><android>","1","3","","",""
"4686479","1","4702202","","2011-01-13 23:24:59","1","490","<p>I followed the Hello MapView tutorial on the developer site, and got everything working well.  But now I need to expand upon that to add around 150 markers, and my current method crashes my app.</p><blockquote>  <p>Reason: keyDispatchingTimedOut</p></blockquote><p>My set up is as follows..</p><p>Four String arrays with the data for the map, all have (and always will) have the exact same number of indexes and fId[0] == fLatitude[0] == fLongitude[0] == fDetails[0], and so on:</p><pre><code>    String[] fId;    String[] fLatitude;    String[] fLongitude;    String[] fDetails;</code></pre><p>As of now this is how I am plotting the points on the map.  This is obviously not the correct way because the map keeps crashing:</p><pre><code>        List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();    Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker);    FriendItemizedOverlay itemizedoverlay = new FriendItemizedOverlay(drawable, mapView.getContext());    for(int i=0;i&lt;aLatitude.length;i++){        Double intLon = Double.parseDouble(aLongitude[i]);        Double intLat = Double.parseDouble(aLatitude[i]);        GeoPoint point = new GeoPoint((int)(intLat * 1E6),                 (int)(intLon * 1E6));        OverlayItem overlayitem = new OverlayItem(point, ""Friend "", ""Something"");        itemizedoverlay.addOverlay(overlayitem);        mapOverlays.add(itemizedoverlay);    }</code></pre><p>Let me know in the comments if you need anymore info, thanks.</p><p>Logcat:</p><blockquote>  <p>01-13 18:39:34.732: ERROR/MapActivity(1085): Couldn't get connection factory client  01-13 18:40:14.473: ERROR/ActivityManager(69): ANR in com.example.friendapp (com.example.friendapp/.FriendMaps)  01-13 18:40:14.473: ERROR/ActivityManager(69): Reason: keyDispatchingTimedOut  01-13 18:40:14.473: ERROR/ActivityManager(69): Load: 2.39 / 0.78 / 0.42  01-13 18:40:14.473: ERROR/ActivityManager(69): CPU usage from 6026ms to 0ms ago:  01-13 18:40:14.473: ERROR/ActivityManager(69):   93% 1085/com.example.friendapp: 93% user + 0% kernel / faults: 25 minor  01-13 18:40:14.473: ERROR/ActivityManager(69):   2.6% 69/system_server: 1.8% user + 0.8% kernel / faults: 3 minor  01-13 18:40:14.473: ERROR/ActivityManager(69):   1.1% 875/com.google.process.gapps: 0% user + 1.1% kernel  01-13 18:40:14.473: ERROR/ActivityManager(69):   1.1% 980/com.android.quicksearchbox: 0% user + 1.1% kernel  01-13 18:40:14.473: ERROR/ActivityManager(69):   0.9% 133/com.android.launcher: 0% user + 0.9% kernel  01-13 18:40:14.473: ERROR/ActivityManager(69):   0.1% 40/adbd: 0% user + 0.1% kernel  01-13 18:40:14.473: ERROR/ActivityManager(69): 100% TOTAL: 95% user + 4.1% kernel  01-13 18:40:14.473: ERROR/ActivityManager(69): CPU usage from 2192ms to 2863ms later:  01-13 18:40:14.473: ERROR/ActivityManager(69):   80% 1085/com.example.friendapp: 80% user + 0% kernel / faults: 3 minor  01-13 18:40:14.473: ERROR/ActivityManager(69):     77% 1085/bile.friendapp: 77% user + 0% kernel  01-13 18:40:14.473: ERROR/ActivityManager(69):   16% 69/system_server: 4.8% user + 11% kernel  01-13 18:40:14.473: ERROR/ActivityManager(69):     14% 101/InputDispatcher: 3.2% user + 11% kernel  01-13 18:40:14.473: ERROR/ActivityManager(69):     1.6% 70/HeapWorker: 1.6% user + 0% kernel  01-13 18:40:14.473: ERROR/ActivityManager(69):   0.5% 133/com.android.launcher: 0% user + 0.5% kernel  01-13 18:40:14.473: ERROR/ActivityManager(69):     0.5% 134/HeapWorker: 0% user + 0.5% kernel  01-13 18:40:14.473: ERROR/ActivityManager(69):   0.6% 980/com.android.quicksearchbox: 0% user + 0.6% kernel  01-13 18:40:14.473: ERROR/ActivityManager(69):     1.3% 981/HeapWorker: 0% user + 1.3% kernel  01-13 18:40:14.473: ERROR/ActivityManager(69): 100% TOTAL: 80% user + 19% kernel  01-13 18:40:20.702: ERROR/InputDispatcher(69): channel '406f88b8 com.example.friendapp/com.example.friendapp.FriendMaps (server)' ~ Consumer closed input channel or an error occurred.  events=0x8  01-13 18:40:20.712: ERROR/InputDispatcher(69): channel '406f88b8 com.example.friendapp/com.example.friendapp.FriendMaps (server)' ~ Channel is unrecoverably broken and will be disposed!</p></blockquote>","570509","","570509","","2011-01-13 23:57:42","2011-01-15 21:16:39","How to add multiple marks on MapView - over a hundred","<java><android><arrays><android-mapview>","1","7","","",""
"4686508","1","","","2011-01-13 23:29:32","1","746","<p>How can I display only the news feed from facebook on the device?  Is this possible with a FB dialog?</p><p>Thanks!</p>","542322","","","","","2011-07-26 05:53:22","Displaying facebook news feed in Android","<android><facebook><facebook-graph-api>","1","1","","",""
"4686763","1","4686821","","2011-01-14 00:08:27","0","696","<p>I am trying to make a simple pong game using opengl-es. I have checked out some of the tutorials/samples, but most of them are pre-dated to 2009.</p><p>I am familiar with game programming, and consider pong to be the hello-world!</p><p>Right now, I intend to make it using their supplied SDK (2.3), but eventually I want to make it in NDK, so I can port my other work to android.</p><p>Would anyone have a good reference for a starting point ?</p><p>Thanks</p>","280924","","","","","2011-01-14 00:18:48","Make Pong on android using OpenGL-ES","<android><opengl-es><android-ndk>","1","0","","",""
"4686840","1","4687264","","2011-01-14 00:21:08","0","1663","<p>I'm working on an app that involves and ExpandableListView.  We should like to replace the groupIndicator with one of our own choosing.</p><p>I created a spec for the indicator that would show a different png depending on the state of the selector (expanded or not expanded)</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/arrow_down"" android:state_expanded=""true""/&gt;    &lt;item android:drawable=""@drawable/arrow_right""/&gt;    &lt;/selector&gt;</code></pre><p>I then set up my layout xml to use:</p><p></p><p>(Note that childDivider is a one pixel tall png rather than a color because setting that to a color seems to be bugged)</p><p>This works, except that our icon is stretched out vertically.  That makes sense, because we just created a 25x25 icon and hoped for the best.  I'm trying to figure out the dimensions of the native icon so that I can match it, but that's where I run into trouble.</p><p>Digging through the source code (ExpandableListView.java) I found that, by default, the class will use com.android.internal.R.styleable.ExpandableListView_groupIndicator.  So I have an id, but no icon yet.</p><p>I'd love to be able to do: </p><pre><code>Bitmap image = BitmapFactory.decodeResource(this.getResources(), com.android.internal.R.styleable.ExpandableListView_groupIndicator);        imWidth = image.getWidth();        imHeight = image.getHeight();</code></pre><p>But as the ""internal"" suggests, it's not visible to me in user space.</p><p>I also found getIndicate() in ExpandableListView.java, but it is private, so I can't get to that either.</p><p>I'm quite new to diving into the platform source code, and I don't know how else to track down that image.  Can anyone help me out?  </p><p>Edit: Thanks CommonsWare.  To spell out the rest for anyone else looking:</p><p>android:drawable/expander_group is defined in /frameworks/base/core/res/res/drawable/expander_group.xml.<br>expander_group.xml mentions that it uses @drawable/expander_ic_maximized and @drawable/expander_ic_minimized.Those drawables can be found in /frameworks/base/core/res/res/drawable/expander_ic_maximized.9.png and /frameworks/base/core/res/res/drawable/expander_ic_minimized.9.png, among other places for specific densities and such.  The ""9"" explains why the default icons don't have distortion problems - they're patch-9 graphics.  The density-agnostic versions of the icons are 34px by 38px.</p>","574859","","574859","","2011-01-14 16:31:57","2011-01-14 16:31:57","How to determine appropriate dimensions for ExpandableListView groupIndicator icons?","<android><expand><expandablelistview><collapse>","1","0","1","",""
"4686909","1","","","2011-01-14 00:31:35","3","345","<p>I have an android app on the market for some time (7 month) that was labeled as ""Beta"" in the title.Yesterday I published a new version and thought it's time to leave the beta state. Therefore I switched the app-title in the market backend and removed the ""beta"" tag.</p><p>The problem is: now, the users don't receive any update notification! If you search for the app in the market, the red update label is shown correctly. But in the ""my apps"" section, the update label and the notification is never shown. The user doesn't see that there's an update.</p><p>It didn't work on my two phones (both 2.2, I cleared the market cache) and it seems like, nearly all users continue to use the old version. </p><p>So, is this a known problem? Or was it just a temporary problem on my phone? Can anybody confirm this behaviour?</p><p>And, what can I do now? Switching the title back doesn't seem to help.</p><p>Thanks a lot</p><p>Marcus</p>","408790","","","","","2011-02-07 02:02:35","No update notification when app-title changed","<android><google-play>","1","4","","",""
"4686954","1","4687542","","2011-01-14 00:39:24","0","1647","<p>I'm using ImageViews for my Tab indicators in a TabActivity. I have two copies of the same jpeg file, one scaled to 75% of the original. What I want to be able to do is use the normal size for selected and the smaller for unselected.</p><p>StateListDrawable doesn't work with ImageView so I figure I have to handle this myself. All I can find that seems to relate to tab selection changing is <code>TabHost.onTabChanged(String tabId)</code> - I assume the tabId is the String I passed to <code>new TabSpec(...)</code>.</p><p>Is this the only way to track tab changes? It would be useful to have an event handler (or handlers) to allow the previously selected tab to change view state and then the new tab to do the same. I can maintain a variable such as <code>int currentSelection</code> but it would be useful if it could be a bit more automated.</p>","488241","","","","","2011-01-14 02:53:30","Handling selected/unselected states with ImageView as Tab indicators","<android><android-tabhost>","1","4","","",""
"4687124","1","4687144","","2011-01-14 01:14:52","1","454","<p>Hi please look at my xml file, very straight and simple, one textView and one Spinner</p><pre><code>                &lt;TextView android:id=""@+id/TextViewContactNamesTexting""                android:layout_height=""wrap_content"" android:layout_gravity=""center_vertical""                android:text=""name"" android:layout_width=""fill_parent""                android:textColor=""@color/font"" android:textSize=""15sp""&gt;&lt;/TextView&gt;            &lt;Spinner android:layout_height=""wrap_content""                android:layout_width=""fill_parent"" android:layout_marginLeft=""10px""                android:id=""@+id/SpinnerNumTexting""&gt;&lt;/Spinner&gt;</code></pre><p>in run time I would like to generate as many as I want depending on an arrayList.I attach the picture which explains my thought better.any suggestion?I know how to fill the spinner appropriately, just stuck on generating more than one :(</p><p>thanks in advance...</p><p><img src=""http://i.stack.imgur.com/u9fOb.jpg"" alt=""alt text""></p>","536853","","","","","2011-01-14 01:20:03","multiple spinner but one in xml","<android><view><spinner>","1","0","","",""
"4687272","1","","","2011-01-14 01:46:06","0","1831","<p>I use a Samsung Vibrant, and one of the annoying bits that Samsung tossed on their TouchWiz skin was changing the color of the Settings menu item description text from white (AOSP) to light blue.</p><p>This looks okay as long as the skin is bluey-themed, but most ROMs seem to be leaning toward Gingerbread clones... doesn't look good with the green.</p><p>How can I change that settings description font color back to white, or even the orange it is in actual Android 2.3? Which xml file is the color property located in?</p><p>It seems to also spread to all apps you install, too... the blue text.</p>","523339","","","","","2011-03-27 16:30:38","Changing the Settings item description text color in Android?","<android><xml><text><colors><themes>","1","1","","",""
"4687282","1","4688629","","2011-01-14 01:47:32","0","229","<p>So in an app I'm messing around with I programmatically create some buttons. Then I setContentView(); to a different page. Then if I come back to the original page (on which I placed the programmatically created buttons), they no longer exist. I guess this makes sense as I am calling setContentView(R.layout.main); again which is just the original xml file with no data pointing to the buttons. So is there a way to have the buttons persist over such screen transitions? Thanks.</p>","382433","","345717","","2011-01-14 01:53:28","2011-01-14 07:25:30","Android Programmatically created Button Persistence","<android><button><persistence>","2","0","","",""
"4687302","1","4691618","","2011-01-14 01:52:58","1","3092","<p>I want to create a custom dialog that contains a listview and buttons below the listview. The buttons should be below the listview but always visible (layout_alignParentBottom=""true"").</p><p>I have created an xml that works quite well, but only on long lists. If the list is short, the buttons are still at the screen bottom, and the height of the dialog title is streched to make dialog fill screen. Image attached shows what I get today.</p><p>In short. I want a normal dialog that only fills screen if nececcary. </p><p>I am unable to post the xml for some reason. but I use a relativelayout, buttons are aligned parent bottom, small panel layouted above buttons, listview layouted above this panel.All layouts are layout:height=wrap_content.</p><p>Thankful for any help. /Magnus</p><p><img src=""http://i.stack.imgur.com/rOTKr.png"" alt=""alt text""></p>","513932","","","","","2013-08-06 18:48:06","Custom dialog with listview and button always fullscreen","<android><listview><button><dialog><alertdialog>","3","0","1","",""
"4687303","1","","","2011-01-14 01:52:59","0","1190","<p>I start an activity in a new task and I want to kill the task is when the user leaves it  because I think the task is useless when the user leaves.</p><p>How can I achieve this on Android? Setting the finishOnTaskLaunch attribute of the root activity has no effect.</p>","554861","","6391","","2011-01-14 02:11:25","2011-01-14 02:45:32","How do I finish a task on Android?","<android><activity><task>","2","1","","",""
"4687370","1","5008788","","2011-01-14 02:12:44","1","6486","<p>how to make a gallery control to scroll one image at a time? Also what is a good way of making a continuous loop of those images? I tried overriding onFling, does not work at all.</p><p>This moves image certain distance but does not really implement ""true paging"".</p><pre><code>@Override        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {          //  return super.onFling(e1, e2, velocityX, velocityY);            int kEvent;              if(isScrollingLeft(e1, e2)){ //Check if scrolling left                kEvent = KeyEvent.KEYCODE_DPAD_LEFT;              }              else{ //Otherwise scrolling right                kEvent = KeyEvent.KEYCODE_DPAD_RIGHT;              }              onKeyDown(kEvent, null);              return true;          }        private boolean isScrollingLeft(MotionEvent e1, MotionEvent e2){              return e2.getX() &gt; e1.getX();            }</code></pre>","538428","","","","","2013-03-27 21:58:05","Gallery scroll one image at a time","<android><gallery>","3","0","1","",""
"4687371","1","4697886","","2011-01-14 02:12:53","3","2763","<p>Here is the exception:</p><pre><code>java.lang.NullPointerExceptionat android.widget.TextView.setTextColor(TextView.java:1787)at android.widget.TabHost$LabelIndicatorStrategy.createIndicatorView(TabHost.java:521)at android.widget.TabHost.addTab(TabHost.java:204)at com.android.layoutlib.bridge.Bridge.setupTabHost(Bridge.java:880)at com.android.layoutlib.bridge.Bridge.postInflateProcess(Bridge.java:807)at com.android.layoutlib.bridge.Bridge.postInflateProcess(Bridge.java:813)at com.android.layoutlib.bridge.Bridge.computeLayout(Bridge.java:401)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.computeLayout(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.activated(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.pageChange(Unknown Source)at org.eclipse.ui.part.MultiPageEditorPart$2.widgetSelected(MultiPageEditorPart.java:290)at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267)at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1061)at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:2743)at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1429)at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:257)at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)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(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:619)at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)at org.eclipse.equinox.launcher.Main.run(Main.java:1407)</code></pre><p>Here is the <code>main.xml</code> file it's associated with:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:id=""@android:id/tabhost""&gt;  &lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""5dp""&gt;  &lt;TabWidget     xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:id=""@android:id/tabs"" /&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;include layout=""@layout/basic_tab"" /&gt;        &lt;include layout=""@layout/advanced_tab"" /&gt;    &lt;/FrameLayout&gt;  &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>Both the include files work individually just fine. But when in a tab layout, this error occurs. Any fixes?<br>Here is the code:  </p><pre><code>import android.app.TabActivity;import android.content.res.Resources;import android.os.Bundle;import android.widget.TabHost;import com.mohit.geo2do.R;public class TaskEdit extends TabActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.edit_task);        Resources res = getResources();        TabHost host = getTabHost();        host.addTab(host.newTabSpec(""basic"")            .setIndicator(""Basic"", res.getDrawable(android.R.drawable.ic_menu_edit))            .setContent(R.layout.basic_tab));        host.addTab(host.newTabSpec(""advanced"")            .setIndicator(""Advanced"", res.getDrawable(android.R.drawable.ic_menu_manage))            .setContent(R.layout.advanced_tab));        host.setCurrentTab(0);    }}</code></pre><p>And here are the xml files, advanced_tab:</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""  android:id=""@+id/advanced_tab_layout""&gt;  &lt;TextView     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentTop=""true""     android:text=""Notify me:""    android:textColor=""#FFFFFF""    android:textStyle=""bold""   /&gt;  &lt;CheckBox        android:layout_width=""wrap_content""       android:layout_height=""wrap_content""       android:layout_alignParentTop=""true""       android:id=""@+id/task_due""        android:text=""when task is due""       android:textColor=""#FFFFFF""       android:textStyle=""bold""        android:paddingTop=""5dip""   /&gt;   &lt;CheckBox        android:layout_width=""wrap_content""       android:layout_height=""wrap_content""       android:layout_alignParentTop=""true""       android:id=""@+id/task_overdue""        android:text=""when task is overdue""       android:textColor=""#FFFFFF""       android:textStyle=""bold""        android:paddingTop=""5dip""   /&gt;    &lt;CheckBox        android:layout_width=""wrap_content""       android:layout_height=""wrap_content""       android:layout_alignParentTop=""true""       android:id=""@+id/task_datetime""        android:text=""at""       android:textColor=""#FFFFFF""       android:textStyle=""bold""        android:paddingTop=""5dip""   /&gt;   &lt;TextView     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentTop=""true""     android:text=""Calendar:""    android:textColor=""#FFFFFF""    android:textStyle=""bold""     android:paddingTop=""5dip""    /&gt;   &lt;CheckBox        android:layout_width=""wrap_content""       android:layout_height=""wrap_content""       android:layout_alignParentTop=""true""       android:id=""@+id/task_calendar""        android:text=""Create a calendar event""       android:textColor=""#FFFFFF""       android:textStyle=""bold""        android:paddingTop=""5dip""   /&gt;&lt;/LinearLayout&gt;</code></pre><p>And basic_tab.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""android:id=""@+id/basic_tab_layout""&gt;&lt;TextView    android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:layout_alignParentTop=""true""   android:text=""Title:""   android:textColor=""#FFFFFF""   android:textStyle=""bold""    android:paddingTop=""5dip""/&gt;&lt;EditText   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:id=""@+id/title""   android:hint=""Name of the task...""/&gt;  &lt;TextView   android:layout_height=""wrap_content""   android:layout_width=""wrap_content""   android:text=""Importance:""   android:textColor=""#FFFFFF""   android:textStyle=""bold""   android:paddingTop=""10dip""/&gt;&lt;RadioGroup     android:layout_height=""wrap_content""    android:layout_width=""fill_parent""    android:orientation=""horizontal""    android:id=""@+id/importance_grp""&gt;    &lt;RadioButton        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""High""         android:paddingRight=""25dip""    /&gt;    &lt;RadioButton        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Medium""         android:checked=""true""        android:paddingRight=""25dip""    /&gt;    &lt;RadioButton        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Low""     /&gt;&lt;/RadioGroup&gt;&lt;TextView   android:layout_height=""wrap_content""   android:layout_width=""wrap_content""   android:text=""Due Date:""   android:textColor=""#FFFFFF""   android:textStyle=""bold""   android:paddingTop=""10dip""/&gt;&lt;Spinner   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:id=""@+id/due_date""    android:prompt=""@string/due_date_prompt""   android:entries=""@array/due_date_entries""/&gt;    &lt;TextView       android:layout_height=""wrap_content""       android:layout_width=""wrap_content""       android:text=""Notes:""       android:textColor=""#FFFFFF""       android:textStyle=""bold""       android:paddingTop=""10dip""    /&gt;    &lt;EditText        android:layout_height=""wrap_content""        android:layout_width=""fill_parent""        android:id=""@+id/notes""        android:hint=""Notes...""        android:minLines=""4""     /&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>UPDATE:</strong>  </p><p>Apparently:</p><pre><code>host.addTab(host.newTabSpec(""advanced"")        .setIndicator(""Advanced"", res.getDrawable(android.R.drawable.ic_menu_manage))        .setContent(R.layout.advanced_tab));</code></pre><p>Doesn't take a layout xml file to be it's content. It should be:</p><pre><code>host.addTab(host.newTabSpec(""advanced"")        .setIndicator(""Advanced"", res.getDrawable(android.R.drawable.ic_menu_manage))        .setContent(R.id.advanced_tab_layout));</code></pre><p>Where <code>setContent</code> takes an id. I still get that error, but on the emulator, the tabs actually display, BUT WITH NO CONTENT! </p>","200477","","200477","","2011-01-15 03:57:40","2011-02-11 10:21:30","NullPointerException thrown in Eclipse when trying to open Android XML view?","<android><xml><eclipse><include><tablelayout>","3","4","","",""
"4687495","1","4687860","","2011-01-14 02:42:57","2","3877","<p>How do I have one image in my Widget, then when its clicked change to another image? Its a widget with only an ImageButton, but I'm not sure where to go after this, I know all about pending intents and such, but that doesn't help here, unless I'm missing something... here is my onUpdate</p><pre><code>public void onUpdate(Context context,AppWidgetManager appWidgetManager,int[] appWidgetIds){   RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget);   PendingIntent onPendingIntent = PendingIntent.getService(context, 0, new Intent(context, widgetService.class), 0);   remoteViews.setOnClickPendingIntent(R.id.ImageButton01, onPendingIntent);   appWidgetManager.updateAppWidget(appWidgetIds, remoteViews); }</code></pre>","481082","","481082","","2011-01-14 03:26:58","2011-07-25 07:33:59","Change Image in Widget","<android><widget><imagebutton>","2","0","","",""
"4687674","1","5291329","","2011-01-14 03:20:27","3","2674","<p>I have repo the Android source code from <a href=""http://source.android.com/"" rel=""nofollow"">http://source.android.com/</a>.And successfully made a build and run with my emulator with my system.img.</p><p>But that is for standard emulator only.Where I can get the source code for google APIs addon?And how to build the google apis with my Android source code?So I can use my build on my emulator of Google APIs.</p>","428022","","250259","","2011-12-24 20:38:45","2011-12-24 20:38:45","How to build Android source code with Google APIs?","<android><build><android-emulator><source-code><google-api>","2","2","","",""
"4687710","1","","","2011-01-14 03:26:42","3","3207","<p>I'm running the following Java, an HttpURLConnection PUT request with JSON data that will be sent from an Android device. I'll handle any raised exceptions after this is working. GET is working just fine.</p><pre><code>Authenticator.setDefault(new Authenticator() {            protected PasswordAuthentication getPasswordAuthentication() {               return new PasswordAuthentication(nameString, pwdString.toCharArray());               }        });url = new URL(myURLString);HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();urlConnection.setDoOutput(true);urlConnection.setChunkedStreamingMode(0);urlConnection.setRequestMethod(""PUT"");urlConnection.setRequestProperty(""Content-Type"", ""application/json"");OutputStream output = null;try {  output = urlConnection.getOutputStream();  output.write(jsonArray.toString().getBytes());} finally {  if (output != null) { output.close(); }}int status = ((HttpURLConnection) urlConnection).getResponseCode();System.out.println("""" + status);urlConnection.disconnect();</code></pre><p>I'm receiving an HTTP 500 error (internal error code), that an unexpected property is blocking the request. The JSONArray comprises JSONObjects whose keys I know are correct. The server is pretty standard, and expects HTTP PUTs with JSON bodies.</p><p>Am I missing something?</p>","283311","","114066","","2012-07-06 08:54:30","2013-10-31 06:40:05","Sending JSON to a server","<android><json><httpurlconnection>","1","0","","",""
"4687802","1","4694031","","2011-01-14 03:48:54","6","2655","<p>Okay well I apologize for how sloppy this code is, but I still cant figure out how to post a code tag on here correctly.  So I am making an Android application (Java) and i have a scrolling text field.  If the user scrolls a long row down and stays at the end when they click the next row and if it is short, it will be scrolled down on that element too even though it may be a 1 line(and non scrollable) row.  I was wondering if there is any way I can call something to right after txtLvlInfo.setText to reset the x-scroll value to 0 or something so it is always reset to the top of the content, long or short.  Thanks for any help with this and please let me know if I need to clarify more. </p><pre><code>TextView txtLvlInfo = (TextView) findViewById(R.id.txtLevelInfo);txtLvlInfo.setMovementMethod(new ScrollingMovementMethod());  switch (v.getId()){    case R.id.row1:    txtLvlInfo.setText(""1: My text view is only two lines max and so I set it to scroll, if the user clicks row2 to load that text while having me scrolled down they have to click and pull to drag back down to the top of text view 2 row."");    break;    case R.id.row2:    txtLvlInfo.setText(""I only fill line 1 of the two."");    break; }</code></pre><p>_</p><pre><code>&lt;TextView        android:textColor=""#052027""      android:text=""""       android:id=""@+id/txtLevelInfo""      android:scrollbars=""vertical""      android:layout_alignParentLeft=""true""      android:layout_width=""fill_parent""       android:layout_height=""fill_parent""      android:layout_toRightOf=""@+id/minimizeBtn""      android:layout_marginRight=""38dip""&gt;  &lt;/TextView&gt;</code></pre>","572286","","321697","","2011-01-14 17:25:24","2013-01-24 13:03:18","reset TextView scroll to top","<java><android><scroll><textview>","1","0","","",""
"4687863","1","","","2011-01-14 04:01:47","3","2527","<p>I have created a softkeyboard application. I would like to set it as my default soft keyboard while installing. Is it possible to add code in my softkeyboard application coding to set this keyboard as default keyboard while installing? </p>","575204","","","","","2011-01-14 04:48:40","Android: Set Default soft keyboard","<java><android>","1","3","","",""
"4688052","1","8764950","","2011-01-14 04:43:59","2","6009","<p>As far as I know we can create notifications in Android using Notification Manager + remote Views.</p><p>I am Creating a notification for downloading Mp3 files. And I want an animations beside It. So far I have learned from forums that it is not possible.</p><p>However I saw A video for an android App which downloads and displays animation beside it while downloading it.Link: <a href=""http://www.youtube.com/watch?v=yNcs-sS2nFU&amp;feature=related"" rel=""nofollow"">http://www.youtube.com/watch?v=yNcs-sS2nFU&amp;feature=related</a></p><p>Can someone tell me the best way to achieve it. </p>","557869","","557869","","2011-01-14 07:33:32","2012-01-06 22:36:52","Animation in Notification bar Cutsom View","<android><animation><widget><android-layout><push-notification>","2","1","5","",""
"4688090","1","4688166","","2011-01-14 04:54:12","0","819","<p>I Get force close when executed on Android emulator. I can't figure out the error. Here is code of Main Activity SimpleJokeList.java</p><pre><code>    package edu.calpoly.android.lab2;import java.util.ArrayList;import android.app.Activity;import android.os.Bundle;import android.widget.Button;import android.widget.EditText;import android.widget.LinearLayout;import android.widget.ScrollView;import android.widget.TextView;public class SimpleJokeList extends Activity {    /** Contains the list Jokes the Activity will present to the user **/    protected ArrayList&lt;Joke&gt; m_arrJokeList;    /**     * LinearLayout used for maintaining a list of Views that each display Jokes     **/    protected LinearLayout m_vwJokeLayout;    /**     * EditText used for entering text for a new Joke to be added to     * m_arrJokeList.     **/    protected EditText m_vwJokeEditText;    /**     * Button used for creating and adding a new Joke to m_arrJokeList using the     * text entered in m_vwJokeEditText.     **/    protected Button m_vwJokeButton;    /**     * Background Color values used for alternating between light and dark rows     * of Jokes.       */    protected int m_nDarkColor;    protected int m_nLightColor;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        initLayout();        // TODO        String[] jokestring=getResources().getStringArray(R.array.jokeList);            for(String str : jokestring) {                addJoke(str);            }        }    /**     * Method used to encapsulate the code that initializes and sets the Layout     * for this Activity.      */    protected void initLayout() {        // TODO        m_vwJokeLayout=new LinearLayout(this);        m_vwJokeLayout.setOrientation(LinearLayout.VERTICAL);        ScrollView Sv=new ScrollView(this);        Sv.addView(m_vwJokeLayout);        setContentView(Sv);    }    /**     * Method used to encapsulate the code that initializes and sets the Event     * Listeners which will respond to requests to ""Add"" a new Joke to the      * list.      */    protected void initAddJokeListeners() {        // TODO    }    /**     * Method used for encapsulating the logic necessary to properly initialize     * a new joke, add it to m_arrJokeList, and display it on screen.     *      * @param strJoke     *            A string containing the text of the Joke to add.     */    protected void addJoke(String strJoke) {        // TODO        Joke j=new Joke(strJoke);        m_arrJokeList.add(j);        TextView TV=new TextView(this);        m_vwJokeLayout.addView(TV);        TV.setText(strJoke);    }}</code></pre><p>Here is code of Joke.java</p><pre><code>   package edu.calpoly.android.lab2;public class Joke {    public static final int UNRATED = 0;    public static final int LIKE = 1;    public static final int DISLIKE = 2;    private String m_strJoke;    private int m_nRating;    public Joke() {        //TODO        m_strJoke="""";        m_nRating=UNRATED;    }    public Joke(String strJoke) {        //TODO        m_strJoke=strJoke;        m_nRating=UNRATED;    }    public Joke(String strJoke, int nRating) {        //TODO        m_strJoke=strJoke;        m_nRating=nRating;    }    public String getJoke() {        //TODO        return m_strJoke;    }    public void setJoke(String mstrJoke) {        //TODO        m_strJoke=mstrJoke;    }    public int getRating() {        //TODO        return m_nRating;    }    public void setRating(int rating) {        //TODO        m_nRating=rating;    }    @Override    public String toString() {        //TODO        return m_strJoke;    }    @Override    public boolean equals(Object obj) {        //TODO        boolean ret=false;        if(obj!=null)        {            if(obj.getClass()==Joke.class)                if(obj.toString().equals(this.m_strJoke))                    ret=true;        }        else            ret=false;        return ret;    }}</code></pre><p>Here is Code of Manifest.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=""edu.calpoly.android.lab2""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;        &lt;uses-library android:name=""android.test.runner"" /&gt;        &lt;activity android:name="".SimpleJokeList""                  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=""4"" /&gt;    &lt;instrumentation android:name=""android.test.InstrumentationTestRunner""                     android:targetPackage=""edu.calpoly.android.lab2""                     android:label=""Tests for Api Demos.""/&gt;&lt;/manifest&gt; </code></pre>","517525","","517525","","2011-01-14 05:05:53","2012-02-27 19:22:13","What's error in this program, I get Force close for this","<android>","2","2","","",""
"4688133","1","","","2011-01-14 05:03:06","1","2433","<p>I wrote a GPSDataCollectService to collect location data every 10 seconds, but it did not report location in my HTC mobile phone, any wrong? could anyone help me?</p><pre><code>package com.android.example;import java.util.Calendar;import java.util.Timer;import java.util.TimerTask;import android.app.Service;import android.content.Context;import android.content.Intent;import android.location.Location;import android.location.LocationListener;import android.location.LocationManager;import android.os.Bundle;import android.os.IBinder;import android.util.Log;public class GPSDataCollectorService extends Service {    private static final String TAG = GPSDataCollectorService.class            .getSimpleName();    LocationManager locationManager;    LocationListener gpsLocationListener;    @Override    public IBinder onBind(Intent intent) {        return null;    }    private Timer timer;    private TimerTask collectTask = new TimerTask() {        @Override        public void run() {            Log.i(TAG, ""Timer task doing work: ""                    + Calendar.getInstance().getTimeInMillis());            locationManager = (LocationManager)  getSystemService(Context.LOCATION_SERVICE);            gpsLocationListener = new GPSLocationListener();            locationManager.requestLocationUpdates(                    LocationManager.GPS_PROVIDER, 10 * 1000L, 0,                    gpsLocationListener);        }    };    @Override    public void onCreate() {        super.onCreate();        Log.i(TAG, ""Service creating"");        timer = new Timer(""GPSDataCollectorTimer"");        timer.schedule(collectTask, 1000L, 10 * 1000L);    }    @Override    public void onDestroy() {        super.onDestroy();        Log.i(TAG, ""Service destroying"");        locationManager.removeUpdates(gpsLocationListener);        timer.cancel();        timer = null;    }    private class GPSLocationListener implements LocationListener {        @Override        public void onLocationChanged(Location location) {            Log.d(TAG, ""onLocationChanged: "" + location.toString());            locationManager.removeUpdates(gpsLocationListener);        }        @Override        public void onStatusChanged(String provider, int status, Bundle extras) {            Log.d(TAG, ""onStatusChanged: "" + status);        }        @Override        public void onProviderEnabled(String provider) {            // TODO Auto-generated method stub        }        @Override        public void onProviderDisabled(String provider) {            // TODO Auto-generated method stub        }    }}</code></pre>","575249","","","","","2011-01-18 08:32:56","How to collect location data every 10 seconds in Android","<android>","2","0","2","",""
"4688202","1","","","2011-01-14 05:19:56","3","302","<p>I'm sure someone out there can answer this in a matter of seconds...<br>All I am wondering is if this piece of code is read from bottom to top? The comments say the snake is initially heading east then heads NORTH and when I run it, this statement is true.But the coordinates go from 7,7 to 6,7 then 5,7 and so on...is that not a west bound snake? or is the code read from bottom to top?<br>Here is the piece of code.  </p><pre><code>private void initNewGame() {    mSnakeTrail.clear();    mAppleList.clear();    // For now we're just going to load up a short default eastbound snake    // that's just turned north    mSnakeTrail.add(new Coordinate(7, 7));    mSnakeTrail.add(new Coordinate(6, 7));    mSnakeTrail.add(new Coordinate(5, 7));    mSnakeTrail.add(new Coordinate(4, 7));    mSnakeTrail.add(new Coordinate(3, 7));    mSnakeTrail.add(new Coordinate(2, 7));    mNextDirection = NORTH;</code></pre>","575264","","1465910","","2012-09-29 08:45:39","2012-09-29 08:45:39","What sort of snake does this code make?","<android><coordinates>","3","0","","",""
"4688246","1","","","2011-01-14 05:27:56","0","446","<p>I am getting some weird errors with my Android App. It appears that this code is double encoding the JSON string. What should be sent is ?{""email"":""asdf@asdf.com"",""password"":""asdf""}or ?%7B%22email%22:%22.....</p><p>what the server is seeing is %257B%2522email%2522:%2522 ....which means the server sees  %7B%22email%22:%22 .....</p><p>This confuses the server.  </p><p>Any ideas why this is happening?</p><p>Thank you for your help</p><p>//edited to define objects better</p><p>Code:</p><pre><code>        DefaultHttpClient c = new DefaultHttpClient();        if(cookies!=null)            c.setCookieStore(cookies);        JSONObject jso = new JSONObject():        if(loginNotLogout){            jso.put(""email"", ""email@email.com"");            jso.put(""password"", ""PassW0RD"");        }        URI u = null;        if(loginNotLogout)            u= new URI(""HTTP"",""www.website.com"",""/UserService"",jso.toString(),"""");        else            u= new URI(""HTTP"",""www.website.com"",""/UserService"",jso.toString(),"""");        HttpGet httpget = new HttpGet(u);        HttpResponse response = c.execute(httpget);        ret.jsonString = EntityUtils.toString(response.getEntity());</code></pre>","575257","","575257","","2011-01-15 14:51:41","2011-01-15 22:57:48","(Android) Seems like my JSON query is getting double encode","<android><json><uri><http-get>","2","0","","",""
"4688277","1","4688610","","2011-01-14 05:37:03","73","120225","<p>I was trying to run a sample code While launching the application in the android 1.5 emulator , I got these errors....Any one have some hint..?</p><p>ERROR from LogCat:</p><pre><code>01-13 02:28:08.392: ERROR/AndroidRuntime(2888): FATAL EXCEPTION: main01-13 02:28:08.392: ERROR/AndroidRuntime(2888): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.s.android.test/com.s.android.test.MainActivity}: java.lang.ClassNotFoundException: com.s.android.test.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.s.android.test-2.apk]01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1544)01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at android.os.Handler.dispatchMessage(Handler.java:99)01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at android.os.Looper.loop(Looper.java:123)01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at android.app.ActivityThread.main(ActivityThread.java:3647)01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at java.lang.reflect.Method.invokeNative(Native Method)01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at java.lang.reflect.Method.invoke(Method.java:507)01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at dalvik.system.NativeStart.main(Native Method)01-13 02:28:08.392: ERROR/AndroidRuntime(2888): Caused by: java.lang.ClassNotFoundException: com.s.android.test.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.s.android.test-2.apk]01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at java.lang.ClassLoader.loadClass(ClassLoader.java:551)01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1536)01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     ... 11 more01-13 02:28:08.407: WARN/ActivityManager(112):   Force finishing activity com.s.android.test/.MainActivity</code></pre><p><strong>Edit</strong>This error happens to most of the beginners, the thing is that you have to add all your activities in the Manifest file.</p>","573700","","573700","","2012-06-21 10:08:28","2014-03-09 10:51:52","java.lang.RuntimeException: Unable to instantiate activity ComponentInfo","<android><fatal-error>","25","3","16","",""
"4688306","1","4689624","","2011-01-14 05:44:59","4","1358","<p>I would like to know if I can make an image opaque if set in image view or set as background of relative layout.</p><p>How can I make image opaque using image view or relative layout for setting the image dynamically or Is there any other option to set image and its opacity dynamically?</p><p>I also want the same image to rotate in both directions and also can zoomin and zoomout to anylevel.</p><p>Thanks in advance</p>","493193","","493193","","2011-01-14 07:49:29","2011-01-14 10:14:02","How can I make image opaque to some level?","<android><image>","1","6","7","",""
"4688311","1","4688762","","2011-01-14 05:46:52","2","1701","<p>I know that it is possible to place the tabs at the top or bottom view in portrait mode. However when i moved the orientation to the landscape view, the tabs will be in a row horizontally at the top. </p><p>I saw that it is possible when i opened up the <code>Calendar</code> application in my android phone, because the tabs are vertical in horizontal view, at the left hand side too.</p><p>Is there any way to change it to appear at the left hand side <code>vertically</code> on the screen?is it possible to change it through doing different views in layout-port and layout-land, or change manifest.xml or any other possible way through coding</p><p>thanks for the help in advance. this problem has been quite hard to solve.  </p>","565097","","1049263","","2013-04-27 13:39:57","2013-04-27 13:39:57","android tab to show vertically at the left hand side of screen in landscape view","<android><android-layout><android-tabhost><android-style-tabhost>","2","0","","",""
"4688470","1","4688521","","2011-01-14 06:17:27","0","1011","<p>Back to the same error...</p><p><code>01-13 02:46:05.971: ERROR/AndroidRuntime(2922): FATAL EXCEPTION: main01-13 02:46:05.971: ERROR/AndroidRuntime(2922): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.s.android.test/com.s.android.test.MainActivity}: java.lang.ClassNotFoundException: com.s.android.test.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.s.android.test-1.apk]</code> </p><p>I have imported a package to this application..do I have to add those activities to  my Manifest file?Please answer..Thanks</p>","573700","","573700","","2011-01-17 06:43:05","2013-02-02 09:43:31","Android Fatal Error","<android>","3","0","","",""
"4688487","1","","","2011-01-14 06:20:51","0","323","<p>So, I have some various controls with OnClickListeners stacked in a ScrollView and I've noticed that sometimes those controls does not react to touch, which is quite annoying and can confuse end user. The other thing I've noticed, that this is happening if scrollbar is still ""visible"", which means that ScrollView is still accelerating and usually happens when I swipe harder and it hits bottom or top (in these cases fade delay can be up to 5 seconds). No setting I've tried solves this (delaybeforefade, fadeduration, fadescrollbars), so I guess the roots of this problem is deeper.</p><p>Does anyone else faced this annoyance and maybe found a valid solution or workaround? Is it possible to stop ScrollView acceleration as soon as it hits top/bottom?</p><p>Now that I think about it... maybe it would be easiest just to ignore fling in subclassed ScrollView (in my case I could live with that)?</p><p>This is actually the same problem as <a href=""http://stackoverflow.com/questions/4061118/problem-in-a-scrollview-with-buttons-inside-no-response-until-second-click-on-an"">described in this question</a>, which, unfortunately, hasn't received any proper solution or workaround. </p>","90571","","","","","2011-01-14 06:43:03","Children of ScrollView doesn't respond to first touch if ScrollView is still ""accelerating""","<android><interface><scrollview>","1","0","","",""
"4688668","1","4688708","","2011-01-14 06:56:14","0","98","<p>Can we place the messages shown in Toast in the whole application to a particular language file.. so that if we need to edit a message , we can edit in that particular file</p>","548218","","","","","2011-01-14 07:04:37","Write application message to a Language file","<android>","1","0","","",""
"4688713","1","4689687","","2011-01-14 07:06:09","0","366","<p>my code is as following </p><pre><code>String projection[] = new String[]{ ContactsContract.Contacts._ID,                                            ContactsContract.Contacts.DISPLAY_NAME };        Cursor cursor = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, //The URI, using the content:// scheme, for the content to retrieve.                        projection,             // projection                        null,               // selection                        null,               // selectionArgs                        ContactsContract.Data.DISPLAY_NAME + "" COLLATE LOCALIZED ASC"");</code></pre><p>I want to add contact id, name and number (MAIN or any one of type) to intent, but problem is that I am unable to access Name. And another problem is that for each contact id returns ""-1"". why? Is there any solution? </p>","550966","","550966","","2011-03-19 18:20:31","2011-03-19 18:20:31","_id and Number not accessing using query : Android","<android>","1","0","","",""
"4688721","1","","","2011-01-14 07:07:31","0","865","<p>I wanted to ask a question to all you experts out there in mobile app development. I'm not a mobile (iOS or Android) developer myself, so I'd like to ask those of you that are comfortable with programming apps.</p><p>I was wondering if it was at all possible to layer HTML5 ON TOP of a native app, if that makes sense. I'm looking for a way to create an add-on to an already built HTML5 app if that's done through a JS add-on or whatever like it's already done on websites. This would allow me to make changes to the add-on (which takes up screen space) whenever I need to via traditional web programming.</p><p>Thanks!</p>","575341","","","","","2012-07-13 08:57:28","HTML5 Layer On Top of Native Mobile App","<android><ios><html5><mobile>","2","1","1","",""
"4688778","1","4735840","","2011-01-14 07:16:17","2","457","<p>i was wondering is it possible to add a button below a webview such that on clicking it, it should flip and give another webpage and so on, maybe a back button to return to the previous webpage, Can we make such changes in the layout> if so how? Coz whenever I wrote TabHost program for webview, upon selecting the tab,it would fill the entire page hiding the tabs,</p><p>I want to create a combination of ViewFlipper, WebView and Button</p>","466590","","","","","2011-01-19 13:34:50","Button for a webview android","<android><webview><android-tabhost>","1","0","","",""
"4688806","1","4688825","","2011-01-14 07:21:48","0","240","<p>I have a ListView which is filled by calling <code>setListAdapter(myAdapter)</code>. The given ListAdapter 'myAdapter' handles a custom layout for each row. Within this row, there's a <code>ImageView</code> where <code>setVisible()</code> is set to <code>false</code> at default.Now I'm searching for a way to enable all of this <code>ImageViews</code> within this list at once. How can you do that? </p><p>Thanks so far!</p>","566904","","610351","","2012-05-08 21:37:20","2012-05-08 21:37:20","Enable all items from a ListAdapter","<android><listview><imageview><visibility><listadapter>","1","0","","",""
"4688861","1","6855181","","2011-01-14 07:32:14","0","805","<p>I am trying to open twitter integration inside a custom webview beacuse, </p><p><a href=""http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/#awp::2009/07/16/android-oauth-twitter-updates/"" rel=""nofollow"">I am using this example</a></p><p>ctx.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));</p><p>If I user above code, it give a problem on pressback button. After redirection and posting status. When I press back button it goes to browser not to my application. I decide to user custom webview to avoide this by handling back event.</p><p>I am using following example. But now after authuntication browser not redirecting me back to my application but give an error, that page not found.?Can anyone help?</p>","486139","","","","","2011-07-28 07:02:07","Why twitter OAUTH not redirecting me back to application in CustomWebView in Android?","<android><android-webview><twitter-oauth>","1","0","","",""
"4688936","1","4688953","","2011-01-14 07:45:01","0","1313","<p>I'm trying to integrate ads (admob) into my Android app.  It's mostly working, except for one issue with the layout.  My layout consists of:</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""    xmlns:app=""http://schemas.android.com/apk/res/com.example.photos""&gt;    &lt;LinearLayout android:orientation=""horizontal""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:id=""@+id/status_layout""&gt;        &lt;ImageView android:id=""@+id/cardStatus""            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/hello""            android:id=""@+id/cardStatusText"" /&gt;    &lt;/LinearLayout&gt;    &lt;GridView android:id=""@+id/imageGridView""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""        android:padding=""10dp"" android:verticalSpacing=""10dp""        android:horizontalSpacing=""10dp"" android:numColumns=""auto_fit""        android:columnWidth=""100dp"" android:stretchMode=""columnWidth""        android:gravity=""center"" android:layout_below=""@id/status_layout"" /&gt;    &lt;!-- Place an AdMob ad at the bottom of the screen. --&gt;    &lt;!-- It has white text on a black background. --&gt;    &lt;!-- The description of the surrounding context is 'Android game'. --&gt;    &lt;com.admob.android.ads.AdView android:id=""@+id/ad""        android:layout_width=""fill_parent"" android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true"" app:backgroundColor=""#000000""        app:primaryTextColor=""#FFFFFF"" app:secondaryTextColor=""#CCCCCC""        app:keywords=""Android Photo"" /&gt;&lt;/RelativeLayout&gt;  </code></pre><p>The ads are shown at the bottom of the screen, just as I want.  However, they seem to be overlayed or drawn on top of the bottom portion of the grid view.  I would like the gridview to be shorter, so that the ad can fill the bottom portion of the screen, and not hide part of the gridview.  The problem is most annoying when you scroll all the way to the bottom of the gridview, and you still cannot fully see the last row items in the grid due to the ad.</p><p>I'm not sure if this is the standard way that AdMob ads work.  If this is the case, adding some padding to the bottom of the grid (if that's possible) would due the trick.  That way the user can scroll a bit further, and see the last row in addition to the ad.</p><p>I just switched from using LinearLayout to RelativeLayout after reading some similar issues with ListViews.  Now my ad is along the bottom instead of above the grid, so I'm getting closer.</p><p>Thoughts?-Kevin</p>","271177","","","","","2011-01-14 07:48:02","Android GridView with ads below","<android><android-widget><android-layout>","1","0","","",""
"4689029","1","4965647","","2011-01-14 07:59:42","7","9608","<p>Hi I'm tried to send extra data via PendingIntent.</p><p>This is my code </p><pre><code>//**1**    Intent intent = new Intent(context, UpdateService.class);             intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,     appWidgetId);             intent.putExtra(BaseConfigurationActivity.EXTRA_WIDGET_MODE,     2);             // put appWidgetId here or intent will replace an intent of     another widget             PendingIntent pendingIntent =     PendingIntent.getService(context, appWidgetId, intent,     PendingIntent.FLAG_UPDATE_CURRENT);             views.setOnClickPendingIntent(R.id.gridview_button,     pendingIntent); //**2**            intent = new Intent(context, UpdateService.class);             intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,     appWidgetId);             intent.putExtra(BaseConfigurationActivity.EXTRA_WIDGET_MODE,     1);             // put appWidgetId here or intent will replace an intent of     another widget             pendingIntent = PendingIntent.getService(context, appWidgetId,     intent, PendingIntent.FLAG_UPDATE_CURRENT);             views.setOnClickPendingIntent(R.id.listview_button,     pendingIntent); </code></pre><p>In my code it assign pendingIntent to two button gridview_button with EXTRA_WIDGET_MODE 2and listview_button with EXTRA_WIDGET_MODE 1</p><p>when I click on gridview_button and it call UpdateService classI also got EXTRA_WIDGET_MODE value is  ""1"" </p><p>What i'm doing wrong?</p>","224505","","224505","","2011-01-14 09:57:01","2011-04-02 06:35:07","Send EXTRA data via PendingIntent problem","<android>","3","3","1","",""
"4689067","1","","","2011-01-14 08:07:57","1","78","<p>I'm developing an Android 2.2 application. I have the following situation:</p><p>A user is working with my app and, when he finishes, he presses home button.</p><p>I'm wondering if it is possible to re-start my app from an specific activity. For example, if user was in activity B when he pressed home button, I always when to re-start it in activity A.</p><p>Is this possible?</p><p>Thanks.</p>","68571","","","","","2011-01-14 12:30:39","Resuming on another activity","<android><activity><android-2.2-froyo>","2","0","","",""
"4689106","1","","","2011-01-14 08:14:57","0","1274","<p>I have decided to use views for my tab interface... I follow a tab interface tutorial and the result of this tutorial is 4 tabs without content (text) under my tabs..</p><p>I was wondering how views working.. how can I make a method to set content to tab from an another class.. So main.java is my main file with the views (tabs). Tab1.java has google maps navigate code. </p><p>How I can invoke the method setupTab and set the navigation function to tab 1.</p><p>Here you can see my code:<br />Thanks in advance!</p><pre><code> package CustomTabs;      import android.app.Activity;    import android.graphics.drawable.Drawable;    import android.os.Bundle;    import android.view.View;    import android.widget.TabHost;    import android.widget.TextView;    import android.widget.TabHost.TabContentFactory;    import android.widget.TabHost.TabSpec;    public class CustomTabs extends Activity {     private TabHost mTabHost;     private void setupTabHost() {      mTabHost = (TabHost) findViewById(android.R.id.tabhost);      mTabHost.setup();     }     /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      // construct the tabhost      setContentView(R.layout.main);      setupTabHost();      setupTab(new TextView(this), ""Tab 1"", getResources().getDrawable(R.drawable.ic_tab_artists));      setupTab(new TextView(this), ""Tab 2"", getResources().getDrawable(R.drawable.ic_tab_artists));      setupTab(new TextView(this), ""Tab 3"", getResources().getDrawable(R.drawable.ic_tab_artists));      setupTab(new TextView(this), ""Tab 4"", getResources().getDrawable(R.drawable.ic_tab_artists));      {       final View v = mTabHost.getTabWidget().getChildAt(0);       v.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_bg_selector));       TextView tv = (TextView) v.findViewById(android.R.id.title);       tv.setTextColor(this.getResources().getColorStateList(R.drawable.tab_text_selector));      }      {       final View v = mTabHost.getTabWidget().getChildAt(1);       v.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_bg_selector));       TextView tv = (TextView) v.findViewById(android.R.id.title);       tv.setTextColor(this.getResources().getColorStateList(R.drawable.tab_text_selector));      }      {       final View v = mTabHost.getTabWidget().getChildAt(2);       v.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_bg_selector));       TextView tv = (TextView) v.findViewById(android.R.id.title);       tv.setTextColor(this.getResources().getColorStateList(R.drawable.tab_text_selector));      }      {       final View v = mTabHost.getTabWidget().getChildAt(3);       v.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_bg_selector));       TextView tv = (TextView) v.findViewById(android.R.id.title);       tv.setTextColor(this.getResources().getColorStateList(R.drawable.tab_text_selector));      }     }     private void setupTab(final View view, final String tag, Drawable icon) {      TabSpec setContent = mTabHost.newTabSpec(tag).setIndicator(tag, icon).setContent(new TabContentFactory() {       public View createTabContent(String tag) {return view;}      });      mTabHost.addTab(setContent);     }    }</code></pre>","468003","","","","","2011-08-30 17:56:40","Android: CustomTabs","<java><android><xml><tabs><android-tabhost>","2","0","","",""
"4689220","1","4690319","","2011-01-14 08:33:27","2","2331","<p>Well this is the code I use to animate the view so that old image disappears (black background) and new one slides in from outside (from left to right).</p><pre><code>this.imgView.setAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_right));this.imgView.setImageResource(imageArray[next]);</code></pre><p>How do I make it that old image slides out of the screen before new one shows up. Would be great if both were visible but I guess that would require 2 views to switch, so for now I could stick to one on screen at a time.</p>","475861","","","","","2012-01-04 14:51:40","Android animation while switching imageview resource","<android><image><animation><resources><screen>","2","0","0","",""
"4689364","1","","","2011-01-14 08:51:35","0","415","<p>I am a begginer in java/android. My question is:Can I download image(mp3 or other http contents) from http site using java.net.Socket? I am going to create several parallel threads for downloading the same contents.When one(thread) of them takes time more MAX time, supervisor interupts it and start againg.</p><p>Thanks a lot.</p>","575416","","","","","2011-01-14 09:05:59","Can I use java.net.Socket to download http content(image, mp3 file and other)?","<android>","1","0","","",""
"4689405","1","4690302","","2011-01-14 08:58:02","0","1674","<p>I need to implement in my application a context menu on a MapView, which takes the coordinates of the selected long clicked point and show a set of option.I tried to register the MapActivity for context menu and then overriding the oncreatecontextmenu method, but the longclick event seems not to fire. (e.g. I put some log in the oncreatecontextmenu method which never show on ddms)</p><p>I searched on the web and in the Android documentation but I have found nothing satisfying.So, is it really impossible to create a contextmenu on a MapView?If so, is there a way to implement something similar?I'm posting the (simple) code:</p><pre><code>public class ChoosePosition extends MapActivity {MapView mappa;MapController mapCtr;LocationManager locManager;LocationListener locLstn;Location myLastLoc;String locProvider;double mylat, mylongi;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.chooseposition);    locManager = (LocationManager)getSystemService(LOCATION_SERVICE);    locLstn = new MyLocationListener();    locManager.requestLocationUpdates(    LocationManager.GPS_PROVIDER,    2000, 10,     locLstn);    mappa = (MapView) findViewById(R.id.map2);    mappa.setLongClickable(true);    mapCtr = mappa.getController();    // attiviamo lo zoom integrato    mappa.setBuiltInZoomControls(true); // getting last known location    myLastLoc = locManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);    GeoPoint point;    if (myLastLoc == null) {        mylat = myLastLoc.getLatitude();        mylongi = myLastLoc.getLongitude();        // trasformiamo l'ultima posizione in un GeoPoint        point= new GeoPoint((int) (myLastLoc.getLatitude() * 1E6),                (int) (myLastLoc.getLongitude() * 1E6));    }   // setting center and zoom   mapCtr.setCenter(point);   mapCtr.setZoom(17);   // adding an overlay   MyLocationOverlay myLocationOverlay = new MyLocationOverlay();   mappa.getOverlays().add(myLocationOverlay);       registerForContextMenu(mappa);}@Overridepublic void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {            Log.i(""MYINFO"", ""I'm in"");    menu.add(Menu.NONE, 0, Menu.NONE, ""First option"");}@Overridepublic boolean onContextItemSelected(MenuItem item) {    return true;    }</code></pre>","575390","","","","","2011-01-14 10:58:30","Context menu on a MapView, or other solutions","<android><contextmenu><android-mapview>","1","0","1","",""
"4689477","1","4692812","","2011-01-14 09:08:12","2","559","<p>I'm using the lightweight Google API Java client to modify contacts.</p><p>There are a few samples for the API showing how to do partial updates (i.e. via HTTP PATCH), but Google Contacts specifically doesn't seem to support PATCH . The docs also specify that contacts updates done via PUT need to include the full information about the contact since any existing data omitted in the PUT request will be removed from the contact.</p><p>So what's the easiest procedure to read a contact, modify its data and update it? The client API has this nice <code>AtomParser</code> that takes the response from the HTTP GET request and populates members in my class, but unless my class contains every possible field that a contact could have, I might not read in all the data and as such delete data during the HTTP PUT.</p><p>My only guess is that I'll have to skip all the cool AtomParser witchcraft and just use a plain old XML parser to read the incoming feed, extract the information I need and then do an HTTP PUT on it. But that seems a bit absurd, given all the functionality int he API client. Is there a better way?</p><p>I'm secretly hoping there is an equivalent to this:</p><pre><code>HttpRequest request = transport.buildPatchRequest();request.setUrl(getEditLink());AtomPatchRelativeToOriginalContent content =    new AtomPatchRelativeToOriginalContent();content.namespaceDictionary = Namespace.DICTIONARY;content.originalEntry = originalEntry;content.patchedEntry = modifiedEntry;request.content = content;return RedirectHandler.execute(request).parseAs(getClass());</code></pre>","345717","","","","","2011-01-14 15:41:22","How to do a partial update on contacts using Google API Java client?","<java><android><google-api-java-client>","1","1","","",""
"4689492","1","","","2011-01-14 09:11:35","1","1116","<p>is there any way to show the Input Method selection dialog from the source code?</p>","575438","","","","","2011-08-11 18:24:08","Input Method Dialog","<android><methods><input>","2","2","","",""
"4689567","1","4690260","","2011-01-14 09:20:38","2","177","<p>I want to develop an android app that provides market data. I've been reading different tutorials and I have an idea on how I could go about making one but there are so many approaches I wanted to make sure I'm taking the right approach and doing all the right practices. </p><p>Basically I wanted to make an app where I can make a list of stocks with up to date market data. I will be getting the market data from a web server. If I click on one of the items I can see another screen with more information regarding the stock. There are a lot more things I want to do but I figured I'll start with that.</p><p>So I was thinking I'd have to make a database to store the list of stocks as well as the market data. The list and the details page will draw the data from the database, while I would have to have a service to poll the data from the server and save it on the database.</p><p>Will I need to make a content provider if I don't plan to share the data or should I just make a local database? Is there an advantage if I use a content provider?</p><p>Is a service the best approach to keep my data fresh? Is there a way for my service to keep getting data from my web server at regular intervals? Not yet sure to do this but based on what I read services seem like the best approach. </p><p>I'd like to hear from the community how they would design this, at least it will help me identify what I have to learn and what to search for in the net hehe.</p><p>Thanks!</p>","575455","","","","","2011-01-14 10:54:32","Designing a Stock App would like some advice","<java><android><design>","1","0","1","",""
"4689634","1","","","2011-01-14 09:31:09","0","2264","<p>I know that you can't turn on GPS in your application without going to system preferences.But i've downloaded GPS on/off widget and this widget do the job.I've decompiled the apk to find how the programmer have done the job with no success, dex files doen't show the code but functions and informations.Idea on how did he does that ?</p>","431652","","","","","2011-04-20 23:27:28","Turn On GPS like GPS on/off widget","<android><gps>","2","1","","",""
"4689785","1","","","2011-01-14 09:51:39","0","1062","<p>We are developing an application which is able to open and modify a DWG file without converting it to other formats (e.g. PDF, JPG). In this application we need to allow the user to open and view DWG files.</p><p>Can someone please help us with this? Or suggest some other ways by which we can open and view DWG files <em>without converting it to any other image file format</em>?</p>","575495","","321697","","2011-01-14 22:43:18","2011-01-14 22:50:16","Is It Possible To Include DWG Trueview In The Android SDK As A Tool To Open And View a DWG File?","<android><image><sdk><file-format><dwg>","1","0","","",""
"4689827","1","","","2011-01-14 09:55:31","0","1093","<p>I'm writing an app for Android (2.1+). And I need to solve problem with brightness of display. App will be running for longer time and if user is inactive (for example 30 seconds) it should set brightness to 0% and after touch on screen restore original value.</p><p>Now I'm using</p><pre><code>PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);  wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, ""DimScreen"");</code></pre><p>and</p><pre><code>@Overrideprotected void onPause() {    super.onPause();wl.release();}@Overrideprotected void onResume() {super.onResume();wl.acquire();}</code></pre><p>But this won't set brightness to 0%. And battery drain is higher.It is possible to set brightness to 0% (no turn off the display) and restore original value <strong>just by touching</strong> the screen ? And device should not lock itself while app is running.</p><p>Thanks in advance.<br>kamelot_sk</p>","537732","","537732","","2011-01-14 10:06:50","2011-02-21 15:29:43","Set display brightness to 0% after some time of inactivity. And back to original value after user input","<android><brightness>","1","2","","",""
"4689918","1","","","2011-01-14 10:08:35","7","25642","<p>i just wanna translate an image from left to right on emulator using android animation.I'm new to android animation.How could i do that.?coding is much appreciated.Thanks..</p>","555948","","21234","","2011-01-14 10:14:48","2013-12-12 06:18:43","Move image from left to right in android","<android><animation>","2","0","5","",""
"4689921","1","","","2011-01-14 10:08:44","1","1761","<p>hiin my application, some times i get the following error , but am not able to understand what is this. These error occur when am resuming my activity</p><p>j</p><pre><code>ava.lang.RuntimeException: Unable to start activity ComponentInfo{com.angi.android.main/com.ang.android.main.Angi}: android.view.InflateException: Binary XML file line #83: Error inflating class &lt;unknown&gt;    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)    at android.app.ActivityThread.access$2200(ActivityThread.java:119)    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)    at android.os.Handler.dispatchMessage(Handler.java:99)    at android.os.Looper.loop(Looper.java:123)    at android.app.ActivityThread.main(ActivityThread.java:4363)    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)Caused by: android.view.InflateException: Binary XML file line #83: Error inflating class &lt;unknown&gt;    at android.view.LayoutInflater.createView(LayoutInflater.java:513)    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)    at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)    at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)    at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)    at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:702)    at android.view.LayoutInflater.rInflate(LayoutInflater.java:614)    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:320)</code></pre>","487219","","","","","2012-02-16 11:19:38","Android unable to start activity","<android>","1","3","","",""
"4689976","1","4690072","","2011-01-14 10:14:39","2","2962","<pre><code>CheckBox checkOne = (CheckBox) findViewById(R.id.checkOne);checkOne.setSelected(true);CheckBox checkTwo = (CheckBox) findViewById(R.id.checkTwo);checkTwo.setSelected(true);CheckBox checkThree = (CheckBox) findViewById(R.id.checkThree);checkThree.setSelected(true);</code></pre><p>I am using the above code to check or uncheck multiple check boxes.</p><p><strong>My question is, is there any way I can get all check boxes at once? (I don't wanna use arrays)For example, my check boxes are in a LinearLayout, so can I get all the check boxes as the child of LinearLayout?</strong></p>","476747","","255905","","2011-01-14 10:25:43","2011-01-14 11:02:46","Checking Multiple Checkboxes in Android","<android><checkbox>","1","1","","",""
"4690145","1","","","2011-01-14 10:35:56","0","8122","<p>I have a listview with title and image in one row.And image is to come from remote server.Whats the best way to cache those images in android.I could think of two ways.</p><ol><li><p>Cache image on sdcard and corresponding entry in sqlite sothat I can get path while listviewis being scrolled.</p></li><li><p>Cache images per activity so if activity finishes. Image cache flushes</p></li></ol><p>Point 2 is simpler but not efficient.</p><p>How will be the performance in point 1.</p><p>Please help and suggest any other alternatives.</p>","547515","","","","","2012-09-26 10:02:38","caching images/file in android for listview","<android><listview>","1","3","1","",""
"4690147","1","","","2011-01-14 10:36:02","4","1575","<p>I want to detect ""user inactivity"" in my Android app. To be more precise: I want to detect if the user has NOT done any interaction with my app (touching the screen, scrolling, input texts ...) for a specific time. Technically I use a timer that is reseted on each (user) interaction.</p><p>In my activity, I override the <em>onUserInteraction</em> method to detect interactions like scrolling, touching the screen ...</p><pre><code>@Overridepublic void onUserInteraction(){    resetInactiveTimer();}</code></pre><p>Unfortunately, onUserInteraction is not called when the user interacts with the soft keyboard. I think the reason is, that the soft keyboard is not part of my Activity.</p><p>For the edit texts in my app I use <em>TextWatcher</em> and the <em>onTextChanged</em> method which works fine. But my app also contain a WebView that loads arbitrary web pages. Of course some web pages could contain input fields and I do not know how to detect that the user interacts with the soft keyboard to edit those text fields.</p>","516472","","","","","2011-05-08 16:43:07","Android: Detect user inactivity / Detect (softkeyboard) keyboard input","<android><android-softkeyboard><user-inactivity>","1","0","1","",""
"4690206","1","5130240","","2011-01-14 10:44:18","2","3200","<p>I bought a very weak netbook that comes preinstalled with android 2.0 whichI want to replace with another linux distro like puppy or damnSmallLinux.</p><p>the netbook has no bios menu with ""boot from SD card"" option so that and when I inserted an SD card or USB key with grub/lilo it still didn't bot from it. </p><p>I wasn't able to find no key sequence to enter android debugging mode so that I don't have root for the android system.</p><ol><li>is there an android-internal way to specify boot from another media?</li><li>is there a ""das-uboot"" way to force android boot from another device?</li></ol><p>thanks!</p>","65724","","35060","","2011-01-14 10:45:02","2011-02-26 22:49:45","howto replace android with another distribution","<android><bootloader><u-boot>","1","0","","",""
"4690208","1","","","2011-01-14 10:44:41","0","2159","<p>ive managed to get out the accelerometers values (x,y,z). Is there an easy way to make a circle move with those values? I would also like it to stop at the edges of the screen. Thanks!</p>","557187","","","","","2011-01-21 04:33:32","android: moving shape/image with values from accelerometer","<android><accelerometer>","1","0","2","",""
"4690209","1","4690231","","2011-01-14 10:44:59","0","105","<p>This code is present in one of this activity. I want to restrict addJoke() function from executing if the String variable new_joke is null, has no text or contains just spaces.Here is code</p><pre><code>protected void initAddJokeListeners() {    // TODO    m_vwJokeButton.setOnClickListener(new OnClickListener() {        @Override    public void onClick(View view) {    //Implement code to add a new joke here...            String new_joke=m_vwJokeEditText.getText().toString();            if(new_joke!=null&amp;&amp;new_joke!=""""&amp;&amp;new_joke!="" "")            {                addJoke(new_joke);            }        }    });}</code></pre><p>I don't know why addJoke() function is getting executed even I don't enter any text in EditText field. Please help.</p>","517525","","","","","2011-01-14 11:00:18","How to restrict this function from execution in android? Please help","<android>","2","0","0","",""
"4690228","1","","","2011-01-14 10:48:19","2","12080","<p>Hi i'm streaming video from a website in my android application. I have a history option showing the last seen videos. I wonder if i can use cache so that when the user enters the history the video is played faster (not downloaded again). When you use cache in Android does that mean that the whole video is downloaded and saved somewhere? or some data is saved somwhere(not the whole video).</p><p>Some help will be appreciated!!!</p><p>Thanks. </p>","526924","","","","","2011-01-14 13:41:15","how to save downloaded files in cache android","<android>","1","0","5","",""
"4690271","1","4690431","","2011-01-14 10:55:55","0","1151","<p>im using addVIew, addview is called using frameLayout, and my Ball Class is passed as a argument which extends View, and it uses onDraw function</p><p>addView is called inside a button listener. program loads fine but crashes whenever i press the button.</p><p>everything works in android 1.6 and 2.1 emulator, and 2.1 HTC phone.it crashes using android 2.2 emulator and 2.2 HTC phone</p><p>if i comment the main.addview statement, everything works fine even in 2.2</p><p>logcat report attached aswell</p><p>Ball class</p><pre><code>import android.content.Context;import android.graphics.Canvas;import android.graphics.Paint;import android.graphics.RectF;import android.view.View;public class Ball extends View{  private final float left;  private final float right;  private final float top;  private final float bottom;   private final float scale;   private float startAngle;     private float sweepAngle;     private Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);  public Ball(Context context, float a, float b, float c, float d, Paint e, float f, float g, float scale) {    super(context);         this.mPaint = e;          this.left = a;         this.top = b;         this.right = c;         this.bottom = d;         this.startAngle = f;         this.sweepAngle = g;         this.scale = scale;     }     @Override     protected void onDraw(Canvas canvas) {         super.onDraw(canvas);         RectF clockRect = new RectF(left, top, right, bottom);         canvas.drawArc(clockRect, startAngle, sweepAngle, true, this.mPaint);         canvas.drawLine(160*scale, 120*scale, 160*scale, 260*scale, this.mPaint);     }}</code></pre><p>main.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/main_view"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:background=""#FFFFFF""&gt; &lt;RelativeLayout     android:orientation=""vertical""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:background=""#FFFFFF"" android:id=""@+id/RelativeLayout01""  &gt;  &lt;Button android:text=""Calculate""   android:layout_height=""45dip""   android:layout_width=""90dip""  android:id=""@+id/Button01""   android:layout_below=""@+id/Spinner06""   android:layout_alignRight=""@+id/Spinner06""&gt;  &lt;/Button&gt;       &lt;/RelativeLayout&gt;&lt;/FrameLayout&gt;</code></pre><p>tyre.java</p><pre><code>import java.text.DecimalFormat;import android.app.Activity;import android.content.Intent;import android.graphics.Paint;import android.os.Bundle;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.view.View;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.FrameLayout;import android.widget.RelativeLayout;import android.widget.Spinner;import android.widget.TextView;public class tyre extends Activity {    /** Called when the activity is first created. */ FrameLayout main1;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        main1 = (FrameLayout) findViewById(R.id.main_view);        final Button button1 = (Button) findViewById(R.id.Button01);        final Paint mPaint3= new Paint(Paint.ANTI_ALIAS_FLAG);        mPaint3.setColor(0xFFFFFFFF);        button1.setOnClickListener        (          new View.OnClickListener()           {           public void onClick(View v)            {           float clear = (float) (0.75*22*2.54 + (0.7*2*365 * 80 / 1000));                  final float scale = getBaseContext().getResources().getDisplayMetrics().density;                  float centerX = 160;                  float centerY = 190;                  main1.addView( new Ball(getParent(),(centerX-clear)*scale,(centerY-clear)*scale,(centerX+clear)*scale,(centerY+clear)*scale,mPaint3,0,360,scale));              }         }        );           }}</code></pre><p>catlog, from pressing RUN on eclipse, till force quit on android emulatorERROR occurs when i press the button</p><pre><code>01-14 12:39:17.567: INFO/ActivityManager(59): Start proc com.aimenrg.tyrecalc for activity com.aimenrg.tyrecalc/.tyre: pid=965 uid=10033 gids={}01-14 12:39:18.797: INFO/ActivityManager(59): Displayed activity com.aimenrg.tyrecalc/.tyre: 1365 ms (total 1365 ms)01-14 12:39:24.387: DEBUG/dalvikvm(127): GC_EXPLICIT freed 765 objects / 43384 bytes in 163ms01-14 12:39:29.476: DEBUG/dalvikvm(157): GC_EXPLICIT freed 156 objects / 11336 bytes in 201ms01-14 12:39:34.427: DEBUG/dalvikvm(268): GC_EXPLICIT freed 28 objects / 1400 bytes in 144ms01-14 12:39:47.447: DEBUG/AndroidRuntime(965): Shutting down VM01-14 12:39:47.447: WARN/dalvikvm(965): threadid=1: thread exiting with uncaught exception (group=0x4001d800)01-14 12:39:47.467: ERROR/AndroidRuntime(965): FATAL EXCEPTION: main01-14 12:39:47.467: ERROR/AndroidRuntime(965): java.lang.NullPointerException01-14 12:39:47.467: ERROR/AndroidRuntime(965):     at android.view.ViewConfiguration.get(ViewConfiguration.java:211)01-14 12:39:47.467: ERROR/AndroidRuntime(965):     at android.view.View.&lt;init&gt;(View.java:1814)01-14 12:39:47.467: ERROR/AndroidRuntime(965):     at com.aimenrg.tyrecalc.Ball.&lt;init&gt;(Ball.java:21)01-14 12:39:47.467: ERROR/AndroidRuntime(965):     at com.aimenrg.tyrecalc.tyre$1.onClick(tyre.java:153)01-14 12:39:47.467: ERROR/AndroidRuntime(965):     at android.view.View.performClick(View.java:2408)01-14 12:39:47.467: ERROR/AndroidRuntime(965):     at android.view.View$PerformClick.run(View.java:8816)01-14 12:39:47.467: ERROR/AndroidRuntime(965):     at android.os.Handler.handleCallback(Handler.java:587)01-14 12:39:47.467: ERROR/AndroidRuntime(965):     at android.os.Handler.dispatchMessage(Handler.java:92)01-14 12:39:47.467: ERROR/AndroidRuntime(965):     at android.os.Looper.loop(Looper.java:123)01-14 12:39:47.467: ERROR/AndroidRuntime(965):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-14 12:39:47.467: ERROR/AndroidRuntime(965):     at java.lang.reflect.Method.invokeNative(Native Method)01-14 12:39:47.467: ERROR/AndroidRuntime(965):     at java.lang.reflect.Method.invoke(Method.java:521)01-14 12:39:47.467: ERROR/AndroidRuntime(965):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-14 12:39:47.467: ERROR/AndroidRuntime(965):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-14 12:39:47.467: ERROR/AndroidRuntime(965):     at dalvik.system.NativeStart.main(Native Method)01-14 12:39:47.489: WARN/ActivityManager(59):   Force finishing activity com.aimenrg.tyrecalc/.tyre01-14 12:39:48.017: WARN/ActivityManager(59): Activity pause timeout for HistoryRecord{43f49210 com.aimenrg.tyrecalc/.tyre}01-14 12:39:51.377: INFO/Process(965): Sending signal. PID: 965 SIG: 901-14 12:39:51.412: INFO/ActivityManager(59): Process com.aimenrg.tyrecalc (pid 965) has died.01-14 12:39:51.417: INFO/WindowManager(59): WIN DEATH: Window{43f98158 com.aimenrg.tyrecalc/com.aimenrg.tyrecalc.tyre paused=false}01-14 12:39:51.537: WARN/InputManagerService(59): Got RemoteException sending setActive(false) notification to pid 965 uid 1003301-14 12:39:58.478: WARN/ActivityManager(59): Activity destroy timeout for HistoryRecord{43f49210 com.aimenrg.tyrecalc/.tyre}</code></pre>","573305","","","","","2011-01-14 11:13:26","addView crashes on android 2.2, works fine on 2.1 and 1.6","<android><crash><android-layout><android-sdk-2.2>","1","0","0","",""
"4690293","1","4759305","","2011-01-14 10:57:36","4","4042","<p>I'm using keytool of JDK to generate the Google Maps API key fingerprint. While being rejected for several times, I realized that I've upgraded JDK to 1.7 recently. So I switch my dir to JDK6 (Thank god, the old version remains.), and repeated the same command:</p><pre><code>D:\.android&gt;""C:\Program Files\Java\jre6\bin\keytool"" -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android</code></pre><p>and Bang! It works. Turned out that JDK7 generated the SHA1 fingerprint instead of MD5, which leads to the rejection of my submission to Google.So I'm wondering why this happens for the new version of JDK. Any one have some clues?</p>","418070","","418070","","2011-01-21 10:28:13","2013-09-30 16:03:54","JDK 7 changes keytool output","<android><google-maps><jdk><keytool>","4","1","3","",""
"4690307","1","4690491","","2011-01-14 10:59:39","2","2923","<p>I am trying to create ListActivity with an AutoCompleteTextView. The Listview has listItems which consists of an ImageView and 2 TextViews.Everything works well except for the autocomplete strings. I am using a ArrayAdapter but I don´t know how to set the Strings (COUNTRIES).Here is some of the code.</p><p>public class SearchActivity extends ListActivity {</p><pre><code>static final String[] COUNTRIES = new String[] {      ""Afghanistan"", ""Albania"", ""Algeria"", ""American Samoa"", ""Andorra"",      ""Angola"", ""Anguilla"", ""Antarctica"", ""Antigua and Barbuda"", ""Argentina"",      ""Armenia"", ""Aruba"", ""Australia"", ""Austria"", ""Azerbaijan"",      ""Bahrain"", ""Bangladesh"", ""Barbados"", ""Belarus"", ""Belgium"",      ""Belize"", ""Benin"", ""Bermuda"", ""Bhutan"", ""Bolivia"",      ""Bosnia and Herzegovina"", ""Botswana"", ""Bouvet Island"", ""Brazil"", ""British Indian Ocean Territory"",      ""British Virgin Islands"", ""Brunei"", ""Bulgaria"", ""Burkina Faso"", ""Burundi"",      ""Cote d'Ivoire"", ""Cambodia"", ""Cameroon"", ""Canada"", ""Cape Verde"",      ""Cayman Islands"", ""Central African Republic"", ""Chad"", ""Chile"", ""China"",      ""Christmas Island"", ""Cocos (Keeling) Islands"", ""Colombia"", ""Comoros"", ""Congo"",      ""Cook Islands"", ""Costa Rica"", ""Croatia"", ""Cuba"", ""Cyprus"", ""Czech Republic""    };private AutoCompleteTextView    searchView;private ListView                mListView;private ArrayList&lt;MyItem&gt;       itemList            = new ArrayList&lt;MyItem&gt;();private ListItemAdapter         searchListAdapter;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.search);    searchView = (AutoCompleteTextView) findViewById(R.id.search_text);    searchView.setAdapter(searchListAdapter);    searchListAdapter = new ListItemAdapter(this, R.layout.search_row, itemList);    setListAdapter(searchListAdapter);    mListView = getListView();    mListView.setTextFilterEnabled(false);}/** * This class is used to for the list objects. */private class ListItemAdapter extends ArrayAdapter&lt;MyItem&gt; {    private ArrayList&lt;MyItem&gt;   bevs;    private MyItem          bevItem;    private TextView                nameView;    private TextView                descView;    private ImageView               imageView;    public ListItemAdapter(Context context, int textViewResourceId,            ArrayList&lt;MyItem&gt; itemList) {        super(context, textViewResourceId, itemList);        this.bevs = itemList;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        View view = convertView;    /* Update the views */        return view;    }}</code></pre><p>}</p><p>Please point me in the right direction</p><p>/Cheers Adrian</p>","575569","","","","","2011-06-29 08:55:13","AutoCompleteTextView issues with custom List","<android><listview><autocompletetextview>","2","0","1","",""
"4690522","1","4690602","","2011-01-14 11:25:20","2","567","<p><pre><code>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/bkgrnd""&gt;&lt;ScrollView    android:id=""@+id/ScrollView01""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:isScrollContainer=""true""    android:scrollbars=""vertical""    android:scrollbarAlwaysDrawVerticalTrack=""true""&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;Spinner            android:id=""@+id/Spinner_Table""            android:layout_height=""wrap_content""            android:layout_width=""fill_parent""            android:drawSelectorOnTop=""true""&gt;&lt;/Spinner&gt;         &lt;TextView            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:textSize=""@dimen/help_text_size""            android:textStyle=""bold""            android:gravity=""center""            android:id=""@+id/Blank""&gt;&lt;/TextView&gt;        &lt;TextView              android:id=""@+id/admintable""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;        &lt;Button             android:id=""@+id/Logout""             android:text=""@string/Logout""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""&gt;&lt;/Button&gt;        &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p></p><p>All I want to do is the last button on this activity to be displayed at the bottom of the view. If I move the button outside the scroll view I get an error.  What should I do?</p>","569654","","1288","","2012-07-19 15:49:59","2012-07-19 15:49:59","android, xml button layout issue","<android><xml><button>","2","0","","",""
"4690568","1","4690679","","2011-01-14 11:29:57","0","2603","<p>friends,</p><p>i have code </p><pre><code> DalCategories selected_object= new DalCategories();           for (DalCategories cat : DalCategories.EditPostCategory)            {                    if(cat.getCategory_Id().equals(root_id))               {                   selected_object  = cat;                   // add to list                   if(selected_object.getSub_Category() != null)                   {                       for (DalCategories t : selected_object.getSub_Category())                        {                           if(t.getSub_Category() != null)                           {                              // MakeChangesInThisObject(t.getSub_Category());                               adapter.addSection(t.getTitle(), new EfficientAdapter(this,t.getSub_Category(),selected_object.getSub_Category().get(0).getSub_Category()));                           }                       }                   }                   // add to list                   break;               }            }</code></pre><p>DalCategories.EditPostCategory has three levels i want to change third level object values and want this change should be done to DalCategories.EditPostCategory by reference and using MakeChangesInThisObject</p><p>any one guide me how to achieve this?</p>","249991","","","","","2011-01-14 11:45:03","how to pass object by reference in android to make changes in orignal object?","<java><android>","1","0","","",""
"4690598","1","4691059","","2011-01-14 11:33:42","3","2117","<p>I would like to have a Context Menu on my <code>MapView</code> and let the user choose between a map or a satellite photo in the background. I have tried to create a Context Menu by following <a href=""http://developer.android.com/guide/topics/ui/menus.html"" rel=""nofollow"">Creating Menus</a> but it doesn't work for me.</p><p>The application works but no Context Menu is shown. How can I create a Context Menu on my <code>MapView</code>?</p><p>In my <code>onCreate()</code> I have this code:</p><pre><code>    MapView mapView = (MapView) findViewById(R.id.mapview);    registerForContextMenu(mapView);</code></pre><p>And I have overrided some methods:</p><pre><code>@Overridepublic void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo info) {    super.onCreateContextMenu(menu, v, info);    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.context_menu, menu);}@Overridepublic boolean onContextItemSelected(MenuItem item) {    AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();    switch (item.getItemId()) {    case R.id.map_view_item:         return true;    case R.id.satellite_item:         return true;    default: return super.onContextItemSelected(item);    }}</code></pre>","213269","","","","","2012-12-15 14:06:53","How to create a Context Menu on a MapView?","<android><android-mapview><contextmenu>","1","0","","",""
"4690622","1","4692529","","2011-01-14 11:36:11","0","607","<p>I am going to create a new appliction that will use a calendar. Do I need to use a third-party calendar, or does Android provide an API to make calendars?</p>","565024","","29995","","2011-05-25 01:34:26","2012-12-17 02:15:53","Is there is any API to make a calendar in Android?","<android><calendar>","2","3","","",""
"4690628","1","4690654","","2011-01-14 11:36:59","5","922","<p>I am trying to resize text in android to make it bigger using;</p><pre><code>Paint paint = new Paint();paint.setTextSize(30);canvas.drawText(""Text goes here"" , x, y,paint);</code></pre><p>However the text gets pixelated. </p><p>Is there any other way of resizing text in android without it being ugly and pixelated?</p>","280240","","372239","","2014-01-04 15:47:18","2014-01-04 15:47:18","Big text in Android","<android><text><antialiasing>","1","0","","",""
"4690735","1","","","2011-01-14 11:52:07","2","2130","<p>I need to copy a PNG file form res.raw my App's private internal memory. This is code I am using. The resulting file appears to be corrupt in that BitmapFactory.decodeFile() returns null. The same file, if placed on the SD Card decodes just fine. Here is the code that I am using.</p><pre><code>private void loadGraphics(){    InputStream inputStream = BasicContext.getResources().openRawResource(R.raw.galaxy);    InputStreamReader inputreader = new InputStreamReader(inputStream);    BufferedReader buffreader = new BufferedReader(inputreader, 8192);     int Byte = 0;     FileWriter writer = null;   String PathA = ""/sdcard/rfo-basic/data/Galaxy1.png"";     try {      writer = new FileWriter(PathA);      do {      Byte = buffreader.read();      {writer.write(Byte);}      } while (Byte != -1);     } catch (IOException e) {       Log.v(Basic.LOGTAG, "" "" + Basic.CLASSTAG + "" I/O Exception 2 "");     }     finally {if (writer != null) { try {  writer.flush();  writer.close(); } catch (IOException e) {          Log.v(Basic.LOGTAG, "" "" + Basic.CLASSTAG + "" I/O Exception 4 ""); }}     }}</code></pre>","575616","","35060","","2011-01-14 12:03:30","2011-01-14 12:03:30","Android, Copy .png file form res.raw to App's private internal memor","<android><resources>","0","2","","",""
"4690840","1","4691050","","2011-01-14 12:04:05","3","6725","<p>The Samsung Galaxy S comes with a propietary filesystem called <a href=""http://movitool.ntd.homelinux.org/trac/movitool/wiki/RFS"" rel=""nofollow"">RFS</a>.</p><p>This filesystem seems to underperform in some occasions. Some applications get laggy, and others <a href=""http://support.runkeeper.com/discussions/problems/2509-android-galaxy-s-issues-app-completely-unusable"" rel=""nofollow"">just freeze</a> when using it. This has reached a point on which <a href=""http://project-voodoo.org"" rel=""nofollow"">an external team</a> has created <a href=""http://project-voodoo.org/lagfix"" rel=""nofollow"">a tool</a> that basically migrates the whole system to ext4.</p><p>But not everyone is technically-savy to apply it, or don't want to risk voiding their smartphone's warranty.</p><p>I realize that the ideal situation would be that the filesystem was transparent and performant in all cases. But since this doesn't seem to be the case, I'd like to know:</p><ul><li>Does anyone know how to work around RFS' rough edges?</li><li>Is there any guide or a best-practices document that the devs should read?</li></ul><p>Thanks a lot!</p>","312586","","21234","","2011-01-14 16:30:52","2012-04-04 21:08:36","android - how to avoid lag/freezes with Samsung RFS filesystem?","<android><filesystems>","2","0","2","",""
"4690900","1","","","2011-01-14 12:11:27","0","588","<p>I am working on a Taxi application which locates nearby taxi companies.  At present, however, I wish to use a set of pre-defined values for the list of taxi companies as the system is in the early stages and not linked to a back-end server - the purpose of the pre-defined list/array is for illustration purposes only so that people can see what the intended outcomes is when selecting a taxi company off of the list.</p><p>I have a Spinner object above a map on my Android screen.</p><p>The options within the Spinner object are populated by an array saved in my strings.xml file.</p><p>I have a WebView object beneath the Spinner object which displays a pre-defined set of coordinates which is saved in my Java/class file.</p><p>At present I have a Toast message which appears, confirming whichever option is selected from the Spinner object; I would like to be able to have the following happen:</p><ol><li>Option from Spinner object is selected;</li><li>A dialog box appears with two options: 'View on Map' and 'Book Taxi'.2.1.  When user selects 'View on Map' I would like to have the map look at an associated set of (pre-defined) coordinates and then display this on the map (WebView object).2.2.  When user selects 'Book', I would like a confirmation message to appear which says, ""Booking Confirmed"".</li></ol><p>I require this desperately as I have a deadline to reach so any helpful answers will be much appreciated.</p><p>My arrays (saved in strings.xml) are:</p><pre><code>&lt;string-array name=""taxi_companies_array""&gt;    &lt;item&gt;Dave\'s Cabs&lt;/item&gt;    &lt;item&gt;Steve\'s Cabs&lt;/item&gt;    &lt;item&gt;Hannibal\'s Cabs&lt;/item&gt;    &lt;item&gt;Taxis Ltd&lt;/item&gt;    &lt;item&gt;Cabs London&lt;/item&gt;    &lt;item&gt;SwiftDrive Taxis Inx&lt;/item&gt;    &lt;item&gt;Cheap Cab Service&lt;/item&gt;    &lt;item&gt;Taxi Taxis&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name=""taxi_company_details""&gt;    &lt;item&gt;1 Taxi Street, TA8 1FE&lt;/item&gt;    &lt;item&gt;2 Taxi Street, TA8 1FE&lt;/item&gt;    &lt;item&gt;3 Taxi Street, TA8 1FE&lt;/item&gt;    &lt;item&gt;Monkey Taxis Ltd&lt;/item&gt;    &lt;item&gt;Smelly Cabs London&lt;/item&gt;    &lt;item&gt;SwiftDrive Taxis Inx&lt;/item&gt;    &lt;item&gt;Cheap Cab Service&lt;/item&gt;    &lt;item&gt;TaxiChimp Taxis&lt;/item&gt;&lt;/string-array&gt;</code></pre><p>This is an excerpt from my FindATaxi.java file:</p><pre><code>String longitude="" 51.53433"", latitude=""-0.469236"";mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings().setJavaScriptEnabled(true);//Build the URI + to concatenatemWebView.loadUrl(""http://maps.google.com/?saddr=""+longitude+"",""+latitude);    spinner = (Spinner) findViewById(R.id.spinner);    ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(this,    R.array.taxi_companies_array, android.R.layout.simple_spinner_item);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spinner.setAdapter(adapter);     spinner.setOnItemSelectedListener(this);     int id = FindATaxi.get(spinner.getSelectedItem());  }   private static int get(Object selectedItem) {  return 0; } public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos, long id) {   Toast.makeText(parent.getContext(), ""You have selected: "" +  spinner.getItemAtPosition(pos).toString(), Toast.LENGTH_LONG).show();  } public void onNothingSelected(AdapterView parent) {    // Do nothing.  } public Spinner spinner;</code></pre><p>...and finally, an excerpt from my find_a_taxi.xml file:</p><pre><code>&lt;Spinner     android:id=""@+id/spinner""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:prompt=""@string/choose_taxi_prompt""    android:layout_below=""@+id/text_view""/&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:layout_below=""@+id/spinner"" /&gt;</code></pre><p>Any help with this matter would be greatly appreciated.</p><p>Thank you for reading.</p>","575638","","575638","","2011-01-14 12:30:19","2011-01-14 12:30:19","Android: Update map from Spinner - Can This Be Done?","<android><arrays><map><spinner>","0","4","","",""
"4690930","1","","","2011-01-14 12:15:01","1","604","<p>I want to add Google Analytics referrals to multiple (dozens in fact) Android products from the same vendor. The Android Market Referral Tracking URL generator expects a single package name, say com.example.application, resulting in </p><blockquote>  <p><a href=""http://market.android.com/details?id=com.example.application&amp;referrer="" rel=""nofollow"">http://market.android.com/details?id=com.example.application&amp;referrer=</a>... </p></blockquote><p>However, I do not want to handle dozens of these URLs in my app, each one differing only in package name. Do referrals also pass on to the vendor if I use a Market search URL like </p><blockquote>  <p><a href=""http://market.android.com/search?q=%22UNIQUE%20VENDOR%20NAME%22&amp;referrer="" rel=""nofollow"">http://market.android.com/search?q=%22UNIQUE%20VENDOR%20NAME%22&amp;referrer=</a>... </p></blockquote><p>to find all products of that vendor? In that case I would need to use only a single referral URL for all (same-priced library) products of this vendor.</p><p>Your advice is much appreciated!</p><p>P.S. I had to add a few dummy spaces in the second example URL because new users may only post one hyperlink</p>","363550","","21234","","2011-01-14 12:42:36","2011-08-06 11:37:52","How to handle Android Market referral tracking for many packages from same vendor?","<android><google-analytics><google-play>","1","0","","",""
"4691006","1","4691826","","2011-01-14 12:27:03","1","649","<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/bkgrnd""&gt;    &lt;RelativeLayout        android:id=""@+id/RelativeLayout01""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        &gt;        &lt;ImageView            xmlns:android=""http://schemas.android.com/apk/res/android""            android:id=""@+id/ImageView_MenuHeader""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:src=""@drawable/logo""            android:layout_alignParentLeft=""true""            android:layout_alignParentTop=""true""&gt;&lt;/ImageView&gt;        &lt;TextView            android:id=""@+id/TextView01""            android:layout_height=""wrap_content""            android:text=""@string/admin""            android:textSize=""@dimen/screen_title_size""            android:shadowDx=""0""            android:shadowDy=""0""            android:shadowRadius=""10""            android:layout_width=""wrap_content""            android:layout_gravity=""fill_horizontal|center""            android:layout_alignParentTop=""true""            android:layout_centerHorizontal=""true""            android:shadowColor=""@android:color/white""            android:textColor=""@color/title_color""&gt;&lt;/TextView&gt;        &lt;ImageView            xmlns:android=""http://schemas.android.com/apk/res/android""            android:id=""@+id/ImageView_MenuHeader2""            android:layout_height=""wrap_content""            android:src=""@drawable/logo""            android:layout_gravity=""right|center_vertical""            android:layout_width=""wrap_content""            android:layout_alignParentRight=""true""            android:layout_alignParentTop=""true""&gt;&lt;/ImageView&gt;    &lt;/RelativeLayout&gt;        &lt;ScrollView        android:id=""@+id/ScrollView01""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:isScrollContainer=""true""        android:scrollbars=""vertical""        android:scrollbarAlwaysDrawVerticalTrack=""true""&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;Spinner                android:id=""@+id/Spinner_Table""                android:layout_height=""wrap_content""                android:layout_width=""fill_parent""                android:drawSelectorOnTop=""true""&gt;&lt;/Spinner&gt;             &lt;TextView                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textSize=""@dimen/help_text_size""                android:textStyle=""bold""                android:gravity=""center""                android:id=""@+id/Blank""&gt;&lt;/TextView&gt;            &lt;TextView                  android:id=""@+id/admintable""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;            &lt;/LinearLayout&gt;    &lt;/ScrollView&gt;    &lt;RelativeLayout            xmlns:android=""http://schemas.android.com/apk/res/android""            android:orientation=""vertical""            android:layout_width=""wrap_content""            android:layout_height=""fill_parent""&gt;               &lt;Button                 android:id=""@+id/Logout""                 android:text=""@string/Logout""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:layout_alignParentBottom=""true""&gt;&lt;/Button&gt;    &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt;</code></pre><p>All of the above xml is within a liner layout...The problem is when the text view admin table get written data too in the application there is a large amount of data shown...the data shows fine...however when the user scrolls to the bottom of the screen they should see the logout button, but it is not showing?</p>","569654","","1470567","","2012-07-19 15:47:29","2012-07-19 15:47:29","Android - XML button goes missing?","<android><xml><button>","2","0","","",""
"4691097","1","4691142","","2011-01-14 12:36:02","4","3505","<p>Hi i would like to know the minimum and maximum range of accelerometer in android.</p><p>i need it for x,y,z.</p><p>do any one have exact values of it?</p>","286831","","","","","2011-01-14 13:01:15","What is android accelerometer min and max range","<android><accelerometer>","2","0","","",""
"4691216","1","4691396","","2011-01-14 12:47:49","0","1725","<p>I'm passing some data between two activities but I'm getting a NullPointerException where I shouldn't...</p><p>I start the activity like this</p><pre><code>Intent i= new Intent(getApplicationContext(),     NewActivity.class);i.putExtra(SERVICE_ID, serviceId);i(serviceActivityIntent);</code></pre><p>And I try to get the serviceId on the other side in this fashion</p><pre><code>    protected void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);/* I also tried this just for in case my object was in the savedInstanceState */    //      mServiceId = (savedInstanceState == null) ? null//        : (GroupServiceId) savedInstanceState//          .getSerializable(ServicesActivity.SERVICE_ID);      if (mServiceId == null) {       Bundle extras = getIntent().getExtras();       mServiceId = extras != null ? (GroupServiceId) extras         .getSerializable(ServicesActivity.SERVICE_ID) : null;    // &lt;-- this is line 86      }</code></pre><p>I think I've done everything okay and I'm running out of clues here...Here's the exception I get:</p><pre><code>01-14 13:11:57.735: ERROR/AndroidRuntime(1019): FATAL EXCEPTION: main01-14 13:11:57.735: ERROR/AndroidRuntime(1019): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.pfc/org.pfc.NewActivity}: java.lang.NullPointerException01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2787)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2803)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at android.app.ActivityThread.access$2300(ActivityThread.java:135)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at android.os.Handler.dispatchMessage(Handler.java:99)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at android.os.Looper.loop(Looper.java:144)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at android.app.ActivityThread.main(ActivityThread.java:4937)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at java.lang.reflect.Method.invokeNative(Native Method)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at java.lang.reflect.Method.invoke(Method.java:521)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at dalvik.system.NativeStart.main(Native Method)01-14 13:11:57.735: ERROR/AndroidRuntime(1019): Caused by: java.lang.NullPointerException01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at org.smepp.datatypes.smm.GroupServiceId.readObject(GroupServiceId.java:105)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at java.lang.reflect.Method.invokeNative(Native Method)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at java.lang.reflect.Method.invoke(Method.java:521)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at java.io.ObjectInputStream.readObjectForClass(ObjectInputStream.java:1537)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at java.io.ObjectInputStream.readHierarchy(ObjectInputStream.java:1460)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2139)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:929)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2285)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2240)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at android.os.Parcel.readSerializable(Parcel.java:1945)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at android.os.Parcel.readValue(Parcel.java:1822)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at android.os.Parcel.readMapInternal(Parcel.java:2008)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at android.os.Bundle.unparcel(Bundle.java:208)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at android.os.Bundle.getSerializable(Bundle.java:1189)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at org.pfc.NewActivity.onCreate(NewActivity.java:86)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2751)01-14 13:11:57.735: ERROR/AndroidRuntime(1019):     ... 11 more</code></pre><p>Obviously, the object ""extras"" from the intent is null when the second activity starts, but I keep wondering why...</p><p>By the way, GroupServiceId implements Serializable so that's not the problem, or I think so...</p><p>Thanks</p>","483362","","","","","2011-01-14 13:12:46","getExtras method retrieves a null object when I passed it correctly","<android><android-intent><bundle>","2","0","","",""
"4691235","1","4733938","","2011-01-14 12:49:27","1","4021","<pre><code>DisplayMetrics displaymetrics = new DisplayMetrics();getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);height = displaymetrics.heightPixels;width = displaymetrics.widthPixels;Log.e(""FirstImage"", ""Width = ""+width+""Height = ""+height);</code></pre><p>The above was the code I have used to display the screen size.. but the problem is I am getting <code>width=320</code> and <code>height=569</code>. But I am using motorola milestone with screen size <code>480x854</code></p><p>How can I get the correct size?</p>","550796","","17413","","2011-04-09 15:12:39","2011-04-09 15:12:39","android problem in getting the screen resolution size","<android><screen>","4","2","","",""
"4691297","1","4721460","","2011-01-14 12:57:22","0","853","<p>I have tried with following code , but its not working </p><pre><code>File file= new File(filename);byte[] data = new byte[(int) file.length()];FileInputStream fileInputStream = new FileInputStream(file);URL url = new URL(""http://www.example.com/resource"");HttpClient client = new DefaultHttpClient();HttpPut put= new HttpPut(url);for (int i = 0; i  pairs = new ArrayList();pairs.add(new BasicNameValuePair(""Data"", data));put.setEntity(new UrlEncodedFormEntity(pairs));HttpResponse response = client.execute(put);</code></pre><p>I could not able to PUT the data on the server I have also tried with HttpsURLConnection but its getting uploaded.</p>","526359","","526359","","2011-01-18 06:03:20","2011-01-18 07:24:02","how to httpput the image on a remote server from android","<java><android><image><http>","1","2","","",""
"4691422","1","","","2011-01-14 13:15:59","0","226","<p>I have downloaded facebook sdk from git repositry. When i try to execute the two samples given in the git repositry i got error <strong>Login Failed : Server Failed to Communicate</strong>. I also register my application in facebook i got facebook application id and key hash also.                                               </p>","523480","","638471","","2013-12-18 10:18:31","2013-12-18 10:18:31","Android Facebook SDK: Login Failed","<android><facebook>","0","2","","",""
"4691439","1","","","2011-01-14 13:18:28","9","1709","<p>Has anyone tried developing an Android app using Ruby? If so, which tool would you recommend? What are the advantages and disadvantages, comparing (between) both?</p><p>Any sharing of experience, insight, etc., would be much appreciated.</p>","38515","","104223","","2013-07-03 17:35:13","2013-07-03 17:35:13","ruby on android : ruboto vs rhodes?","<android><jruby><rhodes><ruboto><mirah>","2","0","2","",""
"4691510","1","4691724","","2011-01-14 13:27:36","12","9509","<p>I have a ListView in my Layout.</p><pre><code>    &lt;ListView         android:id=""@+id/list_infoitems""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""/&gt;</code></pre><p>Every list item layout looks like:</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""    android:background=""@drawable/selector_custombutton""    android:padding=""10dp""    android:layout_gravity=""center""&gt;    &lt;TextView        android:id=""@+id/text_history_station_name""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:gravity=""center_vertical|left""        android:textColor=""@color/rnv_blue_540c""/&gt;    &lt;TextView        android:id=""@+id/text_history_line_id""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:gravity=""center_vertical|left""        android:textColor=""@color/rnv_blue_540c""/&gt;      &lt;/LinearLayout&gt;</code></pre><p>I want to have a distance between all item. For that I'v played with android:margin property, but without success.</p><p>Does anybody know, how to change the distance between item in a listview.</p><p>Thank you,</p><p>Mur</p>","408780","","","","","2012-10-02 07:44:36","Distance between items in a Listview","<android><view><draw>","4","2","2","",""
"4691640","1","","","2011-01-14 13:44:35","0","315","<p>I'm trying to implement a search fonctionality in my android app. With my app :</p><ol><li>I click on the standard search button. </li><li>I    see the standard search dialog with    my icon app.</li><li>I see my list of suggests items appwhen I type something in the searchfield.</li><li>When I choose a suggest, somethingcall the <em>onNewIntent</em> of my standardactivity, but the intent is*Intent.ACTION_VIEW*, not*Intent.ACTION_SEARCH*, as I hope ??</li></ol><p>I'm losted If it's ok to receive ACTION_VIEW, how I retreive the item searched ? If it's not ok, why ?</p>","312025","","","","","2011-01-14 13:46:25","I search, but I don't receive a Intent.ACTION_SEARCH event","<android>","1","0","","",""
"4691706","1","4693525","","2011-01-14 13:50:21","5","8709","<p>I have a list of longitude and longitude points in an xml file that is used throughout my application. I find my self repeating this code to get points often and think there must be a better way?</p><pre><code>    String[] mTempArray = getResources().getStringArray(R.array.stations);    int len = mTempArray.length;    mStationArray = new ArrayList&lt;Station&gt;();    for(int i = 0; i &lt; len; i++){        Station s = new Station();        String[] fields = mTempArray[i].split(""[\t ]"");        s.setValuesFromArray(fields);        Log.i(""ADD STATION"", """"+s);        mStationArray.add(s);    }</code></pre><p>XML is in the format of:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;array name=""stations""&gt;        &lt;item&gt;            &lt;name&gt;Station name&lt;/name&gt;            &lt;longitude&gt;1111111&lt;/longitude&gt;            &lt;latitude&gt;11111&lt;/latitude&gt;            &lt;code&gt;1&lt;/code&gt;        &lt;/item&gt;</code></pre><p>And another (possible) problem is that to get just one station I have to get all of them and pull the one I want from the array. Is this going to be considerably slower? Can I make this array consistent throughout the app? (But keeping the separate Intent methodology)</p>","373712","","","","","2011-01-14 16:45:06","Java/Android get array from xml","<java><android><xml>","3","0","","",""
"4691788","1","4691865","","2011-01-14 13:56:57","0","1198","<p>How do I implement an <code>onMenuItemClickListener</code>?</p><pre><code>@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    super.onCreateOptionsMenu(menu);    getMenuInflater().inflate(R.menu.gameoptions, menu);    menu.findItem(R.id.menu_item).setIntent(new Intent(this, QMenuActivity.class));    menu.findItem(R.id.back_item).setOnMenuItemClickListener;    return true;}</code></pre><p>I want the back_item once clicked on to call a function within the page, how do I do it?</p>","569654","","1554296","","2014-03-27 10:24:09","2014-03-27 10:24:09","How to implement a onMenuItemClickListener in android","<android>","3","1","","",""
"4691885","1","","","2011-01-14 14:08:10","6","2935","<p>I want to develop an application which runs on iPhone / Android / Windows Phone 7 smartphones and is able to recognize a marker and place augmented reality content on it.</p><p>Is there any common framework which I could use for that task?</p>","499910","","19679","","2011-01-14 15:33:43","2011-11-01 00:24:39","Is there an augmented reality framework that works on iPhone, Android, and Windows Phone 7?","<iphone><android><windows-phone-7><augmented-reality>","4","1","6","",""
"4691924","1","4691961","","2011-01-14 14:13:05","4","7772","<p>i would like to parse out some text from a page.</p><p>Is there an easy way to save the product info in to a string for example? Example url: <a href=""http://upcdata.info/upc/7310870008741"" rel=""nofollow"">http://upcdata.info/upc/7310870008741</a></p><p>Thanks</p>","557187","","","","","2012-03-03 17:21:38","android: parse html from page","<android>","3","0","1","",""
"4692104","1","4693536","","2011-01-14 14:31:36","1","229","<p>I am considering to use CBC to encrypt a block of data. Dose it make a sense to use CBC if the data to be encrypted is smaller than 2 blocks ? For example data block size for AES is 128 bits, and total data to be encrypted is less than 256 bits.</p><p>I appreciate your inputs.</p>","575783","","183528","","2011-01-14 16:47:43","2011-01-14 16:47:43","Please comment on data size of cipher block chaining (CBC) in symmetric encryption","<java><android><security><encryption><cryptography>","1","0","","",""
"4692123","1","","","2011-01-14 14:33:16","0","281","<p>I've just written my first android-app (https://sourceforge.net/projects/cashcontroll/).It's a little budget-control tool to control my expenses.</p><p>Everything works fine. Because of the fact that this is quit important data for me I've created a backup function where the whole db-file is stored to the sd card.</p><p>And now the weird thing happens:With my first android (htc desire , android 2.2 Build 2.29) )I can make a backup, transfer it to the pc an analize it with a db tool like navicat. I can also change it an dump it back to the sd card an import it afterwards into my app.</p><p>When I then copy the same file to the sd card of my second android (htc desire hd, android 2.29) I can also import it an use it in my app.As soon as I do a backup on my second android I can't read the database in any other tool (e.g. navicat oder my first android). It can be used in the original device (my second mobile) though.I can also open it with a text editor (e.g nano) but nothing else.</p><p>Any idea?</p><p>Thanks for your help</p><p>Ueli</p>","575788","","35060","","2011-01-14 14:52:31","2011-03-30 13:34:59","Unreadable sqlite3 file","<android><sqlite>","1","2","","",""
"4692345","1","","","2011-01-14 14:56:29","1","1206","<p>I am very new to developping Android application and I am facing adifficulty.</p><p>What I want to do is to use a specific keyboard when I click on an<code>EditText</code>. So far, I have found the <code>Keyboard</code> and <code>KeyboardView</code>classes but I haven't succeeded to do what I want yet.</p><p>Here is the description of where I am :</p><ul><li>I have described my keyboard in a XML file,</li><li>I create a ""KeyboardView"" object,</li><li>I initialize it with <code>clavier=new KeyboardView(activité,(AttributeSet)findViewById(R.xml.clavier_numerique));</code></li><li>but I don't know how to replace the standard keyboard with thiscustomized keyboard.</li></ul><p>Am I doing something wrong? What else should I do?</p><p>Thanks in advance for the time you will spend trying to help me. </p>","575810","","503900","","2011-04-01 15:44:30","2012-05-11 12:06:56","Customized keyboard","<android>","3","0","0","",""
"4692443","1","4692492","","2011-01-14 15:07:46","1","661","<p>friends,</p><p>i want to restrict "" character in android EditText any one guide me how to achieve this in java code?</p>","249991","","255905","","2011-01-14 15:10:31","2011-01-14 16:28:21","How to restrict Single Quote in android EditText?","<java><android>","4","0","","",""
"4692572","1","7060232","","2011-01-14 15:19:31","4","2959","<p>On Android 2.2+ there is something called <a href=""http://developer.android.com/reference/android/media/SoundPool.OnLoadCompleteListener.html"" rel=""nofollow"">SoundPool.OnLoadCompleteListener</a> allowing to know whether a sound has been loaded successfully or not.</p><p>I am targeting lower API version (ideally 1.6 but could go for 2.1) and I need to know whether a sound has been loaded correctly (as it is selected by the user). What's the proper way to do it? </p><p>I hope not load the sound once with MediaPlayer and if correct with SoundPool?!</p>","490961","","490961","","2011-01-14 15:25:08","2011-08-14 22:43:19","Knowing if the loading of a sound with SoundPool has been successful on Android 1.6/2.0/2.1","<android><soundpool>","2","1","1","",""
"4692642","1","4692899","","2011-01-14 15:26:40","60","55682","<p>I made a button that changes the background drawable on different states, this way:</p><pre><code> &lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt; &lt;item android:state_pressed=""true"" android:drawable=""@drawable/btn_location_pressed"" /&gt; &lt;!-- pressed --&gt; &lt;item android:state_focused=""true"" android:drawable=""@drawable/btn_location_pressed""/&gt; &lt;!-- focused --&gt; &lt;item android:drawable=""@drawable/btn_location""/&gt; &lt;!-- default --&gt;</code></pre><p></p><p>The problem here is that I'm also trying to change the textColor as I do with the drawable but I'm not being able to. I already tried android:textColor and android:color but the first doesn't work whilst the seconds changes my background.</p><p>The next code is part of my layout. Regarding to the text color it only works for the normal state text color, thus not changing it to the white one while pressed</p><pre><code>&lt;Button android:id=""@+id/location_name""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:paddingTop=""5dp""        android:background=""@drawable/location""                  android:textSize=""15sp""        android:textColor=""@color/location_color""        android:textColorHighlight=""#FFFFFF""   /&gt;</code></pre><p>Has anybody got a clue?</p><p>ty! :)</p>","508479","","2065587","","2013-09-17 11:26:44","2013-09-17 11:26:44","Android customized button; changing text color","<android><android-button><android-selector>","2","0","31","",""
"4692740","1","4692792","","2011-01-14 15:34:07","0","118","<p>I have an activity, that has in manifest:</p><pre><code>android:theme=""@android:style/Theme.Dialog""</code></pre><p>When I start it, it looks like an activity, but when I close it it fires the onResume on the activity that started it. A real dialog will not do it.How can I avoid the onResume?</p>","380490","","","","","2011-11-26 20:24:04","Activity act as REAL dialog","<android><dialog><onresume>","2","0","","",""
"4692776","1","4692948","","2011-01-14 15:37:16","0","682","<p>I have a strange situation I am seeing.</p><p>I am reading some info from a database , then bringing up a dialog :PSEUDO</p><pre><code> val = DBaseManager.readValue(i,POS_ONE); if(val == 1) {   Dialog_Test myDialog = new    Dialog_Test (myContext,"""",new addListener(),DBaseManager);   myDialog.show(); }</code></pre><p>as you can see I pass into the Dialog the DBaseManager so it can use it also.</p><p>then in there I use it like this :</p><pre><code>DBaseManager.readValue(k,POS_TWO);</code></pre><p>etc.</p><p>Now this works 99% of the time, however I have had some crash logs pointing to these lines in the dialog with null pointer exceptions.</p><p>To me this is indicating that on some devices my onPause or OnDestory methods are being called in the main activity which closes and nulls DBaseManager. These are 1.6, 2.2 and 2.3 devices.</p><p>So the question is why , and how to prevent ? I have added some null pointer checks in to prevent the crashes but it still far from ideal.</p><p>UPDATE: On my devices at least when I do a screen rotate the activity is restarted and the dialog disappears - could it be on some the dialogs remains up???</p>","507991","","473070","","2011-01-14 16:08:19","2011-01-14 16:08:19","Android: Activity closing when in dialog","<android><dialog><activity>","1","0","","",""
"4692852","1","","","2011-01-14 15:44:56","6","43652","<p>I am new to android development.</p><p>Have tried a couple times downloading the Android SDK and ADT plugin for Eclipse</p><p>In the Android SDK and AVD manager load fine but will not load any available packages.Show:- Android Repository--""Some packages were found but are not compatible updates""</p><p>In the installed it shows 1.5 to 2.3 SDK platforms.</p><p>How to I get them available.</p><p>Appreciate help.</p><p>Thanks,</p><p>Alex</p>","575858","","21234","","2011-01-14 15:51:29","2013-12-09 11:36:47","Android SDK and AVD Manager installation","<android><eclipse>","4","0","","",""
"4692913","1","4694359","","2011-01-14 15:51:29","2","376","<p><b>TOPIC Solved: Answer below.</b></p><p>Some users have been reporting border alignment issues on some android components such as the alert popup or the editTexts. This is happening on the Samsung Galaxy Apollo (200x400) and the HTC Pro Touch (480x640) devices. I cannot replicate that because i don't own those devices and in the Samsung Galaxy S and emulator everything looks just right.</p><p>I think that the problem is the dpi or resolution of the device (because the edittext background is a single .9.png so image should look ok); however I am not sure if the <b>supports-screens</b> tag is the solution. Also, application was developed using Api 3 (v1.5) and <b>supports-screens</b> was not yet supported, nor the screen-size resource qualifier.</p><p>The style used for the alerts and editText is the phone default. Could the problem be something related with the theme applied to the phone by the user?</p><p>Thanks in advance!, I show some images given to me showing the problem:</p><p><img src=""http://i.stack.imgur.com/nDpBV.png"" alt=""borders issue link img""></p>","505152","","505152","","2011-01-14 18:08:12","2011-09-12 18:12:56","Android views' borders issue on some devices","<android><border><edittext><alertdialog>","3","0","1","",""
"4692988","1","4695402","","2011-01-14 15:58:27","2","2533","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2220560/can-an-android-toast-be-longer-than-toast-length-long"">Can an Android Toast be longer than &ldquo;Toast.LENGTH_LONG&rdquo;?</a>  </p></blockquote><p>Is there a way to make Toast messages last longer than Toast.LENGTH_LONG.  I don't feel this length of time is quite long enough for the user to read the notification I'm displaying.</p>","406790","","","","","2011-11-06 17:08:15","Toast message length","<android><toast>","1","9","","2012-07-12 12:06:58",""
"4693085","1","4693143","","2011-01-14 16:08:23","0","326","<p>I can not able to understand this sentence in android documention. Since it is saying </p><blockquote>  <p>When the screen orientation changes the system will, by default, <strong>destroy the current activity.</strong></p></blockquote><p>and it also saying </p><blockquote>  <p>create a new one while <strong>preserving its state.</strong></p></blockquote><p>but actully it is contrary. How could it be? Can anybody explan to me.</p>","484073","","","","","2011-01-14 16:13:02","When the screen orientation changes the system will, by default, destroy the current activity and create a new one while preserving its state","<android>","1","0","","",""
"4693096","1","","","2011-01-14 16:09:06","0","1889","<p>Anybody made this successfully? I'm trying connect two styles to get fullscreen activity with transparent background... Unfortunately it's not so easy as should be. Any idea?</p>","575874","","","","","2011-01-14 17:48:27","Mixing Android style: Transparent and Fullscreen","<android><activity><fullscreen><transparent>","1","0","","",""
"4693103","1","4693231","","2011-01-14 16:09:17","2","397","<p>I found a nice feature in Dolphin browser that brings another window from the side on a side-swipe. It's like the window is connected and revealed by swipe. See image below. Anyone knows how it is done?<img src=""http://i.stack.imgur.com/OGxBK.png"" alt=""alt text""></p>","380490","","","","","2011-01-14 23:26:36","How to have a Side window","<android><layout>","1","3","","",""
"4693331","1","4693971","","2011-01-14 16:29:00","3","3498","<p>I am nearing completion of a project I am working on using Android, but ran into a little bump in the road when we got a new device to test our application with.</p><p>I am programming using Android 1.6 and my two devices are:</p><p>HTC Incredible - Verizon (Android 2.2)<br>Samsung Galaxy S - T-Mobile (Android 2.1 update 1)</p><p>One part of the application allows the user to select a recorded audio file using: </p><pre><code>// Select a recordingi = new Intent();           i.setAction(Intent.ACTION_GET_CONTENT);i.setType(""audio/*"");startActivityForResult(Intent.createChooser(i, ""Select audio file""), Enums.REQUEST_CODE_SELECT_ATTACHMENT);</code></pre><p>And will call onActivityResult after the selection is made.</p><pre><code>if (resultCode == RESULT_OK &amp;&amp; Enums.REQUEST_CODE_SELECT_ATTACHMENT == requestCode)) {    // do something here}else{    //ResultCode comes back as RESULT_CANCELED}</code></pre><p>This works fine on the device I programmed my original application on (HTC Incredible - Verizon).</p><p>However, when using the Samsung Galaxy S (T-Mobile), the first select dialog opens (Music Player | Voice Recorder) but from there nothing really works.</p><p>If I select Music Player, none of my recordings are listed (on HTC, I can pick my recordings or music tracks that shipped with my phone).</p><p>If I select Voice Recorder, it returns to my onActivityResult method with result code RESULT_CANCELED and displays a toast message saying ""Message file limit reached"".</p><p>Can anyone give some insight on this? Any help will be greatly appreciated!</p><p>Thanks!</p>","575820","","","","","2011-08-12 00:05:58","Selecting Audio Files Using Intent.createChooser not working with all phones","<android>","1","0","1","",""
"4693387","1","4695567","","2011-01-14 16:33:26","15","7713","<p>Looking at the <a href=""http://developer.android.com/reference/android/content/SharedPreferences.html"">SharedPreferences docs</a> it says: </p><blockquote>  <p>""Note: currently this class does not  support use across multiple processes.  This will be added later.""</p></blockquote><p>So in and of itself it doesn't appear to be Thread Safe. However, what kind of guarantees are made in regards to commit() and apply()?</p><p>For example:</p><pre><code>synchronized(uniqueIdLock){   uniqueId = sharedPreferences.getInt(""UNIQUE_INCREMENTING_ID"", 0);   uniqueId++;   sharedPreferences.edit().putInt(""UNIQUE_INCREMENTING_ID"", uniqueId).commit();}</code></pre><p>Would it be guaranteed that the uniqueId was always unique in this case?</p><p>If not, is there a better way to keep track of a unique id for an application that persists?</p>","445348","","445348","","2013-02-07 16:55:08","2013-02-08 07:41:39","SharedPreferences and Thread Safety","<android><thread-safety><sharedpreferences>","4","3","4","",""
"4693683","1","4694195","","2011-01-14 16:58:04","1","1283","<p>Can a WebView in Android support embedded Flash files?  </p><p>Using the default insert method of Dreamweaver, incorporating the swfobject_modified.js, I receive the standard ""Content on this page requires a newer version of Adobe Flash Player.""  If I attempt to add the file with a simple object/embed tag, I receive nothing.  What does WebView require to embed flash?  Thanks! </p>","518116","","190309","","2013-11-05 02:20:59","2013-11-05 02:20:59","Android WebView + Does it support embedded Flash files?","<android><flash><webview><embed>","1","0","1","",""
"4693694","1","6803540","","2011-01-14 16:58:46","0","4027","<p>When I try to debug an Android app with NetBeans and the nbandroid plugin, it starts the emulator, and eventually when the emulator comes up it says</p><blockquote>  <p><strong>Waiting For Debugger</strong><br>  Application [app name] ([package name]) is waiting for the debugger to attach.</p></blockquote><p>and I get a Force Close button.</p><p>Here is the log from DDMS.</p><pre><code>01-14 11:44:46.131: INFO/ActivityManager(85): Force stopping package [packagename] uid=-101-14 11:44:46.131: INFO/ActivityManager(85): Starting activity: Intent { flg=0x10000000 cmp=[packagename]/.[activityclassname] }01-14 11:44:46.311: DEBUG/AndroidRuntime(420): Shutting down VM01-14 11:44:46.331: DEBUG/jdwp(420): adbd disconnected01-14 11:44:46.371: INFO/AndroidRuntime(420): NOTE: attach of thread 'Binder Thread #3' failed01-14 11:44:46.411: INFO/ActivityManager(85): Start proc [packagename] for activity [packagename]/.[activityclassname]: pid=427 uid=10032 gids={3003}01-14 11:44:47.200: WARN/ActivityThread(427): Application [packagename] is waiting for the debugger on port 8100...01-14 11:44:47.231: INFO/System.out(427): Sending WAIT chunk01-14 11:44:50.280: DEBUG/SntpClient(85): request time failed: java.net.SocketException: Address family not supported by protocol01-14 11:44:56.253: WARN/ActivityManager(85): Launch timeout has expired, giving up wake lock!01-14 11:44:57.003: WARN/ActivityManager(85): Activity idle timeout for HistoryRecord{43f85578 [packagename]/.[activityclassname]}01-14 11:45:05.350: DEBUG/dalvikvm(166): GC_EXPLICIT freed 595 objects / 29656 bytes in 120ms01-14 11:45:10.320: DEBUG/dalvikvm(228): GC_EXPLICIT freed 190 objects / 13056 bytes in 92ms01-14 11:45:15.331: DEBUG/dalvikvm(304): GC_EXPLICIT freed 277 objects / 13112 bytes in 92ms01-14 11:45:20.401: DEBUG/dalvikvm(162): GC_EXPLICIT freed 586 objects / 32240 bytes in 109ms01-14 11:47:05.161: DEBUG/dalvikvm(162): GC_EXPLICIT freed 49 objects / 2704 bytes in 93ms01-14 11:49:05.201: DEBUG/dalvikvm(162): GC_EXPLICIT freed 15 objects / 600 bytes in 130ms01-14 11:49:47.595: INFO/jdwp(85): Ignoring second debugger -- accepting and dropping01-14 11:49:47.710: INFO/jdwp(155): Ignoring second debugger -- accepting and dropping01-14 11:49:47.740: INFO/jdwp(160): Ignoring second debugger -- accepting and dropping01-14 11:49:47.750: INFO/jdwp(162): Ignoring second debugger -- accepting and dropping01-14 11:49:47.772: INFO/jdwp(166): Ignoring second debugger -- accepting and dropping01-14 11:49:47.810: INFO/jdwp(194): Ignoring second debugger -- accepting and dropping01-14 11:49:47.820: INFO/jdwp(224): Ignoring second debugger -- accepting and dropping01-14 11:49:47.861: INFO/jdwp(228): Ignoring second debugger -- accepting and dropping01-14 11:49:47.872: INFO/jdwp(242): Ignoring second debugger -- accepting and dropping01-14 11:49:47.880: INFO/jdwp(271): Ignoring second debugger -- accepting and dropping01-14 11:49:47.980: INFO/jdwp(427): Ignoring second debugger -- accepting and dropping01-14 11:49:47.980: INFO/jdwp(304): Ignoring second debugger -- accepting and dropping01-14 11:49:47.980: INFO/jdwp(337): Ignoring second debugger -- accepting and dropping01-14 11:49:48.020: INFO/jdwp(293): Ignoring second debugger -- accepting and dropping01-14 11:49:50.290: DEBUG/SntpClient(85): request time failed: java.net.SocketException: Address family not supported by protocol01-14 11:50:10.970: DEBUG/Email(271): *** synchronizeMailboxGeneric ***01-14 11:50:11.250: DEBUG/dalvikvm(271): GC_FOR_MALLOC freed 9369 objects / 455104 bytes in 126ms01-14 11:51:05.171: DEBUG/dalvikvm(162): GC_EXPLICIT freed 15 objects / 600 bytes in 90ms01-14 11:53:05.180: DEBUG/dalvikvm(162): GC_EXPLICIT freed 15 objects / 600 bytes in 95ms01-14 11:54:50.293: DEBUG/SntpClient(85): request time failed: java.net.SocketException: Address family not supported by protocol</code></pre><p>Here is the NetBeans ant log</p><pre><code>init:deps-jar:Compiling 1 source file to C:\[apppath]\build\classescompile:Updating zip: C:\[apppath]\dist\[appname].apk_THIS TOOL IS DEPRECATED. See --help for more information.Deleting: C:\[appdir]\dist\[appname].apk_Deleting: C:\[apppath]\dist\[appname].apk__Building zip: C:\[apppath].zipjar:        pkg: /data/local/tmp/[appname].apkSuccess569 KB/s (275945 bytes in 0.473s)About to start [packagename]/[packagename].[activityclassname]Starting: Intent { cmp=[packagenamel]/.[activityclassname] }</code></pre><p>NetBeans tells me the process is still running and gives me a stop button to 'kill' if I want.</p><p>Also my CPU and disk are mostly idle.</p>","463304","","","","","2011-07-23 21:53:00","Waiting For Debugger on Android using NetBeans","<android><debugging><netbeans><hang>","3","0","0","",""
"4693710","1","4694533","","2011-01-14 17:00:10","1","822","<p>I have to get an HTTP request like this:</p><pre><code>http://www.aroundertouch.com/queriesandroid1dot0/project/idProjet/45.484171;;9.050393;;Rotondi Group S.R.L. - Costruzione Macchine Abbigliamento/iphone/354781043339495/lang/en_US</code></pre><p>With this code:</p><pre><code>url = new URL(query);   Log.d(TAG,url.toString());      connection = url.openConnection();      httpConnection = (HttpURLConnection)connection;       int responseCode = httpConnection.getResponseCode();       // HTTP status okay      if (responseCode == HttpURLConnection.HTTP_OK) {        // preparo stream        in = httpConnection.getInputStream();       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();       DocumentBuilder db = dbf.newDocumentBuilder();       dom = db.parse(in);            }      // HTTP status fail       else{       throw new Exception(""responseCode != 200 OK in ""+query);      }      in.close();      httpConnection.disconnect();      _ret = parseXML(dom);</code></pre><p>I meet this exception and I suspect that it is caused by an not encoded URL, how can I encode my URL? It isn't automatically encoded by HTTPURLConnection?Excpetion:</p><pre><code>D/dalvikvm(10100): GC freed 3447 objects / 513168 bytes in 47msW/System.err(10100): org.xml.sax.SAXParseException: Unexpected end of documentW/System.err(10100):    at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:129)W/System.err(10100):    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:157)W/System.err(10100):    at granet.arounder.webservice.ThreadDatiCard.doInBackground(ThreadDatiCard.java:76)W/System.err(10100):    at granet.arounder.webservice.ThreadDatiCard.doInBackground(ThreadDatiCard.java:1)W/System.err(10100):    at android.os.AsyncTask$2.call(AsyncTask.java:185)W/System.err(10100):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)W/System.err(10100):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)W/System.err(10100):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)W/System.err(10100):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)W/System.err(10100):    at java.lang.Thread.run(Thread.java:1096)</code></pre><p>Thanks a lot.</p>","554892","","554892","","2011-01-14 17:07:41","2011-01-14 18:27:05","HTTP Request fail","<android>","1","0","0","",""
"4693853","1","","","2011-01-14 17:13:47","1","511","<p>I have an application whose orientation is hard coded to landscape in the Manifest file.When the user presses options/menu on the application, the application launches a gridview/listview (depending on the option clicked). This works very well in the landscape mode.However, I run into problems if I want to change the UI when the user views the application in portrait mode.No matter what the mode the phone is in, the UIs are always displayed in landscape. (Because of the setting in the Manifest file).I tried doing a rotate animation (90 degrees), but that causes problems. For the list view, the scrolling does not work properly after the animation, and for the grid view, the clicks on the grid view elements correspond to the older layout (landscape) and not the newer one (after rotate animation).Has anyone encountered this problem before? Any suggestions would be most welcome. </p>","458942","","21234","","2011-01-14 17:21:17","2011-01-21 20:54:37","How to rotate views to portrait mode?","<android><screen-orientation>","1","1","","",""
"4693871","1","4693920","","2011-01-14 17:16:39","0","109","<p>Is there a way to make an android app where: When the phone is idle, the phone wakes up for a minute, connects to a bluetooth device, receives/sends information to the device, processes some information and then goes back to idle mode (both cpu and the bluetooth radio shuts off), repeating this process every 20 mins?</p>","377337","","319618","","2011-01-14 17:23:45","2011-01-14 17:40:13","Connect via Bluetooth every 20 minutes","<android><bluetooth><scheduling>","1","2","","",""
"4693890","1","4694164","","2011-01-14 17:18:23","0","2876","<p>Does anyone know how to make a floating menu like the ones in Angry Birds home screen? </p><p>Here is a picture showing the menu buttons in collapsed mode (gear, up buttons). On tapping these buttons, the actual menu would expand, showing two or more round buttons.</p><p><img src=""http://i.stack.imgur.com/KAtcI.jpg"" alt=""alt text""></p><p>Any links, clues is much appreciated. </p>","547491","","319618","","2011-01-14 17:19:53","2011-06-02 13:08:43","Angry birds like Floating menu on Android","<android>","4","0","3","",""
"4693943","1","4694546","","2011-01-14 17:23:39","1","979","<p>I have a Service that can be stopped in multiple ways. Whenever I call stopService(Intent), I pass an intent with some extras. How do you retrieve those extras?</p><p>Thanks.</p>","354607","","","","","2012-12-25 20:34:05","stopService(intent_with_extras) - how do you read those extras from within the service to stop?","<android><service><android-intent>","5","0","1","",""
"4693965","1","","","2011-01-14 17:26:54","1","1176","<p>When I update some applications, I see some show ""Manual update"". I believe this will force uninstall of old version first and the installs fresh.1. Is it true?2. How do I FORCE uninstall of new version (with all preferences etc.), and install the new version fresh?</p>","380490","","","","","2011-01-14 17:46:35","How do I force uninstall first?","<android><install>","1","0","","",""
"4694162","1","7318132","","2011-01-14 17:47:10","0","220","<p>i have the following code. Problem is, when i click on the notification bar (when app launched i see the <em>Text inside: By Firstdroid.com</em> text, but nothing else, even if i click on the bar.</p><pre><code>  NotificationManager mNotManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);    String MyText = ""Text inside: By Firstdroid.com"";    Notification mNotification = new Notification(           R.drawable.icon,                // An Icon to display           MyText,                         // the text to display in the ticker           System.currentTimeMillis()       ); // the time for the notification    mNotification.defaults |= Notification.DEFAULT_SOUND;    String MyNotifyTitle = ""Firstdroid Rocks!!!"";    String MyNotifiyText  = ""Firstdroid: our forum at www.firstdroid.com"";    Intent MyIntent = new Intent( getApplicationContext(), HelloAndroid2.class );    MyIntent.putExtra(""extendedTitle"", MyNotifyTitle);    MyIntent.putExtra(""extendedText"" , MyNotifiyText);    PendingIntent StartIntent = PendingIntent.getActivity(getApplicationContext(),0,MyIntent,PendingIntent.FLAG_CANCEL_CURRENT);    mNotification.setLatestEventInfo(   getApplicationContext(),            MyNotifyTitle,            MyNotifiyText,            StartIntent);    /* Sent Notification to notification bar */    mNotManager.notify(  SIMPLE_NOTIFICATION_ID , mNotification );  </code></pre>","571648","","","","","2011-09-06 10:02:55","Android Notification not workng","<android><notifications>","1","2","","",""
"4694176","1","4694407","","2011-01-14 17:48:19","4","330","<p>Im trying to figure out how to see when a MotionEvent is done with an event (i.e, the user has pressed on the screen, dragged around, and took their finger off the screen). In the Docs i only see getEventTime to generate when the event started, but theres no mention on how to figure out when it finished. Any ideas?</p>","385051","","","","","2011-01-14 18:11:45","finding out when a MotionEvent has finished","<android><ontouchevent>","1","0","","",""
"4694259","1","","","2011-01-14 17:56:46","1","139","<p>looking for a mobile + web project management tool.</p>","105261","","","","","2011-01-14 17:56:46","web+android project managment apps","<android><web-applications>","0","1","1","2011-01-14 18:39:50",""
"4694317","1","4695131","","2011-01-14 18:02:33","0","903","<p>yesterday I posted this question and got answer, and was able to do what I wanted.</p><p><a href=""http://stackoverflow.com/questions/4687124/multiple-spinner-but-one-in-xml"">multiple spinner but one in xml</a> </p><p>but now the question is how to get each spinner from listView's row and do stuff with it?</p><p>in my code i have only injected String as a name to listAdapter?</p><pre><code> ListView listView = (ListView) viewTxting.findViewById(R.id.ListViewTreeView); for (int i = 0; i &lt; names.size(); i++) {     listAdapter.add(names.get(i)); } listView.setAdapter(listAdapter);</code></pre><p>thanks in advance.</p>","536853","","234039","","2011-01-14 19:30:30","2011-01-14 23:03:19","how to get component from listView?","<android><listview><spinner>","1","0","","",""
"4694452","1","","","2011-01-14 18:15:36","2","3700","<p>I am using the code provided at the following URL to try to work with the Android Camera API:</p><p><a href=""http://marakana.com/forums/android/examples/39.html"" rel=""nofollow"">http://marakana.com/forums/android/examples/39.html</a></p><p>This has raised several questions that I have tried in vain to find the answers to so far.</p><p>1) My application needs to be in portrait orientation, but all the code examples I have seen (included that at the URL mentioned above) all seem to depend on landscape orientation. In fact, no matter what I have tried so far, it seems that landscape is inescapable. I have tried forcing the parameters in <code>surfaceCreated(...)</code> like so:</p><pre><code>Camera.Parameters parameters = camera.getParameters();parameters.set(""orientation"", ""portrait"");parameters.set(""rotation"", ""90"");camera.setParameters(parameters);</code></pre><p>I have tried doing the same thing in <code>surfaceChanged(...)</code>. Of course, I am also setting my orientation to portrait in the manifest as follows:</p><pre><code>android:screenOrientation=""portrait""</code></pre><p>Does anyone have any suggestions on what I'm doing wrong and how to fix it?</p><p>2) Another question I have has to do with releasing the camera resources. In the code from the article referenced above, the following are called in the <code>surfaceDestroyed(...)</code> method:</p><pre><code>camera.stopPreview();camera = null;</code></pre><p>There is nothing to release the camera resources, so after you have run this application, any subsequent application that uses the camera will not work. In am attempt to fix this, I added a call to release the resources, like this:</p><pre><code>camera.stopPreview();camera.release();camera = null;</code></pre><p>The problem there, though, is that when I close the application, I get a ""Force Close"" with the following exception in LogCat:</p><pre><code>FATAL EXCEPTION: mainjava.lang.RuntimeException: Method called after release()    at android.hardware.Camera.setHasPreviewCallback(Native Method)    at android.hardware.Camera.access$600(Camera.java:58)    at android.hardware.Camera.$EventHandler.handleMessage(Camera.java:344)    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.lanf.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>Can anyone tell me why I can't release the camera resources there?</p><p>Thank you all in advance. This camera thing is driving me nuts.</p><p>P.S. I am testing all of this on an HTC Evo.</p>","398641","","","","","2012-12-26 14:56:16","Android: Several Camera API Questions","<android><api><release><orientation><android-camera>","3","0","4","",""
"4694565","1","","","2011-01-14 18:30:30","0","10095","<p>I'm developing an Android application.</p><p>I'm trying to set buttons save and close centered, but they appear to the left.</p><p>Here is my XML 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:layout_width=""wrap_content""    android:layout_height=""fill_parent""    android:orientation=""vertical""&gt;    &lt;TextView        android:id=""@+id/dialogGameName""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:gravity=""center""        android:layout_marginBottom=""2sp""        android:layout_marginLeft=""5sp""        android:layout_marginRight=""5sp""        android:layout_marginTop=""5sp""        android:typeface=""sans""        android:textSize=""26sp""        android:textStyle=""bold""/&gt;    &lt;TextView        android:id=""@+id/dialogGameDescription""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:gravity=""left""        android:layout_marginBottom=""5sp""        android:layout_marginLeft=""5sp""        android:layout_marginRight=""5sp""        android:layout_marginTop=""2sp""        android:typeface=""monospace""        android:textSize=""18sp""/&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:layout_gravity=""center_vertical|center_horizontal""&gt;        &lt;Button            android:id=""@+id/registerGameButton""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""@string/save""            android:gravity=""center""            android:layout_marginBottom=""5sp""            android:layout_marginLeft=""5sp""            android:layout_marginRight=""2sp""            android:layout_marginTop=""0sp"" /&gt;        &lt;Button            android:id=""@+id/closeButton""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""@string/close""             android:gravity=""center""            android:layout_marginBottom=""5sp""            android:layout_marginLeft=""2sp""            android:layout_marginRight=""5sp""            android:layout_marginTop=""0sp""/&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","68571","","184184","","2011-11-27 14:39:39","2011-11-27 14:39:39","Android layout set two buttons centered vertically and horizontally","<android><android-layout>","3","0","","",""
"4694716","1","","","2011-01-14 18:46:03","0","1579","<p>I have custom listview with textview and button. I set the button click handle in the xml files and the implementation in the ListActivity.</p><p>The problem is when i click the button, I cant get which selected row that i click.</p><p>Regards</p>","281116","","","","","2011-01-14 18:55:05","android Custom ListView selected row on button click","<android>","1","2","","",""
"4694758","1","4694815","","2011-01-14 18:51:40","5","7034","<p>I already know how to get my Activity as fullscreen on Android, now I need to draw a Image in this screen.</p><p>This is my 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:orientation=""vertical"" android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;ImageView android:id=""@+id/image01"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>This image is dynamic generated and drawed in the ImageView.</p><p>This is my code on my Activity.</p><pre><code>public void onCreate(Bundle savedInstance) {    super.onCreate(savedInstance);    requestWindowFeature(Window.FEATURE_NO_TITLE);    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,            WindowManager.LayoutParams.FLAG_FULLSCREEN);    setContentView(R.layout.main);}</code></pre><p>But when running, the Activity is FullScreen, but the ImageView is adjusted in the center.</p><p>What's wrong?</p><p>I added the following code to see the components dimensions.</p><pre><code>    View view = getWindow().getDecorView();    Log.i(""RMSDK:J:IbaReader(decor)"",            ""[w="" + view.getWidth() + "":h="" + view.getHeight() + ""]"");    Log.i(""RMSDK:J:IbaReader(img)"",            ""[w="" + img.getWidth() + "":h="" + img.getHeight() + ""]"");</code></pre><p>This results in [w=320:h=480] in both cases.</p><p>This is my draw method.</p><pre><code>private void draw() {    byte[] image = services.getImageBuffer(600, 1024);    Bitmap bmp = Bitmap.createBitmap(600, 1024, Bitmap.Config.RGB_565);    int row = 0, col = 0;    for (int i = 0; i &lt; image.length; i += 3) {        bmp.setPixel(col++, row, image[i + 2] &amp; image[i + 1] &amp; image[i]);        if (col == 600) {            col = 0;            row++;        }    }    img.setImageBitmap(bmp);}</code></pre>","558433","","558433","","2011-01-14 19:21:26","2014-03-01 08:17:09","Draw a Image on FullScreen mode Android","<java><android><android-layout><imageview>","2","0","1","",""
"4694855","1","","","2011-01-14 19:03:11","0","729","<p>I recently got introduced to Android via a school course. Did some very simple examples earlier, and decided to installed all the required peripherals at my home computer too. I was on my way to develope all kind of cool stuff, until i noticed that something is wrong with my Android SDK or the emulator itself - it won't run any of the programs i try to.</p><p>I've got Eclipse &amp; All the required add-ons / plugins installed. I get no error messages at any stage ( in eclipse or in the emulator itself ). Whenever i press run at Eclipse, the emulator takes it's time and starts up, but doesn't start the program, and doesn't actually show even the slightest hint of it. Looks just like if i had tried to start only the emulator. I've tried to create several different AVD's, and tried to use different versions of Android on them. No luck.</p><p>Im using windows 7 x64, and after a couple of rounds with Google, i found a few other guys who are having the same problem with the same OS.</p><p>Any help is greatly appreciated, as im running out of options here.</p>","576076","","","","","2011-01-14 21:06:54","Android SDK emulator doesn't run my programs?","<android>","2","0","","",""
"4694907","1","","","2011-01-14 19:09:05","1","411","<p>I want to display phrases from a pre-defined array (array.xml) in a TextView and would like to traverse this array from front to back with buttons. How can I do this?</p><p>Thank you.</p><pre><code>Resources res = getResources();myPiada = res.getStringArray(R.array.curtas);TextView tva = (TextView) findViewById(R.id.piadas);</code></pre>","503269","","321697","","2011-01-14 19:43:28","2011-01-14 19:43:28","Tramping array textviews Android","<android><arrays><textview>","1","0","","",""
"4694951","1","4695011","","2011-01-14 19:14:33","1","170","<p>I made a class to handle a simple message popup so I can reuse the code through out the app.  I can't seem to be able to get the context right.  This is called from all over the place and often from classes that does not have a UI directly.  See the line below... Thanks for any help!!!</p><pre><code>public class msg  {    public void msghand(String message, Exception e) {    {        String s;        if (e != null)         {            s=  message + ""\n"" + e.getLocalizedMessage() + "" "" + e.toString();        }        else        {            s= message ;        }        new AlertDialog.Builder(  getApplicationContext () )  &lt;&lt;&lt;&lt; HERE IS THE PROBLEM        .setMessage(s)        .setPositiveButton(""OK"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int whichButton) {            }        })        .create()        .show();    }    }}</code></pre>","528130","","","","","2011-01-14 19:44:50","How do you specify a CONTEXT","<android><context>","2","0","0","",""
"4695008","1","4699365","","2011-01-14 19:20:34","7","1000","<p>Does anyone know the name of the cryptography libraries come with iPhone &amp; Android SDKs ? I don't mean the name of the classes, functions etc. but the name of the provider and/or the library itself. Are they FIPS certified?</p><p>Thanks</p>","541330","","","","","2012-07-16 17:13:46","FIPS Certification for Android & iPhone","<iphone><android><cryptography><fips>","2","2","2","",""
"4695034","1","4695099","","2011-01-14 19:24:14","0","1106","<p>I'm trying to figure out a way to execute some sort of search and replace in an sqlite column. Say for instance a column has the word ""Hello"" and it can be in numerous rows and I'd like to replace Hello with ""Goodbye"" How can I go about this. I know how to update individual rows but cannot seem to find anything about multiple rows.</p>","427377","","","","","2011-01-14 19:41:01","Android Java Sqlite search and replace","<java><android><sqlite>","2","0","","",""
"4695157","1","4695618","","2011-01-14 19:37:55","5","2685","<p>Problem:</p><p>I want to write a process that will allow a user to take photos with the device and for those photos to then be uploaded to some listener in the cloud.  The user should not have to do anything to initiate the upload, a background listener would just watch the folder and as long as it finds files in it it would upload them and delete them.</p><p>Two problems:1) how to keep the program running in the background even after the user is no longer taking pictures (and if they reboot the device for it to wake up and finish the uploads, if any remain)</p><p>2) assuming the connection is spotty (as it always is) how to verify that a given image has completed its upload, and if not, to resubmit it. </p><p>I don't need any code examples, I just would like opinions on the best strategy to get this implemented. </p><p>I was going to use Apache commons and just do an upload to a PHP, but am not sure what sort of error checking exists to take into account a connection drop mid file. </p><p>TIA.</p>","59947","","","","","2011-07-11 10:31:34","best method for background uploader in Android","<android>","2","0","3","",""
"4695549","1","","","2011-01-14 20:23:20","1","1466","<p>I have tried multiple suggestions and nothing works :(  I am trying to make the number keypad show up when this alert dialog box is show.  Is there just some command to make the keyboard show up anyway?</p><pre><code>void GetQuantity() {  AlertDialog.Builder alert = new AlertDialog.Builder(this);  alert.setTitle(""Quantity"");  alert.setMessage(""Enter Quantity"");  final EditText input = new EditText(this);  alert.setView(input);  input.setText(""1"");  input.setInputType(DEFAULT_KEYS_DIALER |TYPE_NUMBER_FLAG_DECIMAL );  input.setFilters(new InputFilter[] {    // Maximum 5 characters.    new InputFilter.LengthFilter(5),  });  alert.setPositiveButton(""OK"", new DialogInterface.OnClickListener() {   @Override   public void onClick(DialogInterface dialog, int which) {    Quantity =Double.parseDouble( input.getText().toString());    btnQuan.setText(input.getText().toString());   }  });  alert.setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {   public void onClick(DialogInterface dialog, int whichButton) {    // do nothing   }  });  alert.show(); }</code></pre>","528130","","","","","2011-01-14 21:12:45","Android numeric alert popup need numeric keypad","<android><alert>","1","1","1","",""
"4695747","1","","","2011-01-14 20:42:34","2","19824","<p>I have a main activity. From it, I am calling 2 other sub activities called FacebookLogin and Twitterlogin. I am using the following code in AndroidManufest.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.examples.Kikin"" android:versionCode=""1""android:versionName=""1.0""&gt;&lt;!-- THIS IS THE BEGINNING OF SHARING LINKS FROM THE BROWSER --&gt;&lt;application android:icon=""@drawable/kikinlogo""    android:label=""@string/app_name"" android:debuggable=""true""&gt;    &lt;activity android:name="".Kikin"" 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 android:label=""@string/app_name""&gt;            &lt;action android:name=""android.intent.action.SEND"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:mimeType=""text/plain"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".FacebookLogin"" android:label=""@string/app_name""&gt;        &lt;intent-filter android:label=""@string/app_name""&gt;            &lt;action android:name=""android.intent.action.SEND"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;!--    &lt;data android:mimeType=""image/png"" /&gt; --&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".TwitterLogin"" android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW""&gt;&lt;/action&gt;            &lt;category android:name=""android.intent.category.DEFAULT""&gt;&lt;/category&gt;            &lt;category android:name=""android.intent.category.BROWSABLE""&gt;&lt;/category&gt;            &lt;data android:scheme=""yourapp"" android:host=""twitt""&gt;&lt;/data&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;uses-permission android:name=""android.permission.READ_CONTACTS"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></pre><p> Am i doing it right?Should i nest the FacebookLogin and TwitterLogin activities in the main <strong><em></strong> activity?The aforesaid 2 classes are in the package com.examples.<strong></em></strong>.<strong>*</strong> is the same wherever used.</p>","556167","","556167","","2011-01-14 21:58:50","2012-05-29 09:50:17","android multiple activity declaration in manifest","<android><activity><android-manifest>","5","9","1","",""
"4695864","1","","","2011-01-14 20:57:02","0","1117","<p>I have the following code</p><blockquote>  <p><code>import javax.xml.xpath.*;</code></p></blockquote><p>and am getting the following error back in Eclipse 'Problems'</p><blockquote>  <p>The import javax.xml.xpath cannot be resolved</p></blockquote><p>I'm pretty sure I'm developing with Java 6 / JDK 1.6</p><ul><li>Verified via Window >> Preferences >> Java >> Installed JRES<ul><li>Shows jre6 in C:\Program Files\Java\jre6</li></ul></li></ul><p>What's going on / what can I do to debug?  <a href=""http://download.oracle.com/javase/6/docs/api/javax/xml/xpath/package-summary.html"" rel=""nofollow"">Online documentation says XPath should be there</a>.</p>","404980","","","user357812","2011-01-14 22:15:52","2011-01-14 22:15:52","""The import javax.xml.xpath cannot be resolved"" from line ""import javax.xml.xpath.*;""","<java><android><eclipse><xpath><helios>","0","8","","",""
"4695929","1","","","2011-01-14 21:03:54","14","1677","<p>I have a full-screen game in HTML+JavaScript, which uses the arrow keys as primary controls. This cannot be used on keyboardless Android devices (I haven't tested on iOS), and even if the soft keyboard had arrow keys it would take up unnecessary space. Therefore, I have added onscreen control buttons. However, the buttons are unnecessary (and absurdly large) on desktop browsers, so I would like them to not pop up unless they are needed.</p><p>What heuristics can I use to decide whether they are needed — that is, whether it is impossible or awkward for the user to input arrow-key events — <strong>other than recognizing specific User-Agents</strong> (which is straightforward, but not future-proof)?</p><p>I will of course allow the user to hide/show the buttons; I am looking for useful heuristics for choosing the default setting.</p>","99692","","99692","","2012-01-04 21:27:32","2013-02-16 18:08:12","Detect whether browser has keyboard/arrow keys in web page","<javascript><android><ios><touch><mobile-website>","9","1","2","",""
"4695996","1","4696675","","2011-01-14 21:11:44","3","4098","<p>Hallo,</p><p>Here's some code which writes a data class to a file, then checks to see that the file exists. I can see that the file exists on the emulator, but file.exists() and therefore saveStateAvailable() returns false.</p><pre><code>    private void saveStateFile() {    /*DEBUG*/Log.d(this.getClass().getName(), ""saveStateFile: Started"");    mGameData = getGameData();        try {            FileOutputStream fileoutputstream = openFileOutput(mGameData.pilotName + STATE_FILE_EXTENSION, Context.MODE_WORLD_WRITEABLE);            ObjectOutputStream objectoutputstream;            objectoutputstream = new ObjectOutputStream(fileoutputstream);            objectoutputstream.writeObject(mGameData);            objectoutputstream.close();            fileoutputstream.close();            /*DEBUG*/Log.i(this.getClass().getName(), ""saveStateFile: State saved to ""+mGameData.pilotName + STATE_FILE_EXTENSION);        } catch (IOException e) {            /*DEBUG*/Log.e(this.getClass().getName(), ""saveStateFile: Error writing data state file, ""+mGameData.pilotName + STATE_FILE_EXTENSION);            e.printStackTrace();        }    /*DEBUG*/Log.d(this.getClass().getName(), ""saveStateFile: Finished stateFileAvailable=""+stateFileAvailable());}private boolean stateFileAvailable() {    File file = new File(mGameData.pilotName + STATE_FILE_EXTENSION);    /*DEBUG*/Log.d(this.getClass().getName(), ""stateFileAvailable: Called (""+mGameData.pilotName + STATE_FILE_EXTENSION+"" exists = ""+file.exists()+"")"");    return file.exists();}</code></pre><p>Any ideas?</p><p>-Frink</p>","131209","","","","","2011-01-14 22:29:00","Android file.exists() not working","<android>","1","0","","",""
"4696036","1","4720424","","2011-01-14 21:16:03","3","705","<p>I use the selectAll() function but it doesnt seem to do anything at all. Is there a way to have the text highlighted so they do not have to backspace and then retype? </p><pre><code>void GetQuantity(){    AlertDialog.Builder alert = new AlertDialog.Builder(this);    alert.setTitle(""Quantity"");    alert.setMessage(""Enter Quantity"");    final EditText input = new EditText(this);    alert.setView(input);    input.setText(""1"");    // android:selectAllOnFocus=""true""    input.setInputType(InputType.TYPE_CLASS_NUMBER);    input.selectAll();    alert.setPositiveButton(""OK"", new DialogInterface.OnClickListener() {        @Override        public void onClick(DialogInterface dialog, int which) {            Quantity =Double.parseDouble( input.getText().toString());            btnQuan.setText(input.getText().toString());        }    });    alert.setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int whichButton) {            // do nothing        }    });    alert.show();}</code></pre>","528130","","","","","2011-06-23 14:12:30","Select all text on alert popup selectAll()","<android><keyboard>","3","0","","",""
"4696051","1","4696083","","2011-01-14 21:17:31","2","436","<p>I'm working on an Android app that will look like this (Photoshop mockup):</p><p><img src=""http://gyazo.com/873a7d8a6832be9a4f8363f90c0a1a98.png"" /></p><p>The bar at the top will always be at the top and the view below that will always be the ""header"" of the content. Should I just load new views inside the ScrollView below the header or create entire new activities for each page so that the back button is supported better? And how would that work? Currently the main activity builds the above layout with a custom view for the header, top bar and content.</p>","238180","","","","","2011-01-14 21:20:38","Activity and view setup of Android app","<android><view><activity>","1","10","","",""
"4696134","1","4699851","","2011-01-14 21:27:18","1","5367","<p>I want to rotate my phone and keep the locale. I have folders values, values-<b>en</b> and values-<b>hr</b>. In every activity I have</p><pre><code>android:configChanges=""keyboardHidden|orientation|locale""</code></pre><p>and in every <b>activity.java</b> file I have</p><pre><code>private Locale locale = null;@Overridepublic void onConfigurationChanged(Configuration newConfig){    super.onConfigurationChanged(newConfig);    if (locale != null)    {        newConfig.locale = locale;        Locale.setDefault(locale);        getBaseContext().getResources().updateConfiguration(newConfig, getBaseContext().getResources().getDisplayMetrics());    }}</code></pre><p>and in onCreate</p><pre><code>    SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);                   Configuration config = getBaseContext().getResources().getConfiguration();    String lang = settings.getString(""language"",""en"");    if (! """".equals(lang) &amp;&amp; ! config.locale.getLanguage().equals(lang))    {        locale = new Locale(lang);        Locale.setDefault(locale);        config.locale = locale;        getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());    }</code></pre><p>It works till I rotate my phone - app is still working, buttons and everything is fine - but locale is getting weird - sometimes it's my locale (hr) sometimes it's (en)...</p><p>What else I need to add?</p>","455268","","","","","2013-08-03 16:46:04","Force ""locale"" in application","<android><locale>","1","4","","",""
"4696351","1","","","2011-01-14 21:49:33","11","1684","<p>I am able to programmatically insert an entry into the Android call log with a number, date, duration &amp; type BUT I cannot figure out how to also include a photo, label and name?The entry I'm adding is for an existing Contact with the exact same number. I've noticed on a Motorola device the name &amp; pic appears if the number matches an existing Contact but on my HTC Incredible something is missing?</p><p>I do the following.. (didn't know what to even try for the photo)</p><pre><code>ContentValues values = new ContentValues();values.put(CallLog.Calls.NUMBER, number);values.put(CallLog.Calls.CACHED_NAME, name);values.put(CallLog.Calls.CACHED_NUMBER_LABEL, label);values.put(CallLog.Calls.DATE, date);values.put(CallLog.Calls.DURATION, duration);values.put(CallLog.Calls.TYPE, myCallType);context.getContentResolver().insert(CallLog.Calls.CONTENT_URI, values);</code></pre>","420008","","773363","","2014-02-24 10:29:59","2014-03-03 09:22:41","How to programmatically insert call log entries WITH display name and photo?","<java><android><android-intent><call><calllog>","2","2","1","",""
"4696626","1","","","2011-01-14 22:22:53","1","483","<p>When user clicks on my status bar notification, an Activity Intent should be launched. However, nothing happens and this shows up in LogCat:</p><pre><code>W/ActivityManager(   85): java.lang.SecurityException: Permission Denial: starting Intent { flg=0x20000000 cmp=cz.fhejl.pubtran.london/cz.fhejl.pubtran.PubtranMapActivity bnds=[0,152][480,248] (has extras) } from null (pid=-1, uid=10049) requires null</code></pre><p>The app package is cz.fhejl.pubtran.london but the Activity is in cz.fhejl.pubtran. Is this the problem? My application is based a library project, that's why the package names of the app and the Activity are differet.</p>","243225","","243225","","2011-01-14 23:09:54","2011-01-14 23:09:54","SecurityException when launching Intent","<android><android-intent>","1","0","","",""
"4696735","1","","","2011-01-14 22:40:00","0","1372","<p>I was wondering if anyone knew how to return control back to an app after launching a webview? I got the example code for the webview from the android developers page but I haven't been able to find a way to return control to the app after getting out of webview. Any help would be appreciated. </p><pre><code>public class LaunchWeb extends Activity{ WebView webView;   public void onCreate(Bundle savedInstanceType)  {    super.onCreate(savedInstanceType);    setContentView(R.layout.webview_layout);    webView = (WebView) findViewById(R.id.webview);   //webView.setWebViewClient(new WebViewClient());       webView.getSettings().setJavaScriptEnabled(true);   webView.loadUrl(getIntent().getExtras().getString(""url""));   } }</code></pre>","576304","","553682","","2012-03-23 09:21:10","2012-03-23 09:21:10","WebView doesn't return control to app","<android><webview>","2","5","","",""
"4696749","1","4697038","","2011-01-14 22:41:09","0","1065","<p>I have a WebView app, and need to check for an Internet connection with every action ""click"" inside the app.  I got the following code working to check the internet on start up of the app.  But I need to figure out how to have this check every time the user changes pages with in the webview.</p><p>My code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    if(!isNetworkConnectionAvailable()){        Context context = getApplicationContext();        CharSequence text = ""Sorry you need an Internet connection!  Please try again when the network"" +                "" is available."";        int duration = Toast.LENGTH_LONG;        Toast toast = Toast.makeText(context, text, duration);        toast.show();        finish();    }    mWebView = (WebView) findViewById(R.id.webview);    mWebView.getSettings().setJavaScriptEnabled(true);    mWebView.loadUrl(""http://example.com/"");    mWebView.setWebViewClient(new MyAppViewClient());}</code></pre><p>And this is my connection checking code:</p><pre><code>    public boolean isNetworkConnectionAvailable() {     ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);     NetworkInfo netInfo = cm.getActiveNetworkInfo();     if (netInfo != null &amp;&amp; netInfo.isConnectedOrConnecting()){         return true;    }    else{        return false;    } }</code></pre><p>Is this possible?</p>","570509","","","","","2011-01-14 23:33:05","Webview check for connectivity through out session","<java><android><webview>","1","0","","",""
"4696805","1","","","2011-01-14 22:49:56","1","744","<p>Hey Guys, Thanks for your time.</p><p>I'm writing an application for android 2.2 and I'm using a gallery to circulate through a list of images that the user can then click to navigate other portions of the application. In portrait orientation, everything is kosher: the images are displaying correctly (completely in the center of the screen as I intended); however, in landscape orientation, all the images in the gallery are strangely displaced a fixed distance to the left of the center of the screen. I've been researching this issue for hours now and haven't found a solution. I'm hoping that some android guru can aid me in the resolution of this bizarre rendering issue.</p><p>MainMenuActivity.java relevant code snippet (the activity in which the gallery resides)</p><pre><code>Gallery optionList = (Gallery)findViewById(R.id.mainMenuOptionList);GalleryItem[] optionListItemIdArray = new GalleryItem[] {         new GalleryItem(R.drawable.icon_main_menu_option_list_blackboard, ""Start Next Lesson"",                        ""Start the next planned vocab lesson.""),        new GalleryItem(R.drawable.icon_main_menu_option_list_index_cards, ""Review Words"",                         ""Manually look over old words.""),        new GalleryItem(R.drawable.icon_main_menu_option_list_dice, ""Play Vocab Games"",                        ""Play games to reinforce knowledge.""),        new GalleryItem(R.drawable.icon_main_menu_option_list_calendar, ""View Lesson Plan"",                         ""View the schedule for coming lessons.""),        new GalleryItem(R.drawable.icon_main_menu_option_list_pie_chart, ""View Performance Report"",                        ""Evaluate your overall performance statistics.""),        new GalleryItem(R.drawable.icon_main_menu_option_list_settings, ""Manage Settings"",                         ""Change and modify application settings."")     };optionList.setAdapter(new GalleryImageAdapter(this, optionListItemIdArray));</code></pre><p>NOTE: A GalleryItem is a POJO with an image resource id, title and description.</p><p>GalleryImageAdapter.java:</p><pre><code>public class GalleryImageAdapter extends BaseAdapter {private Context context;private GalleryItem[] galleryItemArray;public GalleryImageAdapter(Context context, GalleryItem[] galleryItemArray) {    this.context = context;    this.galleryItemArray = galleryItemArray;}@Overridepublic int getCount() {    return galleryItemArray.length;}@Overridepublic Object getItem(int position) {    return position;}@Overridepublic long getItemId(int position) {    return position;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    ImageView imageView = new ImageView(context);    imageView.setImageResource(galleryItemArray[position].getImageId());    imageView.setScaleType(ImageView.ScaleType.FIT_START);    imageView.setLayoutParams(new Gallery.LayoutParams(Gallery.LayoutParams.WRAP_CONTENT, Gallery.LayoutParams.WRAP_CONTENT));    return imageView;}}</code></pre><p>Portrait version of main_menu.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/mainMenuLinearLayout""android:background=""#3067a8""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextView    android:id=""@+id/mainMenuHeadingTextView""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:paddingLeft=""10dip""    android:textColor=""#ffffff""    android:textSize=""50sp""    android:text=""@string/main_menu_heading""    android:shadowColor=""#555555""    android:shadowDx=""0""    android:shadowDy=""0""    android:shadowRadius=""2""   /&gt;&lt;TextView    android:id=""@+id/mainMenuSubHeadingTextView""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:paddingLeft=""15dip""    android:textColor=""#ffffff""    android:textSize=""15sp""    android:text=""@string/main_menu_sub_heading""    android:shadowColor=""#555555""    android:shadowDx=""0""    android:shadowDy=""0""    android:shadowRadius=""2""   /&gt;&lt;Gallery     xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/mainMenuOptionList""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:paddingTop=""20dip""    android:paddingBottom=""10dip""    android:spacing=""40dip""/&gt;&lt;LinearLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/mainMenuOptionListDetailLinearLayout""    android:gravity=""center_vertical|center_horizontal""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;TextView        android:id=""@+id/mainMenuOptionListLabelTextView""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:textColor=""#ffffff""        android:textSize=""25sp""        android:shadowColor=""#555555""        android:shadowDx=""0""        android:shadowDy=""0""        android:shadowRadius=""2""    /&gt;    &lt;TextView        android:id=""@+id/mainMenuOptionListDescriptionTextView""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textColor=""#ffffff""        android:textSize=""15sp""        android:shadowColor=""#555555""        android:shadowDx=""0""        android:shadowDy=""0""        android:shadowRadius=""2""    /&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Landscape version of main_menu.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/mainMenuLinearLayout""android:background=""#3067a8""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextView    android:id=""@+id/mainMenuHeadingTextView""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:paddingLeft=""10dip""    android:textColor=""#ffffff""    android:textSize=""50sp""    android:text=""@string/main_menu_heading""    android:shadowColor=""#555555""    android:shadowDx=""0""    android:shadowDy=""0""    android:shadowRadius=""2""   /&gt;&lt;TextView    android:id=""@+id/mainMenuSubHeadingTextView""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:paddingLeft=""15dip""    android:textColor=""#ffffff""    android:textSize=""15sp""    android:text=""@string/main_menu_sub_heading""    android:shadowColor=""#555555""    android:shadowDx=""0""    android:shadowDy=""0""    android:shadowRadius=""2""   /&gt;&lt;Gallery     xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/mainMenuOptionList""    android:layout_width=""fill_parent""    android:layout_height=""128dip""    android:paddingLeft=""0dip""    android:paddingTop=""5dip""    android:spacing=""10dip""/&gt;&lt;LinearLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/mainMenuOptionListDetailLinearLayout""    android:gravity=""center_vertical|center_horizontal""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;TextView        android:id=""@+id/mainMenuOptionListLabelTextView""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:textColor=""#ffffff""        android:textSize=""25sp""        android:shadowColor=""#555555""        android:shadowDx=""0""        android:shadowDy=""0""        android:shadowRadius=""2""    /&gt;    &lt;TextView        android:id=""@+id/mainMenuOptionListDescriptionTextView""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textColor=""#ffffff""        android:textSize=""15sp""        android:shadowColor=""#555555""        android:shadowDx=""0""        android:shadowDy=""0""        android:shadowRadius=""2""    /&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Thank you for your time!</p>","575003","","","","","2011-01-14 23:08:25","Gallery items become off-center when switching into landscape orientation","<android>","1","0","0","",""
"4696949","1","4699299","","2011-01-14 23:16:04","0","264","<p>I'm developing a program using App Inventor that will tweet stuff.</p><p>I've assigned a button(<code>btLogin</code>) to authenticate with Twitter, using <code>TwitterAPI.Authorize()</code> and another button to check when it is authorized. If it throws me the even <code>IsAuthorized</code> it will display a label saying that. The problem is that when I click on the login button, nothing happens and when I click on the check button nothing happens too. What should I do?</p>","126353","","","","","2011-01-15 16:01:57","Twitter.Authorize Won't Show Me Nothing","<android><oauth><twitter-api><app-inventor>","1","1","","",""
"4697025","1","","","2011-01-14 23:28:52","2","2361","<p>I have a search textbox, a listview and a few buttons, when the app starts the textbox has the focus so it displays the keyboard, blocking half my screen.How do I prevent that ? </p><p>I already tried putting the focus on a button (and set the button to focusable=true) but that didn't work. Only thing that worked was focusable on the textbox, but then obviously you don't get the keyboard anymore when clicked.</p>","576343","","","","","2012-10-04 07:31:28","Remove initial focus of textbox when app starts?","<android><eclipse><android-layout>","2","2","","",""
"4697177","1","4697330","","2011-01-15 00:00:58","4","3890","<p>How can i make shadow effect in linear layout in android ?</p>","508377","","","","","2011-04-05 09:53:54","How can i make shadow effect in linear layout in android?","<android>","1","0","1","",""
"4697192","1","4702317","","2011-01-15 00:03:57","0","232","<p>I need to backup just some of the tables in my main database. The other tables are reference and are static so do not need to be backed up.</p><p>I have created a new blank DB that is on the SDCARD.  Can I access the DB directly on the SDCARD or do I need to copy it when its finished backup?</p><p>The real question is can I iterate through the fields in each record in a loop or something so I dont have to have hundreds of line of code, one for each field. </p><p>In VB .NET I would do something like</p><pre><code>For X = 0 to RS.Fields.Count NewRS.Fields(x).value = Rs.Fields(x).value</code></pre><p>etc...  How wound I do that in android?</p>","528130","","","","","2011-01-15 21:43:06","Dynamic Database Backup for certain tables","<android><sqlite><backup>","2","0","","",""
"4697233","1","4697248","","2011-01-15 00:11:46","1","474","<p>I don't know if any of you have seen this before:</p><p>I have an application which has the <b>Portrait orientation locked</b> for every activity. However, in the HTC Pro Touch phone (and maybe this happens on other phones with physical keyboards) the application rotates to landscape mode for a few seconds and then returns to portait mode, that happens while navigating on the app. Of course this shouldn't happen but I'm not sure why it does that.</p><p>I am locking the portrait mode by calling <b>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)</b> in the create method of my super class.</p><p>While I was writting this I realized that the locking instruction is called after the super.create(..), could that make a difference? (Testing takes some time if not I would know right now). If not what else could I do to avoid this auto-rotation?</p><p>Thanks in advance, I hope someone knows.</p>","505152","","812149","","2012-06-20 18:30:57","2012-06-20 18:30:57","Android application autorotates to landscape mode for a few seconds even when portrait mode is locked","<android><rotation><landscape><htc>","1","0","","",""
"4697244","1","","","2011-01-15 00:15:06","3","1774","<pre><code>01-15 00:57:08.660: WARN/System.err(25286): java.io.IOException: setDataSourceFD failed.: status=0x8000000001-15 00:57:08.660: WARN/System.err(25286):     at android.media.MediaPlayer.setDataSource(Native Method)01-15 00:57:08.660: WARN/System.err(25286):     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:854)...</code></pre><p>...when trying to play local AMR audio file from application cache directory. It happens on HTC Magic, HTC Desire. AMR audio file is recorded by SonyEricsson xperia x10 mini and was downloaded from the Internet.</p><p>MediaPlayer is created in following way:</p><pre><code>MediaPlayer player = new MediaPlayer();player.setOnCompletionListener(this);player.setOnErrorListener(this);player.setAudioStreamType(AudioManager.STREAM_MUSIC);try { FileInputStream fis = new FileInputStream(filePath); player.setDataSource(fis.getFD());} catch (Exception e) { ...}</code></pre><p>Any ideas?</p>","387710","","387710","","2011-01-15 00:20:23","2012-05-22 11:27:27","MediaPlayer.setDataSource fails on AMR audio file","<android><media-player><amr>","1","0","1","",""
"4697251","1","","","2011-01-15 00:16:39","1","176","<p>so basically i created a URL in the onCreate method, and i want to pass it with an intent just when i click on a button. The URL is created but i can't send it to The NeXT activity because it's just in The oncreate method. What should i do ?</p>","439058","","","","","2011-01-15 10:33:19","How can i take data from the onCreate method and put it on the onClick","<android><methods><onclick><oncreate>","1","1","","",""
"4697343","1","","","2011-01-15 00:38:36","1","561","<p>I have a custom ViewSwitcher with a flip animation. The problem is that the view that's not currently shown (that contains child buttons) is intercepting the clicks from the active view. I've tried to set the visibility to invisible or gone (didn't work), I tried iterating through all child view and setting setClickable(false) and that didn't work.</p><p>Maybe I'm applying my changes in the wrong place? Below is the relevant sections of my code.</p><pre><code>public class ViewFlip3D extends ViewSwitcher {    // switches views    public void flip() {        float centerX = getWidth() / 2.0f;        float centerY = getHeight() / 2.0f;        Flip3D animOut = new Flip3D(-90, 0, centerX, centerY);        animOut.setDuration(500);        animOut.setInterpolator(new AccelerateInterpolator());        animOut.setFillAfter(true);        Flip3D animIn = new Flip3D(0, 90, centerX, centerY);        animIn.setDuration(500);        animIn.setInterpolator(new DecelerateInterpolator());        animIn.setFillAfter(true);        animIn.setAnimationListener(new ShowNextView(this, animOut));        ViewGroup view = (ViewGroup) getCurrentView();        // Disable clicks here!        // like: view.DisableClicksFromAllChildViews();        view.startAnimation(animIn);    }    private final class ShowNextView implements Animation.AnimationListener {        public void onAnimationEnd(Animation animation) {            container.showNext();            ViewGroup view = (ViewGroup) container.getCurrentView();            view.startAnimation(flipin);            // Enable clicks here!            // like: view.EnableClicksFromAllChildViews();        }    }}</code></pre>","397706","","","","","2011-01-15 00:38:36","android: disable clicks from ViewSwitcher's inactive child view","<android><click>","0","1","1","",""
"4697528","1","4697794","","2011-01-15 01:27:36","51","25316","<p>I have an ImageView that has a drawable image resource set to a selector. How do I programmatically access the selector and change the imgages of the highlighted and non-highlighted state?</p><p>Here is a code of selector:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/iconSelector""&gt;  &lt;!-- pressed --&gt;  &lt;item android:state_pressed=""true"" android:drawable=""@drawable/btn_icon_hl"" /&gt;  &lt;!-- focused --&gt;  &lt;item android:state_focused=""true"" android:drawable=""@drawable/btn_icon_hl"" /&gt;  &lt;!-- default --&gt;  &lt;item android:drawable=""@drawable/btn_icon"" /&gt;&lt;/selector&gt;</code></pre><p>I want to be able to replace btn_icon_hl and btn_icon with other images.</p><p>Thank you in advance</p>","538428","","","","","2013-03-28 06:29:05","replace selector images programmatically","<android><selector><imageview><drawable>","2","2","25","",""
"4697533","1","","","2011-01-15 01:28:38","1","1293","<p>I try to reuse a TextView. Sometimes it contains a URL and sometimes not. If I try to set the TextView back to textView.setAutoLinkMask(0) it does unfortunately nothing and the new text remains clickable.</p><pre><code>TextView snippet = new TextView();snippet.setText(""someText"");if (ifSomeTextContainsURL) {        // Recognize web URLs        Linkify.addLinks(snippet, Linkify.WEB_URLS);        snippet.setLinksClickable(true);    } else {        Linkify.addLinks(snippet, 0);        snippet.setLinksClickable(false);        snippet.setAutoLinkMask(0x00000000);}</code></pre><p>I tried the above code but it doesn't work for me.Thx for help</p>","255864","","","","","2013-08-27 14:53:32","unable to set textView1.setAutoLinkMask(0) - it remains clickable","<android>","2","1","1","",""
"4697631","1","","","2011-01-15 01:58:25","11","39672","<p>I tried <code>getOrientation()</code> to get the orientation value but it always returns 0!</p>","550796","","429063","","2013-05-24 20:01:06","2013-05-24 20:01:06","android screen orientation","<android><orientation>","7","2","1","",""
"4697699","1","4730335","","2011-01-15 03:02:04","2","588","<p>I wanted to make a ListView where the items have two pressable pieces, like the layouts that show up in a couple of places in the stock Android phone/contacts application:</p><p><a href=""http://i55.tinypic.com/358s1lc.jpg"" rel=""nofollow""><img src=""http://i55.tinypic.com/358s1lc.jpg"" width=""240"" height=""400""></a> <a href=""http://i.stack.imgur.com/sXalI.jpg"" rel=""nofollow""><img src=""http://i.stack.imgur.com/sXalI.jpg"" width=""240"" height=""400""></a></p><p>I have the layout working fine, including handling events from each piece separately, except for a visual issue when the smaller piece is pressed.  In my application the smaller piece only gets a small ellipse for the background when it is pressed, like this:</p><p><a href=""http://i.stack.imgur.com/7lwm1.jpg"" rel=""nofollow""><img src=""http://i.stack.imgur.com/7lwm1.jpg"" width=""240"" height=""400""></a></p><p>Note that is actually not my application - that is <a href=""http://code.google.com/p/nubdial/"" rel=""nofollow"">NubDial</a>, but my application has the same problem.  Since NubDial uses the exact same XML layout as the phone app, I'm not sure how relevant the list item layouts are, but here they are anyway:</p><p>Contacts list: <a href=""https://github.com/CyanogenMod/android_packages_apps_Contacts/blob/froyo-stable/res/layout-finger/contacts_list_item.xml"" rel=""nofollow"">contacts_list_item.xml</a><br>NubDial: <a href=""http://code.google.com/p/nubdial/source/browse/trunk/res/layout-finger/contacts_list_item.xml"" rel=""nofollow"">contacts_list_item.xml</a></p><p>Does anybody know what might be happening there?</p>","106302","","106302","","2011-01-15 16:49:20","2011-01-20 22:10:02","Odd visual issue with ListView item layout with two pressable pieces","<android><listview><android-layout>","3","0","","",""
"4697711","1","4716593","","2011-01-15 03:04:11","0","717","<p>In server audio files are there having 2 minutes. I have to record some audio(in 5- 10 sec) on Android device and then send to server to match.</p><p>I have to match audio.</p><p>How to do this ?</p>","412168","","","","","2012-01-25 17:30:55","Audio Matching in Android","<android><audio>","2","0","1","",""
"4697799","1","","","2011-01-15 03:32:54","0","1033","<p>Is there any example of creating <strong>shared library</strong> referenced <a href=""http://developer.android.com/guide/topics/manifest/manifest-intro.html#libs"" rel=""nofollow"">here</a></p><blockquote>  <p>However, some packages reside in their  own libraries. If your application  uses code from any of these packages,  it must explicitly asked to be linked  against them. The manifest must  contain a separate   element to name each of the libraries.  (The library name can be found in the  documentation for the package.)</p></blockquote><p>And <a href=""http://developer.android.com/guide/topics/manifest/uses-library-element.html"" rel=""nofollow"">here</a></p><blockquote>  <p>Specifies a shared library that the  application must be linked against.  This element tells the system to  include the library's code in the  class loader for the package.</p></blockquote>","62192","","","","","2012-09-24 22:15:44","How to create a shared library to be used with <uses-library> element","<android><shared-libraries>","1","0","","",""
"4697862","1","4698010","","2011-01-15 03:47:37","0","1491","<p>So I have a SQliteDatabase mDb. It only has one column, and its data are Strings for previously saved inputs. I'm trying to populate all the data from mDb into a String[] for AutoCompleteTextView (so that the autocomplete is based on previous inputs), and here's my code to get all of the String.</p><pre><code>public String[] fetchAllSearch() { ArrayList&lt;String&gt; allSearch = new ArrayList&lt;String&gt;(); Cursor c = mDb.rawQuery(""select * from "" + DATABASE_TABLE, null); c.moveToFirst(); if (c.getCount() &gt; 0) {  do {   allSearch.add(c.getString(c.getColumnIndex(""KEY"")));  } while (c.moveToNext()); } String[] foo = (String[]) allSearch.toArray(); if (foo == null) {  foo = new String[] {""""}; } return foo;}</code></pre><p>my CREATE_TABLE command is</p><pre><code>private static final String DATABASE_CREATE = ""create table "" + DATABASE_TABLE;..public void onCreate(SQLiteDatabase db) {            db.execSQL(DATABASE_CREATE);        }</code></pre><p>But for some reason the line mDb.rawQuery(...) is giving me ""no such table found"" exception, and for the life of me I can't figure out why. Any pointers? </p>","569421","","","","","2011-11-23 11:03:34","android: error on SQLiteDatabase rawQuery (fetching data)","<android><sqlite>","2","0","","",""
"4697873","1","16258624","","2011-01-15 03:51:09","21","3672","<p>I have question about wakelock. In cases shown below, does android OS release wakelock (<code>PARTIAL_WAKE_LOCK</code> if you need to specify) to prevent wakelock was left acquired and wasting battery until turning power off (not sleep).</p><p><em>Case 1-a:</em><br>App has acquired wakelock (w/o timeout option) in one of its threads (please think it is reasonable in this case) and it was designed to release wakelock when critical task was finished. App can be killed by taskmanager or notorious taskkiller, and app has no chance to let its thread release wakelock. What happens to that wakelock?</p><p><em>Case 1-b:</em><br>(If answer to case 1-a is ""Yes, don't worry"", then please ignore this case.)Same as case 1-a but app gave timeout option to wakelock, say 3 seconds. Is this timeout option kept valid?</p><p><em>Case 2-a:</em><br>Please imagine there is a service which was started by AlarmManager (via Broadcast receiver) and the service has acquired a wakelock (w/o timeout option). This service is designed to make wakelock-acquired-time minimum. But unfortunately, Android OS picked this service to kill due to memory crunch. (I don't know if OS won't kill service when wakelock is acquired, but I guess OS  doesn't care. But I hope OS will release wakelock later.) What happens to that wakelock?</p><p><em>Case 2-b:</em><br>(If answer to case 2-a is ""Yes, don't worry"", then please ignore this case.)Same as case 2-a but service gave timeout option to wakelock, say 3 seconds. Is this timeout option kept valid?</p>","576442","","1365960","","2013-04-28 02:02:29","2014-01-21 14:19:51","Does the Android OS release a wakelock if the app or service holding it is killed?","<android><android-source><wakelock><kill-process><android-wake-lock>","3","0","8","",""
"4697908","1","","","2011-01-15 04:00:38","4","2838","<p>I have a very simple Android app that's just a WebView.  Everything works fine (complex Javascript etc.).  However, all of the HTML <code>select</code> controls seem to be disabled.  They display with default values, but nothing happens when I click on them, and they don't get the orange highlight when I arrow through the controls.</p><p>Other inputs (text, radios, submit) work fine, so I don't think it's a focus issue.</p><p>Configuration:</p><ul><li>Eclipse IDE</li><li>SDK Version 8 (2.2)</li><li>Testing in the Emulator</li></ul>","394422","","","","","2013-06-18 21:56:51","HTML <select> control disabled in Android WebView (in emulator)","<android><android-emulator><webview><html-select>","4","2","1","",""
"4698051","1","4702200","","2011-01-15 04:50:49","1","1085","<p>As far as I can see there doesn't seem to any mature environment for crossplatform development for iPhone &amp; Android slate (but feel free to correct me).</p><p>I don't know Ipad, I must admit. Any reason why plain Java wouldn't cut it? (maybe underlying things like database (I am not too concerned with hardware))</p><p>I am thinking to try to make everything browser based, although that won't get around the d/b &amp; h/w issues, unless there is JS framework that does so.</p><p>Any advice?</p>","192910","","","","","2011-01-15 21:16:35","Crossplatform development for iPhone & Android","<android><ipad><cross-platform>","3","3","","",""
"4698159","1","","","2011-01-15 05:16:46","0","80","<p>I have to zoom particular area or particular pixels in picture when touched.</p><p>Please suggest how to go about this.</p>","550796","","1109425","","2012-08-15 23:23:43","2012-08-15 23:23:43","android suggestion on zooming","<android>","1","0","","",""
"4698214","1","4698825","","2011-01-15 05:35:11","0","587","<p>Is there a way to play animated gif directly in android jdk now?</p>","522431","","","","","2011-01-15 10:51:21","How to play animated gif in android jdk besides extract into static images?","<java><android>","2","0","","",""
"4698382","1","4698871","","2011-01-15 06:49:42","0","896","<p>Currently I am using 26 <code>Textview</code> so that I can apply style to particular character depending on runtime situation.But if I can able to apply style on particular character in textview I can achieve my goal using only one textview.</p><p>e.g.If I want to make character 'M' red in following code. Is it possible to achieve this?</p><pre><code>    &lt;TextView     android:id=""@+id/TextView01""     android:layout_height=""wrap_content""     android:textSize=""20dip""     android:textStyle=""bold""    android:layout_width=""15dip""     android:text=""ABCDEFGHIJKLMNOPQRSTUVWXYZ""     android:background=""#FFFFFF""    android:textColor=""#000000""/&gt;`</code></pre><p>Or anybody have better option than using 26 <code>TextView</code> it also welcome.</p>","484073","","1228","","2011-04-12 19:16:17","2013-04-23 13:37:15","Applying style to particular character in textview","<android>","3","1","","",""
"4698386","1","4701877","","2011-01-15 06:51:09","5","20828","<p>I have a collection of items in an ArrayList. I add them to a customer adapter as follows:</p><pre><code>this.m_adapter = new MyAdapter(this, R.layout.myitem,    itemCart.m_items);</code></pre><p>I have a delete button for each of these items in my list, but I am not sure how to connect the delete button's <code>onClick()</code> with the original item in the ArrayList. Can someone please explain how to do this or point me to a tutorial where I can read up on this?  Non-sarcastic/non-condescending responses are greatly appreciated.</p>","267702","","1353011","","2012-10-19 08:40:17","2013-02-19 08:49:44","Android: how to remove an item from a listView and arrayAdapter","<android><listview><arraylist>","5","0","2","",""
"4698398","1","","","2011-01-15 06:54:57","0","400","<p>I've installed eclipse and android manually at /optHod do I make /opt/android/temp writable by an <em>application</em> group ?I don't want to chmod it to 777.</p><pre><code>sudo chgrp -R eclipse temp/chmod -R g+w temp/</code></pre>","126833","","","","","2011-01-15 06:54:57","Make folder writeable by an Application","<android><eclipse><ubuntu>","0","4","","",""
"4698427","1","","","2011-01-15 07:05:18","0","912","<p>I have <code>listview</code> customized by <code>simplecursoradapter</code> .in each row i have the text and button</p><p>I want to click to both the button and list item , but i only click to button  so what i should do to to <code>onclicklistener</code> them.</p>","568658","","68805","","2012-02-16 19:29:31","2012-02-16 19:29:31","button in listview","<android><listview>","3","1","","",""
"4698445","1","4701105","","2011-01-15 07:11:37","4","1110","<p>Guile looks somewhat straightforward to embed into a C/C++ project, but how does it fare on iOS or Android?  Does it require 3rd party libraries that are unavailable for those platforms?</p><p>How is it as an embeddable scripting language as opposed to JavaScript or Lua?</p>","321897","","13","","2011-01-15 15:10:39","2011-01-16 23:08:06","Is it possible to embed Guile in a C++ app on iOS or Android?","<android><ios><scripting><scheme><guile>","1","1","0","",""
"4698483","1","4698504","","2011-01-15 07:24:37","2","8846","<p>Is there any registration process for creating a daemon application with Google or any other registration site?</p><p>We are making an alert application that runs in the background. Can we create a daemon or is there some another method provided?</p>","565024","","200291","","2011-01-15 07:30:43","2013-09-18 02:26:05","Daemon in Android","<android><daemon>","1","0","2","",""
"4698713","1","","","2011-01-15 08:42:25","0","441","<p>Does anyone know what settings to use for glBlendFunc to achieve cumulative blending?</p><p>For example:1. 50% alpha + 50% alpha = 50% alpha2. 50% alpha + 40% alpha = 50% alpha3. 50% alpha + 60% alpha = 60% alpha</p><p>What I'm tryong to do is render multiple shapes, all of the same colour, but with different alpha values. Some shapes will overlap. I want each resulting pixel to be the equivalent of just rendering once with the largest alpha value.</p><p>I need to use vanilla GL10 so none of the min/max equation stuff is available.</p><p>I'm working on a couple of hotch-potch alternative solutions, one using depth and one using multi-pass rendering, but I have a gut feeling there's a neater way that I'm not seeing.</p>","522858","","44729","","2011-01-16 04:57:28","2011-01-16 04:57:28","Cumulative alpha blending","<android><opengl-es>","1","0","","",""
"4698721","1","4860807","","2011-01-15 08:44:21","-1","163","<p>I am having trouble with my Android App when adding information into SQLite. I am relatively new to Java/SQLite and though I have followed a lot of tutorials on SQLite and have been able to get the example code to run I am unable to get tables to be created and data to import when running my own app. I have included my code in two Java files Questions (Main Program) and QuestionData (helper class represents the database).</p><p>Questions.java:</p><pre><code>public class Questions extends Activity {private QuestionData questions;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.quiztest);questions = new QuestionData(this);try {Cursor cursor = getQuestions();showQuestions(cursor);} finally {questions.close();}}private Cursor getQuestions() {//Select Query String loadQuestions = ""SELECT * FROM questionlist"";SQLiteDatabase db = questions.getReadableDatabase();Cursor cursor = db.rawQuery(loadQuestions, null);startManagingCursor(cursor);return cursor;}private void showQuestions(Cursor cursor) {// Collect String Values from Query and Display them this part of the code is wokring fine when there is data present.</code></pre><p>QuestionData.java</p><pre><code>public class QuestionData extends SQLiteOpenHelper {private static final String DATABASE_NAME = ""TriviaQuiz.db"" ;private static final int DATABASE_VERSION = 2;public QuestionData(Context ctx) {super(ctx, DATABASE_NAME, null, DATABASE_VERSION);}@Overridepublic void onCreate(SQLiteDatabase db) {db.execSQL(""CREATE TABLE questionlist (_id INTEGER PRIMARY KEY AUTOINCREMENT, QID TEXT, QQuestion TEXT, QAnswer TEXT, QOption1 TEXT, QOption2 TEXT, QOption3 TEXT, QCategoryTagLvl1 TEXT, QCategoryTagLvl2 TEXT, QOptionalTag1 TEXT, QOptionalTag2 TEXT, QOptionalTag3 TEXT, QOptionalTag4 TEXT, QOptionalTag5 TEXT, QTimePeriod TEXT, QDifficultyRating TEXT, QGenderBias TEXT, QAgeBias TEXT, QRegion TEXT, QWikiLink TEXT, QValidationLink1 TEXT, QValidationLink2 TEXT, QHint TEXT, QLastValidation TEXT, QNotes TEXT, QMultimediaType TEXT, QMultimediaLink TEXT, QLastAsked TEXT);"");db.execSQL(""INSERT INTO questionlist (_id, QID, QQuestion, QAnswer, QOption1, QOption2, QOption3, QCategoryTagLvl1, QCategoryTagLvl2, QOptionalTag1, QOptionalTag2, QOptionalTag3, QOptionalTag4, QOptionalTag5, QTimePeriod, QDifficultyRating, QGenderBias, QAgeBias, QRegion, QWikiLink, QValidationLink1, QValidationLink2, QHint, QLastValidation, QNotes, QMultimediaType, QMultimediaLink, QLastAsked)""+""VALUES (null,'Q00001','Example','Ans1','Q1','Q2','Q3','Q4','','','','','','','','','','','','','','','','','','','','')"");}@Overridepublic void onUpgrade(SQLiteDatabase db, int oldVersion,int newVersion) {db.execSQL(""DROP TABLE IF EXISTS "" + TABLE_NAME);onCreate(db);}}</code></pre><p>Any suggestions at all would be great. I have tried debugging which suggests that the database does not exist. Thanks in advance for your assistance.</p>","576576","","576576","","2011-01-15 08:49:53","2011-02-01 09:21:20","Adding Information in SQLite","<java><android><sql><sqlite>","1","5","","",""
"4699035","1","4699157","","2011-01-15 10:14:17","7","4105","<p>My Android app is trying to urge a user to upgrade a particular app from the Market. I can detect the old version of the app but how do I redirect user to the app page in Market directly with a button click?</p>","42340","","","","","2011-11-08 12:20:12","How to redirect user to a particular app in Market?","<android>","2","1","3","",""
"4699059","1","","","2011-01-15 10:21:19","0","1414","<p>I want to pass the content of an edittext to a notification in another .java file. The main part of the code is as follows:</p><pre><code>   public class HelloAndroid2 extends Activity {  private Button b2;public Editable etext;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);       EditText editText = (EditText)findViewById(R.id.EditText01);    editText.setText(""name"");    etext = editText.getText();    b2 = (Button) findViewById(R.id.Button02);    b2.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {      //Toast.makeText(HelloAndroid2.this, editText.getText(), Toast.LENGTH_LONG).show();        Toast.makeText(HelloAndroid2.this, etext, Toast.LENGTH_LONG).show();    }    });}</code></pre><p>}</p><p>This should be code for calling the etext variable in my MyService.java file: String MyNotifiyText = etext;What should i do, or how should i call the etext variable in the other .java file?</p>","571648","","","","","2011-01-15 10:37:33","Android passing variable","<android><variables>","2","0","","",""
"4699098","1","4699130","","2011-01-15 10:30:42","7","1680","<p>there has already been some discussion about the problems the gen folder causes together with version control systems (SVN, CVS, Git etc). But what is still unclear for me is, should it be commited or put on the ignore list?What is the recommended way?</p><p>thanks!</p>","97688","","272824","","2011-01-15 10:41:15","2011-01-15 10:41:15","Android and version control systems, commit gen folder or put on ignore list?","<android><svn><git><mercurial><cvs>","1","2","","",""
"4699294","1","4699542","","2011-01-15 11:25:54","0","5401","<p>Hello I have a gridView which I use to show some pictures on (small thumb of diffrent levels).When the user finishes one level, I would like to change the thumb for that level. (Somehow show that it has been completed).</p><p>I created two thumbs for each level. One is the original and one that shows that the level is completed.</p><p>But how can i change the source of the images?</p><p>The code which I use to draw the images looks like this.</p><p>The main activity:</p><pre><code>/** Called when the activity is first created. */public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.maps);  GridView gridview = (GridView) findViewById(R.id.gridview);  gridview.setAdapter(new ImageAdapter(this));  gridview.setOnItemClickListener(new OnItemClickListener() {    @Override      public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {        //Open the map which was clicked on, if there is one        if(position+1 &gt; 1){            Toast.makeText(maps.this, ""Level "" + (position+1) + "" is not yet available!"", Toast.LENGTH_SHORT).show();        }else{            Toast.makeText(maps.this, ""Opening Level "" + (position+1), Toast.LENGTH_SHORT).show();            Intent myIntent = new Intent(v.getContext(), Tutorial2D.class);            startActivity(myIntent);        }      }  });}</code></pre><p>The ImageAdapter Class:</p><pre><code>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 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.setLayoutParams(new GridView.LayoutParams(85, 85));        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);        imageView.setPadding(8, 8, 8, 8);    } else {        imageView = (ImageView) convertView;    }    //Changing    imageView.setImageResource(mThumbIds[position]);    return imageView;}// references to our imagesprivate Integer[] mThumbIds = {        R.drawable.map1, R.drawable.map2, R.drawable.map3,        R.drawable.map4, R.drawable.map5, R.drawable.map6,        R.drawable.map7, R.drawable.map8, R.drawable.map9,        R.drawable.map10, R.drawable.map11, R.drawable.map12,        R.drawable.map13, R.drawable.map14, R.drawable.map15,        R.drawable.map16, R.drawable.map17, R.drawable.map18,        R.drawable.map19};</code></pre><p>}</p>","576671","","","","","2013-01-09 03:50:21","Android GridView - How to change a bitmap dynamically?","<android><gridview><bitmap><bitmapsource>","3","0","1","",""
"4699409","1","4700902","","2011-01-15 11:50:14","0","936","<p>I have 3 classes, let's call them 1, 2, and 3.</p><p>Class 1 extends TabActivity and organizes the whole tab thing, Class 2 and 3 are just two separate tabs each with some lines of text. I call Class 1 from another activity using startActivityForResult.</p><p>I then added an optionsMenu in class 2, and when user clicks the optionMenu, the following code is carried out:</p><pre><code>@Override    public boolean onMenuItemSelected(int featureId, MenuItem item) {        Intent i = new Intent();        switch(item.getItemId()) {            case Result.NEXT_ID:                i.putExtra(Result.PAGE_REQUEST, NEXT);                setResult(RESULT_OK, i);                finish();                break;            case Result.PREV_ID:                i.putExtra(Result.PAGE_REQUEST, PREV);                setResult(RESULT_OK, i);                finish();        }        return super.onMenuItemSelected(featureId, item);    }</code></pre><p>In my parent class (the class that called 1 to begin with), in its onActivityResult function, I want to get the data from the extras. However, the intent is always null, and I can't figure out why.</p><p>When I call finish() on class 2, is it calling some other function in class 1? Do I have to transfer the intent data somehow?</p><p>Here's the startactivityforresult, Result is Class 1</p><pre><code>private void getResult(String result) {        Intent i = new Intent(this, Result.class);        i.putExtra(RESULT, result);        i.putExtra(PAGE, curr_start_page);        startActivityForResult(i, 0);    }</code></pre><p>I also tried to put the optionmenu methods in Class 1, however, when I call finish(), it doesn't do anything.</p><p>Edit:</p><p>I think I should put optionsmenu in Class 1, since im starting class 1 in startActivityForResult. But how do I exit out of a tab layout? calling finish() in class 1 doesn't seem to do the trick.</p>","569421","","569421","","2011-01-15 16:31:17","2011-01-15 17:05:26","android: ending activity from tab","<android><activity><tabs>","2","2","","",""
"4699417","1","6462517","","2011-01-15 11:50:42","7","6390","<p>Im creating an application where i need to position a ImageView depending on the Orientation of the device. I use the values from a MagneticField and Accelerometer Sensors to calculate the device orientation with </p><pre><code>SensorManager.getRotationMatrix(rotationMatrix, null, accelerometerValues, magneticFieldValues)SensorManager.getOrientation(rotationMatrix, values);double degrees = Math.toDegrees(values[0]);</code></pre><p>My problem is that the positioning of the ImageView is very sensitive to changes in the orientation. Making the imageview constantly jumping around the screen. (because the degrees change)</p><p>I read that this can be because my device is close to things that can affect the magneticfield readings. But this is not the only reason it seems.</p><p>I tried downloading some applications and found that the ""<a href=""http://www.androlib.com/android.application.com-a0soft-gphone-acompass-zzzw.aspx"">3D compass</a>"" and ""<a href=""http://www.androlib.com/android.application.com-apksoftware-compass-qAC.aspx"">Compass</a>"" remains extremely steady in its readings (when setting the noise filter up), i would like the same behavior in my application.</p><p>I read that i can tweak the ""noise"" of my readings by adding a ""<strong>Low pass filter</strong>"", but i have no idea how to implement this (because of my lack of Math). </p><p>Im hoping someone can help me creating a more steady reading on my device, Where a little movement to the device wont affect the current orientation.Right now i do a small </p><pre><code>if (Math.abs(lastReadingDegrees - newReadingDegrees) &gt; 1) { updatePosition() }</code></pre><p>To filter abit of the noise. But its not working very well :)</p>","246234","","120261","","2011-01-15 12:40:21","2014-02-02 11:33:46","Android Compass orientation on unreliable (Low pass filter)","<android><algorithm><orientation><signal-processing><compass-geolocation>","5","0","6","",""
"4699502","1","","","2011-01-15 12:10:11","7","6065","<p>Ok, I have a Preferences activity set with an XML layout.Here I have a couple of Preferences that open some dialogs. On these preferences I want to have an arrow on the right of them like in the screenshot. How I do this, is something related to the theme ?First screenshot is how I want to look, second is what I have now.</p><p><a href=""http://img545.imageshack.us/i/screenshot1zlk.png/"">http://img545.imageshack.us/i/screenshot1zlk.png/</a></p><p><a href=""http://img405.imageshack.us/i/tsc3.png/"">http://img405.imageshack.us/i/tsc3.png/</a> </p>","467780","","","","","2011-02-12 22:26:30","How to customize preferences screen theme to look like that?","<android><themes><preferences><customization>","2","3","5","",""
"4699647","1","","","2011-01-15 12:46:51","1","763","<p>i want to close an activity with the back button of my device... any suggestion???</p>","583080","","21234","","2011-01-15 12:48:26","2011-01-15 13:15:02","How can i close an activity with the back button of device?","<android>","3","2","","",""
"4699692","1","","","2011-01-15 12:58:26","0","2761","<p>I'm developing for Android under Ubuntu 10.04 with Eclipse and also with Intellij Idea. If I deploy and debug on virtual devices everything is OK.</p><p>I would like to run my applications directly on my Samsung Galaxy Tab. Therefore I plugged it to the USB port, switched on the ""USB Debugging"" in the Settings and I added a udev rule for the galaxy tab.</p><p>If i call ~/android-sdk-linux_86/platform-tools/adb devices I get also the output, that my samsung galaxy tab is connected. The output is:</p><p>List of devices attached<br>1000abdb6248    device</p><p>Its also possible to connect to the logcat. If i call ./adb logcat I get the log from my galaxy tab.</p><p>I am sure, this is my galaxy tab. Because when I plug off the tab, this device disappears.</p><p>But unfortunately I do not see the device in Eclipse or Idea in the AVD Manager.</p><p>The ""Choose Device"" dialog is empty. But I am able to start virtual devices without problems.</p><p>Any idea how to run and debug application directly on the galaxy tab from the IDE?</p><p>Thanks<br>   frafu</p>","576716","","1676530","","2012-10-03 07:41:31","2012-10-03 07:41:31","Debugging an Android application directly on a device","<android-emulator><android>","3","2","","",""
"4699746","1","","","2011-01-15 13:12:39","0","959","<p>I am going to create call record application, There I need to play minute and recording notification sound. It should here to caller and receiver two parties. Is there any good example for such application?</p><p>Thank You.</p>","377438","","","","","2011-01-15 13:56:31","Android Play background sound","<android>","1","0","","",""
"4699781","1","4699806","","2011-01-15 13:19:23","2","284","<p>I am thinking of starting with android development. </p><p>What are the equivalents of IBActions and IBOutlets in android? </p><p>Is it as easy as Interface Builder to setup connections to code?</p><p>Is it quick to learn the basics of android development if one knows java?</p>","356387","","","","","2011-01-15 13:40:03","Android equivalent of IBActions and IBOutlets","<iphone><android>","2","0","","",""
"4699873","1","4748372","","2011-01-15 13:40:49","2","525","<p>I have an OptionMenu which has single option in it named ""Search"". When the search option is clicked, it should dynamically add a EditText at the top of Activity window like it has in WebView (browser address bar) so users could search something in my application.</p><p>After there would be EditBox, one can write inside it. I also want to have some OnTextChanged like event of that EditBox so do you think it's also available with that View?</p>","355507","","355507","","2011-01-15 15:18:54","2011-01-20 14:36:13","Android Floating EditBox","<android><editbox>","1","0","","",""
"4700058","1","4700185","","2011-01-15 14:21:23","1","4809","<p>This works fine:</p><pre><code>Intent intent = new Intent(HelloAndroid2.this, AlarmReceiver.class);    PendingIntent pendingIntent = PendingIntent.getBroadcast(HelloAndroid2.this, 0,    intent, PendingIntent.FLAG_ONE_SHOT);    AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);    alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + (12 * 1000), pendingIntent);</code></pre><p>This doesn't work. I hear the alarm only time.</p><pre><code>alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + (12 * 1000), 3 * 1000, pendingIntent);</code></pre><p>I have also tried this, no luck:</p><pre><code>Calendar calendar = Calendar.getInstance();    calendar.setTimeInMillis(System.currentTimeMillis());    calendar.add(Calendar.SECOND, 5);    alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), 7000, pendingIntent);</code></pre><p>What is the problem?</p>","571648","","","","","2011-07-18 19:25:47","Android repeating alarm not working","<android><repeat><alarm>","2","0","","",""
"4700089","1","","","2011-01-15 14:27:19","4","2156","<p>I have a relativelayout, and in it two textviews. Textview 1 is aligned top and left with parent. Textview 2 is aligned to the right of textview 1, and to the right with parent. This creates a problem if the text in 1 is too long, meaning that 1 will push 2 out of the screen worst case.</p><p>How do I get these two to ""sacrifice"" from text nr 1 instead of 2? min width does not seem to work. My final goal is to ellipsize text 1, but seems to hinge on the textview to be sized correctly in the first place.</p><p>Here is the xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout android:id=""@+id/RelativeLayout01""                android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TextView android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:id=""@+id/TextView02""          android:layout_alignParentRight=""true""          android:layout_toRightOf=""@+id/TextView01""          android:text=""I am number 2""          android:gravity=""right""          android:lines=""1""          android:minWidth=""32sp""&gt;&lt;/TextView&gt;&lt;TextView android:layout_height=""wrap_content""          android:layout_alignParentTop=""true""          android:id=""@+id/TextView01""          android:layout_alignParentLeft=""true""          android:textSize=""22sp""          android:layout_width=""wrap_content""          android:lines=""1""          android:text=""sd sd asd sad asd asd saasd a""&gt; &lt;/TextView&gt;&lt;/RelativeLayout&gt;</code></pre>","266486","","","","","2014-03-05 12:35:57","TextView and Ellipsize when squeezed by other TextView","<android><android-layout><textview><relativelayout><android-textview>","2","1","","",""
"4700091","1","4700491","","2011-01-15 14:27:27","3","923","<p>I have a LinearLayout that would contain some other views. I would like to have the ability to zoom in and out on the actual LinearLayout as a whole. Is there a way to do that?</p><p>thanks in </p>","576768","","","","","2013-10-10 02:49:38","Zoom with LinearLayout","<android>","1","0","2","",""
"4700109","1","","","2011-01-15 14:30:10","3","3466","<p>While debugging the code below, BroadcastReceiverCustom is beingcalled but PhoneStateListenerCustom is not.</p><p>For now I and doing required action in BroadcastReceiverCustom only,but maynot be best place to do it.Any suggestions why PhoneStateListener not being called??Already spent lot of time for possible reasons, no idea??Manifest file is all correct with correct permissions.I see no runtime exceptions.</p><p>BroadcastReceiverCustom.java</p><pre><code>public class BroadcastReceiverCustom extends BroadcastReceiver {private static final String TAG = ""BroadcastReceiverCustom"";    @Override    public void onReceive(Context context, Intent intent) {        Log.v(TAG, ""WE ARE INSIDE!!!!!!!!!!!"");        TelephonyManager telephony = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);        PhoneStateListenerCustom phoneStateListenerCustom = new PhoneStateListenerCustom();        telephony.listen(phoneStateListenerCustom, PhoneStateListener.LISTEN_CALL_STATE);    }}</code></pre><p>PhoneStateListenerCustom.java</p><pre><code>public class PhoneStateListenerCustom extends PhoneStateListener {    private static final String TAG = ""PhoneStateListenerCustom"";    public void onCallStateChange(int state, String incomingNumber){        Log.v(TAG, ""WE ARE INSIDE!!!!!!!!!!!"");        switch(state){            case TelephonyManager.CALL_STATE_RINGING:                 Log.d(TAG, ""RINGING"");                 break;        }        super.onCallStateChanged(state, incomingNumber);    }}</code></pre><p>Manifest file</p><pre><code>&lt;uses-permission android:name=""android.permission.READ_PHONE_STATE"" /&gt;&lt;receiver android:name="".BroadcastReceiverCustom""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.PHONE_STATE"" /&gt;    &lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre>","211249","","857361","","2012-07-26 10:10:34","2012-10-09 19:23:47","BroadcastReceiver called but PhoneStateListener not called","<android><broadcastreceiver><phone-state-listener>","2","0","","",""
"4700225","1","","","2011-01-15 14:58:02","17","5342","<p>I'm programming a radio streaming app. I run the ""radio playing"" as a remote Service by using AIDL interface technique to communicate with the Service. But I don't really understand one thing.</p><p>What is the ""out"" in a AIDL interface parameter value?</p><p>Like this:</p><pre><code>String doSomething(in String a, out String[] b);</code></pre><p>I understand ""in"", that is sending data to the remote when the method is called from activity.</p><p>What is the ""out"", and why we need ""in"" and ""out"" in same method? In which case are they(""out/inout"") used? Why is the <code>String[]</code> ""out""?</p><p>Please help..</p>","566096","","875832","","2013-04-18 05:22:52","2013-04-18 05:22:52","""In/out/inout"" in a AIDL interface parameter value?","<android><interface><aidl>","1","1","6","",""
"4700285","1","9629095","","2011-01-15 15:13:23","9","14377","<p>I have seen a lot of tutorials and been trying for 2 hours now , though something is still wrong. I am very nervous now :) I want to set an alarm e.g. to 16:25 to go off, but nothing happens. I have this code:</p><pre><code>   Calendar cur_cal = new GregorianCalendar();    cur_cal.setTimeInMillis(System.currentTimeMillis());    Calendar cal = new GregorianCalendar();    cal.add(Calendar.DAY_OF_YEAR, cur_cal.get(Calendar.DAY_OF_YEAR));    cal.set(Calendar.HOUR_OF_DAY, 16);    cal.set(Calendar.MINUTE, 25);    cal.set(Calendar.SECOND, 0);    cal.set(Calendar.MILLISECOND, 0);    alarmManager.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), pendingIntent);</code></pre><p>I have also tried this:</p><pre><code> cal.set(Calendar.AM_PM, cur_cal.get(Calendar.AM_PM));    cal.set(Calendar.HOUR, 4);</code></pre><p>My final goal is to make it a repeating alarm, e.g. it should go off every day at the set time.</p><p>Update 01.17.2011. Still not working. I have this code:</p><pre><code>           Calendar cal = Calendar.getInstance();            cal.set(Calendar.YEAR, 2011);            cal.set(Calendar.MONTH, Calendar.JANUARY);             cal.set(Calendar.DAY_OF_MONTH, 17);            cal.set(Calendar.HOUR_OF_DAY, 16);            cal.set(Calendar.MINUTE, 58);         cal.set(Calendar.SECOND, 0);          cal.set(Calendar.MILLISECOND, 0);</code></pre><p>I have also tried this:</p><pre><code> cal.set(Calendar.HOUR, 4); cal.set(Calendar.AM_PM, Calendar.PM);</code></pre><p>and this:</p><pre><code>cal.set(Calendar.HOUR_OF_DAY, 4 );            cal.set(Calendar.AM_PM, Calendar.PM);</code></pre>","571648","","571648","","2011-01-17 16:04:40","2013-01-08 04:15:43","Android - how to set an alarm to a specific date","<android><calendar><alarm>","4","0","8","",""
"4700311","1","","","2011-01-15 15:16:20","0","304","<p>I am unable to develop a popUp Calendar for a month where the user can select multiple dates.Does Android provide any API for such ?If not , can anyone provide any hints/sample code to develop the same.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2011-04-17 01:28:43","Need to develop popup Calendar for a month","<android>","1","1","","",""
"4700357","1","4700411","","2011-01-15 15:24:02","4","41057","<p>Im trying to compare the values of two edittext boxes. What i would like is to just compare passw1 = passw2. As my code is now comparing two strings i have entered as i could not get to compare them.</p><pre><code> final EditText passw1= (EditText) findViewById(R.id.passw1); final EditText passw2= (EditText) findViewById(R.id.passw2); Button buttoks = (Button) findViewById(R.id.Ok);      buttoks.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            if (passw1.toString().equalsIgnoreCase(""1234"") &amp;&amp; passw2.toString().equalsIgnoreCase(""1234"")){      Toast.makeText(getApplication(),""Username and password match"", Toast.LENGTH_SHORT).show();      }    else {        Toast.makeText(getApplication(),""Username and password doesn't match"", Toast.LENGTH_SHORT).show();      }     }   }); </code></pre>","554215","","47961","","2011-01-15 16:23:46","2014-01-06 11:16:30","Comparing strings in Java","<java><android><string>","8","0","1","",""
"4700371","1","","","2011-01-15 15:26:45","-1","225","<p>Little confussion, new in android,i have  CUSTOM listviewand on clicking the rows i want a new intent to b created of textview(image,text and buttons)...</p><p>I m building this Offline (no internet &amp; no_phone_backup) application for my classtill now i have: 4tabs(section a,b,c &amp; d) and on each tab i have a listview(student name).</p><p>Problem:- Confussion: how to select the rows and is it possible to generate textview form(student detail) from listview.</p><p>thank youPLZ. . .RPLY ASAP....>>>>></p><blockquote>  <p>Blockquote</p></blockquote>","576742","","","","","2011-01-16 01:14:18","confusion: question on intent","<android><source-code><android-layout><android-intent>","2","1","","",""
"4700387","1","","","2011-01-15 15:29:57","1","1053","<p>I am on Windows 7 with JDK 1.6. I downloaded Android SDK. Added and setup ADT for Eclipse. Wrote a Hello World app in Android. Eclipse is not able to identify ""Activity"" and other android packages. I added tools folder to path. Still am receiving the same problem. </p><p>In Eclipse I started getting message ""SDK misssing... Run SDK set up"". On reading more, I found that I had to install the SDK prior installing ADT. Now am trying to install SDK, but it says ""tools folder is being used by some app"". I removed from path also and closed all applications, explorer, etc yet I receive the same message. </p><p>I guess the only place left is the setting of ADT in Eclipse. Am I correct ? If so, what to do to install the SDK and then set ADT ! Or what's wrong can anyone point out and help me set Android on my PC.</p><p>Any help is highly appreciative.</p><p>Thanks</p>","455979","","287727","","2011-01-15 15:40:46","2012-12-28 07:54:20","Problem in Setting Android - Need to ReSet ADT !","<android><sdk><set><adt>","1","0","1","",""
"4700399","1","","","2011-01-15 15:32:29","2","244","<p>If I have to do some specific actions while connected to a specific wifi network, what can I save inside my DataBase to be sure that I'm connected exactly to that network?I saw that Android doesn't save the BSSID of a saved network but only the SSID and multiple profile with the save SSID are allowed so I can't use it.</p>","576804","","","","","2011-02-09 12:40:47","Is there a unique identifier for a saved netword on an Android device?","<android><networking><wifi><ssid><bssid>","1","2","1","",""
"4700650","1","4700724","","2011-01-15 16:15:35","2","9710","<p>I have several TextViews in a row and I want the 1st TextView to take up all spare space but if the combined length of the TextViews is too long to fit on one line, I want the 1st TextView to be cut off.</p><p>As for the spare space I have set the 1st TextView's layout_width to match parent and layout_weight to 1 which works. I just can't get it to cut off any extra letters so it fits on one row.</p><p>What I want is something like the following with 'Text' and 'Long Text'</p><pre><code>'Text   :data''Long T :data'</code></pre><p>So 'Long Text' gets cut off to 'Long T' in order to fit.</p><p>What I get is </p><pre><code>'Text   :data''Long Text :d'</code></pre><p>Thanks!</p>","554508","","","","","2012-06-23 02:44:45","How do I set the android text view to cut any letters that don't fit in a layout","<android><layout><textview>","1","0","2","",""
"4700668","1","4700689","","2011-01-15 16:20:06","1","1443","<p>When a user returns from an activity to the main menu of my program, what class do you use to for example; refresh/restart the main menu (update it)?</p>","576820","","","","","2011-01-15 16:26:12","Android - Refresh/restart a previous activity","<android><database><activity><refresh><restart>","1","0","0","",""
"4700736","1","","","2011-01-15 16:38:01","0","302","<p>I have a problem disabling views from my Gallery in my Android application. Nothing seems to happen with the View when I click it. Here is my <code>onItemClick(...)</code> method:</p><pre><code> @Override public void onItemClick(AdapterView&lt;?&gt; adapterView, View view,   int position, long id) {        view.setEnabled(false);    }</code></pre><p>I have also tried <code>setVisibility(...)</code>What am I missing?</p><p>Thanks in advance.</p>","490315","","","","","2011-01-15 18:39:11","Disable Gallery View","<java><android><gallery>","1","3","","",""
"4700839","1","4700907","","2011-01-15 16:53:56","1","687","<p>does someone know how to get rid of black rows in ListView, please have a look on the screenshot. </p><p><img src=""http://i.stack.imgur.com/BRk2L.png"" alt=""alt text""></p><p>The xml for each row: </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/list_view""&gt;    &lt;RelativeLayout        android:id=""@+id/r_layout_for_tasks""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:background=""#ffffff""&gt;        &lt;ImageView            android:id=""@+id/icon_image_view""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:src=""@drawable/clock""            android:layout_alignParentLeft=""true""&gt;        &lt;/ImageView&gt;        &lt;TextView            android:id=""@+id/task_text_view""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:paddingLeft=""10dp""            android:layout_toRightOf=""@id/icon_image_view""&gt;        &lt;/TextView&gt;             &lt;TextView            android:id=""@+id/time_text_view""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_alignParentRight=""true""&gt;        &lt;/TextView&gt;    &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>The activity's 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""  android:background=""#ffffff""&gt;  &lt;RelativeLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:padding=""10dp""    android:background=""#ffffff""&gt;    &lt;Button        android:id=""@+id/ok_button""        android:onClick=""onClickOKButton""        android:text=""OK""        android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""        android:minWidth=""60dp""        android:layout_alignParentRight=""true""&gt;    &lt;/Button&gt;       &lt;EditText        android:id=""@+id/edit_text""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:hint=""Task description""        android:layout_toLeftOf=""@id/ok_button""&gt;    &lt;/EditText&gt;  &lt;/RelativeLayout&gt;&lt;ListView    android:id=""@+id/list_view""         android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""10dp""&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre>","397991","","","","","2011-01-15 17:08:24","How to get rid of black rows in ListView layout","<android><listview>","3","0","","",""
"4700888","1","4701264","","2011-01-15 17:03:28","1","562","<p>i want to build an application on Android platform that will convert text to speech for the text,documents,pdf files.  Multireader app. does the same thing.is there any open source app. similar to this ?i know  how to build text to speech for text ,but how to make it work for other file types ?</p>","575805","","","","","2011-01-15 18:09:54","Text to Speech Android Application Query","<android>","1","0","","",""
"4700945","1","4701077","","2011-01-15 17:11:41","8","8479","<p>I want to access a youtube video and play using my own media player. I am able to get the video properties (title, url etc..) using the youtube data API. Can I get access to the stream of the video and use my own Media Player (like the Android Media Player) to play it.I am trying all of these in JAVA.</p><p>Thanks in advance.. :)</p>","381417","","","","","2012-12-23 19:02:00","Youtube data API : Get access to media stream and play (JAVA)","<java><android><youtube><youtube-api>","3","2","3","",""
"4700974","1","4704844","","2011-01-15 17:18:35","0","3182","<p>Here is the code of main activity. I added TextView in addJoke() method, but it doesn't appear in LinearLayout. please solve.</p><pre><code>package edu.calpoly.android.lab2;import java.util.ArrayList;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.view.KeyEvent;import android.view.Menu;import android.view.View;import android.view.View.OnClickListener;import android.view.View.OnKeyListener;import android.view.ViewGroup.LayoutParams;import android.view.inputmethod.InputMethodManager;import android.widget.Button;import android.widget.EditText;import android.widget.LinearLayout;import android.widget.TextView;public class AdvancedJokeList extends Activity {    private static int i=0;    //protected String m_strAuthorName;    protected ArrayList&lt;Joke&gt; m_arrJokeList=new ArrayList&lt;Joke&gt;();    //protected JokeListAdapter m_jokeAdapter;    /**     * ViewGroup used for maintaining a list of Views that each display Jokes.     **/    protected LinearLayout m_vwJokeLayout;    protected EditText m_vwJokeEditText;    protected Button m_vwJokeButton;    protected int m_nDarkColor;    protected int m_nLightColor;    /**     * Filter Options Submenu constants     */    protected static final int FILTER_OPTIONS = 1;    protected static final int LIKE = Menu.FIRST + 1;    protected static final int DISLIKE = Menu.FIRST + 2;    protected static final int UNRATED = Menu.FIRST + 3;    protected static final int SHOW_ALL = Menu.FIRST + 4;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        initLayout();        String[] jokestring=getResources().getStringArray(R.array.jokeList);            for(String str : jokestring)         {                Joke j=new Joke();                j.setJoke(str);                addJoke(j);        }        initAddJokeListeners();    }    protected void addJokeImplementation(){        String strJoke=m_vwJokeEditText.getText().toString().trim();        if(!strJoke.equals(""""))        {        Joke joke=new Joke();        joke.setJoke(strJoke);        addJoke(joke);        }    }    protected void initLayout() {        setContentView(R.layout.advanced);        m_vwJokeLayout=(LinearLayout)findViewById(R.id.jokeListViewGroup);        m_vwJokeEditText=(EditText)findViewById(R.id.newJokeEditText);        m_vwJokeButton=(Button)findViewById(R.id.addJokeButton);    }    protected void initAddJokeListeners() {        // TODO        m_vwJokeEditText.setOnKeyListener(new OnKeyListener(){            @Override            public boolean onKey(View v,int keyCOde, KeyEvent event){                if(event.getAction()==KeyEvent.ACTION_DOWN)                {                    if(keyCOde==KeyEvent.KEYCODE_DPAD_CENTER)                    {                        addJokeImplementation();                    }                }                return false;            }        });        m_vwJokeButton.setOnClickListener(new OnClickListener() {            @Override        public void onClick(View view) {        //Implement code to add a new joke here...                addJokeImplementation();            }        });    }    protected void addJoke(Joke joke) {         if(!m_arrJokeList.contains(joke))          {            m_arrJokeList.add(joke);            //I also added textview here this one also            //doesn't appear in Emulator layout, wondering whats wrong?;            TextView TV=new TextView(this);            TV.setLayoutParams(new LayoutParams(                    LayoutParams.FILL_PARENT,                    LayoutParams.WRAP_CONTENT));            TV.setText(joke.toString());            m_vwJokeLayout.addView(TV);            m_nDarkColor=getResources().getColor(R.color.dark);            m_nLightColor=getResources().getColor(R.color.light);                   if(i==0)            {                TV.setBackgroundColor(m_nLightColor);                i=1;            }            else            {                TV.setBackgroundColor(m_nDarkColor);                i=0;            }            m_vwJokeEditText.setText("""");            InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);            imm.hideSoftInputFromWindow(m_vwJokeEditText.getWindowToken(), 0);          }    }             /**     * Method used to retrieve Jokes from online server. The getJoke script     * takes a single optional parameter, which should be encode in ""UTF-8"".     * This parameter allows tells script to only retrieve Jokes whose author     * name matches the value in the parameter.     *      * param-1) ""author"": The author of the joke.     *      * URL: http://simexusa.com/aac/getJokes.php?     *      */    protected void getJokesFromServer() {        // TODO    }    /**     * This method uploads a single Joke to the server. This method should test     * the response from the server and display success or failure to the user     * via a Toast Notification     *      * The addJoke script on the server requires two parameters, both of which     * should be encode in ""UTF-8"":     *      * param-1) ""joke"": The text of the joke.     *      * param-2) ""author"": The author of the joke.     *      * URL: http://simexusa.com/aac/addJoke.php?     *      * @param joke     *            The Joke to be uploaded to the server.     *      */    protected void uploadJokeToServer(Joke joke) {        // TODO    }}         </code></pre><p>Here is  advanced.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""    &gt;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        &gt;        &lt;Button            android:id=""@+id/addJokeButton""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""Add Joke""            /&gt;        &lt;EditText            android:id=""@+id/newJokeEditText""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:hint=""Enter Joke""            /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        android:id=""@+id/jokeListViewGroup""        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        &gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Update: Modified code a little bit, added Layout.params() but still TextView doesn't appear.</p>","517525","","517525","","2011-01-16 09:20:29","2011-01-16 10:29:22","TextVIew doesn't appear or doesn't get added to LinearLayout","<android><android-layout><textview>","3","0","","",""
"4700993","1","","","2011-01-15 17:21:55","0","1891","<p>Trying to get my custom Bluetooth device to be read by my Android phone.  So far, the device is sending data continuously, and I can receive it on a PC with a BT interface running SPP and hyperterminal.</p><p>Now changing the PC to my Evo, I installed <a href=""http://developer.android.com/resources/samples/BluetoothChat/index.html"" rel=""nofollow"">BluetoothChat</a> but it won't connect to my phone.  Found a few SPP terminal emulator apps in the market, but those seem to be based off Bluetooth Chat and also won't connect.  However, Amarino on the same phone connects to the same bluetooth device properly (but that is not a terminal program).</p><p>I'm just getting started with Android programming, so not sure where to go from here.  I don't see much docs on how the Bluetooth API works.  Anyone know where I can get info on this?  Or perhaps some other terminal program that will work.</p><p>Thanks.</p>","576895","","","","","2013-07-05 06:36:54","Bluetooth terminal app (interface BT device to Android via SPP)?","<android><bluetooth>","1","0","","",""
"4701017","1","","","2011-01-15 17:27:25","1","2036","<p>I am trying to find a way to take a picture from the camera of a netbook (Win7 or Android) inside a web browser(either chrome, firefox or ie). After that I want to take that image as a file(or binary) back into the web browser. </p><p>Is this possible? or does anyone have a code sample for a similar situation like this? </p><p>Assume that user agrees to give all the privileges that are required.</p><p>Regards,sakal</p>","333878","","","","","2011-01-15 17:39:47","Taking a Picture from Web Browser","<javascript><android><windows><browser><camera>","1","0","1","",""
"4701025","1","","","2011-01-15 17:27:59","0","85","<p>I develop app which will download information from Internet server and show search results in ListView. When user clicks on item more detailed information will be shown. The question is whether to write search results before showing to DB or not? I know that Activity lifecycle can loose all data and some developers recomend to do it safe, but is it really necessary?</p>","468311","","","","","2011-01-15 17:42:08","Android showing results of the query to the server","<android>","1","0","","",""
"4701275","1","","","2011-01-15 18:11:35","2","9071","<p>I just started learning programming at the android and I have a problem with using variable at onSaveInstanceState. This is my code:</p><pre><code>int resultCode;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    if (savedInstanceState != null) {        super.onRestoreInstanceState(savedInstanceState);        int resultCode = savedInstanceState.getInt(""resultCode"");    }     Button btnOpenWithResult = (Button)findViewById(R.id.btnOpenWithResult);    btnOpenWithResult.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View arg0) {            // TODO Auto-generated method stub            Intent myIntent = new Intent(flashlight.this, ThirdActivity.class);            startActivityForResult(myIntent, 1);        }    });}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    // TODO Auto-generated method stub    super.onActivityResult(requestCode, resultCode, data);    switch (resultCode) {    case 1:            /** option 1  */                    break;    case 2:         /** option 2 */        break;} @Overridepublic void onSaveInstanceState(Bundle savedInstanceState) {     savedInstanceState.putInt(""resultCode"", resultCode);    super.onSaveInstanceState(savedInstanceState);}</code></pre><p>I want to save the variable resultCode using onSaveInstanceState and after the resumption of activity once again to use it ...</p><p>(sorry for my level of English)</p>","576930","","","","","2012-09-18 18:41:19","how to use variable in onSaveInstanceState","<android>","1","2","1","2013-06-20 13:27:04",""
"4701319","1","4701372","","2011-01-15 18:17:31","1","1376","<p>Colleagues, please advice how can I or remove these black lines which appears on ListView scrolling (see screenshot) either disable them?<img src=""http://i.stack.imgur.com/F1HOs.png"" alt=""alt text""></p>","397991","","","","","2011-01-16 04:15:34","How to disable or change color for black rows while ListView scrolling","<android><listview>","3","0","1","",""
"4701327","1","","","2011-01-15 18:19:22","0","648","<p>I’m looking for a way to replace the animation of the emulator cam in Android with an own animation or at least a picture. I don’t want to connect the emulator with a webcam and if possible don’t want to get any code in my Projects to replace the animation. Does anyone have a solution?Thanks a lot.</p>","552865","","","","","2011-03-11 06:56:59","Change the Camera Animation of the Android Emulator","<android><animation><android-emulator><camera>","1","2","1","",""
"4701332","1","","","2011-01-15 18:20:23","0","201","<p>It's probably obvious but I can't figure out how I'm supposed to link the data that has already been parsed to an XML built UI? As in, I want to make a template for where the data should go on the UI and when the Activity is called, it will plug the data into the XML created UI.</p><p>Thanks</p>","576934","","","","","2011-01-15 18:24:51","How to present parsed data to an XML built UI?","<android><xml><user-interface><data>","1","1","","",""
"4701365","1","4701524","","2011-01-15 18:25:45","5","4116","<p>I want pass one parameter in a Url (to update one of many paramaters contained by my URL) like this:</p><pre><code>httpGet.setURI(new URI(url/user?""nickname""=""John"") </code></pre><p>ServerSide in Python:</p><pre><code>class GetInfo(BaseHandler):  def Get(self):        nickname = self.get_argument(""nickname"")        gender = self.get_argument(""gender"")        logging.info(nickname)        logging.info(gender)  application = tornado.web.Application([  (r""/"", MainHandler),  (r""/user"", GetInfo),  ])</code></pre><p>The server told me that I can't do this because the parameter ""gender"" is missing.How can I do?</p><p>Thanks </p>","420574","","126214","","2011-01-15 18:38:50","2011-01-18 07:47:57","Pass one parameter in a Tornado HttpGet with several parameters","<python><android><http-post><tornado><http-get>","1","2","2","",""
"4701450","1","","","2011-01-15 18:43:02","0","799","<p>I am trying to get the location updates but it takes anything between 30 seconds - 5 mins. So i decided to throw in coarse location which is faster and run the GPS_PROVIDER in background. But no luck. As of now after the coarse location is executed, the control never goes to onLocationChanged in GPS_PROVIDER listener. Is there some way to get the updates faster, so the user does not have to wai long?</p>","484691","","388614","","2013-12-20 19:21:42","2013-12-20 19:21:42","Is there anyway to requestLocationUpdates fast using GPS_PROVIDER in android","<android><gps><location>","2","0","","",""
"4701510","1","4702167","","2011-01-15 18:56:50","0","1228","<p>Sorry if this is a repeat, none of the solutions I found online worked for me.</p><p>I have 2 tabs, and I'm trying to add a list unto one of the tabs. Here's the code:</p><pre><code>public class Library extends ListActivity {    ParsingDBHelper mDbHelper;    ListView lv;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Bundle extra = getIntent().getExtras();        String temp = extra.getString(Httpdwld.RESULT);        mDbHelper = new ParsingDBHelper(this);        mDbHelper.open();        parsing();        fillData();    }        private void parsing() {        // IMPLEMENT    }    private void fillData() {        Cursor c = mDbHelper.fetchAllSearch();        String[] FROM = new String[] {ParsingDBHelper.KEY_TITLE, ParsingDBHelper.KEY_AUTHOR,                ParsingDBHelper.KEY_YEAR, ParsingDBHelper.KEY_LOCATION,                 ParsingDBHelper.KEY_CALL_ISBN, ParsingDBHelper.KEY_AVAILABILITY};        int[] TO = new int[] {R.id.row_title, R.id.row_author, R.id.row_year,                 R.id.row_location, R.id.row_id, R.id.row_avail};        SimpleCursorAdapter notes =             new SimpleCursorAdapter(this, R.layout.row_layout, c, FROM, TO);        lv.setAdapter(notes);    }}</code></pre><p>mDbHelper is simply a a helper for using SQLiteDatabase.</p><p>Here's my XML code for the Tabs</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=""wrap_content""            android:padding=""5dp"" &gt;                       &lt;/FrameLayout&gt;        &lt;ListView android:id=""@android:id/list""            android:layout_width=""fill_parent""             android:layout_height=""wrap_content""         /&gt;    &lt;/LinearLayout&gt;&gt;&lt;/TabHost&gt;</code></pre><p>But I keep getting ""Cannot start Activity: Library"" error. Here's where I call Library</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.search_result);        TabHost tabHost = getTabHost();        TabHost.TabSpec spec;        Intent intent;        intent = new Intent(this, Library.class);        // Initialize a TabSpec for each tab and add it to the TabHost        spec = tabHost.newTabSpec(""Library"").setIndicator(""Library"")        .setContent(intent);        tabHost.addTab(spec);</code></pre><p>}</p><p>Any suggestions?</p>","569421","","","","","2011-01-15 21:11:32","android: listActivity under Tab","<android><listview><tabs><listactivity>","1","1","","",""
"4701536","1","4719764","","2011-01-15 19:02:51","2","6066","<p>I installed the Android SDK and Eclipse on OSX.  When I check my ~/.android folder there is no debug.keystore.  My understanding though is that it gets created when you run, build, or clean.  I create a simple HelloWorld project and set up my run configurations.  When I try to run I see the following error:</p><p>Error generating final archive: Unable to get debug signature key   HelloAndroid        Unknown Android Packaging Problem</p><p>I then see that the debug.keystore still isn't created.</p>","576955","","","","","2013-06-27 22:15:54","Unable to get debug signature key while setting up SDK/Eclipse on OSX","<android>","4","0","","",""
"4701727","1","4702242","","2011-01-15 19:35:33","4","3344","<p>I need to make some videos of Android applications for a presentation. All solutions I found in the Android SDK can only take pictures. Is there a possibility to create a video - for example on a rooted device?</p><p>edit: I found the project droidAtScreen but the frame rate isn't very good...</p>","247002","","247002","","2011-01-15 19:47:15","2012-01-25 07:15:29","Capture video of applications from an Android device","<android><video-capture>","2","0","2","2013-03-30 15:32:42",""
"4701825","1","4701916","","2011-01-15 19:56:57","1","2616","<p>How do I get the VideoView to go Fullscreen in lanscape?</p><p>I've set the following in the manifest file for the activity.</p><p>android:screenOrientation=""landscape""android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""></p><p>Is there anything else I need to do?</p>","553462","","","","","2013-03-13 06:50:18","VideoView in Fullscreen","<java><android>","3","0","1","",""
"4701842","1","4701909","","2011-01-15 20:00:21","0","1395","<p>I d like to ""kill"" the black color of my texture. Or, I want to show png files, without background (transparent bg)</p><p>How i can do this?Any example?</p>","472537","","44729","","2011-01-16 04:56:25","2011-01-16 04:56:25","Android OpenGL ES Texturing - alphablending","<android><opengl-es>","1","0","1","",""
"4701928","1","","","2011-01-15 20:21:11","17","16747","<p>I am looking for a way to replace the stock lock screen (with an app, not a rom).What is the best way to do it, for a start to disable the lock screen on as much devices as possible?Thanks!</p>","246206","","","","","2013-08-14 06:35:31","Disable Lock Screen","<android>","4","1","7","",""
"4701933","1","4702027","","2011-01-15 20:22:31","2","564","<p>I'm planning to write an application that would provide results in quick search box. </p><p>Is there any way to fire an Intent to navigate user to ""Searchable items"" screen in Android 1.6?</p><p><img src=""http://i.stack.imgur.com/fKFAw.png"" alt=""alt text""></p>","296427","","","","","2013-06-17 11:52:29","How to navigate user to ""Searchable Items"" setting?","<android><search><preferences>","3","0","","",""
"4701975","1","4702015","","2011-01-15 20:32:17","1","1450","<p>Okay, here's my problem. The system I'm working with uses objects called Areas to represent a 920x920 metre area on a map. The only reference given for the Area, however, is the latitude and longitude for the top-left corner of the grid square.</p><p>What I need to do is work out whether the user's current GPS location falls within a specific area, so I'm writing a function that checks if this is the case, and if so returns data from that area object.</p><p>Where I'm struggling is actually working out the best way to do the location checking, when all I have to go on is the user's exact lat/long and a known lat/long for the top left of the grid square...what would be the best way to approach this problem?</p><p>Many thanks for any help.</p>","577028","","","","","2011-01-15 20:40:45","Determining if a GPS position (lat/long) is within a fixed area... [Android]","<java><android><gps><location><area>","1","5","2","",""
"4702095","1","","","2011-01-15 20:56:42","-1","1179","<p>Going back to develop on Android. Eclipse wasn't downloading the 2.3 SDK, so I decided to just reinstall everything.</p><p>I found I needed the 32 bit version of Java SE sdk, jdk-6u23-windows-i586.exe from Oracle's web site.</p><p>Downloaded eclipse and put it in the programs directory, but when I try to run Eclipse now I get the error message ""Failed to load the JNI shared library c:\Program Files (x86)\Java\jdk1.6.0_23\bin\client\jvm.dll. The jdk installer didn't create a bin\client directory.</p>","325124","","","","","2011-01-16 15:35:43","Reinstalling Android development tools--now getting Failed to load the JNI shared library","<java><android><eclipse>","2","2","","",""
"4702204","1","4702378","","2011-01-15 21:17:06","1","16475","<p>The Android market://details?id= link is not working for only one of my apps and it is driving me insane.  I am pulling my hair out does anyone have any idea?  It is my ""Wrap It Up Box"" link that just comes up as ""Not Found"" ""The requested item could not be found.""(last link below).  If you search Wrap It Up Box it shows up just fine, just directly linking to it isn't working.</p><pre><code>    public void onClick(View v){    switch (v.getId()){    case R.id.morebubrubsoundboardBtn:        Intent goToMarket = null;        goToMarket = new Intent(Intent.ACTION_VIEW,Uri.parse(""market://details?id=com.jayavon.bubrubsoundboard""));        startActivity(goToMarket);    break;    case R.id.morefarmvillehelperBtn:        Intent goToMarket1 = null;        goToMarket1 = new Intent(Intent.ACTION_VIEW,Uri.parse(""market://details?id=com.jayavon.farmvillehelper""));        startActivity(goToMarket1);    break;    case R.id.morefarmvillehelperfreeBtn:        Intent goToMarket2 = null;        goToMarket2 = new Intent(Intent.ACTION_VIEW,Uri.parse(""market://details?id=com.jayavon.farmvillehelperfree""));        startActivity(goToMarket2);    break;    case R.id.morefishvillehelperBtn:        Intent goToMarket3 = null;        goToMarket3 = new Intent(Intent.ACTION_VIEW,Uri.parse(""market://details?id=com.jayavon.fishvillehelper""));        startActivity(goToMarket3);    break;    case R.id.morefishvillehelperfreeBtn:        Intent goToMarket4 = null;        goToMarket4 = new Intent(Intent.ACTION_VIEW,Uri.parse(""market://details?id=com.jayavon.fishvillehelperfree""));        startActivity(goToMarket4);    break;    case R.id.morelarrysoundboardBtn:        Intent goToMarket5 = null;        goToMarket5 = new Intent(Intent.ACTION_VIEW,Uri.parse(""market://details?id=com.jayavon.larrysoundboard""));        startActivity(goToMarket5);    break;    case R.id.moreleonsoundboardBtn:        Intent goToMarket6 = null;        goToMarket6 = new Intent(Intent.ACTION_VIEW,Uri.parse(""market://details?id=com.jayavon.leonsoundboard""));        startActivity(goToMarket6);    break;    case R.id.morewrapitupboxBtn:        Intent goToMarket7 = null;        goToMarket7 = new Intent(Intent.ACTION_VIEW,Uri.parse(""market://details?id=com.jayavon.wrapitupbox""));        startActivity(goToMarket7);    break;    }}</code></pre>","572286","","","","","2014-03-20 23:04:55","android market://details?id= not working for app","<java><android><google-play><android-intent>","3","0","","",""
"4702206","1","4702465","","2011-01-15 21:17:15","3","6732","<p>Here is the logcat:</p><pre><code>01-15 16:06:03.622: ERROR/AndroidRuntime(22300): Uncaught handler: thread main exiting due to uncaught exception01-15 16:06:03.657: ERROR/AndroidRuntime(22300): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mohit.geo2do/com.mohit.geo2do.activities.TaskEdit}: java.lang.IllegalArgumentException: Invalid column due_date01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at android.os.Handler.dispatchMessage(Handler.java:99)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at android.os.Looper.loop(Looper.java:123)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at android.app.ActivityThread.main(ActivityThread.java:4363)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at java.lang.reflect.Method.invokeNative(Native Method)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at java.lang.reflect.Method.invoke(Method.java:521)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at dalvik.system.NativeStart.main(Native Method)01-15 16:06:03.657: ERROR/AndroidRuntime(22300): Caused by: java.lang.IllegalArgumentException: Invalid column due_date01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at android.database.sqlite.SQLiteQueryBuilder.computeProjection(SQLiteQueryBuilder.java:508)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at android.database.sqlite.SQLiteQueryBuilder.buildQuery(SQLiteQueryBuilder.java:356)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:309)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:266)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at com.mohit.geo2do.provider.TasksProvider.query(TasksProvider.java:174)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at android.content.ContentProvider$Transport.query(ContentProvider.java:130)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at android.content.ContentResolver.query(ContentResolver.java:202)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at com.mohit.geo2do.activities.TaskEdit.onCreate(TaskEdit.java:105)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)01-15 16:06:03.657: ERROR/AndroidRuntime(22300):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)</code></pre><p>The line that's associated with it is:</p><pre><code>private Cursor task;private Uri uri;private String[] PROJECTION {     Tasks._ID, Tasks.TITLE, Tasks.COMPLETED, Tasks.DUE_DATE, Tasks.IMPORTANCE, Tasks.NOTES};...@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.edit_task);    ...    uri = getIntent().getData();    task = getContentResolver().query(uri, PROJECTION, null, null, null);} ...</code></pre><p>What could be the problem? The database is created just fine. Is there any other code you'd need to see?  </p><p><strong>UPDATE:</strong><br>I am VERY sure this column exists. I queried the database with this:</p><pre><code>Cursor c = db.rawQuery(""SELECT * FROM tasks LIMIT 1"", null);for (int i = 0; i &lt; c.getColumnNames().length; i++) {    Log.v(TAG, c.getColumnNames()[i]);}</code></pre><p>And in LogCat:</p><pre><code>01-15 16:52:07.857: VERBOSE/TasksProvider(24325): Creating database...01-15 16:52:07.862: VERBOSE/TasksProvider(24325): _id01-15 16:52:07.862: VERBOSE/TasksProvider(24325): title01-15 16:52:07.862: VERBOSE/TasksProvider(24325): completed01-15 16:52:07.862: VERBOSE/TasksProvider(24325): due_date01-15 16:52:07.862: VERBOSE/TasksProvider(24325): notes01-15 16:52:07.862: VERBOSE/TasksProvider(24325): importance</code></pre><p>So the column DOES exist.</p>","200477","","135152","","2011-05-25 03:00:29","2011-07-21 20:29:31","IllegalArgumentException: Invalid column","<java><android><sqlite><android-contentprovider><illegalargumentexception>","3","5","","",""
"4702288","1","","","2011-01-15 21:36:12","0","181","<p>I cant seem to find any info on this anywhere.</p><p>Is it possible first?</p><p>Classic page with 5 buttons each open new page.</p><p>I guess the question is how do i create a listener for an unknown button?</p><p>Thanks</p>","577069","","","","","2011-01-15 21:41:32","Using SWITCH to call different intents depending on what button was pressed","<java><android>","1","0","","",""
"4702291","1","4705501","","2011-01-15 21:37:10","3","186","<p>How do I list my app in Data Synchronization -> Application sync settings on android 1.5?</p><p>Gmail, Calendar and contacs are there.</p>","65171","","","","","2011-01-16 13:05:51","How to List my application in Application sync settings config screen on android 1.5?","<android>","1","0","","",""
"4702326","1","","","2011-01-15 21:47:10","0","524","<p>Hi there I am really a beginner, and I have been fighting with this problem for 3 days. :(</p><p>I am able to get an image to show using a grid view and an adapter as in the grid view tutorial, but I wanted to be able to just  use ImageView in the xml.</p><pre><code>public class HelloImage extends Activity {   public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        ImageView gridview = (ImageView) findViewById(R.id.gridview);        gridview.setLayoutParams(new GridView.LayoutParams(85, 85));        gridview.setScaleType(ImageView.ScaleType.CENTER_CROP);        gridview.setPadding(8, 8, 8, 8);        gridview.setImageResource(R.drawable.hand_tool);    }}  </code></pre><p></p><pre><code>&lt;LinearLayout     xmlns:android = ""http://schemas.android.com/apk/res/android""    android:layout_width = ""wrap_content""     android:layout_height = ""wrap_content""    android:orientation = ""horizontal""&gt;     &lt;ImageView            android:id =""@+id/gridview""           android:layout_width = ""wrap_content""         android:layout_height = ""wrap_content""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>When I run this it causes the app to force close when loading.</p><p><strong>EDIT by kcoppock: Transferring LogCat data from comments to post</strong></p><p>0</p><pre><code>1-15 14:59:24.952: INFO/BackupManagerService(61): + android 01-15 14:59:24.952: INFO/BackupManagerService(61): + com.android.inputmethod.latin 01-15 14:59:24.952: INFO/BackupManagerService(61): + com.android.browser 01-15 14:59:24.952: INFO/BackupManagerService(61): + com.android.providers.userdictionary01-15 14:59:24.961: INFO/BackupManagerService(61): + com.android.providers.settings For ""Exception"": 14:59:23.832: ERROR/System(61): java.lang.SecurityException 14:59:36.361: WARN/Checkin(103): Can't update stat PHONE_GSM_REGISTERED: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/stats 14:59:38.951: WARN/Checkin(103): Can't update stat PHONE_GPRS_ATTEMPTED: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/stats 14:59:39.991: WARN/NotificationService(61): java.io.IOException: setDataSource failed.: status=0x80000000 01-15 14:59:40.001: WARN/Checkin(103): Can't update stat PHONE_GPRS_CONNECTED: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/stats 01-15 15:40:40.929: ERROR/AndroidRuntime(128): ERROR: thread attach failed 01-15 15:40:44.269: ERROR/AndroidRuntime(212): ERROR: thread attach failed</code></pre>","577075","","321697","","2011-01-16 00:06:32","2011-01-16 00:06:32","ImageView Force closes my application","<android><imageview>","2","14","","",""
"4702450","1","","","2011-01-15 22:16:30","3","4417","<p>I have some problems im not able to recreate in emulator, but i keep getting error reports in android market that i have no clue how to solve... anyone else that might see it id be wery greatful</p><p><strong>Sometimes this reposrts</strong></p><pre><code>java.lang.NullPointerExceptionat android.webkit.WebViewDatabase.getCacheTotalSize(WebViewDatabase.java:734)at android.webkit.CacheManager.trimCacheIfNeeded(CacheManager.java:548)at android.webkit.WebViewWorker.handleMessage(WebViewWorker.java:190)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.os.HandlerThread.run(HandlerThread.java:60)</code></pre><p><strong>And sometimes this report</strong></p><pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{polis.koll/polis.koll.WebPageLoader}: java.lang.IllegalArgumentException: provider==nullat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2737)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2753)at android.app.ActivityThread.access$2500(ActivityThread.java:129)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2107)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:143)at android.app.ActivityThread.main(ActivityThread.java:4701)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: provider==nullat android.location.LocationManager.requestLocationUpdates(LocationManager.java:625)at polis.koll.WebPageLoader.getLocation(WebPageLoader.java:54)at polis.koll.WebPageLoader.onCreate(WebPageLoader.java:70)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2701)</code></pre><p><strong>Here is my code</strong></p><pre><code>    public class WebPageLoader extends Activity implements LocationListener{    public static String Android_ID = null;    final Activity activity = this;    private Location mostRecentLocation;    private void CheckEnableGPS(){        String provider = Settings.Secure.getString(getContentResolver(),          Settings.Secure.LOCATION_PROVIDERS_ALLOWED);           if(!provider.equals("""")){               //GPS Enabled               getLocation();           }else{            Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);               startActivity(intent);           }       }private void getLocation() {    String provider = Settings.Secure.getString(getContentResolver(),          Settings.Secure.LOCATION_PROVIDERS_ALLOWED);           if(!provider.equals("""")){    LocationManager locationManager =      (LocationManager)getSystemService(Context.LOCATION_SERVICE);    Criteria criteria = new Criteria();    criteria.setAccuracy(Criteria.ACCURACY_FINE);    String bestprovider = locationManager.getBestProvider(criteria,true);    locationManager.requestLocationUpdates(bestprovider, 1, 500, this);         mostRecentLocation = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);         }else{            Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);               startActivity(intent);           }  }@Overridepublic void onCreate(Bundle savedInstanceState){    //AdManager.setTestDevices( new String[] { AdManager.TEST_EMULATOR } );    super.onCreate(savedInstanceState);    this.getWindow().requestFeature(Window.FEATURE_PROGRESS);    setContentView(R.layout.main);    getLocation();    Android_ID = Secure.getString(getContentResolver(), Secure.ANDROID_ID);    WebView webView = (WebView) findViewById(R.id.webView);    webView.getSettings().setJavaScriptEnabled(true);    /** Allows JavaScript calls to access application resources **/    webView.addJavascriptInterface(new JavaScriptInterface(), ""android16"");    webView.setWebChromeClient(new WebChromeClient() {        public void onProgressChanged(WebView view, int progress)        {            activity.setTitle(""Letar poliskontroller"");            activity.setProgress(progress * 100);            if(progress == 100)                activity.setTitle(R.string.app_name);        }    });    webView.setWebViewClient(new WebViewClient() {        @Override        public void onReceivedError(WebView view, int errorCode, String description, String failingUrl)        {            // Handle the error        }     // Testade att ta bort denna override för att få market länkar att fungera     //   @Override     //   public boolean shouldOverrideUrlLoading(WebView view, String url)     //   {     //       view.loadUrl(url);     //       return true;     //   }    });    if (Locale.getDefault().getLanguage().equals(""sv"")){    //webView.loadUrl(""file:///android_asset/android.html"");        webView.loadUrl(""file:///android_asset/findgps_sv.html"");    }else{    //webView.loadUrl(""http://m.bryggplatsen.se/android/polis/index.php"");    //webView.loadUrl(""file:///android_asset/android_en.html"");        webView.loadUrl(""file:///android_asset/findgps_en.html"");    }}    /** Sets up the interface for getting access to Latitude and Longitude data from device     **/private class JavaScriptInterface {    public double getLatitude(){        return mostRecentLocation != null ? mostRecentLocation.getLatitude() : Double.NaN;    }    public double getLongitude(){        return mostRecentLocation != null ? mostRecentLocation.getLongitude() : Double.NaN;    }    public String getAndroid_ID(){        return Android_ID;    }     public void sharethisapp(){     startActivity(Intent.createChooser(sharespotIntent(), ""Share this warning""));     }  }@Overridepublic void onLocationChanged(Location location) {    // TODO Auto-generated method stub    getLocation();    //CheckEnableGPS();}@Overridepublic void onProviderDisabled(String provider) {    // TODO Auto-generated method stub    getLocation();}@Overridepublic void onProviderEnabled(String provider) {    // TODO Auto-generated method stub    getLocation();}@Overridepublic void onStatusChanged(String provider, int status, Bundle extras) {    // TODO Auto-generated method stub    getLocation();}@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    super.onCreateOptionsMenu(menu);    MenuItem item = menu.add(""Shut down"");    item.setIcon(R.drawable.exit);    item = menu.add(""Share"");    item.setIcon(R.drawable.m_share);    item = menu.add(""Fix GPS"");    item.setIcon(R.drawable.globe);    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    if (item.getTitle() == ""Shut down"") {        System.exit(0);        finish();    }    if (item.getTitle() == ""Fix GPS"") {        getLocation();    }    if (item.getTitle() == ""Share"") {        if (Locale.getDefault().getLanguage().equals(""sv"")){        startActivity(Intent.createChooser(shareIntent(), ""Dela denna app""));        }else{        startActivity(Intent.createChooser(shareIntent(), ""Share this app""));        }    }    return true;}private Intent shareIntent() {        Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);        shareIntent.setType(""text/plain"");          if (Locale.getDefault().getLanguage().equals(""sv"")){        shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""Testa denna android app..."");        return shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, ""index.php"");    }else{        shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""Try this cool android app..."");        return shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, ""index_en.php"");             }}private Intent sharespotIntent() {    Intent sharespotIntent = new Intent(android.content.Intent.ACTION_SEND);    sharespotIntent.setType(""text/plain"");      if (Locale.getDefault().getLanguage().equals(""sv"")){    sharespotIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "" la just upp en ny varning i appen Polisradar"");    return sharespotIntent.putExtra(android.content.Intent.EXTRA_TEXT, ""warn.php?lat="" + mostRecentLocation.getLatitude() + ""&amp;lng="" + mostRecentLocation.getLongitude() + """");}else{    sharespotIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "" just added a new warning in the app Policeradar"");    return sharespotIntent.putExtra(android.content.Intent.EXTRA_TEXT, ""warn_en.php?lat="" + mostRecentLocation.getLatitude() + ""&amp;lng="" + mostRecentLocation.getLongitude() + """");           }}</code></pre><p>}</p>","523221","","94363","","2013-02-02 14:54:22","2013-02-02 14:54:22","java.lang.NullPointerException when getting location","<android><nullpointerexception><android-location>","2","2","","",""
"4702474","1","4702492","","2011-01-15 22:21:25","0","114","<p>I'm about to start the design of an application for Android (and possibly later on iPhone, if I ever get around learning it). In this application I will need to send and retrieve various information to a backend (that me myself also will need to design and code). The information will most likely be in json format.</p><p>How would I go about making this data as safely transmitted as possible? Is https the only anser to this? Or are there any other smart solutions to this?</p>","346115","","","","","2011-01-15 22:26:39","Communicate with backend as safe as possible","<android>","1","2","","",""
"4702627","1","4702781","","2011-01-15 22:55:39","0","629","<p>Simple question that i've always pondered about. When I first got into opengl I had to find a way to draw ""tiles"" or a bunch of triangles with 1 opengl draw call to improve performance vastly. I did that by putting all the vertices into an array and drawing the array. One problem that occurred was whenever I scrolled the tiles, I would see random placed pixels showing on and off depending on how much I scrolled the map. Around 5-8 on a 10x10 map. Now, I got back into opengl again and and this time I drew using GL_LINE_LOOP instead of GL_TRiANGLES. This never occurred to me back then but what I see when using GL_LINE_LOOP is all the triangles but when it finishes(it goes from bottom left to top right, so top right) there is a line connecting where I ended and where I began. Would the cause of those random pixels be because of this? Or does this have nothing to do with it. Does that line connecting the end and beginning appear because of GL_LINE_LOOP mode or does that also have nothing to do with and have to do with the way I created the map?</p>","507007","","44729","","2011-01-16 04:55:52","2011-01-16 04:55:52","Android opengl vertex array","<java><android><opengl-es>","1","0","","",""
"4702655","1","4702726","","2011-01-15 23:01:17","1","686","<p>Hi I want to send a fixed amount of data (say 5MB) from server to Android client over TCP using the Java programming language. The data doesn't matter it will be dropped at the client I am only doing this to do performance measurements on the phone. </p><p>Can anyone recommend a good way of accomplishing this? How can I have the server continually sending a large amount of data? Without the intermittent behaviour of reading a line from a file, then sending those bytes... then reading another line and sending those ones.</p><p>Ideas? Cheers.</p>","577017","","","","","2011-01-15 23:16:14","Send 5MB of data over a socket?","<java><android><performance><tcp><large-data-volumes>","2","2","1","",""
"4702722","1","","","2011-01-15 23:15:35","6","403","<p>I have a relative layout with some ImageViews that sometimes extend beyond the layout's boundaries.When this happens the ImageViews get resized so they become smaller instead of extend out of bounds. I want them to display normally and just get cropped.</p><p>I think there is some kind of boolean to do that, but I can't find it in the API. I thought it might be clipChildren under ViewGroups, but setting that to false or true seems to do nothing. Anyone help is appreciated.</p>","522710","","","","","2012-03-12 23:49:17","Android - Need help cropping instead of resizing an imageview extending beyond parent layout","<android>","1","0","","",""
"4702866","1","","","2011-01-15 23:51:52","4","1980","<p>I've tried, but have had no luck trying to find this answer elsewhere.</p><p>I want to add a row to the bottom of my listview that displays ""Loading..."" and maybe a spinning progress indicator.</p><p>My program already loads additional information into the listview once the user scrolls to the bottom. But I want the user to be able to see that the program is indeed loading something.</p><p>Example: If you go to the android marketplace and scroll to the bottom of one of the lists, the last row will say ""Loading..."". Then once the data is loaded, that bar is replaced with the first item of the new data.</p><p>Sorry, it's a little hard to describe. I am NOT trying to add a footer to the bottom of the list view. I want it to be an actual item in the listview.</p>","577139","","","","","2012-10-18 08:55:57","Adding a row to a ListView that displays ""Loading"" while information is downloaded. Like in the Market","<android><listview><loading>","2","1","","",""
"4702873","1","4755020","","2011-01-15 23:53:01","1","4744","<p>I'm starting out with the Android NDK and OpenGL. I know I'm doing something (probably a few) things wrong here and since I keep getting a black screen when I test I know the rendering isn't being sent to the screen.</p><p>In the Java I have a GLSurfaceView.Renderer that calls these two native methods. They are being called correctly but not drawing to the device screen.</p><p>Could someone point me in the right direction with this?</p><p>Here are the native method implementations:</p><pre><code>int init(){    sendMessage(""init()"");    glGenFramebuffersOES(1, &amp;framebuffer);    glBindFramebufferOES(GL_FRAMEBUFFER_OES, framebuffer);    glGenRenderbuffersOES(1, &amp;colorRenderbuffer);    glBindRenderbufferOES(GL_RENDERBUFFER_OES, colorRenderbuffer);    glRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_RGBA8_OES, 854, 480);    glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, colorRenderbuffer);    GLuint depthRenderbuffer;    glGenRenderbuffersOES(1, &amp;depthRenderbuffer);    glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthRenderbuffer);    glRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_DEPTH_COMPONENT16_OES, 854, 480);    glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, depthRenderbuffer);    GLenum status = glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES);    if(status != GL_FRAMEBUFFER_COMPLETE_OES)        sendMessage(""Failed to make complete framebuffer object"");    return 0;}void draw(){    sendMessage(""draw()"");    GLfloat vertices[] = {1,0,0, 0,1,0, -1,0,0};    glEnableClientState(GL_VERTEX_ARRAY);    glVertexPointer(3, GL_FLOAT, 0, vertices);    glDrawArrays(GL_TRIANGLES, 0, 3);    glDisableClientState(GL_VERTEX_ARRAY);    glBindFramebufferOES(GL_FRAMEBUFFER_OES, framebuffer);    glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);    glBindRenderbufferOES(GL_RENDERBUFFER_OES, colorRenderbuffer);}</code></pre><p>The log output is:</p><blockquote>  <p>init()  draw()  draw()  draw()  etc..</p></blockquote>","38258","","","","","2012-05-19 09:08:19","Android NDK OpenGL ES 1.0 Simple Rendering","<c++><android><opengl-es><android-ndk-r4>","3","0","","",""
"4702877","1","4702953","","2011-01-15 23:54:40","3","1355","<p>I already set <code>android:focusable=""false""</code> on my CheckBox in my custom layout. My back-end SQLite database depends on whether or not the CheckBox is checked or not. Each row in my <code>ListView</code> corresponds to a row in my database. So my question is, where should I put on OnClickListener for the CheckBox so I can update the item associated with that <code>ListView</code> row? I would need it to be placed where I have access to an id. Maybe <code>onListItemClick</code>?  </p><p><strong>UPDATE:</strong><br>Here my custom adapter:</p><pre><code>package com.mohit.geo2do.adapters;import java.text.SimpleDateFormat;import java.util.Calendar;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.Filterable;import android.widget.TextView;import com.mohit.geo2do.R;import com.mohit.geo2do.provider.Task.Tasks;import com.mohit.geo2do.utils.Util;public class TasksAdapter extends CursorAdapter {    private final Context context;    public TasksAdapter(Context context, Cursor c) {        super(context, c);        this.context = context;    }    @Override    public View newView(Context context, Cursor cursor, ViewGroup parent) {        //Inflate the view         LayoutInflater inflater = LayoutInflater.from(context);        View v = inflater.inflate(R.layout.row_item, parent, false);                return v;    }    @Override    public void bindView(View view, Context context, Cursor cursor) {        CheckBox checkbox = (CheckBox)view.findViewById(R.id.completed);        TextView due_date = (TextView)view.findViewById(R.id.due_date);        String title = cursor.getString(cursor.getColumnIndex(Tasks.TITLE));        boolean completed = Util.intToBool(cursor.getInt(cursor.getColumnIndex(Tasks.COMPLETED)));        SimpleDateFormat format = new SimpleDateFormat(""EEEEEE, MMM dd yyyy hh:mm aa"");        long unixTime = cursor.getLong(cursor.getColumnIndex(Tasks.DUE_DATE));        Calendar due = Util.timestampToDate(unixTime);        due_date.setText(format.format(due.getTime()));        checkbox.setText(title);        checkbox.setChecked(completed);    }}</code></pre>","200477","","200477","","2011-01-16 00:19:26","2011-01-16 01:29:07","Update a CheckBox in ListView row that corresponds to a database row","<java><android><checkbox><onclick>","1","0","2","",""
"4702926","1","6694880","","2011-01-16 00:08:12","2","1289","<p>I try to implement a long polling push-service on my android application (based on Microsofts AUTD ActiveSync -> <a href=""http://technet.microsoft.com/en-us/library/aa997252.aspx"" rel=""nofollow"">http://technet.microsoft.com/en-us/library/aa997252.aspx</a>).</p><p>I have already realised the server part with Servlets 3.0 running on Tomcat 7.0. I have tested my AsyncServlets with CURL, everything works fine.</p><p>Thats how I tested my AsyncServlet:</p><pre><code>curl ""https://webservice.mydomain.net/push?id=1&amp;heartbeat=180000"" --insecure --user user:password -D -</code></pre><p>Server response after 3 minutes (Heartbeat Interval)</p><pre><code>HTTP/1.1 200 OKServer: Apache-Coyote/1.1Pragma: No-cacheCache-Control: no-cacheExpires: Thu, 01 Jan 1970 01:00:00 CETContent-Type: application/json;charset=ISO-8859-1Content-Length: 0Date: Sat, 15 Jan 2011 23:38:57 GMT</code></pre><p>On my android application I used following code:</p><pre><code>HttpParams httpParams = mDefaultHttpClient.getParams();HttpConnectionParams.setConnectionTimeout(httpParams, CONNECTION_TIMEOUT);HttpConnectionParams.setSoTimeout(httpParams, mHeartbeat + TIMEOUT_TOLERANCE);mDefaultHttpClient.setParams(httpParams);HttpGet httpGet = new HttpGet(mPushURL);httpGet.addHeader(""Accept"", ""application/json"");try {    Log.i(TAG, ""Executing GET(PUSH) request "" + httpGet.getRequestLine());    HttpResponse httpResponse = mDefaultHttpClient.execute(httpGet);    Log.i(TAG, httpResponse.getStatusLine().toString());    Log.i(TAG, convertInputStream(httpResponse.getEntity().getContent())); //For testing purposes} catch (ClientProtocolException e) {    e.printStackTrace();} catch (IOException e) {    e.printStackTrace();}</code></pre><p>I ran several tests. If I use a 70 seconds heartbeat interval I recieve the response. If I use a > 70 seconds hearbeat interval I recieve (after the specified heartbeat interval) a SocketTimeoutException instead of my HTTP 200 OK Response. (To clarify: My set SocketTimeout(SoTimeout) is working correcty, but maybe the connection get lost, I have no idea why).</p><p>Thanks for every response.</p>","555478","","555478","","2011-01-17 15:36:30","2011-07-14 14:30:36","Android https long polling problem: Cannot recieve response when polling interval is longer than 70 seconds","<java><android><timeout><httpclient><push>","2","0","2","",""
"4702997","1","4703106","","2011-01-16 00:22:32","0","281","<p>Documentation says: ""a configuration change (such as a change in screen orientation, language, input devices, etc) will cause your current activity to be destroyed, going through the normal activity lifecycle process of onPause(), onStop(), and onDestroy().""</p><p>I would like to suspend the orientation change, since it crashes my app if it was done in the middle of a a loop (of reading a file).</p><p>How can I do this? Also - looking for some kind of ""onOrientationChnage"" function :)</p>","380490","","","","","2011-01-16 00:55:03","Suspend orientation change","<android><orientation>","2","0","","",""
"4703017","1","4706901","","2011-01-16 00:26:14","2","2786","<p><br>I have a layout that contains two lists. Since you can't put lists in a <code>ScrollView</code> I am trying to use an <code>ExpandableListView</code>, with a custom <code>SimpleExpandableListAdapter</code>, as per <a href=""http://stackoverflow.com/questions/1353101/about-expandable-list-in-android"">this question</a>.<br>List layout:</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;ExpandableListView android:id=""@+id/android:list""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Now, the troubles come when I try to add something as header. It works if I create a layout from code, like this:  </p><pre><code>LinearLayout ll = new LinearLayout( this );ll.setOrientation( LinearLayout.VERTICAL );TextView t = new TextView( this );t.setText( ""some text"" );ll.addView( t );ImageView i = new ImageView( this );i.setImageResource( R.drawable.icon );ll.addView( i );getExpandableListView( ).addHeaderView( ll );</code></pre><p>If I use the same layout, or simpler even than the one from code, the application crashes before even showing on screen. Here's the layout I want to add as header to the above list:</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"" android:id=""@+id/ll""&gt;        &lt;TextView android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:text=""some text""/&gt;        &lt;ImageView android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:src=""@drawable/icon""/&gt;&lt;/LinearLayout&gt;</code></pre><p>And the code:</p><pre><code>LinearLayout ll = (LinearLayout)findViewById( R.id.ll );getExpandableListView( ).addHeaderView( ll );</code></pre><p>I tried to fiddle with the layout_width or height of about all the components in my layout, but it doesn't work. What baffles me most is that when it crashes, on the DDMS says <code>NullPointerException</code> when calling setAdapter (which doesn't when I use the layout from code, and it adds the adapter just fine):</p><pre><code>01-16 01:17:27.447: ERROR/AndroidRuntime(21314): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.stephan.test/org.stephan.test.ExpandableListViewTest}: java.lang.NullPointerException01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2833)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2854)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at android.app.ActivityThread.access$2300(ActivityThread.java:136)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2179)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at android.os.Handler.dispatchMessage(Handler.java:99)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at android.os.Looper.loop(Looper.java:143)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at android.app.ActivityThread.main(ActivityThread.java:5068)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at java.lang.reflect.Method.invokeNative(Native Method)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at java.lang.reflect.Method.invoke(Method.java:521)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at dalvik.system.NativeStart.main(Native Method)01-16 01:17:27.447: ERROR/AndroidRuntime(21314): Caused by: java.lang.NullPointerException01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at android.widget.ListView.clearRecycledState(ListView.java:506)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at android.widget.ListView.resetList(ListView.java:492)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at android.widget.ListView.setAdapter(ListView.java:424)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at android.widget.ExpandableListView.setAdapter(ExpandableListView.java:475)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at android.app.ExpandableListActivity.setListAdapter(ExpandableListActivity.java:246)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at org.stephan.test.ExpandableListViewTest.onCreate(ExpandableListViewTest.java:80)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1066)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2797)01-16 01:17:27.447: ERROR/AndroidRuntime(21314):     ... 11 more</code></pre><p>So, my question is: what am I doing wrong here? And, in case, any advices on how I could do this better?</p>","525843","","525843","","2011-01-16 00:53:21","2011-01-16 17:34:53","layout as listview header","<android><expandablelistview>","2","0","","",""
"4703129","1","","","2011-01-16 00:54:32","2","1732","<p>below is my code... but only a blank screen shows up, anyone know what's up?</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        URL url;        try {            url = new URL(""http://pennapps.com/biblioteka/images/C.jpg"");            URLConnection conn=url.openConnection();            conn.connect();            InputStream is = conn.getInputStream();            BufferedInputStream bis = new BufferedInputStream(is);            Bitmap bm = BitmapFactory.decodeStream(bis);            bis.close();            is.close();            ImageView image = new ImageView(this);            image.setImageBitmap(bm);            setContentView(image);        }         catch (Exception e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }</code></pre>","576686","","","","","2013-03-25 18:58:06","Trying to display images from a website in Android","<android><image>","2","0","3","",""
"4703131","1","6803287","","2011-01-16 00:55:03","8","4190","<p>Well, I've been diving in the murky waters of low-level Android programming (native C/C++ using the CodeSourcery toolchain). I tried out the executable on an emulator and it worked. I'd like to try it out on a real device. So I plugged in my nexus and pushed the files on to the filesystem. Then I tried to execute the binary, and I got a permission error. It really doesn't matter how I mount it, or where I send it, I'm not root and it's not letting me execute it. Is there any way to run a program like this on a non-rooted phone?</p>","498680","","779813","","2013-01-08 03:44:36","2013-02-25 21:55:45","Is it possible to run a native arm binary on a non-rooted android phone?","<android><android-ndk><arm><root><codesourcery>","1","3","9","",""
"4703505","1","4704225","","2011-01-16 02:44:35","1","1416","<p>is there any way to get the file names stored in the res/raw folder programmatically</p><p>please suggest</p><p>thanks in advance</p>","550796","","","","","2011-01-17 02:37:36","android raw resource","<android>","1","0","1","",""
"4703535","1","4704360","","2011-01-16 02:54:58","13","9148","<p>Is there a way to dynamically show and hide preferences?  In my case, I have a checkbox preference that would disable or enable one of 2 preference groups (""with-"" and ""without-handicap"" groups).  While this would be the ideal GUI in a desktop environment, the ""with-handicap"" takes up nearly the whole screen, while the other, ""without-handicap"" takes up only a small portion of the screen.</p><p>Rather than showing both groups at the same time, I'd like to show only one of them at a time, and dynamically show or hide the 2 groups when the checkbox changes.  Is there a way to do this?</p>","434414","","515205","","2013-10-25 16:48:20","2013-10-25 16:48:20","How to show and hide preferences on Android dynamically?","<android><android-preferences><preferenceactivity>","1","1","5","",""
"4703550","1","4714551","","2011-01-16 02:59:27","2","661","<p>In opengl, is it bad practice or not recommended to modify the vertex array after I have drawn it?</p>","507007","","507007","","2011-01-16 07:10:37","2012-08-18 23:05:16","Android opengl modify vertex array after draw call","<java><android><arrays><opengl-es><vertex>","1","1","1","",""
"4703634","1","4704681","","2011-01-16 03:26:51","7","6197","<p>Here is my LogCat:</p><pre><code>01-15 22:13:08.277: ERROR/AndroidRuntime(28747): java.lang.IllegalStateException: get field slot from row 0 col -1 failed01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.database.CursorWindow.getLong_native(Native Method)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.database.CursorWindow.getLong(CursorWindow.java:414)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:108)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.database.CursorWrapper.getLong(CursorWrapper.java:127)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at com.mohit.geo2do.adapters.TasksAdapter.bindView(TasksAdapter.java:60)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.widget.CursorAdapter.getView(CursorAdapter.java:186)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.widget.AbsListView.obtainView(AbsListView.java:2818)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1218)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.widget.ListView.onMeasure(ListView.java:1131)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.view.View.measure(View.java:8039)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.widget.RelativeLayout.measureChild(RelativeLayout.java:554)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:377)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.view.View.measure(View.java:8039)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3025)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.view.View.measure(View.java:8039)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.view.View.measure(View.java:8039)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3025)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.view.View.measure(View.java:8039)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.view.ViewRoot.performTraversals(ViewRoot.java:779)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1658)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.os.Handler.dispatchMessage(Handler.java:99)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.os.Looper.loop(Looper.java:123)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at android.app.ActivityThread.main(ActivityThread.java:4363)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at java.lang.reflect.Method.invokeNative(Native Method)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at java.lang.reflect.Method.invoke(Method.java:521)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>The LogCat refers to this line of code<code>01-15 22:13:08.277: ERROR/AndroidRuntime(28747):     at com.mohit.geo2do.adapters.TasksAdapter.bindView(TasksAdapter.java:60)</code>. Here is my task adapter's <code>bindView</code> method:</p><pre><code>@Overridepublic void bindView(View view, Context context, Cursor cursor) {    CheckBox checkbox = (CheckBox)view.findViewById(R.id.completed);    TextView due_date = (TextView)view.findViewById(R.id.due_date);    String title = cursor.getString(cursor.getColumnIndex(Tasks.TITLE));    boolean completed = Util.intToBool(cursor.getInt(cursor.getColumnIndex(Tasks.COMPLETED)));    SimpleDateFormat format = new SimpleDateFormat(""EEEEEE, MMM dd yyyy hh:mm aa"");    long unixTime = Calendar.getInstance().getTimeInMillis();    if (cursor.getLong(cursor.getColumnIndex(Tasks.DUE_DATE)) &gt; 0) {        Log.v(""TasksAdapter"", ""Unix time is "" + unixTime);        unixTime = cursor.getLong(cursor.getColumnIndex(Tasks.DUE_DATE));        Calendar due = Util.timestampToDate(unixTime);        due_date.setText(format.format(due.getTime()));    }    checkbox.setText(title);    checkbox.setChecked(completed);    due_date.setText(""No Deadline"");}</code></pre><p>I have verified 100% that the column does exist. What could be the problem?  </p><p><strong>UPDATE:</strong><br>The cursor is from a bindView method, so I have not created the query for the cursor myself. I recreated the database and now I get this error:  </p><pre><code>01-16 09:46:39.459: ERROR/AndroidRuntime(32563): java.lang.IllegalArgumentException: column 'due_date' does not exist01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:314)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.database.CursorWrapper.getColumnIndexOrThrow(CursorWrapper.java:99)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at com.mohit.geo2do.adapters.TasksAdapter.bindView(TasksAdapter.java:64)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.widget.CursorAdapter.getView(CursorAdapter.java:186)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.widget.AbsListView.obtainView(AbsListView.java:2818)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1218)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.widget.ListView.onMeasure(ListView.java:1131)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.view.View.measure(View.java:8039)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.widget.RelativeLayout.measureChild(RelativeLayout.java:554)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:377)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.view.View.measure(View.java:8039)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3025)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.view.View.measure(View.java:8039)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.view.View.measure(View.java:8039)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3025)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.view.View.measure(View.java:8039)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.view.ViewRoot.performTraversals(ViewRoot.java:779)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1658)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.os.Handler.dispatchMessage(Handler.java:99)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.os.Looper.loop(Looper.java:123)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at android.app.ActivityThread.main(ActivityThread.java:4363)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at java.lang.reflect.Method.invokeNative(Native Method)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at java.lang.reflect.Method.invoke(Method.java:521)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)01-16 09:46:39.459: ERROR/AndroidRuntime(32563):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I have verified that the column index is -1:</p><pre><code>01-16 09:46:39.434: VERBOSE/TasksAdapter(32563): The index is -1</code></pre><p>And that the due_date column exists:</p><pre><code>01-16 09:46:29.839: VERBOSE/TasksProvider(32563): Creating database...01-16 09:46:29.839: VERBOSE/TasksProvider(32563): _id01-16 09:46:29.839: VERBOSE/TasksProvider(32563): title01-16 09:46:29.839: VERBOSE/TasksProvider(32563): completed01-16 09:46:29.839: VERBOSE/TasksProvider(32563): due_date01-16 09:46:29.839: VERBOSE/TasksProvider(32563): notes01-16 09:46:29.839: VERBOSE/TasksProvider(32563): importance</code></pre>","200477","","200477","","2011-01-16 15:15:27","2011-01-17 09:20:59","IllegalStateException: get field slot from row 0 col -1 failed","<java><android><sqlite><cursor>","1","2","1","",""
"4703644","1","","","2011-01-16 03:31:57","1","1247","<p>So i wanted to have a bottom button so that it shows in all tabs, but i cant seem to make it available at the bottom of every tab screen. I only have the first tab filled with edit text elements and spinners. But the button doesnt show even after setting a scrollview since all elements take more than the screen size. Heres the xml:</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;TabHost     android:id=""@+id/personalfiletab""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_marginTop=""5dp""&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""            android:paddingBottom=""56dp""&gt;           &lt;ScrollView android:id=""@+id/ScrollView01""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""&gt;       &lt;LinearLayout           android:orientation=""vertical""           android:layout_width=""fill_parent""           android:layout_height=""fill_parent""&gt;              &lt;TableLayout                android:id=""@+id/pessoal_tab""      android:layout_width=""fill_parent""       android:layout_height=""fill_parent""      android:layout_alignParentBottom=""true""&gt;      &lt;include android:id=""@+id/first""  layout=""@layout/ecra_editpersonalfile_infoform"" /&gt;     &lt;/TableLayout&gt;     &lt;TableLayout android:id=""@+id/morada__contacto_tab""      android:layout_width=""fill_parent""       android:layout_height=""fill_parent""      android:layout_alignParentBottom=""true""&gt;      &lt;include android:id=""@+id/first""  layout=""@layout/ecra_editpersonalfile_moradacontactoform"" /&gt;     &lt;/TableLayout&gt;      &lt;TableLayout                android:id=""@+id/profissional_tab""      android:layout_width=""fill_parent""       android:layout_height=""fill_parent""      android:layout_alignParentBottom=""true""&gt;      &lt;include android:id=""@+id/first""  layout=""@layout/ecra_editpersonalfile_infoproform"" /&gt;     &lt;/TableLayout&gt;      &lt;TableLayout                android:id=""@+id/documentacao_tab""      android:layout_width=""fill_parent""       android:layout_height=""fill_parent""      android:layout_alignParentBottom=""true""&gt;      &lt;include android:id=""@+id/first""  layout=""@layout/ecra_editpersonalfile_documentacaoform"" /&gt;     &lt;/TableLayout&gt;    &lt;/LinearLayout&gt;   &lt;/ScrollView&gt;          &lt;/FrameLayout&gt;        &lt;/LinearLayout&gt;  &lt;/TabHost&gt;    &lt;Button   android:text=""submit""   android:layout_width=""fill_parent""    android:layout_height=""wrap_content""   android:id=""@+id/submitprofileButton""&gt;        &lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>But the button doesnt show at the bottom of the screen in every tab...</p>","382115","","302328","","2011-01-16 05:30:45","2011-01-16 05:30:45","Android - Add button after tabhost not showing in every tab","<android><button><tabs>","0","1","","",""
"4703654","1","4703866","","2011-01-16 03:36:38","0","314","<p>I'm developing a simple app, only a handful of activities and nothing to complicated.  The issue I'm having is that in a few of my activities I have EditText widgets, and when the screen is rotated, these widgets loose their values.  They still visually, that is, on the handset screen, report their values from before the rotation, but to the code report their default values.  </p><p>An example, I have an activity with an EditText, I enter a number, 15, the calculator starts calculating, displays a result.  If at this point I rotate to a different orientation, as expected the activity dies, reloads, shows the new orientation, my value of 15 is still in the EditText, however the calculator (the code) calculates as if it was 0, which is the initial value.  I have not tried changing the initial value to see if it is really pulling from the default value, or just setting itself to 0 when I cast it as an int.</p><p>If I didn't explain this well enough, let me know, I can add source code if I need to.Thanks.</p>","388992","","","","","2011-01-16 04:48:04","Screen orientation change forces data re-entry","<android><orientation><edittext>","1","2","","",""
"4703690","1","4703833","","2011-01-16 03:49:47","6","301","<p>In some sources I see such declarations</p><pre><code>&lt;item    android:id=""@+id/menu_display_groups""    android:icon=""@*android:drawable/ic_menu_allfriends""    android:title=""@string/menu_displayGroup"" /&gt;</code></pre><p>Notice the *</p><pre><code>@*android:</code></pre><p>It seems to give access to internal resources. But would like to know for sure.</p><p>Also curious, if it is safe to build application with such declarations using Android 2.2 SDK, and run it on 1.5.</p>","62192","","89806","","2011-01-16 08:44:42","2011-01-16 08:44:42","Android XML. What is the purpose of the star in the ID string?","<android>","1","1","2","",""
"4703853","1","","","2011-01-16 04:43:58","1","2855","<p>When I build hello-jni which i got from the sample folder of android-ndk-r5, I got a folloiwng error. Would you please tell me your any idea what i missed?</p><pre><code>arm-linux-androideabi-gcc: Internal error: Killed (program cc1)</code></pre><p>Development environment:</p><ul><li>OS: Ubuntu 10.04 Desktop on WINDOWS 7 via VertualBox</li><li>Android SDK: r08</li><li>Android NDK: r5</li></ul><p>detail of error:</p><pre><code>$ ndk-buildGdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserverGdbsetup : libs/armeabi/gdb.setupCompile thumb : hello-jni &lt;= hello-jni.carm-linux-androideabi-gcc: Internal error: Killed (program cc1)Please submit a full bug report.See &lt;http://gcc.gnu.org/bugs.html&gt; for instructions.make: *** [/home/users001/android-ndk/samples/hello-jni/obj/local/armeabi/objs-debug/hello-jni/hello-jni.o] error1</code></pre><p>Please advice.</p>","577272","","300805","","2011-01-20 18:09:48","2011-12-15 12:08:27","arm-linux-androideabi-gcc: Internal error: Killed (program cc1) from Android NDK r8","<android><android-ndk>","4","0","","",""
"4703928","1","4703943","","2011-01-16 05:09:49","0","1031","<p>I'd like to start looking into the Android source code. I'd like to start with the easiest place. Which is the easiest place to start with - any application / framework? Please suggest.</p>","421372","","648313","","2011-07-13 21:00:40","2012-05-26 08:44:27","Starting with the Android source code","<android><android-source>","4","0","","",""
"4703996","1","4704185","","2011-01-16 05:36:20","3","5558","<p>I've currently got a preferences screen, and I've created a custom class that extends <code>DialogPreference</code> and is called from within my Preferences. My preferences data seems store/retrieve from <code>SharedPreferences</code> without an issue, but I'm trying to add 2 more sets of settings from the <code>DialogPreference</code>.</p><p>Basically I have two issues that I have not been able to find. Every site I've seen gives me the same standard info to save/restore data and I'm still having problems. Firstly I'm trying to save a username and password to my <code>SharedPreferences</code> (visible in the last block of code) and if possibly I'd like to be able to do it in the<code>onClick()</code>.</p><p>My preferences XML that calls my <code>DialogPreference</code>:</p><pre class=""lang-xml prettyprint-override""><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""&gt; &lt;PreferenceCategory&gt;    &lt;com.rone.optusmon.AccDialog  android:key=""AccSettings""  android:title=""Account Settings""  android:negativeButtonText=""Cancel""  android:positiveButtonText=""Save"" /&gt;    &lt;/PreferenceCategory&gt; &lt;/PreferenceScreen&gt; </code></pre><p>My Custom DialogPreference Class file:</p><pre class=""lang-java prettyprint-override""><code>package com.rone.optusmon;import android.content.Context;import android.content.DialogInterface;import android.content.SharedPreferences;import android.preference.DialogPreference;import android.preference.PreferenceManager;import android.text.method.PasswordTransformationMethod;import android.util.AttributeSet;import android.view.View;import android.widget.CheckBox;import android.widget.CompoundButton;import android.widget.CompoundButton.OnCheckedChangeListener;import android.widget.EditText;import android.widget.LinearLayout;import android.widget.TextView;import android.widget.Toast;public class AccDialog extends DialogPreference implements DialogInterface.OnClickListener { private TextView mUsername, mPassword; private EditText mUserbox, mPassbox; CharSequence mPassboxdata, mUserboxdata; private CheckBox mShowchar; private Context mContext; private int mWhichButtonClicked; public AccDialog(Context context, AttributeSet attrs) {  super(context, attrs);  mContext = context; } @Override protected View onCreateDialogView() {// Access default SharedPreferences@SuppressWarnings(""unused"")SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(mContext);  @SuppressWarnings(""unused"")  LinearLayout.LayoutParams params;  LinearLayout layout = new LinearLayout(mContext);   layout.setOrientation(LinearLayout.VERTICAL);   layout.setPadding(10, 10, 10, 10);   layout.setBackgroundColor(0xFF000000);   mUsername = new TextView(mContext);    mUsername.setText(""Username:"");    mUsername.setTextColor(0xFFFFFFFF);    mUsername.setPadding(0, 8, 0, 3);   mUserbox = new EditText(mContext);    mUserbox.setSingleLine(true);     mUserbox.setSelectAllOnFocus(true);   mPassword = new TextView(mContext);    mPassword.setText(""Password:"");    mPassword.setTextColor(0xFFFFFFFF);   mPassbox = new EditText(mContext);    mPassbox.setSingleLine(true);    mPassbox.setSelectAllOnFocus(true);   mShowchar = new CheckBox(mContext);    mShowchar.setOnCheckedChangeListener(mShowchar_listener);    mShowchar.setText(""Show Characters"");    mShowchar.setTextColor(0xFFFFFFFF);    mShowchar.setChecked(false);    if(!mShowchar.isChecked()) {     mPassbox.setTransformationMethod(new PasswordTransformationMethod());    }   layout.addView(mUsername);   layout.addView(mUserbox);   layout.addView(mPassword);   layout.addView(mPassbox);   layout.addView(mShowchar);  return layout;  }  public void onClick(DialogInterface dialog, int which) {  mWhichButtonClicked = which;  // if statement to set save/cancel button roles  if (mWhichButtonClicked == -1) {   Toast.makeText(mContext, ""Save was clicked\nUsername: "" + mUserbox.getText().toString() +""\nPassword is: "" + mPassbox.getText().toString(), Toast.LENGTH_SHORT).show();          // Save user preferences   SharedPreferences settings = getDefaultSharedPreferences(this);   SharedPreferences.Editor editor = settings.edit();   editor.putString(""usernamekey"", mUserbox.getText().toString());   editor.putString(""passwordkey"", mPassbox.getText().toString());   editor.commit();  }  else {   Toast.makeText(mContext, ""Cancel was clicked"", Toast.LENGTH_SHORT).show();  } } }</code></pre><p>My main activity test code:</p><pre class=""lang-java prettyprint-override""><code>public void onResume() {    super.onResume();       SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);    StringBuilder builder = new StringBuilder();    builder.append(""\nThe monitor will refresh every ""+ pref.getString(""refreshfreq"", ""30 minutes""));    builder.append(""\nThe skin chosen is ""+ pref.getString(""skinkey"", ""null""));    builder.append(""\nThe style chosen is ""+ pref.getString(""stylekey"", ""% used""));    builder.append(""\nThe font chosen is ""+ pref.getString(""fontkey"", ""Calibri""));    builder.append(""\nThe font color is ""+ pref.getString(""fontcolkey"", ""White""));    builder.append(""\nYour username is ""+ pref.getString(""usernamekey"", ""not set yet""));    builder.append(""\nYour password is ""+ pref.getString(""passwordkey"", ""not set yet""));    Toast.makeText(Optusmon.this, builder.toString(), Toast.LENGTH_LONG).show();    }</code></pre><p>In my <code>SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);</code> line, Eclipse says ""The method getDefaultSharedPreferences(AccDialog) is undefined for the type AccDialog"". I've attempted to change the context to my preferences class, use a blank context and I've also tried naming my SharedPrefs and using <code>getSharedPreferences()</code> as well. I'm just not sure exactly what I'm doing here.</p><p>As I'm quite new to Java/Android/coding in general, could you please be as detailed as possible with any help, eg. which of my files I need to write the code in and whereabouts in that file should I write it (i.e. <code>onCreate()</code>, <code>onClick()</code>, etc)</p>","576952","","387076","","2012-03-28 18:03:35","2012-03-28 18:03:35","Saving to SharedPreferences from custom DialogPreference","<java><android><sharedpreferences>","2","0","1","",""
"4704147","1","4704350","","2011-01-16 06:28:40","3","1351","<p>I've wasted around 30 hours this week writing and re-writing code, believing that I had misunderstood how the OpenGL depth buffer works. Everything I tried, failed. I have now resolved my problem by finding what may be an error in the Android implementation of OpenGL.</p><p>See this API entry:</p><p><a href=""http://www.opengl.org/sdk/docs/man/xhtml/glClearDepth.xml"" rel=""nofollow"">http://www.opengl.org/sdk/docs/man/xhtml/glClearDepth.xml</a></p><blockquote>  <p>void glClearDepth(GLclampd depth);</p>    <p>Specifies the depth value used when  the depth buffer is cleared. The  initial value is 1.</p></blockquote><p>Android's implementation has two versions of this command:</p><ul><li><p><strong>glClearDepthx</strong> which takes an integervalue, clamped 0-1</p></li><li><p><strong>glClearDepthf</strong> which takes a floatingpoint value, clamped 0-1</p></li></ul><p>If you use <strong>glClearDepthf(1)</strong> then you get the results you would expect. If you use <strong>glClearDepthx(1)</strong>, as I was doing then you get different results. (Note that 1 is the default value, but calling the command with the argument 1 produces different results than not calling it at all.) Quite what is happening I do not know, but the depth buffer was being cleared to a value different from what I had specified.</p>","522858","","44729","","2011-01-16 07:42:42","2011-01-16 07:48:47","Android depth buffer issue: Advice for anyone experiencing problem","<android><opengl-es><depth><depth-buffer>","1","1","","",""
"4704205","1","4710398","","2011-01-16 06:55:20","1","1850","<p>I have created a custom view and I try to implement onMeasure() to work well in all situations. I am currently wondering about the parameters that are passed as  width/heightMeasurementSpec when my view is placed within a linear layout 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;MyView     android:layout_width=""fill_parent""  android:layout_height=""wrap_content""   android:id=""@+id/someId""&gt;&lt;/MyView&gt;&lt;/LinearLayout&gt;</code></pre><p>In this case after doing</p><pre><code>protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec){  int height = MeasureSpec.getSize(heightMeasureSpec);  int heightmode = MeasureSpec.getMode(heightMeasureSpec);  //...}</code></pre><p>I have height = 271 (on a 480x320 screen) and heightmode = AT_MOST which seems to make sense.</p><p>But when I add some TextViews like this after my view:</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;MyView         android:layout_width=""fill_parent""      android:layout_height=""wrap_content""       android:id=""@+id/someId""&gt;&lt;/MyView&gt;    &lt;TextView android:text=""1""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;    &lt;TextView android:text=""2""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;    &lt;/LinearLayout&gt;</code></pre><p>I still get the same height/heightmode values (onMeasure is actually called twice, but with the same arguments). I thought that as the TextViews consume some space, there should be less space for MyView? (Which would be ok, but I need to know how much space I can occupy...)</p><p>Any ideas? Thanks a lot!</p>","292233","","","","","2011-01-17 05:58:30","onMeasure() parameters provided by LinearLayout","<java><android><user-interface>","2","0","1","",""
"4704540","1","","","2011-01-16 08:57:18","0","250","<p>Can i handle size of item in xml file when i'm in portrait or landscape mode?Thanks</p>","508197","","79061","","2011-01-16 09:00:26","2011-01-16 10:32:35","Landscape layout","<android><android-layout>","2","0","","",""
"4704563","1","4704996","","2011-01-16 09:04:36","0","932","<p>my problem seems simple but I can not manage to find an answer here.</p><p>I have different activities in one application. Activities start each other.I have a <strong>""main-screen""</strong> that shows all the different available levels, user clicks on a level and that activity is lunched, when user finishes that level, he can press the back-button to go to the main-screen and start another level.When back-button is pressed I would like to re-draw the ""main-screen"" again, since this time the thumb for the completed level will be different to show that it is completed.</p><p><em>So how do I run a re-draw on a activity upon back-button pressed?(I suppose I should put some code in the Activity.onResume method)</em>(I use SharedPreferences to save the state of finished levels)</p><p>The main-screen activity is basically this:<pre>    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.maps);</p><code>    SharedPreferences settings = getSharedPreferences((getResources().getString(R.string.PREFS_HI)),0);    /**/      GridView gridview = (GridView) findViewById(R.id.gridview);      gridview.setAdapter(new ImageAdapter(this,(settings.getBoolean(""level_1_finished"", false))));      /**/      gridview.setOnItemClickListener(new OnItemClickListener() {        @Override          public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {            //Open the map which was clicked on, if there is one            if(position+1 &gt; 1){                Toast.makeText(maps.this, ""Level "" + (position+1) + "" is not yet available!"", Toast.LENGTH_SHORT).show();            }else{                Toast.makeText(maps.this, ""Opening Level "" + (position+1), Toast.LENGTH_SHORT).show();                Intent myIntent = new Intent(v.getContext(), Tutorial2D.class);                startActivity(myIntent);            }          }      });}</code></pre><p></p><p>ImageAdapter then uses the boolean true/false to choose the source of the image, either the unfinished thumb or the finished level thumb.</p>","576671","","576671","","2011-01-16 10:54:00","2013-05-16 17:49:15","re-draw an activity in Android","<android><activity><draw><redraw><onresume>","2","4","1","",""
"4704635","1","5347998","","2011-01-16 09:28:26","1","2937","<p>I have a screen that uses tabs in my android application. There is a line (like a border) that shows between the tabwidget and the framelayout. I want to get rid of that line, but cant seem to find what it is. I have determined that it is part of the FrameLayout by setting its visibilty to gone. Please refer to the code below:</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:background=""#fb8c10""    &gt;    &lt;ImageView    android:id=""@+id/img_confirm_header""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:src=""@drawable/confirm_header""                     /&gt;    &lt;TabWidget        android:id=""@android:id/tabs""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""         android:layout_marginBottom=""0dip""        android:background=""#fb8c10""                                      android:tabStripEnabled=""false""                                 /&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""                    android:background=""@drawable/tab_bg""                                                         /&gt;&lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>This is a link of the current layout and what I'm trying to do<a href=""http://img441.imageshack.us/g/screenshot20110116at513.png/"" rel=""nofollow"">http://img441.imageshack.us/g/screenshot20110116at513.png/</a></p><p>The orange layout is my app, and the gray is what I'm trying to do.</p><p>Notice how in the gray screenshot the tab flows into the frame.</p><p>Apologies for the links, I can't post images yet :p</p><p>Thanks!</p>","577376","","1288","","2011-03-18 11:29:06","2011-03-18 11:29:06","top border on FrameLayout when using tabs","<android><tabs><border><tabwidget><framelayout>","2","0","1","",""
"4704642","1","4704750","","2011-01-16 09:29:52","1","1161","<p>I want to create a single choice listview in which when an item is pressed i should be able to change the background color of the item pressed. I have tried setting the backgroundcolor of the view parameter passed to the <em>onItemClick</em> function but this changes the backgrouncolor of someother item. After the background color change i want to make the Listview non clickable. I have tried setting <em>clickable</em> and <em>focusable</em> to false in the <em>onItemClick</em> handler function but that doesnt help. I also want to be able to populate this ListView with new data and then make it <em>clickable</em> again later. I will have only four listviewitems so is it better not to use the listview at all and may be use four buttons.</p><p>Thanks </p>","259024","","","","","2011-01-16 10:40:21","How to change backgroundcolor of clicked row in a single choice listview","<android><listview>","1","0","","",""
"4704653","1","4704722","","2011-01-16 09:33:55","1","392","<p>I have an app that requires two builds - one is a demo app, the other uses the same codebase but uses a flag to introduce different functionality.</p><p>The identifier must be different each time (e.g. com.siteA.appA and com.siteB.appB). </p><p>However it doesn't appear to be trivial to use the refactor functionality in Eclipse to change the com identifier - all references change apart from the ""import com.siteA.appA.R"" reference.</p><p>Is there a way to create different builds with different com identifiers/app name within Eclipse?</p><p>Thanks</p>","553978","","","","","2011-01-16 09:51:29","Android/Eclipse: Creating multiple builds with different com identifiers","<android><eclipse>","1","0","","",""
"4704725","1","","","2011-01-16 09:52:30","1","3685","<p>I have custom <code>InputMethod</code> that have a <code>BroadcastListener</code> in it. When the listener catches an intent in <code>onReceive()</code> method I call the <code>onKey</code> method of my <code>InputMethod</code> and in that way I simulate a key press from the softkey board. If I call <code>onKeyDown</code> or <code>onKeyUp</code> then I simulate the hardware keyboard. So this is a solution that I dont like.</p><p>Yesterday I found this:<a href=""http://mylifewithandroid.blogspot.com/2009/01/generating-keypresses-programmatically.html"" rel=""nofollow"">http://mylifewithandroid.blogspot.com/2009/01/generating-keypresses-programmatically.html</a></p><p>Is it a good idea to use <code>Instrumentation.sendKeyDownUpSync</code> to simulate key press and it is working perfectly, I don't even need to implement my own <code>InputMethod</code>. I mean this Instrumentation is provided for testing purpose as I understand.</p><p>Is it a good idea to be used in way I do?</p>","575438","","119895","","2011-01-16 12:49:47","2013-08-20 23:47:51","Way to simulate hardware key press event","<android><methods><input><instrumentation>","1","0","1","",""
"4704747","1","4704790","","2011-01-16 09:59:12","22","17456","<p>I have seen many parcelable examples so far, but for some reason I can't get it to work when it gets a bit more complex.I have a Movie object, which implements Parcelable. This book object contains some properties, such as ArrayLists.Running my app results in a NullPointerException when executing the ReadTypedList ! I'm really out of ideas here</p><pre><code>public class Movie implements Parcelable{   private int id;   private List&lt;Review&gt; reviews   private List&lt;String&gt; authors;   public Movie () {      reviews = new ArrayList&lt;Review&gt;();      authors = new ArrayList&lt;String&gt;();   }   public Movie (Parcel in) {      readFromParcel(in);   }   /* getters and setters excluded from code here */   public void writeToParcel(Parcel dest, int flags) {      dest.writeInt(id);      dest.writeList(reviews);      dest.writeStringList(authors);   }   public static final Parcelable.Creator&lt;Movie&gt; CREATOR = new Parcelable.Creator&lt;Movie&gt;() {      public MoviecreateFromParcel(Parcel source) {         return new Movie(source);      }      public Movie[] newArray(int size) {         return new Movie[size];      }   };   /*    * Constructor calls read to create object    */   private void readFromParcel(Parcel in) {      this.id = in.readInt();      in.readTypedList(reviews, Review.CREATOR); /* NULLPOINTER HERE */      in.readStringList(authors);   }}</code></pre><p>The Review class:</p><pre><code>    public class Review implements Parcelable {   private int id;   private String content;   public Review() {   }   public Review(Parcel in) {      readFromParcel(in);   }   public void writeToParcel(Parcel dest, int flags) {      dest.writeInt(id);      dest.writeString(content);   }   public static final Creator&lt;Review&gt; CREATOR = new Creator&lt;Review&gt;() {      public Review createFromParcel(Parcel source) {         return new Review(source);      }      public Review[] newArray(int size) {         return new Review[size];      }   };   private void readFromParcel(Parcel in) {      this.id = in.readInt();      this.content = in.readString();   }}</code></pre><p>I would be very grateful if someone could just get me on the right track, I have spend quite a bit of time searching for this one !</p><p>Thanks in adnvanceWesley</p>","577402","","","","","2011-01-16 10:18:48","Arraylist in parcelable object","<java><android><arraylist><parcelable><typed>","2","0","8","",""
"4704827","1","4704870","","2011-01-16 10:24:43","1","661","<h2>What I an trying to achieve:</h2><p>I am downloading a file and showing updates in the Expanded Notification bar's Views. For android </p><hr><h2>The problem</h2><p>How to handle the situation when server gets disconnected while downlading?</p><hr><h2>What I have done so far:</h2><p>When Input stream is read and net gets disconnected, It should throw an exception. But it isnt throwing an exception.</p><p>This code here is s simple download loop:</p><pre><code>           try{         while ( (bufferLength = inputStream.read(buffer)) &gt; 0 )                {                      fileOutput.write(buffer, 0, bufferLength);                      //add up the size so we know how much is downloaded                      downloadedSize += bufferLength;                    percent=(int)(100 *( (float)downloadedSize/totalSize ));                    Log.i(""Downloaded"", String.valueOf(downloadedSize) );                }                }                ucon.disconnect();            return 1;        }            catch (IOException e) {                Log.d(""Download"", ""Error: "" + e);               return 2;            }</code></pre><p>I am stunned, why isnt it throwing an exception. What is a work around?</p><hr>","557869","","557869","","2011-01-16 10:35:56","2011-01-16 10:36:35","Interrupted AsyncTask, how to handle it?","<java><android><exception-handling><inputstream><android-asynctask>","1","0","","",""
"4705053","1","4705080","","2011-01-16 11:31:08","1","560","<p>I'm working on a academic project: writing a library for finding the shortest path on large, weighted, directed graphs. </p><p>Specifications are: </p><ul><li><p>The example data set is a graph of 1500 vertices with an average of 5.68 edges per node. Specification may vary up to 20.000 nodes.</p></li><li><p>Moreover I'm working in a cpu / memory bound, environment: Android.</p></li><li><p>Edge weight is not trivial, nor costant. It depends on variable states of the graph.</p></li><li><p>We must work offline.</p></li></ul><p>I face several difficulties:</p><ul><li><p>I need an efficient way to store, retrive and update data of the graph. Should I use a SQLite object with queries from the Java classes, a large custom java object on the heap, or what? I think this is the most performance-critical aspect.</p></li><li><p>I need an efficient way to implement some kind of short path algorithm. Since all the weight are positive, should I apply the Dijikstra algorithm with an ArrayList as the container of the visited nodes? </p></li><li><p>Is this a good case to use the NDK? The task is CPU intensive, but it also make frequent access to the memory, so I don't think so, but I'm open to contribution.</p></li><li><p>Always remember that resources are scarce, ram is insufficient, disk is slow, cpu is precious (battery - wise).</p></li></ul><p>Any advice is wellcome, cheers :)</p>","269931","","269931","","2011-01-16 11:38:13","2011-01-16 11:38:13","Best data structure for large graph in cpu/memory bound environment","<java><android><graph><shortest-path><android-ndk>","1","2","","",""
"4705092","1","4705128","","2011-01-16 11:38:43","2","239","<p>Hii try show layout like image 1 (textView and editText in same line) but my out put shown like image 2 ! i try with this 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=""wrap_content""    android:padding=""5px""    &gt;    &lt;TextView         android:id=""@+id/label""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""URL:""        android:layout_alignBaseline=""@+id/entry""        android:layout_alignParentLeft=""true""/&gt;        /&gt;    &lt;EditText         android:id=""@+id/entry""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/label""        android:layout_alignParentTop=""true""        /&gt;    &lt;Button         android:id=""@+id/button""         android:layout_width=""wrap_content""        android:layout_height=""wrap_content""         android:layout_gravity=""center_horizontal""        android:paddingRight=""30px""         android:paddingLeft=""30px""         android:text=""Go...""         /&gt;&lt;/LinearLayout&gt;</code></pre><p>please help me thanks</p><p><img src=""http://i.stack.imgur.com/4Cix7.jpg"" alt=""image1""></p><p><img src=""http://i.stack.imgur.com/khdVd.jpg"" alt=""image2""></p>","377983","","408780","","2011-02-23 08:26:54","2011-03-07 12:50:01","layout problem in android","<android><xml><layout><textview><edittext>","4","0","","",""
"4705145","1","4705390","","2011-01-16 11:50:41","5","14490","<p>I try to develop an Android App which allows the user to fetch data from flickr and show it in a <code>GridView</code> (with some nice 3D-Animation). After some adventures i got it almost running, but now I'm stuck.</p><hr><p>Here's the problem:</p><p>I got a UI Thread ""LoadPhotosTask"" which gets the pictures from flickr, just like the open source application <a href=""http://code.google.com/p/apps-for-android/source/browse/trunk/#trunk/Photostream"">photostream</a>. In the method <code>onProgressUpdate(LoadedPhoto... value)</code> of that subclass I call <code>addPhoto()</code>. Until now everythings fine - I got some nice Bitmap and Flickr.photo data with all the information I need.</p><pre><code>        @Override    public void onProgressUpdate(LoadedPhoto... value) {        addPhoto(value);    }</code></pre><p>On the other hand I have got a <code>GridView</code>. Now I want to fill it with the Photos. It has got an adapter called <code>ImageAdapter</code> (which extends <code>BaseAdapter</code>, see this <a href=""http://developer.android.com/guide/tutorials/views/hello-gridview.html"">tutorial</a>). If I use an array inside the <code>ImageAdapter</code> class I can populate the <code>GridView</code> with some sample images. But if I want to populate it at runtime, I don't know what to do.</p><p>How do I have to set up the getView method in the <code>ImageAdapter</code>? I was trying to fill the array inside the <code>ImageAdapter</code> class with my values in <code>addPhoto</code>, but it doesn't display anything.</p><p>So first of all I was setting up the array with the amount of Photos i wanted to display in the grid like that (code is inside the <code>ImageAdapter</code> class):</p><pre><code>// class variableprivate ImageView[] mThumbIds;    [...]     public void setupArray(int count) {            this.mThumbIds = new ImageView[count];        }</code></pre><p>Then I call this method with the lenght of my photolist:</p><pre><code>    final Flickr.PhotoList list = params[0];        final int count = list.getCount();        int helper = 0;    imagead.setupArray(count);</code></pre><p>Afterwards I call the getView method manually inside the addPhoto method:</p><pre><code>private void addPhoto(LoadedPhoto... value) {    ImageView image = (ImageView) mInflater.inflate(    R.layout.grid_item_photo, null);    image.setImageBitmap(value[0].mBitmap);    image.setTag(value[0].mPhoto);    imagead.setmThumbIds(image, value[0].mPosition);    imagead.getView(value[0].mPosition, null, mpicturesGrid);}</code></pre><p>That is the getView method inside ImageAdapter:</p><pre><code>    public View getView(int position, View convertView, ViewGroup parent) {    if (convertView == null) { // if it's not recycled, initialize some        // attributes        imageView = new ImageView(mContext);        imageView.setLayoutParams(new GridView.LayoutParams(EDGE_LENGTH,        EDGE_LENGTH));        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);        imageView.setPadding(0, 0, 0, 0);        imageView.setVisibility(View.VISIBLE);    } else {        imageView = (ImageView) convertView;    }    imageView.setImageDrawable(mThumbIds[position].getDrawable());    imageView.setTag(mThumbIds[position].getTag());    return imageView;}</code></pre>","423775","","119895","","2011-01-16 12:35:52","2011-01-16 12:42:28","Populating a GridView with ImageViews dynamically/programmatically using a ImageAdapter","<android><gridview><dynamic><adapter><flickr>","1","0","2","",""
"4705152","1","4706171","","2011-01-16 11:51:20","2","12060","<p>Ive created a new thread for a file browser. The thread reads the contents of a directory. What I want to do is update the UI thread to draw a graphical representation of the files and folders. I know I can't update the UI from within a new thread so what I want to do is:</p><p>whilst the file scanning thread iterates through a directories files and folders pass a file path string back to the UI thread. The handler in the UI thread then draws the graphical representation of the file passed back.</p><pre><code>public class New_Project extends Activity implements Runnable {    private Handler handler = new Handler() {        @Override        public void handleMessage(Message msg) {            Log.d(""New Thread"",""Proccess Complete."");            Intent intent = new Intent();            setResult(RESULT_OK, intent);            finish();        }    };    public void fileScanner(){        //if (!XMLEFunctions.canReadExternal(this)) return;        pd = ProgressDialog.show(this, ""Reading Directory."",                ""Please Wait..."", true, false);        Log.d(""New Thread"",""Called"");        Thread thread = new Thread(this);        thread.start();    }    public void run() {        Log.d(""New Thread"",""Reading Files"");        getFiles();        handler.sendEmptyMessage(0);    }    public void getFiles() {        for (int i=0;i&lt;=allFiles.length-1;i++){            //I WANT TO PASS THE FILE PATH BACK TU A HANDLER IN THE UI            //SO IT CAN BE DRAWN.            **passFilePathBackToBeDrawn(allFiles[i].toString());**        }     }}</code></pre>","548552","","160665","","2012-05-18 07:36:24","2012-08-24 18:06:37","Pass a Message From Thread to Update UI","<android><multithreading><messages>","3","3","1","",""
"4705159","1","4705251","","2011-01-16 11:52:22","2","877","<p>I want to make sure that devices with 10,1"" and 1024x600 under 2.1/2.2(e.g. Archos 101) are using the correct layout.</p><p>Are they large and ldpi?</p><p>Also, how can I simulate them using the android emulator?</p>","564468","","","","","2011-01-16 12:09:34","Which layout will use a 10,1"" 1024x600 tablet?","<android><android-emulator><android-layout>","1","0","","",""
"4705311","1","","","2011-01-16 12:25:07","0","581","<p>Can anyone tell me how i can set the keyboard to landscape in as3? I'm using flash cs5 and air for android and i don't have the auto aspect ration turned on, so what i want is to set the key board to come up in landscape in code.</p><p>Thanks in advance!!!</p><p>FlashCreated</p>","556086","","773263","","2012-05-14 00:46:57","2012-05-14 00:46:57","AS3 air android Change to landscape keyboard","<android><actionscript-3><keyboard><landscape><air-android>","1","0","","",""
"4705355","1","5337204","","2011-01-16 12:34:59","0","2190","<p>I want my android application to automatically post a preset message when the user click on a button. The preset message will be set by the user, so I am guessing that is not a violation of Facebook policies. How do I do this?</p>","481239","","","","","2012-08-25 14:23:33","Android: How to post update on Facebook wall automatically?","<android><facebook><facebook-android-sdk>","3","0","1","",""
"4705363","1","4705388","","2011-01-16 12:36:38","0","340","<p>I need to read some specific data in an HTML web page, from Android.</p><p>I wrote class that build the exact HTTP address. Now I can load the page and parse the data I want, but since bandwidth is expensive on smartphones, I would like to load just some custom data off the HTTP web page, to save memory.</p><p>Is this possible? How could I do it?</p><p>Cheers guys :)</p>","269931","","157882","","2011-01-16 12:48:46","2011-01-16 12:51:52","Load custom data from HTTP web page","<java><android><http>","1","0","","",""
"4705476","1","","","2011-01-16 13:00:19","0","612","<p>I have a problem.I would like custom my TitleBar and when I try with this method:</p><p><strong>requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.mytitle);</strong></p><p>But he crash when i am in the Intent of my TabBar.</p><p>He works in my main Activity, I think there are a different method for the intent of tabBar for customize the titleBar.</p><p>Someone known how it's done?</p><p>I'am a begginer developper Android.</p><p>Thanks !</p>","577477","","","","","2011-08-09 13:19:37","Custom TitleBar in activity ANDROID","<android><tabbar><android-titlebar>","1","1","","",""
"4705585","1","","","2011-01-16 13:25:55","0","611","<p>In itunesconnect, we can specify search terms for our apps. However, in the android market, we are not able to do it. I wonder if this would prove as a restriction for users to search for our apps on android market place. </p><p>Would appreciate if anyone can give their opinions on this matter as i find that android sales figures are much lower than iphone sales.</p>","404109","","","","","2011-01-16 13:25:55","Android app search key words","<android><search><key><words>","0","2","","",""
"4705624","1","4705636","","2011-01-16 13:34:25","2","837","<p>So why isn't toString always invoked? This is an example using the Android API.</p><p>E.g</p><pre><code>@Overridepublic void onItemSelected(AdapterView&lt;?&gt; adapterView, View view,        int position, long id) {    Toast.makeText(this, adapterView, Toast.LENGTH_LONG).show();}</code></pre><p>Will not compile. However if I change it to</p><pre><code>@Overridepublic void onItemSelected(AdapterView&lt;?&gt; adapterView, View view,            int position, long id) {    Toast.makeText(this, adapterView.toString(), Toast.LENGTH_LONG).show();}</code></pre><p>It will. What is the actual difference?</p>","490315","","932225","","2012-07-13 10:33:29","2012-07-13 10:33:29","Why isn't toString() always automatically invoked","<java><android><android-adapterview>","7","0","","",""
"4705643","1","4706825","","2011-01-16 13:40:14","0","646","<p>I build application which allows user to make ""graphic"" notes.I got a problem, when tried to save Bitmap into my custom ContentProvider(NotesProvider extends ContentProvider). According to the Google devGuide should override openFile(Uri uri, String mode) method. And I got Error: File not found.I look through this problem and get solution <a href=""http://stackoverflow.com/questions/3883211/how-to-store-large-blobs-in-an-android-content-provider/4336013#4336013"">here</a>. Then I build my representation like so</p><pre><code>    public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {        if(sUriMatcher.match(uri)!=NOTE_ID)            throw new IllegalArgumentException(""Unsupported open file on directori uri "" +uri);        File root = new File(Environment.getDataDirectory(),            BITMAPS_PATH);        root.mkdirs();        File path=new File(root, uri.getEncodedPath());        int imode = 0;        if (mode.contains(""w"")) {            imode |= ParcelFileDescriptor.MODE_WRITE_ONLY;            if (!path.exists()) {                try {                    path.createNewFile();                } catch (IOException e) {                    // TODO decide what to do about it, whom to notify...                    e.printStackTrace();                }            }        }        if (mode.contains(""r"")) imode |= ParcelFileDescriptor.MODE_READ_ONLY;        if (mode.contains(""+"")) imode |= ParcelFileDescriptor.MODE_APPEND;        return ParcelFileDescriptor.open(path, imode);}</code></pre><p>and application have IOException </p><pre><code>12:42:12.714    2550    WARN    System.err  java.io.IOException: No such file or directory</code></pre>","577516","","","","","2011-01-16 17:19:58","Content provider file storage No Such file or directory","<android><content><android-contentprovider>","1","0","","",""
"4705772","1","4705833","","2011-01-16 14:07:23","0","436","<p>I've tried all weekend to find the answer to this, but I'm lost.  I may have programmed myself into a hole, and need to do something different.</p><p>Imagine that my game launches into the main activity (the intro screen),then if the player wishes to view the whole continent a intent starts the Continent View Activity.  If the player wishes to view the local city, then an intent starts the city view activity.</p><p>I can do this with buttons on the main intro screen, but I want the player to be able to select a the City Location on the Continent View.  The result is to stop the intent for the Continent View and then trigger the activity for the City View.</p><p>The problem is, I don't seem to be able to call finish from the Thread (SurfaceView) that is drawing Continent View.</p><p>I don't really want to make the Continent Map out of Buttons if I can help it.  For now, the Continent View is made of .PNG cells.</p><p>Is my whole approach wrong?</p>","577182","","","","","2011-01-16 14:20:31","Stopping an intent from a thread and starting a new intent :Android","<android><multithreading><android-intent>","1","2","","",""
"4705830","1","","","2011-01-16 14:19:57","2","2796","<p>I have been working on a project about video summarization on android platfrom. and I am stuck in encoding. I think; first I must convert my frame into RGB Frame, then convert that RGB FRame into YUV Frame. Then encode the frame. After this operations, The output video was so weird. I think I missed something. Here is my las optimized code. Maybe someone has an experiement in this subject. </p><p>Its syntax is changed  according to android ndk syntax: </p><pre><code>jint Java_com_test_Test_encodeVideo(JNIEnv* env, jobject javaThis) {      char *flname, *err, *info;      AVCodec *codec;      AVCodecContext *c= NULL;      int i,out_size, size, x, y,z, outbuf_size;      int frameCount=99;      FILE *f;      AVFrame *picture, *yuvFrame;      uint8_t *outbuf, *picture_buf;      PPMImage *img;      const char *destfilename = ""/sdcard/new.mp4"";      int             numBytes;      uint8_t         *buffer;      av_register_all();      // must be called before using avcodec lib      avcodec_init();      // register all the codecs      avcodec_register_all();      log_message(""Video encoding\n"");      // find the H263 video encoder      codec = avcodec_find_encoder(CODEC_ID_H263);      if (!codec) {          sprintf(err, ""codec not found\n"");          log_message(err);      }      c= avcodec_alloc_context();      picture= avcodec_alloc_frame();      yuvFrame= avcodec_alloc_frame();      // get first ppm context. it is because I need width and height values.      img = getPPM(""/sdcard/frame1.ppm"");      c-&gt;bit_rate = 400000;      // resolution must be a multiple of two      c-&gt;width = img-&gt;x;      c-&gt;height = img-&gt;y;      free(img);      // frames per second      c-&gt;time_base= (AVRational){1,25};      c-&gt;gop_size = 10; // emit one intra frame every ten frames      //c-&gt;max_b_frames=1;      c-&gt;pix_fmt = PIX_FMT_YUV420P;      // open it      if (avcodec_open(c, codec) &lt; 0){     log_message(""codec couldn't open"");     return -1;      }      //destfilename = (*env)-&gt;GetStringUTFChars(env, dst, 0);      f = fopen(destfilename, ""wb"");      log_message(destfilename);      if (!f) {          sprintf(err, ""could not open %s"", destfilename);          log_message(err);      }      log_message(""after destination file opening"");      // alloc image and output buffer      outbuf_size = 100000;      outbuf = malloc(outbuf_size);      size = c-&gt;width * c-&gt;height;      picture_buf = malloc(size * 3); // size for RGB      picture-&gt;data[0] = picture_buf;      picture-&gt;data[1] = picture-&gt;data[0] + size;      picture-&gt;data[2] = picture-&gt;data[1] + size / 4;      picture-&gt;linesize[0] = c-&gt;width;      picture-&gt;linesize[1] = c-&gt;width / 2;      picture-&gt;linesize[2] = c-&gt;width / 2;      numBytes=avpicture_get_size(PIX_FMT_YUV420P, c-&gt;width,               c-&gt;height);      buffer=malloc(numBytes);           // Assign appropriate parts of buffer to image planes in FrameYUV      avpicture_fill((AVPicture *)yuvFrame, buffer, PIX_FMT_YUV420P,               c-&gt;width, c-&gt;height);      // encode the video      log_message(""before for loop"");      for(z=1;z&lt;frameCount;z++) {                          sprintf(flname,""/sdcard/frame%d.ppm"",z);                          // read the ppm file                          img = getPPM(flname);                          picture-&gt;data[0] = img-&gt;data;                          // convert the rgb frame into yuv frame                          rgb2yuv(picture,yuvFrame,c);                          log_message(""translation completed."");                          // encode the image                          out_size = avcodec_encode_video(c, outbuf, outbuf_size, yuvFrame);                          sprintf(info,""encoding frame %3d (size=%5d)\n"", z, out_size);                          log_message(info);                          fwrite(outbuf, 1, out_size, f);                          free(img);      }      // get the delayed frames      for(; out_size; i++) {          //fflush(stdout);          out_size = avcodec_encode_video(c, outbuf, outbuf_size, NULL);          sprintf(info,""write frame %3d (size=%5d)\n"", i, out_size);              log_message(info);          fwrite(outbuf, 1, out_size, f);      }      // add sequence end code to have a real mpeg file      outbuf[0] = 0x00;      outbuf[1] = 0x00;      outbuf[2] = 0x01;      outbuf[3] = 0xb7;      fwrite(outbuf, 1, 4, f);      fclose(f);      free(picture_buf);      free(outbuf);      avcodec_close(c);      av_free(c);      av_free(picture);      av_free(yuvFrame); } int rgb2yuv(AVFrame *frameRGB, AVFrame *frameYUV, AVCodecContext *c) {         char *err;         static struct SwsContext *img_convert_ctx;         log_message(""conversion starts"");         // Convert the image into YUV format from RGB format         if(img_convert_ctx == NULL) {                 int w = c-&gt;width;                 int h = c-&gt;height;                 img_convert_ctx = sws_getContext(w, h, PIX_FMT_RGB24,w, h, c-&gt;pix_fmt, SWS_BICUBIC,NULL, NULL, NULL);                 if(img_convert_ctx == NULL) {                         sprintf(err, ""Cannot initialize the conversion context!\n"");                         log_message(err);                         return -1;                 }         }   int ret = sws_scale(img_convert_ctx,frameRGB-&gt;data, frameRGB-&gt;linesize , 0,c-&gt;height,frameYUV-&gt;data, frameYUV-&gt;linesize );         return; }</code></pre>","577538","","139010","","2011-01-16 14:33:48","2012-12-25 06:01:09","FFmpeg encoding in c","<android><ffmpeg><android-ndk>","0","1","4","",""
"4705859","1","4705894","","2011-01-16 14:25:07","3","936","<p>I'm developing an application with executes searches via an API on a web server. My search page displays well in portait mode but is too big for landscape mode so I've decided to simply contain all UI elements in a ScrollView by customising the XML in layout-land folder. The problem is, the buttons on the bottom of my form are not being shown in landscape ScrollView. I don't use ScrollView in portrait so maybe that's the problem? The layout XML is like this:</p><pre><code>&lt;LinearLayout&gt;&lt;ScrollView&gt;    &lt;LinearLayout&gt;        &lt;TableLayout&gt;            &lt;!-- stuff here is being shown (table with TextViews and EditTexts --&gt;        &lt;/TableLayout&gt;        &lt;LinearLayout&gt;            &lt;!-- stuff here is not being shown (3 Buttons) --&gt;        &lt;/LinearLayout&gt;    &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p></p>","561498","","","","","2011-01-16 14:31:19","ScrollView not displaying some UI elements","<android><activity><scrollview>","1","1","","",""
"4706067","1","4706113","","2011-01-16 15:05:10","0","219","<p>I have been using the Medialytics plugin library to track usage of my app. Only problem is when i use this code to track a button press</p><pre><code>mManager.trackEvent(new MMEvent(""Buttonclick""));</code></pre><p>and insert it into my code like so</p><pre><code>Button btnOpenNewActivity3 = (Button) findViewById(R.id.ButtonM03);     btnOpenNewActivity3 .setOnClickListener(new View.OnClickListener() {     public void onClick(View v) {     mManager.trackEvent(new MMEvent(""Button Click""));    Intent myIntent = new Intent(Converter.this,Weight.class);    Converter.this.startActivity(myIntent);} }); </code></pre><p>the app runs fine but when i click the button it crashes and the logcat displays this message</p><pre><code>01-16 14:51:42.503: ERROR/AndroidRuntime(456): Uncaught handler: thread main exiting due to uncaught exception01-16 14:51:42.673: ERROR/AndroidRuntime(456): java.lang.NullPointerException01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at app.android.converter.Converter$3.onClick(Converter.java:46)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at android.view.View.performClick(View.java:2364)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at android.view.View.onTouchEvent(View.java:4179)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at android.widget.TextView.onTouchEvent(TextView.java:6532)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at android.view.View.dispatchTouchEvent(View.java:3709)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1690)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at android.os.Handler.dispatchMessage(Handler.java:99)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at android.os.Looper.loop(Looper.java:123)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at android.app.ActivityThread.main(ActivityThread.java:4310)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at java.lang.reflect.Method.invokeNative(Native Method)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at java.lang.reflect.Method.invoke(Method.java:521)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)01-16 14:51:42.673: ERROR/AndroidRuntime(456):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I'm not entirly sure how this can be fixed</p><p>any clues? =/</p>","562562","","","","","2011-01-16 15:15:22","Problems with external libraries (Uncaught exception)","<android><android-intent><logcat><uncaught-exception><external-library>","1","0","","",""
"4706087","1","4706819","","2011-01-16 15:10:04","3","1629","<p>I'm trying to upload a photo to the popular service Dailybooth via their new API through the method <a href=""http://developers.dailybooth.com/pictures"" rel=""nofollow"">documented here</a>.</p><p>The problem is that the server is responding with:</p><pre><code>&lt;html&gt;&lt;head&gt;&lt;title&gt;411 Length Required&lt;/title&gt;...</code></pre><p>The code I'm using to send this data is here:</p><pre><code>// 2: Build requestHttpClient httpclient = new DefaultHttpClient();SharedPreferences settings = DailyboothShared.getPrefs(DailyboothTakePhoto.this);String oauth_token = settings.getString(""oauth_token"", """");HttpPost httppost = new HttpPost(        ""https://api.dailybooth.com/v1/pictures.json?oauth_token="" + oauth_token);Log.d(""upload"", ""Facebook: "" + facebook);Log.d(""upload"", ""Twitter: "" + twitter);try {    InputStream f = getContentResolver().openInputStream(snap_url);    MultipartEntity entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);    entity.addPart(""picture"", new InputStreamBody(f, snap_url.getLastPathSegment()));    entity.addPart(""blurb"", new StringBody(blurb));    entity.addPart(""publish_to[facebook]"", new StringBody(facebook));    entity.addPart(""publish_to[twiter]"", new StringBody(twitter));    httppost.setEntity(entity);    HttpResponse response = httpclient.execute(httppost);    Log.d(""upload"", response.toString());    int statusCode = response.getStatusLine().getStatusCode();    if (statusCode == 200) {        // do something?    } else {        Log.d(""upload"", ""Something went wrong :/"");    }    Log.d(""upload"", EntityUtils.toString(response.getEntity()));} catch (Exception ex) {    ex.printStackTrace();}</code></pre><p>I've got no idea what I'm doing wrong.</p>","230419","","569101","","2013-03-14 08:45:33","2013-03-14 08:45:33","Invalid Content-Length is sent to the server?","<java><android><apache-httpcomponents>","1","0","1","",""
"4706091","1","4706190","","2011-01-16 15:11:00","3","2789","<p>I've got a list of search results which are being shown in a ListActivity. When I change the background color of the ListActivity items, by changing the background color of the first LinearLayout (parent), the OnClick highlight stops working. Why is this and how can I make this highlight still work when I change the background color of my items? On a side note, is it possible to change the color of this highlight? Thanks.</p><p>My XML is something like this:</p><pre><code>&lt;LinearLayout&gt;&lt;LinearLayout&gt; &lt;ImageView&gt; &lt;LinearLayout&gt;  &lt;TextView&gt;  &lt;/TextView&gt;  &lt;TextView&gt;  &lt;/TextView&gt;  &lt;TextView&gt;  &lt;/TextView&gt; &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>and my activity is like this:</p><pre><code>public class ResultsPage extends ListActivity {</code></pre>","561498","","","","","2013-05-26 17:29:43","changing background color of ListView disables highlight color","<android><onclick><listactivity>","2","0","","",""
"4706178","1","4706221","","2011-01-16 15:28:16","1","309","<p>I have an application and in one of my activities I created a base activity that contains some helper methods that derived classes can use.</p><p>I have a method that lazy loads views, here is the code</p><pre><code>    protected &lt;T extends View&gt; void loadView(T view, int id) {    if(view == null){        view = (T)findViewById(id);    }</code></pre><p>In my derived class I call it as such.</p><pre><code>private Button btnAddAlarm...@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.timer_list);    loadView(btnDeleteAlarm, R.id.btnDeleteAlarm); //the view in the helper method loaded fine    btnDeleteAlarm.setEnabled(false); //Null pointer exception!</code></pre><p>the problem is that btnDeleteAlarm is null after it exits from the function, even though the reference is passed in.</p><p>I haven't touched java in a while but if I remember the basics this shouldn't happen when passing references.</p>","499646","","","","","2011-01-16 15:36:31","Trying to lazy load android view using generics","<java><android><generics>","1","0","1","",""
"4706251","1","4706285","","2011-01-16 15:40:30","1","1690","<p>What is the recommended best practice for minimizing the startup time of an android application?</p>","191246","","272824","","2011-01-16 16:02:47","2011-01-16 18:32:14","How to improve the startup time of an Android app?","<java><android><apk>","4","0","1","",""
"4706323","1","","","2011-01-16 15:50:33","0","743","<p>I have a problem with right-to-left languages in TextView. When I write in Arabic, the characters appear separately. How can I solve this problem?</p>","377983","","1167234","","2013-03-15 15:26:03","2013-11-12 07:50:56","Issue with RTL languages in android","<android><unicode><textview><arabic><right-to-left>","2","1","","",""
"4706364","1","4706396","","2011-01-16 15:58:10","0","191","<p>Is it possible to use the MapView to build on GMaps-based  apps without having Google Market and the other Google tools installed? </p><p>Do i need to have a custom ROM on such phones with that Google tools?</p><p>Are there some other possibilities to use Maps and a MapView-like-thing?</p><p>Especially some Tablet devices like Notion Ink Adam , Advent Vega und Point of View Tegra lack this Google Tools.</p>","142405","","","","","2011-01-16 16:03:48","Using MapView on non-""Google Market""/non-""Google featured"" phones","<android><google-maps><android-mapview><google-play>","1","0","","",""
"4706434","1","4706533","","2011-01-16 16:09:24","1","2382","<p>I'm new to this forum and to android development itself so my question will probably be a very stupid one and i apologize for this .I began reading the Dev Guide on developer.android.com and until the part with the context menus everything worked pretty fine. Now i tried to have a context menu with a submenu that contains some checkable items. So i added the submenu and the items to my menu.xml and some item.setchecked(true) methods to my onContextItemSelected(...) method.</p><p>menu.xml</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/info""        android:title=""@string/info"" /&gt;    &lt;item android:title=""@string/change""&gt;        &lt;menu&gt;           &lt;item android:id=""@+id/checkable_item1""               android:checked=""true""               android:checkable=""true""               android:title=""@string/hello""/&gt;           &lt;item android:id=""@+id/checkable_item2""               android:checkable=""true""               android:title=""@string/moin""/&gt;           &lt;item android:id=""@+id/checkable_item3""               android:checkable=""true""                android:title=""@string/aloha""/&gt;       &lt;/menu&gt;  &lt;/item&gt;   &lt;/menu&gt;</code></pre><p>part of my .java file</p><pre><code>...@Overridepublic void onCreateContextMenu(ContextMenu menu, View v,      ContextMenuInfo menuInfo){   super.onCreateContextMenu(menu, v, menuInfo);   MenuInflater inflater1 = getMenuInflater();   inflater1.inflate(R.menu.context_menu, menu);}@Overridepublic boolean onContextItemSelected(MenuItem item){   switch(item.getItemId())   {   case R.id.checkable_item1:      if(item.isChecked()) item.setChecked(false);      else item.setChecked(true);      return true;   case R.id.checkable_item2:      if(item.isChecked()) item.setChecked(false);      else item.setChecked(true);      return true;   case R.id.checkable_item3:      if(item.isChecked()) item.setChecked(false);      else item.setChecked(true);      return true;   default:      return super.onContextItemSelected(item);   }}...</code></pre><p>Now the problem is that when i open the menu and press one of the checkable items and i can see that the green tick pops up in the little box just before the context menu closes but when i open up the menu again the tick is gone. Now i don't really know why the tick doesn't stay in the box. It would be nice if someone could give me hint and tell me what i'm doing wrong.thanking you in anticipation </p><p>jean-claude91</p>","577615","","","","","2011-01-16 16:26:10","checked context menu items don't stay checked","<android><android-layout><android-context><android-menu>","1","0","","",""
"4706473","1","4706599","","2011-01-16 16:16:33","2","3193","<p>I'm building an Android application (as an Eclipse project) that needs to access a web service. We will be sending the data from the service as JSON serialized classes, so we want to share some of the classes between the Android application and the server application. We are currently thinking that the way we need to do this is to structure our Git repository with 3 folders. One for the client, one for the server, and one for the shared library.</p><p>But at that point we couldn't figure out how to create the shared code. It looks like we can put all the .java files into a folder and then create a relative link to that folder from the other projects, but is that a good way to go about this?</p><p>The other possibility we found was to create another project in Eclipse and then include the library project in the client project. However we ran into a problem here. How can we make the library usable by both the server and Android? If I create a new Java project in Eclipse, I must select a JRE to build for, but Dalvik isn't an option, and even if it was how could I use the library with a desktop VM if the library was compiled for Dalvik?</p>","370556","","","","","2011-01-16 17:55:31","How should I structure my project to share classes between an Android client application and a JSP server application?","<java><android><version-control>","3","0","","",""
"4706550","1","4706797","","2011-01-16 16:28:58","0","1154","<p>I want to place each character on new line.I am using following 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=""12dip""    android:layout_marginLeft=""12dip""    android:textSize=""12dip""     android:layout_height=""fill_parent""     android:text=""ABCDEFGHIJKLMNOPQRSTUVWXYZ""/&gt;&lt;/LinearLayout&gt;</code></pre><p>but I am getting output as follow(On some line 2 character are coming)</p><p><img src=""http://i.stack.imgur.com/Ha4o6.png"" alt=""alt text"">. </p><p>I know that I can use <code>\n</code> but anybody have better option.</p>","484073","","","","","2011-01-16 17:35:30","Textview placing each character on newline","<android><android-textview>","2","0","","",""
"4706638","1","4706804","","2011-01-16 16:44:14","2","1423","<p>For example, I have four columns: <code>first_name</code>, <code>last_name</code>, <code>phone_number</code> and <code>picture</code>. Somewhere in my code there's:  </p><pre><code>ContentValues values = new ContentValues();values.put(MyPerson.FIRST_NAME, ""Ted"");values.put(MyPerson.LAST_NAME, ""Johnson"");values.put(MyPerson.PHONE_NUMBER, ""111-111-1111"");values.put(MyPerson.PICTURE, ""file://tedpicture.jpeg"");getContentResolver().update(tedUri, values, null, null);</code></pre><p>Could I run something like:</p><pre><code>ContentValues values = new ContentValues();values.put(MyPerson.PHONE_NUMBER, ""222-222-2222"");getContentResolver().update(tedUri, values, null, null);</code></pre><p>And expect the <code>first_name</code>,<code>last_name</code>, and <code>picture</code> columns to have the same values as when I first set them. Or do I have to also populate the <code>first_name</code>, <code>last_name</code>, and <code>picture</code> columns too?</p>","200477","","","","","2011-01-16 17:20:37","Update item in database without all of the columns set in ContentValues","<java><android><android-contentprovider>","3","0","2","",""
"4706676","1","","","2011-01-16 16:53:38","1","590","<p>I am newbie to both Java and Android, and currently I am confused about ""memory leak"" in Android, for example: I have 01 Class, 01 Activity and 01 Interface as following:</p><p>Class BackGroundWorker is a singleton, which lives as long as the application lives:</p><pre><code>public class BackGroundWorker { private IOnEventOccurListener listener = null; private static BackGroundWorker instance;// .... public void setListener(IOnEventOccurListener pListener) {  this.listener =  pListener; }// .... public static BackGroundWorker getInstance() {  //...  return instance; }}</code></pre><p>The Listener Interface:</p><pre><code>public interface IOnEventOccurListener { public void onEventOccur();}</code></pre><p>And the Listener itself (An activity):</p><pre><code>public class ShowSomething extends Activity implements IOnEventOccurListener{ BackGroundWorker bgWorker; @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  bgWorker = BackGroundWorker.getInstance();  bgWorker.setListener(this); } @Override public void onEventOccur() {  // TODO do something }}</code></pre><p>Now, according to what Romain Guy mentioned <a href=""http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.html"" rel=""nofollow"">here</a>: It’s a memory leak, because there’s a reference to the listener (Activity). So Java GC cannot collect the Activity, even when it’s not in use.   </p><p>I was able to solve that problem by WeakReference – but still wonder: <strong>In this case, when the device needs more memory, according to Android Dev document, it will “kill” the activity if needed  - assuming that the Activity ShowSomething is “killed” – then what happens ? (It’s still leak according to Romain Guy, and still “killed” )</strong> </p><p>I am really confused. Could anybody please explain this ?</p><p>Thank you in advanced,<br>Son</p>","424721","","","","","2012-12-15 15:19:06","Memory leak: Confusion between Java Garbage Collector - and Android killing mechanism?","<android>","2","0","2","",""
"4706729","1","4707537","","2011-01-16 17:03:02","1","3081","<p>I have four columns and four buttons I got them to all line up like I want it to, but they are all scrunched together. is there anyway to make it so that the layouts have spacing? this is what I have:</p><pre><code> &lt;TableLayout    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:stretchColumns=""4""&gt;    &lt;TableRow&gt;        &lt;Button             android:layout_column=""1""            android:id=""@+id/Button01""             android:onClick=""OnClick""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:background=""@drawable/Button01""&gt;        &lt;/Button&gt;        &lt;Button             android:layout_column=""2""            android:id=""@+id/Button02""             android:onClick=""OnClick""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:background=""@drawable/Button02""&gt;        &lt;/Button&gt;        &lt;Button             android:layout_column=""3""            android:id=""@+id/Button03""             android:onClick=""OnClick""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:background=""@drawable/Button03"" &gt;        &lt;/Button&gt;                    &lt;Button             android:layout_column=""4""            android:id=""@+id/Button04""             android:onClick=""OnClick""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:background=""@drawable/Button04"" &gt;        &lt;/Button&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre>","424421","","","","","2013-06-27 00:10:00","get spacing between columns android sdk","<android><layout><spacing>","2","0","","",""
"4706765","1","","","2011-01-16 17:08:45","0","523","<p>I need to have a ""stable"" connection to a server.</p><ol><li><p>The client tries to connect to the server every 5 (10, N)-seconds.</p></li><li><p>After having connected successfully the client receives data from the server.</p></li><li><p>In case of service interruption (server shutdown, for example), go to step #1.</p></li></ol><p>How I test:</p><ol><li><p>I start the server</p></li><li><p>I start the client (to be sure that client gets data from the server)</p></li><li><p>I stop the server</p></li><li><p>I wait for about 200 client attempts to connect to the server.</p></li><li><p>I restart the server.</p></li></ol><p>The server sends data, but the client doesn't get it.<code>socket.connect(...)</code> is sucessfull, but<code>socket.getInputStream().read(byte[])</code> is not: the <code>Thread</code> blocks on <code>input.read(..)</code>.</p><p>If I uncomment this line:</p><pre><code>//socket.setSoTimeout(500);</code></pre><p>then <code>input.read(..)</code> throws a <code>TimeoutException</code>.</p><p>But the server receives data from the client.</p><p>Where is my wrong?Thanks.</p><p>Part of client code:</p><pre><code>private void initSocket() {    try {        if (socket == null || socket.isClosed() == true                || socket.isConnected() == false) {            socket = new Socket();            // socket.setSoTimeout(500);            InetSocketAddress socketAddress = new InetSocketAddress(""192.168.1.3""                  , 12344);            notifyDataListener(4);            socket.connect(socketAddress, 500);            notifyDataListener(5);        }    } catch (Throwable t) {        System.err.println(t);    }}private void closeSocket() {    try {        if (socket != null &amp;&amp; socket.isClosed() == false) {            socket.close();        }    } catch (Throwable t) {        System.err.println(t);    }}private byte[] buffer = new byte[1024];public void run() {    while (isActive) {        try {            notifyDataListener(1);            initSocket();            InputStream input = socket.getInputStream();            int length = input.read(buffer);            if (length &lt; 0) {                throw new EOFException(""Was got -1"");            }            notifyDataListener(2);        } catch (Throwable t) {            closeSocket();            notifyDataListener(3);            try {                Thread.sleep(100);            } catch (InterruptedException ie) {            }        }    }}</code></pre><p>On J2SE the same code works fine. Connection repairs after many wrong attempts.It looks like Android has limit slosts of sockets (FileDescriptior?), takes them, but don't release after.</p>","577157","","909742","","2013-12-08 22:26:26","2013-12-08 22:26:26","Need to have ""stable"" TCP connection to server","<android>","1","1","","",""
"4706874","1","","","2011-01-16 17:29:18","4","7081","<p>I have an application that I can insert data into a SQLite database. There's a service thread running every sixty seconds checking if a condition is true and raising an alarm if necessary. Think ""calendar"" application.</p><p>I have lots of activities with a reference to their own SQLiteOpenHelper, and their own SQLiteDatabase object.</p><p>The application was working pretty well, but one of the main update applications I decided needed a progress dialog subject - that's another subject, but if you can tell me how I can get the spinner to spin that'd be great. It does however display.</p><p>But to get it to display, I needed to put it in a thread.</p><p>Creating this thread, I started to get loads of ""database is locked"" messages in the Log.</p><p>I figured the issue may have been related to the fact I had a task in the background running every sixty seconds - even though it visually only took a couple of seconds to do the update, so I placed the main write transactions for the updater function in a beginTransaction block. That's the only place I used one.</p><p>Everything seemed good, but then I started getting more spurious errors about the database being locked all over the place.</p><p>It's encouraged me to do some tidying up, but it seems after I do the first beginTransaction, any further database modifications I want to make fail with a report that the database is locked, despite that fact I do call db.close. I even close the database helper object and cursor just to be on the safe side. </p><p>I was able to clear up most of the warnings with regards to cursors still being open, eg</p><pre><code>E/Database(  678): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here</code></pre><p>I couldn't figure out what was locking the database as everything was being closed.</p><p>I then decided to remove the ""beginTransaction"" which stabilised things - I could now navigate my program again. But Im still getting a few random locking issues.</p><pre><code>E/Database( 1304): Failure 5 (database is locked) on 0x26e5d8 when executing 'INSERT INTO</code></pre><p>Is it possible to figure out what is locking the database? I can see what is grumbling about the lock, but not what is locking it.</p><p>What is the best way to handle concurrent database updates/reads like this? I've read a lot about synchronized and ContentProviders but I must admit, it is a little bit big for me.</p><p>Any pointers on the ""best"" way of doing things?</p><p>And can I find out what is locking the database?</p><p>ThanksSimon</p>","509326","","","","","2013-08-01 08:19:36","Android - Database is Locked","<android><sqlite><locking>","2","2","1","",""
"4706894","1","4707003","","2011-01-16 17:33:53","2","1230","<p>Here is my .java file:</p><pre><code>package com.shoppinglist;import java.util.ArrayList;import android.app.Dialog;import android.app.ListActivity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.EditText;import android.widget.ListView;public class ShoppingList extends ListActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        final EditText et = (EditText) findViewById(R.id.edittext);        ListView lv = (ListView) findViewById(android.R.id.list);        final ArrayList&lt;String&gt; items = new ArrayList&lt;String&gt;();        final ArrayAdapter&lt;String&gt; adapter;        adapter = new ArrayAdapter&lt;String&gt;(        this, android.R.layout.simple_list_item_1, items);        lv.setAdapter(adapter);        setContentView(R.layout.main);        Button button1main = (Button) findViewById(R.id.add);        button1main.setOnClickListener(new OnClickListener()  {            @Override            public void onClick(View v)  {            final Dialog dialog = new Dialog(ShoppingList.this);            dialog.setContentView(R.layout.maindialog);            dialog.setCancelable(true);        Button button = (Button) dialog.findViewById(R.id.cancel);        button.setOnClickListener(new OnClickListener()  {                @Override                public void onClick(View v)  {                    dialog.dismiss();                }            });            dialog.show();        Button ok = (Button) dialog.findViewById(R.id.ok);        ok.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                items.add(0, et.getText().toString());                adapter.notifyDataSetChanged();                dialog.dismiss();                et.setText("""");        }            }        );       }        });    }}</code></pre>","560096","","","","","2013-06-04 10:40:10","Android App Crashes on Startup due to java.lang.NullPointerException","<android><crash>","2","0","","",""
"4706929","1","4709900","","2011-01-16 17:40:26","2","3381","<p>I am testing a simple widget in android and using Alarms to update a TextView at regular intervals. The problem is that in the BroadcastReceiver class I cannot access the TextView element, which I want to get updated when the alarm expires. The class is being called properly because the Toast i have put there is giving the appropriate message. The following code is from the class where I configure the widget and set the timers.</p><pre><code> public void onCreate(Bundle bundle) {     super.onCreate(bundle);     Intent intent = getIntent();     Bundle extras = intent.getExtras();     if(extras != null){      mWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);      AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(WidgetConfigure.this);      RemoteViews views = new RemoteViews(WidgetConfigure.this.getPackageName(), R.layout.widget_layout);      views.setTextViewText(R.id.quote, ""Widget Loaded From Activity"");      appWidgetManager.updateAppWidget(mWidgetId, views);      setTimer(); //set the timers...      setResult();// set the result...     } }</code></pre><p>Now i want to update the same TextView when the BroadCastReceiver is called after the timer expires. I have tried the code provided in the ExampleAppWidget example provided in android api demos and that isnt working out. How can i set the required text?</p>","378143","","213269","","2011-01-17 11:41:39","2011-01-17 11:41:39","How to access a TextView element in a BroadcastReceiver","<android><layout><widget>","1","0","3","",""
"4707015","1","","","2011-01-16 17:55:39","3","852","<p>Hey,I want to build a simple android app for loving the recent track. I receive the song with user.getRecentTrack and send the data and session key to my method but there is an error:""The target server failed to response."" Sometimes, there is also Error 3 from the lastfm method: track.love: ""Invalid Method - No method with that name in this package"".This is my Http Post Request for <a href=""http://www.lastfm.de/api/show?service=260"" rel=""nofollow"">track.love</a></p><pre><code>HttpClient client = new DefaultHttpClient(); String postURL = ""http://ws.audioscrobbler.com/2.0/"";;HttpPost post = new HttpPost(postURL); List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;(2);String signatur = makeTrackLoveSignatur(artist, title, key);params.add(new BasicNameValuePair(""method"", ""track.love""));params.add(new BasicNameValuePair(""track"", title));params.add(new BasicNameValuePair(""artist"", artist));params.add(new BasicNameValuePair(""api_key"", api_key));params.add(new BasicNameValuePair(""api_sig"", signatur));params.add(new BasicNameValuePair(""sk"", key));params.add(new BasicNameValuePair(""format"", ""json""));UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params,HTTP.UTF_8);post.setEntity(ent);HttpResponse responsePOST = client.execute(post); InputStream data = responsePOST.getEntity().getContent();</code></pre><p>I implemented also a convert InputStream to String method: </p><pre><code>BufferedReader reader = new BufferedReader(                new InputStreamReader(stream));        StringBuilder sb = new StringBuilder();        String line = null;        try {            while ((line = reader.readLine()) != null) {                sb.append(line + ""\n"");            }            stream.close();        } catch (IOException e) {            e.printStackTrace();        }        System.out.println(""Output""+sb.toString());        return sb.toString();</code></pre><p>What's the problem? Thanks...</p>","577675","","","","","2011-02-01 19:00:51","HTTP Post Request: target server failed to response","<java><android><http><last.fm>","2","0","","",""
"4707049","1","4739167","","2011-01-16 18:02:28","0","129","<p>I have a button class thats created from within the onSurfaceCreated method in my glSurfaceView; It takes gl as one of its parameters so it can properly draw. Im having an issue passing gl to an overlay class, which looks like a pin in the google maps app. If i call makeOverlay() in my button's constructor it draws perfectly, if i call it anywhere else all i get is a white square. They are all on the same drawing thread. Anyone know what im missing? Thanks.</p>","385051","","44729","","2011-01-16 21:41:24","2011-01-23 01:43:51","problems passing gl with Android","<android><opengl-es>","2","1","","",""
"4707212","1","","","2011-01-16 18:29:07","3","1111","<p>My application has a bunch of external .jars, android libraries, and a plenty of code. Bulding the project (I am using eclipse) is terrible. It takes few minutes to do clean/build. And after each rebuild I have to restart eclipse, otherwise it just hangs on second build. I am afraid that soon I'll not be able to build it at all!! Giving more memory to Eclipse has no effect.</p><p>On the other side, there is absolutly no problems building small anroid applications.</p><p>I am on Windows Vista, eclipse-java-galileo-SR2, Android SDK Tools (revision8), Core 2 Duo 2GHz. </p><p><strong>Q:</strong> It would be great to hear from other developers having pretty big projects, if you have same issues, and how you solve them?</p><p>An other issue that I see, is that compilation hangs some times since it can't communicate with emulator. If I close emulator, it may complete.</p>","62192","","","","","2011-01-21 15:19:49","Building medium size android application is very slow","<android>","1","3","1","",""
"4707237","1","4707281","","2011-01-16 09:45:02","5","891","<p>Looks like Android SDK doesn't come with any AVDs byt default. We need to create a new custom one. But I was wondering if there are pre-configured AVDs available to use that matches exact devices, for example LG P500.</p>","126833","anjanesh","","","","2012-05-08 01:40:51","Pre-configured AVDs to match real devices","<devices><android>","1","2","4","",""
"4707262","1","4707319","","2011-01-16 18:38:38","1","1772","<p>I've got an ImageView that I've wrapped in a LinearLayout. The LinearLayout has a background drawable which is basically a border, so the effect is that my image has a border around it. </p><p>However no matter what I try, I get a big chunk of empty space underneath my image, which is pushing the lower border of my LinearLayout down. I want the LinearLayout to wrap tightly around the image with no padding (except for the 1sp that I specify)</p><p>This is how I've defined the two</p><pre><code>  &lt;LinearLayout   a:orientation=""vertical"" a:layout_width=""wrap_content""   a:layout_height=""wrap_content""   a:gravity=""top""   a:padding=""1sp""   a:background=""@drawable/heading_background""&gt;     &lt;ImageView a:src=""@drawable/photo""     a:layout_width=""wrap_content""    a:layout_height=""wrap_content""    a:scaleType=""fitStart""/&gt;     &lt;/LinearLayout&gt;</code></pre><p>Can anyone tell me what I'm doing wrong?</p><p>Thanks</p>","577702","","","","","2012-07-27 13:43:34","LinearLayout not wrapping image","<android><imageview><android-linearlayout>","2","0","","",""
"4707320","1","","","2011-01-16 18:48:49","2","5356","<p>im throughoutly confused by dips on Android.</p><p>I understand from the reference that the base for dp values is 160.So, shouldn't 80dp in width equals a view with a width of 50% of the screen ?On my Nexus One the width in dp is something around 300dp as it seems.</p><p>What am i missing here ?</p><p>thx in advance</p>","577708","","","","","2013-04-14 06:47:14","basics of device-independent-pixels","<android><layout><dip>","3","0","2","",""
"4707367","1","4707459","","2011-01-16 18:55:28","9","14410","<p>I'm trying to run <code>NOT IN</code> select where <code>NOT IN</code> list is dynamic. Something like</p><pre><code>SELECT id, type FROM CONTACTS where type NOT IN ('connect','answer')</code></pre><p>In the code my futile attempts were:</p><pre><code>db.query(TABLE, new String[] { ""id"", """"}, "" type NOT IN (?)"", ""connect,answer"",     null, null, null); // didn't workdb.query(TABLE, new String[] { ""id"", """"}, "" type NOT IN (?)"", ""'connect','answer'"", null, null, null); // didn't work</code></pre><p>My take on this is that <code>?</code> substitution treats my comma list as single argument. I did find a solution but it is rather ugly so I won't post it here until someone comes forward with something more elegant</p>","135946","","21234","","2011-01-17 08:52:34","2014-03-04 16:20:36","Android Sqlite IN, NOT IN syntax","<android><sql><sqlite>","3","0","2","",""
"4707445","1","4708188","","2011-01-16 19:08:44","9","913","<p>Just out of interest - why has it been decided to move tests to a separate project, not just to a separate source folder?</p>","397991","","","","","2011-08-10 16:06:40","Why to hold tests in a separate project rather then folder?","<android><unit-testing>","3","0","1","",""
"4707576","1","4709997","","2011-01-16 19:34:58","0","391","<p>Hi I'm new to the whole xml type stuff. I've built a ROM called Sourcery for the D1 and I'm looking to write an xml that I want to point at from the drawable.xml in the values folder in the framework-res.apk that part is easy I already have it pointed at an xml I named newbackgrounds.xml and I've created it in the values folder.</p><p>I want to use it for backgrounds and my idea is to have a selector where it sets an image as a background but if the image is not there to have it be black (#ffffffff). The image is kept in the drawable folder of the framework-res.apk and is named background_dark.jpg</p><p>Something kind of like this (again i'm new so pardon any errors here this is just my basic idea)</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 ""@drawable/background_dark.jpg""=""true"" android:screen_background_dark=""@drawable/background_dark.jpg"" /&gt;    &lt;item ""@drawable/background_dark.jpg""=""false"" android:screen_background_dark=""#ffffffff"" /&gt;&lt;/selector&gt;</code></pre><p>That however didn't work so what changes need to be made?Thank you for any help or alternatives it is much appreciated</p>","577732","","","","","2011-01-17 04:17:53","Xml selector type question","<android><xml><selector>","1","0","","",""
"4707656","1","","","2011-01-16 19:50:59","4","20435","<p>I have been trying out the tutorials shown on various websites on connecting a MySQL database to android. At the moment the code below, takes the values which you hard code in, (i.e year=2005 and name=tom) and runs it through the php script. What I would like know is how I can modify this, so that it takes the values of what the user enters in a textbox instead.</p><pre><code> package com.test;import java.io.BufferedReader;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.HttpClient;import org.apache.http.client.entity.UrlEncodedFormEntity;import org.apache.http.client.methods.HttpPost;import org.apache.http.impl.client.DefaultHttpClient;import org.apache.http.message.BasicNameValuePair;import org.json.JSONArray;import org.json.JSONException;import org.json.JSONObject;import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.widget.LinearLayout;import android.widget.TextView;public class test extends Activity {/** Called when the activity is first created. */   TextView txt;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    // Create a crude view - this should really be set via the layout resources     // but since its an example saves declaring them in the XML.     LinearLayout rootLayout = new LinearLayout(getApplicationContext());     txt = new TextView(getApplicationContext());     rootLayout.addView(txt);     setContentView(rootLayout);     // Set the text and call the connect function.     txt.setText(""Connecting..."");  //call the method to run the data retrieval    txt.setText(getServerData(KEY_121));}public static final String KEY_121 = ""http://***.****.com/mysqlcon.php""; //i use my real ip hereprivate String getServerData(String returnString) {   InputStream is = null;   String result = """";    //the year data to send    ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();    nameValuePairs.add(new BasicNameValuePair(""year"",""2005""));    nameValuePairs.add(new BasicNameValuePair(""name"",""tom""));    //http post    try{            HttpClient httpclient = new DefaultHttpClient();            HttpPost httppost = new HttpPost(KEY_121);            httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));            HttpResponse response = httpclient.execute(httppost);            HttpEntity entity = response.getEntity();            is = entity.getContent();    }catch(Exception e){            Log.e(""log_tag"", ""Error in http connection ""+e.toString());    }    //convert response to string    try{            BufferedReader reader = new BufferedReader(new InputStreamReader(is,""iso-8859-1""),8);            StringBuilder sb = new StringBuilder();            String line = null;            while ((line = reader.readLine()) != null) {                    sb.append(line + ""\n"");            }            is.close();            result=sb.toString();    }catch(Exception e){            Log.e(""log_tag"", ""Error converting result ""+e.toString());    }    //parse json data    try{            JSONArray jArray = new JSONArray(result);            for(int i=0;i&lt;jArray.length();i++){                    JSONObject json_data = jArray.getJSONObject(i);                    Log.i(""log_tag"",""id: ""+json_data.getInt(""id"")+                            "", name: ""+json_data.getString(""name"")+                            "", sex: ""+json_data.getInt(""sex"")+                            "", birthyear: ""+json_data.getInt(""birthyear"")                    );                    //Get an output to the screen                    returnString += ""\n\t"" + jArray.getJSONObject(i);            }    }catch(JSONException e){            Log.e(""log_tag"", ""Error parsing data ""+e.toString());    }    return returnString;}   }</code></pre>","577758","","750711","","2012-02-16 05:06:45","2012-02-16 05:08:38","Android - Connecting to MySQL database","<java><android><mysql><json>","1","5","2","",""
"4707664","1","4708443","","2011-01-16 19:52:21","10","2471","<p>Tim Bray's article <a href=""http://android-developers.blogspot.com/2010/12/saving-data-safely.html"">""Saving Data Safely""</a> left me with open questions. Today, it's over a month old and I haven't seen any follow-up on it, so I decided to address the topic here.</p><p>One point of the article is that FileDescriptor.sync() should be called to be on the safe side when using FileOutputStream. At first, I was very irritated, because I never have seen any Java code doing a sync during the 12 years I do Java. Especially since coping with files is a pretty basic thing. Also, the standard JavaDoc of FileOutputStream never hinted at syncing (Java 1.0 - 6). After some research, I figured ext4 may actually be the first mainstream file system requiring syncing. (Are there other file systems where explicit syncing is advised?)</p><p>I appreciate some general thoughts on the matter, but I also have some specific questions:</p><ol><li>When will Android do the sync to the file system? This could be periodic and additionally based on life cycle events (e.g. an app's process goes to the background).</li><li>Does FileDescriptor.sync() take care of syncing the meta data? That is syncing the directory of the changed file. Compare to FileChannel.force().</li><li>Usually, one does not directly write into the FileOutputStream. Here's my solution (do you agree?):<code><pre>FileOutputStream fileOut = ctx.openFileOutput(file, Context.MODE_PRIVATE);BufferedOutputStream out = new BufferedOutputStream(fileOut);try {    out.write(something);    out.flush();    fileOut.getFD().sync();} finally {    out.close();}</pre></code></li></ol>","551269","","551269","","2011-01-16 20:18:25","2012-11-06 14:31:36","ext4/fsync situation unclear in Android (Java)","<java><android><fileoutputstream><fsync><ext4>","2","0","7","",""
"4707904","1","4730112","","2011-01-16 20:41:16","1","1126","<p>I'm trying to minimize the number of places in my code where I need to setup StrictMode. But I'm not sure if I'm right or not about the following.</p><p>The documentation for Android's StrictMode says you can use it for Applications, Activities and other components. I've read that it is not desirable to extend the Application class, and I'd prefer not to extend Application just to enable StrictMode. But I don't think I have to.</p><p>There are two policies you can use: ThreadPolicy (for a thread) and VmPolicy (for all threads). So it would seem that if I setup StrictMode on a thread once, it doesn't matter from where I do that, and violations will be reported thereafter on that thread regardless of other calls or not on StrictMode. I just need to call it from somewhere before violations could occur that I want to detect. And it needs to be setup for any new threads that get created in my application that I also want to check.</p><p>What I think I want to avoid is calling the build() methods more than I need to. Putting StrictMode at the beginning of onCreate() in all my activities means that build() is going to get called more than once on that thread. If I have one Launcher activity in my application, setting up StrictMode in that activity's onCreate() should be sufficient for the rest of the application. Is that true?</p><p>Secondly, if my main activity gets restarted even though the application did not die, is it technically necessary to call StrictMode again? Or is my thread still setup to report violations? I was thinking there might be some value in doing a wrapper-type of class around StrictMode like so:</p><pre><code>public class MyStrictModeSettings {    static private List&lt;Long&gt; setThreads = new ArrayList&lt;Long&gt;();    // Prevent instantiation of this class    private MyStrictModeSettings() {}    static public synchronized void init() {        try {            Long tid = Thread.currentThread().getId();            if(!setThreads.contains(tid)) {                setThreads.add(tid);                Class sMode = Class.forName(""android.os.StrictMode"");                Method enableDefaults = sMode.getMethod(""enableDefaults"");                enableDefaults.invoke(null);            }        }        catch(Exception e) {            // StrictMode not supported on this device, punt            Log.v(""StrictMode"", ""... not supported. Skipping..."");        }    }}</code></pre><p>That way, in my main activity's onCreate(), I can simply call MyStrictModeSettings.init() and be done with it. And it should work on Android versions prior to 2.3 too. But it may not be worth it. Brad, are you there? Thanks.</p><p><strong>Edit:</strong> Since VmPolicy is for all threads, technically I only need to set that up once per application, right? So enableDefaults() is wasting effort to redo the VmPolicy when it gets called a second, third, etc time? Again, maybe it's more trouble than it's worth to try to avoid the extra calls.</p>","461187","","461187","","2011-01-17 03:17:33","2013-12-03 17:44:22","What is the lifecycle for Android's StrictMode?","<android><strictmode>","2","0","3","",""
"4707906","1","","","2011-01-16 20:41:24","0","867","<p>I'm making an alarm app for android. Once the user scheduled an alarm, a thread will count until the alarm is reached and then there will be an alarm sound.</p><p>However, the counting thread <em>stops</em> when the device is locked (I mean when the screen turns off after half a minute) and continue from where it left if it is unlocked again - even if that is hours later.</p><p>That makes for a pretty weird alarm app. I've looked into AlarmManager, but it seems like it's not appropriate in my case, since I only want the alarm to happen <em>if</em> my app is still running. Quitting the app should stop it. Here's what AlarmManager's documentation says though:</p><blockquote>  <p>Note: The Alarm Manager is intended  for cases where you want to have your  application code run at a specific  time, even if your application is not  currently running. For normal timing  operations (ticks, timeouts, etc) it  is easier and much more efficient to  use Handler.</p></blockquote><p>The ""Handler"" class it mentions seems to be intended for something entirely different from what I'm trying to achieve.</p><p>So I'm asking you: How can I keep my thread alive and counting even if the device is locked? Or is there another way?</p>","577791","","","","","2011-01-17 00:20:33","Android: Keep a thread running even if the device is locked","<android><alarm>","2","2","","",""
"4707994","1","","","2011-01-16 20:56:42","4","11314","<p>I have been messing around with the AudioRecord feature of the Android API and found some strange behaviors with it. </p><p>Background info:My phone is a HTC IncredibleI am using the Eclipse plugin for Android development with the emulator.Targeted platform or OS is 2.2... Since it is what my phone uses.</p><p>Some code:</p><pre><code>bufferSize = AudioRecord.getMinBufferSize(FREQUENCY, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT);audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, FREQUENCY, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, bufferSize);</code></pre><p>This is the code I use to setup the AudioRecord API with. Now, for the emulator it likes FREQUENCY to be set to 8000 for it to work. Comes back with a buffer size 640. For the phone I use 44100. One issue here is it seems the resulting PCM data for the wave seems to be an eight bit signed wave. I get values from -127 to 128. I thought the value <code>AudioFormat.ENCODING_PCM_16BIT</code> would produce something different.</p><p>I process the audio with a thread,</p><pre><code>public void run() {  while(isRecording) {    audioRecord.startRecording();    byte[] data = new byte[bufferSize];    audioRecord.read(data, 0, bufferSize);    listener.setData(data);    handleData(data);  }  audioRecord.release();}</code></pre><p>I have a way to graphically display to corresponding wave in real time using a <code>SurfaceView</code>. There seems to be a lot of noise coming from the MIC. I get this noise from the emulator and the phone as well. Do I need to run the data through some sort of filter(s)? I would like to use this data to calculate some fun FFT and stuff just to play around with the wave. But I need to reduce the noise somehow. </p><p>Has anyone else experience this as well. Does anyone have a solution?</p><p>I appreciated your time and responses, thanks,dk</p>","577802","","149841","","2011-08-11 16:11:09","2012-06-07 12:42:34","Android AudioRecord questions?","<android><audio><pcm><audiorecord><sample-rate>","4","0","4","",""
"4708067","1","","","2011-01-16 21:10:25","0","103","<p><strong>EDITED</strong></p><p>It dawned on me that this speed slowness started after updating eclipse and occurred to me to check the eclipse ini file - I found that the memory allocation settings changed from my original custom setting of 512meg (from the original 256) to 40megs !!!  I' surprised it even booted.</p><p>This helps a good bit as far as key input response goes but has no affect on the emulator. I'd still like to get opinions on the optimal placement/use of open and close.</p><hr><p>This may be as much an Emulator issue as a Database Open/Close issue.</p><p>I have an app that has several activities: three of them are used for database interface. But, only if the user chooses to do so. Thus, I don't call the database open/close in the main activity.</p><p>The record to insert has only three columns and as far as the database and list goes, all work well. However, <em>I notice the emulator's response to buttons and data entry becomes slower and slower</em> - slow enough that it sometimes seems to stall.</p><p>This happens regardless of the number of records (even just a few will do it). I have deleted the database from the emulator but, that doesn't help.</p><p>This makes me wonder if my scheme for opening and closing is bad or if it's because this is done on the emulator (maybe both?). The open/close scheme is:</p><p><strong>MainActivity</strong> - no db interface. Has button to call ListActivity</p><p><strong>SaveDataActivity</strong> </p><p>onCreate: Button opens db, saves the record (from user textfield input) then closes db and calls finish to return to mainActivity.<br>onDestroy also closes db</p><p><strong>ListActivity</strong></p><p>onCreate: Opens db, fills the list.</p><p>ListItem click: Item is selected, strings filled and closes db.</p><p>onDestroy: Closes db after populating list.</p><p><strong>DBMgmtActivity</strong></p><p>onCreate: Opens db</p><p>onResume: Opens db</p><p>onDestroy: Closes db</p><p>In addition to any suggestions, is there a recommend approach to opening and closing the database?</p><p>Thanks</p>","382200","","382200","","2011-01-16 22:20:05","2011-01-16 22:20:05","Optimal Use Of Open, Close and Emulator Slowing Down","<android><sqlite><android-emulator>","0","2","","",""
"4708098","1","4708433","","2011-01-16 21:13:37","0","659","<p>I have an app with a quickaction shown once a button is pressed. The quickaction shows a popup like in the Gallery 3D application for android, and when an action is clicked, I try to show a dialog, but I recieve a force close. Debug in Eclipse points to the slideDialog.show(); line, but I need that to show the dialog, right? Here's an example of one of those quickaction/dialogs.</p><blockquote>  <p>final ActionItem third = new ActionItem();</p>    <p>third.setTitle(""Adjust Brush Width"");</p>    <p>third.setIcon(getResources().getDrawable(R.drawable.arrow_up));</p><pre><code> third.setOnClickListener(new OnClickListener() {</code></pre>    <p>@Override</p>    <p>public void onClick(View v) {</p><pre><code>slideDialog = new slideDialog(getApplicationContext());   slideDialog.show();slideDialog.setOnDismissListener(new OnDismissListener() { @Override public void onDismiss(DialogInterface dialog) {  mPaint.setStrokeWidth(slideDialog.getSize()); }      });    }   });</code></pre></blockquote>","413488","","246246","","2013-09-28 15:29:21","2013-09-28 15:30:06","Starting Dialog from QuickAction Button","<android><dialog><popup><quickaction>","1","0","","",""
"4708104","1","4709225","","2011-01-16 21:15:16","8","3193","<p>How can you make a custom toast notification fill the width of the screen?</p><p>I have tried multiple things and can't get it to work.</p><p>Thanks.</p>","574940","","","","","2012-08-06 10:41:10","How to make a custom toast fill width?","<android>","5","0","1","",""
"4708109","1","4709305","","2011-01-16 21:16:08","1","4368","<p>As part of a larger UI, I have a <code>RelativeLayout</code> with three Views that I would like to have the same width. The three views are ""stacked"" on top of each other like this</p><ol><li><code>ImageView</code></li><li><code>TextView</code></li><li><code>ImageView</code></li></ol><p>I've tried various things such as setting the <code>View</code>s' <code>android:layout_width</code> to ""wrap_content"", setting <code>android:layout_width</code> to ""0px"" and <code>android:layout_weight</code> to ""1"" as suggested by <a href=""http://stackoverflow.com/questions/1177020/android-how-to-make-all-elements-inside-linearlayout-same-size/1177076#1177076"">this answer</a>, and placing the <code>View</code>s in a <code>LinearLayout</code> with no success. </p><p>How can I get these three views to be the same width?</p><p>Relevant portion of the layout xml:</p><pre><code>&lt;RelativeLayout    android:layout_width=""fill_parent""    android:layout_height=""0px""    android:layout_weight=""1""&gt;        &lt;ImageView            android:layout_above=""@string/window_text""            android:layout_below=""@string/eighteen_id""            android:layout_height=""wrap_content""            android:layout_width=""wrap_content""            android:paddingTop=""5dp""            android:layout_alignParentRight=""true""            android:paddingBottom=""5dp""            android:src=""@drawable/line1""            android:id=""@string/line_1_id""/&gt;        &lt;TextView            android:layout_above=""@string/line_2_id""            android:layout_height=""wrap_content""            android:layout_width=""fill_parent""            android:gravity=""right""            android:layout_centerVertical=""true""            android:textColor=""#000000""            android:id=""@string/window_text""/&gt;        &lt;ImageView            android:layout_above=""@string/top_row_id""            android:layout_height=""wrap_content""            android:layout_width=""wrap_content""            android:layout_alignParentRight=""true""            android:paddingTop=""5dp""            android:paddingBottom=""10dp""            android:src=""@drawable/line1""            android:id=""@string/line_2_id""/&gt;&lt;/RelativeLayout&gt;</code></pre>","124538","","","","","2011-01-17 01:46:09","How to make multiple Views the same Width?","<android><layout><view><size><width>","3","2","1","",""
"4708198","1","4730137","","2011-01-16 21:29:10","2","2704","<p>I've been playing around with the lunar lander example and have run into a problem while trying to implement an about screen. I changed one of the menu items (in onCreateOptionsMenu) to an ""about"" option. When this option is selected, a new Activity starts and displays an about screen.</p><pre><code>@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {        case MENU_ABOUT:            startActivity(new Intent(this, About.class));            return true;            //Other cases    }    return false;}</code></pre><p>This works perfectly and a the focus moves to a new Activity. However, when I press back on the phone to get back to the game, the program crashes. I get this error: </p><pre><code>Thread [&lt;3&gt; main] (Suspended (exception IllegalThreadStateException))   LunarView(SurfaceView).updateWindow(boolean) line: 465  LunarView(SurfaceView).onWindowVisibilityChanged(int) line: 189 LunarView(View).dispatchWindowVisibilityChanged(int) line: 3782 FrameLayout(ViewGroup).dispatchWindowVisibilityChanged(int) line: 704   FrameLayout(ViewGroup).dispatchWindowVisibilityChanged(int) line: 704   PhoneWindow$DecorView(ViewGroup).dispatchWindowVisibilityChanged(int) line: 704 ViewRoot.performTraversals() line: 710  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]  </code></pre><p>Can anyone help me figure out whats going on? I run into the same problem anytime I try to come back to the game screen from something else (whether its from a preferences Activity, a help Activity, or from the home screen). Thanks</p>","577826","","577826","","2011-01-18 23:13:23","2011-01-18 23:13:23","Flaw in the Lunar Lander example (IllegalThreadStateException)","<android><activity><preferences><surfaceview>","1","2","","",""
"4708221","1","","","2011-01-16 21:34:10","0","86","<p>i have created a music app.the app has 16 music btns.the app is running with no problem but as i press the btns many times the app forces down..</p><pre><code>     super.onCreate(icicle);        setContentView(R.layout.main);          int[] ids = {R.id.btn,R.id.btn2, R.id.btn3, R.id.btn4, R.id.btn5, R.id.btn6, R.id.btn7, R.id.btn8, R.id.btn9, R.id.btn10,                R.id.btn11, R.id.btn12, R.id.btn13, R.id.btn14, R.id.btn15, R.id.btn16 };            for (int i : ids) {                b =  (Button) findViewById(i);                b.setOnClickListener(this);            }}      //outside of onCreate()        @Override        public void onClick(View v) {            switch(v.getId()) {                case R.id.btn:                     if (mp != null &amp;&amp; mp.isPlaying()) mp.stop();                    mp = MediaPlayer.create(zoo.this, R.raw.gata);                    mp.start();                    break;</code></pre><p>this is the code and i use case for every btn.When the app forces down, the logCat is finding a NullPointerException in the mp.start(); of the button that forces the app down..please help!</p><p>EDIT in from comment below:</p><pre><code>case R.id.btn:     if (mp != null &amp;&amp; mp.isPlaying()) mp.stop();     mp.reset();     try {         mp.setDataSource(""zoo.this,R.raw.gata"");     } catch (IllegalArgumentException e1) {         // TODO Auto-generated catch block         e1.printStackTrace();     } catch (IllegalStateException e1) {         // TODO Auto-generated catch block         e1.printStackTrace();     } catch (IOException e1) {         // TODO Auto-generated catch block         e1.printStackTrace();     }    mp.start();     break;</code></pre>","519526","","321697","","2011-01-17 14:15:18","2011-01-17 14:15:18","App forces down suddently","<android>","1","6","","",""
"4708319","1","4708767","","2011-01-16 21:52:47","0","837","<p>I want to create list view just like this: <a href=""http://dl.maximumpc.com/galleries/androidpower/Alarm_full.jpg"" rel=""nofollow"">http://dl.maximumpc.com/galleries/androidpower/Alarm_full.jpg</a>I need to create view like on second and fourth screens. As for fourth screen, it seems that each row has it's own layout...I've searched Internet and even downloaded alarm source code from git repository, but it doesn't contains what I want. Any help would be useful. Thanks!</p>","577841","","","","","2011-01-17 03:44:57","Android: Custom ListView","<android><listview>","2","0","","",""
"4708397","1","4709128","","2011-01-16 22:07:15","2","706","<p>My sister has Cerebral Palsy, which in her case means she has only gross motor control and her speech is slurred.  Implications should be obvious: traditional computer/phone/tablet interfaces won't work for her and she can't speak clearly enough for speech recognition software to help her at all.  She enjoys reading but has difficulty holding the book and/or turning a page.</p><p>There are a few options for helping her use a computer, but nothing for tablets or eReaders.  </p><p>That's where you come in.  I would like to make (or buy, if such a thing exists) a better interface to an Android tablet that would work for someone with little to no physical dexterity or speech ability.  I'd also be interested in work on the Kindle or iPad, but I'm most familiar with Android so I'm starting there.</p><p>I know Android has Bluetooth capability.  Is it possible to interface a joystick to control the Android device?  By ""control"", I mean the entire operating system - selecting an app, launching it, controlling the menus, etc.  I want to give her control over the whole thing, not just a specific app.  On a PC this can be accomplished by creating a generic USB HID interface and an arcade joystick to move the mouse over the screen and click on thigns.  Is it possible to do something like that in Android?</p><p>Any help you can offer would be greatly appreciated.</p><p>EDIT:  After further research it seems that remote control from a PC is actually possible, but requires the phone to be rooted.  Is there any way to do this without modifying the phone?  Ideally I'd like to install my simple app and control the unit remotely (through a PC would be fine, but direct control through Bluetooth would be better).  Thoughts?</p>","500069","","168868","","2011-12-31 20:51:50","2012-07-10 16:33:31","Tablet interface for the physically disabled?","<android><ipad><disability>","2","1","","",""
"4708526","1","","","2011-01-16 22:29:40","0","344","<p>i am trying to implement a detabase query using WHERE, and really just wondering how to implement it? the code i have here gives me an error ;/ thnánk you!</p><pre><code>        public Cursor fetchAllCatagoryForSign(String sign) {        String signSelect="""";        if(sign!=null){            signSelect="" WHERE "" + CATAGORY_SIGN + ""="" + sign;        }        return mDb.rawQuery(""SELECT "" + CATAGORY_ID + "","" +                "" "" + CATAGORY_NAME +  "","" +                "" "" + CATAGORY_SIGN + "" FROM ""                + CATAGORY_TABLE + signSelect +                 "" ORDER BY "" + CATAGORY_NAME + "" DESC"", null);    }</code></pre>","525726","","","","","2011-01-16 22:43:05","sql query with WHERE","<android><sql><database><where>","2","3","","",""
"4708622","1","","","2011-01-16 22:46:55","0","210","<p>It didn't seem like there was a post about this, so here goes. I've been working on a simple app to grab my time table from my school, and get it on my phone. Currently I'm working on the port on android but I've hit an issue. I get the error: </p><blockquote>  <p>java.io.IOException: -1 error loading URL urladress.</p></blockquote><p>Code:</p><pre><code>public void updateTimeTable(){    //Get UID and Birthday    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());    String uid = prefs.getString(""uid"", ""000000"");    String fods = prefs.getString(""fodsdag"", ""000000"");    //Set URL    String url = ""http://unv1.aalborg-stu.dk/cgi-bin/elevskema.pl?ugen=0&amp;unavn="" + uid + ""&amp;fodsdag="" + fods;    try {     Document doc = Jsoup.connect(url).get();    Elements td = doc.getElementsByTag(""td"");    //ArrayList&lt;String&gt; tdArray = new ArrayList&lt;String&gt;();   //  for (Element tds : td) {    //    String tdText = tds.text();    //    tdArray.add(tdText);     //} //String[] data = tdArray.toArray(new String[tdArray.size()]);       } catch (IOException e ){     Log.e(""Parser"", ""shite"", e);    }    Context context = getApplicationContext();    CharSequence text = url;    int duration = Toast.LENGTH_SHORT;    Toast toast = Toast.makeText(context, text, duration);    toast.show();}</code></pre><p>I've commented some lines out to identify where the issue is, and it seems it's at the actual parsing. Anywho, screenshot of the error I get:</p><p><a href=""http://img220.imageshack.us/img220/2061/errorwy.jpg"" rel=""nofollow"">Screenshot</a></p><p>I got about 4 days worth of Java experience so forgive me if it's something silly.Best Regards</p>","577875","","12707","","2011-01-16 22:49:42","2011-01-17 00:45:35","Parsing URL error","<java><android><java-io>","1","0","","",""
"4708827","1","5145567","","2011-01-16 23:27:09","5","7612","<p>I know that some peoples view is that you should not create persistent services. </p><p>But for those of us that want to increase our knowledge, how does one go about creating one in theory?</p><p>I have been playing around, and noticed that services that use <a href=""http://developer.android.com/reference/android/app/Service.html#startForeground%28int,%20android.app.Notification%29"" rel=""nofollow"">startForeground</a> are killed in low memory situations.</p><p>I have seen a, now deprecated, permission PERSISTANT_ACTIVITY, but that didn't do much.</p><p>So what is the secret?</p>","354607","","1267021","","2012-09-05 23:32:43","2012-09-05 23:32:43","Persistent service","<android><service><android-service>","2","0","4","",""
"4708891","1","","","2011-01-16 23:41:07","1","151","<p>I'd like to use DX Tool API for triying to generate ad-hoc a dexfile invoking this library. Are there any sample or any specification of this library?</p><p>Thanks for all</p><p>Greetings!</p>","577909","","","","","2011-01-27 00:04:47","Are there a specification of an API or samples for the DX tool for Android!","<android><bytecode><dalvik><dx>","1","0","2","",""
"4708982","1","4709201","","2011-01-17 00:06:18","2","1176","<p>I'm making a game and I've created a separate thread for loading assets, 3d models, etc. So that the UI thread won't lock up while its loading. However, the thread for loading requires an instance of GL10 in order to load and map textures correctly.</p><p>Heres an overview of the problem so you can better understand my predicament:<br>1. my Renderer class creates and starts the ""loading"" thread.<br>2. The loading thread loads the models and textures from assets<br>3. 'glGenTextures' is required to load the textures, <em><strong>but</strong></em> the loading thread doesn't have an instance of GL10  </p><p>I tried just giving the loading thread the GL10 instance given by the Renderers onSurfaceCreated method, but it doesn't work.(I guess it gets deleted, or messed up, or something when the function is over)</p><p>So, how would I be able to pass a working instance of GL10 to my loading thread?</p>","482085","","","","","2012-06-28 23:13:09","Getting GL10 instance on separate thread on Android","<java><android><multithreading><synchronization><opengl-es>","2","0","1","",""
"4709026","1","4710211","","2011-01-17 00:20:08","8","7022","<p>Before today I would have said this is just not possible, to have an app that runs overlayed on top of everything else: home screens, apps, dialer, etc.</p><p>If you try the free application ""Super Manager"" it does exactly this.  It has an icon and widget like screen that will show up always and everywhere.  While the icon or widget is on the screen you can still interact with the app running behind it.</p><p>How is this possible and how can we recreate this functionality?</p><p>Update:Here is some images of it in action.  You can see the overlayed application running as a small arrow on top of Dolphin.  Then when you press it you can see the application running as a big widget kind of thing.  Even while the widget is up you can still interact with the background app.  In this example dolphin is the background app.</p><p><img src=""http://i.stack.imgur.com/NKw1X.jpg"" alt=""Image 1""></p><p><img src=""http://i.stack.imgur.com/m9jvg.jpg"" alt=""alt text""></p>","242904","","242904","","2011-01-17 01:12:12","2014-01-24 15:20:44","Android app that runs on top of ALL other apps?","<android>","3","2","6","",""
"4709137","1","","","2011-01-17 00:50:45","258","141890","<p>The INSTALL_FAILED_INSUFFICIENT_STORAGE error is the bane of every Android developer's life. It happens regardless of app size, or how much storage is available. Rebooting the target device fixes the problem briefly, but it soon comes back. There are hundreds (if not thousands) of message board posts from people asking why the problem occurs, but the folks at Google are frustratingly silent on the issue.</p><p>There is a simple workaround. If your test device is running Android 2.2 or later then add the <strong>android:installLocation</strong> attribute to your application's manifest file, with the value ""<strong>preferExternal</strong>"". This will force the app to be installed on the device's external storage, such as a phone's SD card.</p><p>For example:</p><pre><code>  &lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""    package=""com.andrewsmith.android.darkness""    android:installLocation=""preferExternal""</code></pre><p>This is more of a band-aid than a fix, and it may not be ideal if you want your finished app to install on the device's internal memory. But it will at least make the development process a lot less frustrating.</p>","522858","","63550","","2013-12-21 14:47:34","2014-02-27 11:51:03","Solution to INSTALL_FAILED_INSUFFICIENT_STORAGE error on Android","<android>","31","9","79","","2013-08-12 06:23:04"
"4709221","1","4722573","","2011-01-17 01:09:32","1","1243","<p>I currently have an open gl renderer set up which displays a 2d square and another 2d shape. By using the keys the user is able to move the square up down left and right. This is done through translating the square based on values altered by whether the user presses up down left right eg if the user presses right it would mean a translation of gl.glTranslatef(rightdisplacement, 0, 0); etc. The movement works fine but I cant figure out how to get the camera to follow the square as it continues moving. I would like to move the square and have the camera move in the same direction.</p>","560571","","","","","2011-01-18 09:41:55","Camera movement. How do I move camera?","<android><opengl-es><camera>","1","0","1","",""
"4709291","1","","","2011-01-17 01:28:14","11","12988","<p>I would like my Android app to be compatible with as many devices as humanly possible, so naturally I would like to try to make it ready for all of the new incoming tablets.  Unfortunately when I add :</p><pre><code>android:xlargeScreens=""true""</code></pre><p>To my Manifest, it gives me this error :</p><pre><code>error:No resource identifier found for attribute ""xlargeScreens"" in package 'android'</code></pre><p>Now I'm fairly new to all of this yet, but from what I've read this has something to do with my min/target SDK's being too low to support this, being a brand new feature and all.  I did try raising my target SDK up since I thought that wasn't a problem, but that made most of my code ""unable to be resolved"".  I'm sure that makes sense to those of you that have been around Android a little longer than myself, but what I'm really wondering is if there is a way for me to enable support for ""xlargeScreens"".</p><p>Perhaps there is some other way, or maybe it's not even necessary to have that line to allow it to work with them.  Perhaps because it's a new addition I've had trouble finding anything that answered this for me, so any suggestions would be great.  Thank you for your help!</p>","571451","","","","","2012-05-10 09:06:56","Android No Resource Identifier Found for XLargeScreens","<android><size><screen><manifest><tablet>","3","1","1","",""
"4709335","1","4709825","","2011-01-17 01:38:59","2","417","<p>I'm playing around with a small notification app.  My basic requirements are: when an SMS comes in, turn on the LED.  When it gets read, turn it off.  The first part seems easy enough: I have a <code>BroadcastReceiver</code> with the following in my manifest:</p><pre><code>&lt;intent-filter&gt;    &lt;action android:name=""android.provider.Telephony.SMS_RECEIVED"" /&gt;&lt;/intent-filter&gt;</code></pre><p>However, the second part has proven more tricky.  Currently, I have a service which starts up whenever a message comes in.  It runs a <code>TimerTask</code> every 15 seconds which runs this code:</p><pre><code>int count = 0;Uri providerURI = Uri.parse( ""content://sms"" );Cursor cursor = this.getContentResolver().query( providerURI, null, ""read=0"", null, null );if( cursor != null ) {    try {        count = cursor.getCount();    }    finally {        cursor.close();    }}return count;</code></pre><p>It seems to work well enough.  When the count is 0, I cancel the <code>TimerTask</code> and stop the service.  However, I'm concerned about battery life.  Is there any sort of general notification for when the number of unread messages changes?  Or any better way of doing this?</p>","141681","","","","","2011-01-17 03:35:11","Is there a good way to tell when an SMS gets read on Android?","<android><sms>","1","0","","",""
"4709336","1","","","2011-01-17 01:39:00","1","457","<p>I'm development a SOAP web service version 1.1 in Java.</p><p>I have the following situation:</p><ol><li>there's a secured channel with ssh;</li><li>customers don't have login credentials (they don't have username and password);</li><li>when a customer opens an account is generated a session token;</li><li>when a customer make requests is validated by their session token;</li><li>when a customer account is open only him or employee is allowed to close the account (session timeout can't exist);</li></ol><p>what is the best way to implement security in this situation? should i generate the session tokens or there is already apis/frameworks to do that job? Does STS (Security Token Service) able to do it without requirements of login credentials?</p><p>the purpose of that is to invoke the web service in android application. </p>","577960","","331508","","2011-03-11 01:28:15","2011-03-11 01:28:15","Security in Webservice without login credentials","<android><web-services><security><token><sts-securitytokenservice>","0","0","","",""
"4709444","1","4709614","","2011-01-17 02:00:21","0","499","<p>I am getting the GUI flicker when reading a file properties and accordingly enabling/disabling checkbox and List value in listbox. when i remove this file reading code the GUI doesnt have flicker. </p><p>I am reading the properties before creating the Preferences in OnCreate(). Attached the file write code below for reference.Please let us know is there any other way to read and update the preference staus.</p><pre><code>private void SetExtendConf(String key, String strValue){    mProperties = new Properties();    try {        File file = new File(FILE_EXT);        if(!file.exists())            file.createNewFile();        file.setWritable(true,false);        FileInputStream fis = new FileInputStream(file);           mProperties.load(fis);        fis.close();        FileOutputStream stream = new FileOutputStream(file);        Log.d(TAG, ""Setting Values "" + key  + "":""+ strValue);        mProperties.setProperty(key, strValue);        mProperties.store(stream,""ext.conf"");        stream.close();    } catch (IOException e) {        Log.d(TAG, ""Could not open properties file: "" + GPS_FILE_EXT);    }}</code></pre><p>-Manoj</p>","469119","","","","","2011-01-17 02:48:05","In Android GUI flickers when reading the properties file","<android><properties><flicker>","1","0","","",""
"4709532","1","4709672","","2011-01-17 02:24:44","0","188","<p>I had to build separate bundle for two different android phones, and the two have different icon. I do not want to modify the manifest file everytime when I build the application. </p><p>Can I define the icon in my code ?  as I can get the phone model.</p>","238061","","","","","2011-01-17 03:06:56","Can I define android:icon in code?","<android>","1","0","1","",""
"4709649","1","","","2011-01-17 03:01:00","1","2038","<p>I'm starting an Android project, a port from an existing iPhone project I've completed.</p><p>I have a fairly large read-only SQLite database, about 100Mb in all. It's called ""mydata.sqlite"". Where do I place this in my Eclipse workspace? It's too big for ""assets"".</p><p>Next, how do I best get at the file? I would think to try (handling exceptions later) something like:</p><pre><code>SQLiteDatabase myDatabase = null;myDatabase = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);</code></pre><p>But I would then need the path string <code>myPath</code> and since I don't know where to put the resource I don't know what this needs to be.</p><p>Can I put ""mydata.sqlite"" into ""res/raw"" (once I create ""raw"" in Eclipse?) and then reference it as a resource with ""R.raw.mydata""?</p><p>I would very much appreciate some direct help here, rather than a reference to a tutorial. I have checked tons of these, including those that are already cited here on stackoverflow. I've also gone through the ""Notepad"" project in the Android developer documents. However these and the documentation typically consider only new, empty or small databases that aren't always persistent. This should be a simple thing and given the time I've spent already it is perhaps easier to ask.</p><p>Thanking you kindly in advance for your assistance.</p>","283311","","283311","","2011-01-17 04:02:49","2011-01-17 07:23:20","Android and fairly large SQLite datafiles","<android><sqlite>","3","3","1","",""
"4709663","1","4709865","","2011-01-17 03:04:59","0","1512","<p>On the Android, without using a framework like Sencha or JQTouch or JQMobile, but using jQuery (regular jQuery), I want to detect a Cancel/Back Swipe (swiping left to right). I have something accomplished so far, but I'm trying to determine the math formula to implement in jQuery such that I capture a left to right swipe event, and not another kind of gesture. What do you suggest? I imagine I need some kind of acceptable variance. I'm assuming there's some sort of calculus formula that could get reapplied here, but unfortunately I shied away from calculus in college. So, your answer will educate me, hopefully.</p><p>Here's some sample x,y start/finish data to play with:</p><p>(a) Swiping diagonally from middle left to upper right (an undesirable gesture in this case)</p><p>21,269 - 278,85</p><p>(b) Swiping diagonally from middle left to lower right (an undesirable gesture in this case)</p><p>13,269 - 331,436</p><p>(c) Swiping straight (sort of) from middle left to middle right (a desirable gesture)</p><p>34,267 - 326,266</p><p>or</p><p>36,494 - 355,479</p><pre><code>var gnStartX = 0;var gnStartY = 0;var gnEndX = 0;var gnEndY = 0;window.addEventListener('touchstart',function(event) {  gnStartX = event.touches[0].pageX;  gnStartY = event.touches[0].pageY;},false);window.addEventListener('touchmove',function(event) {  gnEndX = event.touches[0].pageX;  gnEndY = event.touches[0].pageY;},false);window.addEventListener('touchend',function(event) {  alert('START (' + gnStartX + ', ' + gnStartY + ')   END (' + gnEndX + ', ' + gnEndY + ')');},false);</code></pre>","105539","","105539","","2011-01-17 03:21:24","2013-04-03 16:14:24","Determining Android Cancel/Back Swipe (Swipe Left To Right) with jQuery","<jquery><android><swipe><calculus>","2","0","1","",""
"4709748","1","4713565","","2011-01-17 03:21:22","2","803","<p>I've downloaded the source code for the entire Android platform and I'm interested in looking at the SSL implementation. For example, when visiting an SSL enabled site, I'd like to figure out exactly how Android does the SSL hand shake and sets up the connection.</p><p>I've looked through various sections of the code but I haven't found what I'm looking for yet so I thought I'd ask here and see if anyone could point me in the right direction. Thanks in advance!</p>","269181","","","","","2011-01-17 13:18:02","Android SSL internals - where is the actual implementation?","<android><ssl><implementation>","2","2","3","",""
"4709812","1","4710039","","2011-01-17 03:31:44","6","11640","<p>As a developer, I tend to program first then research later. I was trying to implement a screen that would handle multiple user inputs. Basically map more than just one finger. I tried two things.. </p><p>I had an Activity class that implemented OnTouchListener. Here I had two separate child views that added the Activity as their ontouch listeners. And then I had a print line that printed out the event.getPointerCount() and printed out the location of each of the pointers.. </p><p>Downloaded it to the phone and tested it. I noticed that the pointers never grew greater than two. I even noticed if one finger was on one child and another finger on the other child view that the events only made it to the first child component. Next I tried to put separate listeners on each of the child components to see if that would work but it acted the same.</p><p>So, it seems that the android only supports a total of two user inputs when dealing with inputs from the user touching the screen.</p><p>Is this true? It seems from testing and research that this is the case.</p><p>Has anyone ran into this limitation. Any clever work arounds?</p><p>Thanks for you time and responses. </p><p>dk</p>","577802","","","","","2011-01-18 03:27:06","Android multitouch?","<android><multi-touch><ontouchlistener>","2","0","","",""
"4709857","1","","","2011-01-17 03:41:25","6","1291","<p>I'm looking for advice and your preferences on different music affiliate services for use in my Android application.  My end goal is to have a revenue stream via dynamic affiliate links to any artist's music. The music should be purchasable via the web browser (not in app)</p><p>The two affiliate programs that I'm most aware of are Amazon and iTunes. Here are my issues:</p><ol><li><p>Amazon seems to have a grudge against mobile apps and its in their TOS that the affiliate program cannot be used. Not really sure why, but its stopping me from using them.</p></li><li><p>iTunes is a Apple thing and it goes against my moral code to have them in an Android app, not to mention my users wouldn't even be able to buy music via their Android phone.</p></li></ol><p>Have you used any other services with success? Should I bother contacting Amazon to ask for permission to use their associates program on a mobile app?</p><p>Moderators: If this belongs somewhere else on the stack exchange network, please let me know and I'll move it.</p>","413575","","","","","2012-03-24 13:21:12","Advice on Affiliate Programs for Music for Android app","<android><music><affiliate>","1","1","2","",""
"4709870","1","","","2011-01-17 03:42:51","5","31070","<p>I have a custom ListView. This ListView contain of 1 Image and 6 TextView,to retrieve the value I have create a setOnItemClickListener. Whenever I click on the ListView how could I actually retrieve all the data from the 6 TextView?</p>","557964","","557964","","2011-01-17 09:56:26","2013-07-02 17:42:11","setOnItemClickListener on custom ListView","<android><android-listview>","6","0","2","",""
"4709883","1","","","2011-01-17 03:46:29","7","3205","<p>I'm using a <a href=""http://developer.android.com/intl/zh-CN/reference/android/media/SoundPool.html"">SoundPool</a>  to play audio clips in my app. All is fine but I need to know when the clip playback has finished.</p><p>At the moment I track it in my app by obtaining the duration of each clip using a <a href=""http://developer.android.com/intl/zh-CN/reference/android/media/MediaPlayer.html"">MediaPlayer</a> instance. That works fine but it looks wasteful to load each file twice, just to get the duration. I could roughly calculate the duration myself knowing the length of the file (available from the <a href=""http://developer.android.com/intl/zh-CN/reference/android/content/res/AssetFileDescriptor.html"">AssetFileDescriptor</a>) but I'd still need to know the sample rate and the number of channels.</p><p>I see two potential solutions to that problem:</p><ol><li>Figuring out when a clip has finished playing (doesn't seem to be possible with SoundClip).</li><li>Having a class which could load just the header of an audio file and give me the sample rate/number of channels (and, ideally, the sample count to get the exact duration).</li></ol><p>Any suggestions?</p><p>Thanks,Max</p><p>The code I'm using at the moment (works fine but is rather heavy for the purpose):</p><pre><code>String[] fileNames = ...MediaPlayer mp = new MediaPlayer();for (String fileName : fileNames) {    AssetFileDescriptor d = context.getAssets().openFd(fileName);    mp.reset();    mp.setDataSource(d.getFileDescriptor(), d.getStartOffset(), d.getLength());    mp.prepare();    int duration = mp.getDuration();    // ...}</code></pre><p>On a side note, this question has already been <a href=""http://stackoverflow.com/questions/3357484/is-there-a-way-to-determine-the-duration-of-an-audio-file"">asked</a> but got no answers.</p>","277174","","272824","","2011-01-17 03:55:19","2011-01-17 10:52:09","What is the best way to get an audio file duration in Android?","<android><audio><media-player><duration><soundpool>","1","0","3","",""
"4709971","1","","","2011-01-17 04:09:50","0","224","<p>I wrote a PreferenceActivity, its setting.xml includes the following code:</p><pre><code>        &lt;ListPreference      android:key=""key""     android:title=""@string/title""     android:entries=""@array/entries""     android:entryValues=""@array/values""&gt;            &lt;/ListPreference&gt;</code></pre><p>And I supply the following in array.xml</p><pre><code>&lt;array name=""entries""&gt;&lt;item&gt;displayName&lt;/item&gt;&lt;/array&gt;&lt;array name=""values""&gt;&lt;item&gt;10240&lt;/item&gt;&lt;/array&gt;</code></pre><p>When the &lt;item&gt; is 10240, Android will throw NullPointerException. But when I changes it to 10240k, Android will work.Why?</p>","554861","","","","","2011-01-17 04:37:15","Why Android throws NullPointerException?","<android><arrays><setting>","1","0","","",""
"4710025","1","4712170","","2011-01-17 04:25:47","20","39872","<p>I can set ImageButton background transparent in <code>layout.xml</code> using:</p><pre><code>android:background=""@android:color/transparent""</code></pre><p>How I can acomplish same thing using java code?Something like <code>ib.setBackgroundColor(???);</code></p>","578053","","656600","","2013-07-26 08:55:11","2014-03-13 14:31:59","How to set transparent background for Image Button in code?","<android><background><transparent><imagebutton>","4","0","2","",""
"4710043","1","","","2011-01-17 04:32:25","0","1020","<p>Hey,Anyone knows how to kill widget on delete(). When i delete the widget its stays running in the background,it never dies unless i foreclose the whole app.My app consists of 4 activities and the widget is not the main activity and im using thread instead of service for the appwidget.</p><p>All what i need is stop the widget from running in the background when i delete it.i've tried using system.exit(0). It didn't work, all what it does is clear all the data in the widget.Or if i can kill the app ondelete();</p><p>Any ideas? I'd really appreciated.</p>","560243","","15541","","2011-01-17 04:41:04","2011-01-17 06:38:00","stop the widget from running in the background, on delete()","<android><widget><kill>","1","1","","",""
"4710080","1","","","2011-01-17 04:42:54","11","3560","<p>Dear All,I am a newbiew to Android. I had read a lot of articles about Android Service but I am not clearly understanding what defferent between Local Service and Remote Service (except for ""Local Service run in the same process as the lunching activity; remote services run in their own process"" - The Busy Coder's Guide to Android Development - Mark L. Murphy ).</p><ol><li>Please shows me what different between Local Service and Remote Service.</li><li>What's the advantage/disadvantage of using Local Service. </li><li>What's the advantage/disadvantage of using Remote Service.</li></ol><p>Thanks &amp; best regardsDai Son</p>","434538","","","","","2012-12-03 13:56:38","Remote Service Vs. Local Service","<android>","3","0","1","",""
"4710092","1","4710699","","2011-01-17 04:45:44","2","897","<p>i m new in android developing.</p><p>i want to create custom tab bar in android like Iphone tab bar. i have found so much example to done this. but i would like to use only one XML file for tab bar and after include these to screens. i think it is possible with the help of layout but i don't have much idea.</p><p>if there are only one property of layout there implement component  at the bottom.</p><p>if anybody done this please provide some idea.</p><p>Thanks</p>","562296","","","","","2011-01-17 06:52:35","add component in bottom of android screen","<android><layout>","2","0","","",""
"4710098","1","4730209","","2011-01-17 04:47:27","6","4023","<p>I am working on an Android app that already exists on iPhone.</p><p>In the app, there is a Map activity that has (I counted) around 800 markers in four groups marked by drawable in four different colors. Each group can be turned on or off. Information about markers I have inside List. I create a mapOverlay for each group, then I attach that overlay to the map. I strongly believe that coding part I did properly. But I will attach my code anyway...</p><p>The thing is, my Nexus One can't handle map with all those markers. It takes around 15 seconds just to draw 500 markers. Then when all drawn, map is not quite smooth. It is sort of hard to zoom and navigate around. It can be done, but experience is bad and I would like to see if something can be done there. I know if I avoid String > Double conversion, I could save some time, but I doubt that would be significant.</p><p>iPhone seems doesn't have problems showing all these markers. It takes roughly about 1-2 seconds to show all of them and zooming and panning is not that bad. Slow down is noticeable but still acceptable. I personally think it is no good to draw all those markers, but app is designed by somebody else and I am not supposed to make any drastic changes.</p><p>I am not sure what to do here. It seems I will have to come up with different functionality, maybe use GPS location, if known, and draw only markers within some radius, or, if location not known, use center of the screen(map) and draw markers around that. I will have to have reasonable explanation for my bosses in case I make these changes.</p><p>I appreciate if anybody has any idas.</p><p>And the code:</p><pre><code>    List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();    Drawable drawable = this.getResources().getDrawable(R.drawable.pin_blue);    drawable = this.getResources().getDrawable(R.drawable.pin_blue);    ArrList = appState.GetSleepArrList();    ItemizedOverlay itemizedoverlay = new ItemizedOverlay(drawable, this);     ...    ...       for (int m = 0; m &lt; ArrList.size(); m++) {            tName = ArrList.get(m).get(""name"").toString();            tId = ArrList.get(m).get(""id"").toString();            tLat = ArrList.get(m).get(""lat"").toString();;            tLng = ArrList.get(m).get(""lng"").toString();;            try {                lat = Double.parseDouble(tLat);                lng = Double.parseDouble(tLng);                p1 = new GeoPoint(                        (int) (lat * 1E6),                         (int) (lng * 1E6));                OverlayItem overlayitem = new OverlayItem(p1, tName, tId);                itemizedoverlay.addOverlay(overlayitem);            } catch (NumberFormatException e) {                Log.d(TAG, ""NumberFormatException"" + e);                }        }        mapOverlays.add(itemizedoverlay);        mapView.postInvalidate();</code></pre><p>................................ </p><pre><code>public class ItemizedOverlay extends ItemizedOverlay&lt;OverlayItem&gt;{    private ArrayList&lt;OverlayItem&gt; mOverlays = new ArrayList&lt;OverlayItem&gt;();    private Context mContext;    public HelloItemizedOverlay(Drawable defaultMarker, Context context)    {        super(boundCenterBottom(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)    {        final OverlayItem item = mOverlays.get(index);                    ... EACH MARKER WILL HAVE ONCLICK EVENT THAT WILL PRODUCE CLICABLE                     ... BALOON WITH MARKER'S NAME.                  return true;    }       }    </code></pre>","507153","","507153","","2011-01-17 04:54:31","2011-11-10 16:15:06","Problem with large number of markers on the map","<android><map><markers>","3","4","12","",""
"4710107","1","4710123","","2011-01-17 04:49:14","19","9140","<p>You may need to use an older version of the Eclipse ADT in case you have a custom setup that depends on Google's earlier build system standards.  Where on the web can you find the older versions of the ADT and how do you install them in Eclipse?</p>","341631","","","","","2014-01-03 17:55:45","Where can I find older versions of Eclipse ADT","<android><eclipse>","2","0","13","",""
"4710111","1","9956796","","2011-01-17 04:51:23","4","9707","<p>I've been able to <a href=""http://stackoverflow.com/questions/4709663/determining-android-cancel-back-swipe-swipe-left-to-right-with-jquery/4709865#4709865"">successfully play</a> with the touchstart, touchmove, and touchend events on Android using jQuery and an HTML page. Now I'm trying to see what the trick is to determine a long tap event, where one taps and holds for 3 seconds. I can't seem to figure this out yet. I'm wanting to this purely in jQuery without Sencha Touch, JQTouch, jQMobile, etc. </p><p><em>I like the concept of jQTouch, although it doesn't provide me a whole lot and some of my code breaks with it. With Sencha Touch, I'm not a fan of moving away from jQuery into Ext.js and some new way of doing Javascript abstraction, especially when jQuery is so capable. So, I want to figure this out with jQuery alone. I've been able to do many jQTouch and Sencha Touch things on my own using jQuery. And jQMobile is still too beta and not directed enough to the Android yet.</em></p>","105539","","","","","2014-03-17 03:11:02","Determining Long Tap (Long Press, Tap Hold) on Android with jQuery","<jquery><android><tapandhold>","3","0","2","",""
"4710215","1","","","2011-01-17 05:15:22","4","1549","<p>I have ListActivity with custom items, where every item has it's own TextEdit.Taping on any of them brings IME keyboard up and it causes ListView to be resized.So EditText, which recently received focus by tap looses it. Second tap is required to put it focused or sure. It happens only when I have move than 1 items in the list. </p><p>Is there any way to open IME and keep focus on EditText by only one tap?</p>","366101","","","","","2012-04-18 15:32:55","Android: ListView with EditTexts messes up focus and IME","<android><listview><focus><edittext><ime>","2","1","3","2013-11-02 04:33:02",""
"4710295","1","4710350","","2011-01-17 05:36:29","3","4072","<p>I want to iterate a list of items into a ListView. This code below is not enough to iterate all the items into the list because of the weird behaviour of getChildCount() function which only returns the visible item count. </p><pre><code>for (int i = 0; i &lt; list.getChildCount(); i++) {   item = (View)list.getChildAt(i);   product = (Product)item.getTag();   // make some visual changes if product.id == someProductId}</code></pre><p>My screen displays 7 results and when there are more than 7 items into the list, it's not possible to access to the 8th item or so.. Only visible items..</p><p>Should I use ListIterator instead?</p><p>Thanks.</p>","304796","","","","","2011-01-17 09:29:48","Iterating ListView items in Android","<android><listview><iteration><listviewitem>","3","1","","",""
"4710361","1","","","2011-01-17 05:51:28","12","2387","<p>I'm unclear about when to use PopupWindow vs Dialog.  Any insight would be much appreciated.  Thanks. </p>","369722","","","","","2011-03-26 19:58:06","When to use Android PopupWindow vs Dialog","<android><comparison><dialog><use-case><popupwindow>","1","1","0","",""
"4710363","1","","","2011-01-17 05:52:17","3","10490","<p>Hi i am new to android dev.</p><p>getting error ..</p><pre><code>[2011-01-17 11:15:48 - TriviaGK] Installation failed due to invalid APK file![2011-01-17 11:15:48 - TriviaGK] Please check logcat output for more details.[2011-01-17 11:15:48 - TriviaGK] Launch canceled!</code></pre><p>plz tell where is logcat stored and how to debug this.</p><p>Also another app is running successfully in same enviroment.</p><p>Please Help android geeks. </p>","578112","","2102225","","2013-07-21 18:47:12","2014-01-31 20:20:33","invalid APK file","<android><apk>","5","1","","",""
"4710413","1","","","2011-01-17 06:02:30","0","3817","<p>as we know,the default position of the child which is selected is in the middle.but i want to show it in the gallery's left.how to do this.</p><p>thanks~</p>","578122","","","","","2011-02-11 17:12:55","android-gallery how to set the position of the child which is selected","<android><view><position><gallery>","1","0","","",""
"4710462","1","","","2011-01-17 06:14:21","4","6185","<p>I have a question about publishing apk to android market with android LVL service.</p><p>I would like to publish paid application to android market, so I added android LVL into my apk. I have tested on my mobile. When I install apps, it shows the permission to check phone status, market license. After installation, I try to run and prompt ""license not found and go to market to purchase"".  It seems that it works as apk is not allowedto run without downloading from market.</p><p>The problem now, how can I test or emulate the buyer situation ? That means will buyer able to run my apps after they buy my apps. If they cannot run and prompt license not found after purchasing, then my license check has problems. I already include my gmail into ""Edit profile"" in dashboard of market.android.com. I changed the status to LICENSED, NON-LICENSED, OLD LICENSED. but no response sent to my gmail. So I don't know how to do it.</p><p>Does it already done on Google license server or do I need to modify android market license code package? I check that there is code to handle request for the case like license, no license, old license, market error and so on.</p><p>It is because there is no market in android emulator, also I cannot add google account(only exchange account) in account and sync in emulator (tried in 1.6,2.2 and 2.3). So I only can test in my real android phone.</p><p>Anyone has experience or some methods to test paid apps without buying own apps from market, how can I also test the response from license server as well if anyone buy my apps ?</p><p>Thanks for sharing.</p>","471567","","","","","2012-11-03 15:08:08","How to test licensed android apk without buying from market?","<android><licensing>","3","0","1","",""
"4710504","1","5089117","","2011-01-17 06:20:30","0","1090","<p>I want to make an android application that will intimate the users about the approaching railway stations in INDIA. For this I will use GPS (Location Manager etc) on Android. So far, I have not developed the applications using GPS, so I have little insight on the capabilities of Android API for this.I know, through the android API I can know the current location of the users through GPS and google API but can I know the location of nearby railway stations from Google API for India? Or can I know the latitude and longitude of all the Railway Stations so that I can pre-feed that in the application?</p>","578098","","-1","","2011-02-22 11:53:13","2013-11-19 09:19:18","Android GPS data of Railway Stations of India","<android><gps>","3","0","2","",""
"4710631","1","4710659","","2011-01-17 06:44:45","0","1170","<p><br>Is there anyway to make my listview scroll horizontally.<br>Now me implemented it using Horizontal scroll view. But i think it will not be good if there is many itemsThank you</p>","477754","","","","","2011-01-17 06:47:40","listview scroll horizontally","<android><listview><horizontalscrollview>","2","0","","",""
"4710641","1","6379768","","2011-01-17 06:45:36","1","354","<p>I do not know what is the reason of this but I just installed one Android app in Samsung Galaxy S - GT I9000 device and its displaying Version code in App info screen. Whereas the Nexus One is displaying the proper Version Name and not Version code.</p><p>Has anyone faced a similar issue and is there any solution to this? </p>","261566","","","","","2011-06-16 23:23:36","Version code being displayed instead of Version Name in Samsung Galaxy S - GT I9000 device?","<android><versioning>","1","1","","",""
"4710646","1","","","2011-01-17 06:46:03","1","2052","<p>developing an application to open and view dwg files on the android os using eclipse IDEi found an open source dwg viewer active x</p><p>but how to include this activeX in android ??</p>","578162","","","","","2011-01-17 06:50:38","how to include active X in android?","<android><eclipse><activex><dwg>","1","0","","",""
"4710711","1","","","2011-01-17 06:54:28","0","119","<p>friends,</p><p>if i have written something on external storage and then i uninstalled application</p><p>android will delete that file automatically or i will have to delete it explicitly?</p><p>please guideany help would be appreciated.</p>","249991","","","","","2011-01-17 07:03:50","how android OS deals with written file on application uninstall?","<android>","1","0","","",""
"4710791","1","4730204","","2011-01-17 07:08:14","0","1679","<p><strong>Hi all,</strong></p><p>I have a activity which have a listview. I need to refine the listview by people's inputs.</p><p>I have tried to implement it by following the topic <a href=""http://developer.android.com/guide/topics/search/search-dialog.html"" rel=""nofollow"">http://developer.android.com/guide/topics/search/search-dialog.html</a>. but the problem is that I can only get the default searchbar (which can search contacts or any words in browser) from system after press the search button.</p><p>So my question is how to implement a search locally?</p><p>Thank you in advance.</p><hr><p>In the searchable activity ListActivity:</p><pre><code>@Overridepublic boolean onSearchRequested(){    Bundle bundle=new Bundle();    bundle.putString(""data"", ""data"");    startSearch(null, false, bundle, false);    return true;}</code></pre><p>In the manifest:</p><pre><code>&lt;searchable xmlns:android=""http://schemas.android.com/apk/res/android""android:label=""DiseaseListActivity""android:hint=""Search Diseases..."" android:searchMode=""showSearchLabelAsBadge""android:voiceSearchMode=""showVoiceSearchButton|launchRecognizer""android:voiceLanguageModel=""free_form""android:voicePromptText=""Please Speak""</code></pre><p>/></p><p>The searchable.xml:</p><pre><code>&lt;searchable xmlns:android=""http://schemas.android.com/apk/res/android""android:label=""DiseaseListActivity""android:hint=""Search Diseases..."" android:searchMode=""showSearchLabelAsBadge""android:voiceSearchMode=""showVoiceSearchButton|launchRecognizer""android:voiceLanguageModel=""free_form""android:voicePromptText=""Please Speak""/&gt;</code></pre>","479927","","","","","2011-01-18 23:21:51","How to use SearchManager in local app?","<android><android-searchmanager>","1","0","","",""
"4710797","1","4710847","","2011-01-17 07:09:22","1","1395","<p>I want to capture the signature of user in my app is this possible, please provide your suggestions how would I proceed on this</p><p>Regard's Saurabh</p>","517247","","","","","2011-05-30 13:05:53","Android signature capture","<android><signature>","1","1","3","",""
"4710825","1","4713983","","2011-01-17 07:13:29","9","5164","<p>I tried a couple of different ways but failed.Can you share what the right way is to tell intelliJ to include a jar file in the libs directory?</p><p>Thanks</p>","551811","","","","","2011-02-20 03:04:31","How to reference an external jar in an Android Library project in IntelliJ v10","<android><intellij-idea>","3","0","5","",""
"4710850","1","4711869","","2011-01-17 07:17:47","2","338","<p>Using below this code i m launching Web Browser But Cant</p><p>the code is:</p><pre><code>Uri uriUrl = Uri.parse(""www.google.com"");Intent launchBrowser = new Intent(Intent.ACTION_WEB_SEARCH, uriUrl);  startActivity(launchBrowser);  finish();</code></pre><p>i have also added menifest file internet permission and stringerror is :Unexpectdly close.pls </p>","565024","","379693","","2011-12-17 09:17:01","2011-12-17 09:17:01","Launching Web Browser in Android Application Occuring Error","<android><android-manifest>","2","2","","",""
"4710877","1","","","2011-01-17 07:22:47","0","170","<p>Logcat error:</p><blockquote>  <p>`  01-13 02:28:08.392: ERROR/AndroidRuntime(2888): FATAL EXCEPTION: main<br>  01-13 02:28:08.392: ERROR/AndroidRuntime(2888): java.lang.RuntimeException: Unable to instantiate activity </p></blockquote><p>Do I have to include the Activities in a package when I import them to my app.</p>","573700","","573700","","2011-01-17 08:35:22","2011-01-17 08:35:22","importing packages in android app","<android><package>","0","4","","",""
"4711065","1","4711579","","2011-01-17 07:56:25","0","293","<p><code><pre>Cursor mCursor = getContentResolver().query(Data.CONTENT_URI,                new String[] {ContactsContract.Contacts.DISPLAY_NAME,                                ContactsContract.CommonDataKinds.Phone.NUMBER,                                ContactsContract.Contacts._ID},                     // projection                null,                       // selection                null,                       // selectionArgs                ContactsContract.Contacts.DISPLAY_NAME);            // sortOrder</pre></code></p><p>this is my query method. I don't know why it returns repeated Names ( according to Mboile number, Phone number, work, home etc). If in contact list a person ""Person1"" having three contact number, then I will get three rows of ""Person1"" with 3 different number. </p>","550966","","","","","2011-01-17 09:20:41","""query()"" returns repeated contacts : Android","<android>","1","2","1","",""
"4711154","1","4711858","","2011-01-17 08:11:43","0","1326","<p>We have web server which only accepts  decoded value from android phone</p><p>As example </p><p>""http://www.url.com/data/?name=hello World""</p><p>returns expected rssult</p><p>but when we are trying to use </p><p>""http://www.url.com/data/?name=URLEncoder.encode(""hello World"")""</p><p>gives nothing.</p><p>We can not change the web service.</p><p>But as we all know java only accept encoded url </p><p>How can we achieve  the goal so that we can send the decoded url as it is to the server</p>","463721","","","","","2011-01-17 09:55:38","UrlEncodedFormEntity Replacement","<java><android><connection><httpclient>","1","0","1","",""
"4711216","1","","","2011-01-17 08:25:45","0","361","<p>I am new Android. I have declared the imageView in xml file.I want to get zoom in and out when the image is get focused.there is any way to zoom a   static image view in android. Thanks in advance.</p>","366916","","","","","2011-01-17 09:13:05","Android-Zoom a imageView when it got Focused","<android>","1","0","","",""
"4711247","1","4711365","","2011-01-17 08:31:00","9","6043","<p>I am creating an application in Android. I want that once my application is installed on one device, user should not be able to copy the "".apk"" and run it on other device. Please help me out. Thanks in advance. :)</p>","544313","","272824","","2011-01-17 08:38:30","2013-04-01 12:47:45","Protect android application from piracy","<android><licensing><copy><protection><android-lvl>","4","0","1","2013-04-06 08:52:21",""
"4711260","1","8730888","","2011-01-17 08:33:36","2","101","<p>Hi i have developed an application and it smoothly running in all phones except Htc Eris, in Htc Eris i get out of memory exception, null pointer exception etc, but these problem i never see in my samsung galaxy or motrolloz milestone or spice mobile, i need to know any problem in Htc Eris, like low memory ,low processing power etc</p>","487219","","487219","","2011-01-17 08:47:01","2012-01-04 17:08:34","Android Htc Eris","<android>","1","3","","",""
"4711312","1","4711438","","2011-01-17 08:43:03","-2","1867","<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>Hi,</p><p>I want to take input from user. where user can write some values and this value can be stored in a variable and can be used for later use.</p>","569938","","","","","2011-01-17 09:00:57","How to take user input in android","<android>","1","4","","2011-01-17 13:57:19",""
"4711459","1","4711718","","2011-01-17 09:03:30","1","386","<p>The normal way how AutoCompleteTextView shows suggestions, is that it shows only strings that begin with the text the user entered, but the sort order of the results is undefined. Can I somehow sort them by myself? So that when user enters e.g. ""g"", I show him results beginning with ""g"" that are most relevant for him.</p>","555653","","","","","2011-01-17 09:38:40","sorting data in autocompletetextview","<android>","1","0","0","",""
"4711485","1","","","2011-01-17 09:07:34","0","673","<p>i'm trying to rotate a TextView but i have several problems with the different resolutions .. i override onDraw method in this way           </p><pre><code>canvas.save();canvas.rotate(-90,60,60);super.onDraw(canvas);canvas.restore();</code></pre><p>But i cannot have the same result in different devices, i think because of pivotX and pivotY measure index parameters in rotate method; in 320x480 it runs fine, in 240x320 TextView is clipped.</p><p>Has anyone had the same problem?</p>","339500","","339500","","2011-01-17 12:29:01","2011-01-17 12:29:01","Problem rotating TextView in Android","<android><textview>","1","0","","",""
"4711625","1","4778574","","2011-01-17 09:26:26","16","15854","<p>I need to provide feature for users where users can share some data by sending email.I used below code.</p><pre><code>Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);emailIntent.setType(""text/html"");emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""testing email send."");emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(""&lt;b&gt;this is html text in email body.&lt;/b&gt;""));startActivity(Intent.createChooser(emailIntent, ""Email to Friend""));</code></pre><p>This shows mail app, gmail and bluetooth for user to choose.I dont want user to show bluetooth in this list. What i need to do ?I have facebook app, which does same thing, but doesn't show bluetooth in the list.I need to do the same.</p>","490031","","","","","2013-03-21 21:17:03","Sending email from android app","<android><email>","3","1","6","",""
"4711702","1","4713142","","2011-01-17 09:37:05","16","14390","<p>What is the best way? If i use drawarrays, or if i use drawelements? Any differents?</p>","472537","","44729","","2011-01-17 12:53:39","2013-07-18 05:06:59","Android openGL ES glDrawArrays or glDrawElements?","<android><opengl-es>","3","0","9","",""
"4711768","1","","","2011-01-17 09:44:37","3","715","<p>I use asmack building a jabber client for android, it works well ,but I got a problem when sending a large text in Chinese. The XMPPConnection just disconnected from server immediately,here are my Codes of Connection initialization:</p><pre><code>   ConnectionConfiguration c = new ConnectionConfiguration(mServerAddress, mPort);    c.setSecurityMode(SecurityMode.disabled);   c.setReconnectionAllowed(true);   c.setCompressionEnabled(false);      mConn = new XMPPConnection(c);</code></pre><p>and I send a chat message like this:</p><pre><code>   final Message msg = new Message(chatMsg.getTo(), Message.Type.chat);   msg.setBody(chatMsg.getBody());   new Thread() { @Override public void run() {  if(mConn != null &amp;&amp; mConn.getUser() != null) {   mConn.sendPacket(msg);  } }   }.start();</code></pre>","578314","","","","","2011-01-17 09:44:37","send large text using asmack","<android><xmpp><smack>","0","2","2","",""
"4711775","1","4713749","","2011-01-17 09:45:06","4","2826","<p>Like many Android developers I want to have two programs for MarketPlace - a demo and a full version - they both have the same code but use different assets. Unfortunately as they have the same package namespace they cannot both be loaded onto the same device. By the way, the assets are in an asset folder and not in the res folder.</p><p>I want to make the second <strong>apk</strong> via the command line and derive it from the first <strong>apk</strong> that was compiled/built using NetBeans/Eclipse IDE.</p><p>The answer seemed to be <strong>aapt</strong> and its <code>--rename-package-manifest</code> option but I clearly don't understand how to use it.</p><p>I do the following steps:</p><ol><li><p>Build my full apk using NetBeans</p></li><li><p>Unpack apk with <strong>apktool</strong></p></li><li><p>Add the new assets</p></li><li><p>Rename the package with <strong>aapt</strong></p></li><li><p>Repack into demo version using <strong>apktool</strong>.  </p></li></ol><p>However, I cannot get step 4 -  the <strong>aapt</strong> rename stage to work. I have seen so many threads on the web about this but no explicit example.</p><p>I then tried the very simplest of programs to test it out - an Hello World using following the steps <a href=""http://developer.android.com/guide/developing/other-ide.html"" rel=""nofollow"">here</a>.</p><p>The Hello World works fine using command line options, it builds and runs on both emulator and device.</p><p>However, when I use the <strong>aapt</strong> <code>--rename-manifest-package</code> command it gives lots of errors.</p><p>The command I use is:</p><pre>  aapt package -f -v          -M c:\android-sdk-windows\tools\hellow\AndroidManifest.xml          -S c:\android-sdk-windows\tools\hellow\res         —rename-package-manifest com.myname.demo</pre><p>The errors are in both the <code>main.xml</code> and the <code>AndroidManifest.xml</code> are of the form:</p><blockquote>  <p>""No resource identifier found for attribute 'layout_width'""</p></blockquote><p>Any ideas would be really welcome.</p>","578211","","447356","","2011-11-01 07:47:29","2011-11-01 07:47:29","Releasing 2 applications based on same code but different package name","<android><command-line><package><marketplace><aapt>","1","1","","",""
"4711786","1","4750310","","2011-01-17 09:46:39","1","768","<p>I would like to write a program that records video but <strong>not</strong> sound.</p><p>Can anyone help me on how to not record the sound while recording the video using MediaRecorder?</p>","551919","","213269","","2011-08-12 09:16:23","2011-08-12 09:16:23","Can sound be turned off in MediaRecorder of the Android API?","<android><mediarecorder>","1","0","","",""
"4711835","1","7365481","","2011-01-17 09:52:24","4","3429","<p>Okey, so I've implemented a button on a Sliding drawer in a android application I'm building. The only problem is that when I press the button the whole sliding drawer is pressed and it slides up.</p><p>I know I can disable 'press to slide up' in the XML, but that does not seem to work as the sliding drawer still is pressed just without the slide up.</p><p>If I call the slidingDrawer.lock(); function the button actually works but then the sliding drawer can't slide up or even be pressed up.</p><p>Any one have a simple solution to this problem?</p>","525016","","","","","2013-09-30 13:25:29","Buttons on a Sliding Drawer? - Android","<android>","3","0","3","",""
"4711883","1","","","2011-01-17 09:59:25","3","9686","<p>Can anyone tell me how do i establish HTC Desire Emulator in my Eclipse.</p><p>I have already tried, available packages installation, but HTC is not there in third party packages.</p>","543022","","883699","","2012-09-03 11:08:33","2012-09-03 11:08:33","Emulator in Android for HTC Desire","<htc><android>","2","0","","",""
"4711910","1","4711950","","2011-01-17 10:03:42","1","1946","<p>I have a file which I am using as a temporary file until the user selects to save this file, How do I go about making a copy of this file but at the same time re-naming it. Example below:</p><pre><code>File 1:/sdcard/Folder/file1.wavFile 2:Copy of file 1, renamed to file2.wav in /sdcard/Folder/file2.wav</code></pre><p>I understand using <code>Environment.getExternalStorageDirectory().getAbsolutePath()</code> gets me the path to the external storage so i'm not asking how I get to the sdcard or whatever. just to make a copy of a file and re-name it.</p>","400406","","","","","2011-01-17 10:08:52","Copy and re-name a file on android","<java><android><android-sdcard>","1","0","","",""
"4711942","1","5168574","","2011-01-17 10:08:17","2","2293","<p>I recently activated ProGuard for my Eclipse Android project. After adding external libs and dynamically referenced classes to the proguard.cfg, I don't get any errors when building the apk. I get however a NoSuchMethodError when I try to start the installed app.</p><p>I narrowed it down to a specific method called in the onCreate method of the main activity. To simplify things, here's what the class and method look like (I left out a lot of code, but I think this should illustrate it):</p><pre><code>public class TestMain extends TabActivity implements OnSharedPreferenceChangeListener{    ...    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        ...        testMethod();    }}</code></pre><p>testMethod() is defined as follows:</p><pre><code>private void testMethod() {    int charsLeft = maxPostMessageLength - someEditText.length();    ...}</code></pre><p>When I remove the ""someEditText.length()"" part, the app starts. So, the way I see it, the method that can't be found is the EditText.length() method. Strangely, though, the app also starts when I remove ""someEditText.length()"" from the testMethod and put it directly into the onCreate method:</p><pre><code>    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        test = someEditText.length();        testMethod();    }</code></pre><p>Does anyone know how I can get rid of this error and why I can call someEditText.length() directly in the onCreate method but not in a method called by the onCreate method?Without using Proguard the app works fine, of course.</p><p>Edit:I tried the -dontshrink, -dontobfuscate and the -dontoptimzie options in the proguard.cfg. With -dontoptimize the app starts without errors.Still, it would be interesting what exactly causes this specific error.</p>","388826","","388826","","2011-01-17 11:45:21","2011-08-17 10:05:27","Android: Proguard NoSuchMethodError","<android><eclipse><proguard><nosuchmethoderror>","4","0","","",""
"4711982","1","4713693","","2011-01-17 10:13:03","1","299","<p>I've written a program which uses Broadcast receivers to identify when certain events happen - e.g. new SMS/MMS message, missed call and new gmails.</p><p>When the broadcast receivers are triggered I'm setting variables to store the new states that have happened. What I'm looking for is a way to be able to change the setting upon the user seeing these messages - i.e. viewing the SMS, reading the e-mail or viewing the call log - or once they've clicked on the notification. Are there any broadcast receivers to be able to do this, or is there another way?</p><p>I ideally want to avoid having to poll for these changes and want to reflect the changes when they happen. Even if polling I'm not sure what I'd look for to see when a user had viewed the call log - for the others I can see how I could use the content provider to handle them.</p>","578374","","","","","2011-01-17 13:31:55","Are there any broadcast recievers to be able to tell when messages have been read?","<android><notifications><broadcastreceiver>","1","0","","",""
"4712003","1","4712086","","2011-01-17 10:14:58","9","3212","<p>I need to connect three points by a smooth curve. I've looked at the same questions already answered on StackOverflow but they all suggest using <code>Path.quadTo()</code>. I do not understand why this is considered a correct answer as Bezier curve is only approaching middle (control) point but not going through it. In my case I have to go exactly through it. So how can I achieve that?</p>","488489","","","","","2011-11-18 13:38:32","How do I draw a curve through tree points in Android?","<android><graphics>","3","0","3","",""
"4712044","1","4712138","","2011-01-17 10:18:57","4","952","<p>In my application, I'd like to keep status bar but make its background be the same as the main screen.</p><p>So I created a custom theme to set application background:</p><pre><code>&lt;resources&gt;  &lt;style name=""Theme.Shelves"" parent=""android:Theme""&gt;    &lt;item name=""android:windowBackground""&gt;@drawable/background_shelf&lt;/item&gt;    &lt;item name=""android:windowNoTitle""&gt;true&lt;/item&gt;  &lt;/style&gt;&lt;/resources&gt;</code></pre><p>Then put it in manifest:</p><pre><code> &lt;application android:icon=""@drawable/icon""               android:theme=""@style/Theme.Shelves""              android:label=""@string/app_name""&gt;    &lt;activity android:name="".HelloWorld""              android:label=""@string/app_name""&gt;</code></pre><p>And get this one:</p><p><a href=""http://i1178.photobucket.com/albums/x370/BinhNguyen84/device.png"" rel=""nofollow"">Screen shot 2</a></p><p>Everything is okay except the separator line between status bar and main screen. I thought that it's because of text view padding, so I set it to zero but nothing changed. </p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    TextView tv = new TextView(this);    tv.setText(""Hello World"");    setContentView(tv);    tv.setPadding(0,0,0,0);}</code></pre><p>Please let me know if you have any idea about this.  Thanks.</p>","578309","","74815","","2011-08-02 23:15:54","2011-08-02 23:15:54","How does one remove the separator line / shadow between status bar and main screen?","<java><android><background><themes><statusbar>","1","1","2","",""
"4712057","1","","","2011-01-17 10:20:45","0","991","<p>Do I have to include the activities to my app's Manifest file from the package which are imported to my android app.?thanks</p><p>Logcat error:</p><p><code>01-13 02:28:08.392: ERROR/AndroidRuntime(2888): FATAL EXCEPTION: main01-13 02:28:08.392: ERROR/AndroidRuntime(2888): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.s.android.test/com.s.android.test.MainActivity}: java.lang.ClassNotFoundException: com.s.android.test.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.s.android.test-2.apk]01-13 02:28:08.392: ERROR/AndroidRuntime(2888):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1544)</code></p><p><a href=""http://paste.org/pastebin/api/27440"" rel=""nofollow"">Error >paste.org</a></p>","573700","","573700","","2011-01-17 11:23:19","2011-01-17 11:23:19","importing packages in android","<android><package>","2","10","","",""
"4712167","1","4712309","","2011-01-17 10:35:05","0","292","<p>Friend's         I need to parse and list the data from web service response as json array,i can able to parse and list the response with simple format like <strong>Sting jsonStr = ""[{\""id\"":101,\""date\"":\""Wed, 29 Dec 2010 11:55:00 GMT\""}]"";</strong> by using json parser...</p><pre><code>JSONArray jArray = new JSONArray(jsonStr);            for(int i=0;i&lt;jArray.length();i++){               JSONObject json_data = jArray.getJSONObject(i);               id = json_data.getString(""id"");}</code></pre><p>but i need help on parsing the format given below<strong>[{""DealUser"":{""id"":""3"",""created"":""2011-01-13 17:40:34""},""User""{""usertype_id"" : ""2"",""username"" : ""fsp""},""Deal""{""id"":""122"",""price"":""$34""}];</strong></p><p>here i need to parse the three json tags like DealUser,User,Deal and add to list to set on listview.Help me to parse the above string data to add on list.</p><p>Thanks in advance. </p>","393953","","","","","2011-01-17 10:49:25","Need help on android Json Parsing","<android><json>","1","1","","",""
"4712188","1","4712258","","2011-01-17 10:36:59","0","209","<p>can we get API level 3 inbuilt in version 2.2 or we have to add it? as i am not able to update it . </p>","573776","","41688","","2011-05-26 14:46:30","2011-05-26 14:46:30","Android sdk 2.2","<android><android-2.2-froyo>","1","0","","",""
"4712202","1","","","2011-01-17 10:38:27","0","222","<p>I have an alphabetically sorted list of strings for the AutoCompleteTextView,some strings have 2 words,when I type a letter, I would that the autocomplete list that appear shows the strings sorted by the letter typed</p><p>for example:I have this list alphabetically sorted: New Orleans, Omaha, Portland, Rome</p><p>now, if I type 'O', the first string in the autocomplete list, is New Orleans, the second Omaha,but I would that Omaha is the first string because it start with 'O' and after New Orleans that doesn't</p>","555653","","","","","2011-04-07 16:49:17","AutoCompleteTextView widget","<android>","1","0","0","",""
"4712331","1","","","2011-01-17 10:51:20","0","1837","<p>I don't manage to set a neither a title nor a (title) icon to my custom alert dialog. My code:</p><pre><code>public class AddingFavoriteDialog extends AlertDialog {private OnAddingFavoriteListener       onAddingFavoriteListener;private Context context;private GeocodingManager geocodingManager;private FavoritesActivity favoritesActivity;public AddingFavoriteDialog(Context context, OnAddingFavoriteListener onAddingFavoriteListener) { super(context, android.R.style.Theme_Dialog);this.context = context;this.onAddingFavoriteListener = onAddingFavoriteListener;this.geocodingManager = new GeocodingManager(context);this.favoritesActivity = (FavoritesActivity) context;}@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.adding_favorite_dialog2); setTitle(""MYTITLE""); setIcon(R.drawable.star_gold); }</code></pre><p>What am i doing wrong? I also tried to set it by calling <code>super.setTitle(""MYTITLE"");</code> in <code>onCreate()</code> as well as in the constructor. </p><p><strong>EDIT:</strong> Even <code>setButton(BUTTON_POSITIVE, context.getString(R.string.button_value_OK),                new OnClickListener() {...}</code> seems not to work.</p>","566904","","566904","","2011-01-17 11:13:18","2012-01-07 07:31:10","Set title and (title) icon for a custom alert dialog","<android><title><alertdialog><customdialog>","2","2","","",""
"4712356","1","4712728","","2011-01-17 10:53:39","9","175","<p>I have a strange question...I've got a netbook with Android 2.2 and i'm a developer. </p><p>is it possible to use android to write and compile applications? So write android application on android? it would be nice. </p><p>Thanks.</p>","415963","","1128618","","2012-04-12 03:49:30","2012-04-12 04:32:04","Android Creating application on Android using Android","<android>","3","3","2","",""
"4712426","1","4714211","","2011-01-17 11:02:31","1","426","<p>This one has made me bite my nails.I parsed image URL's from XML into an arraylist.I am displaying images in table layout along with some text. I am using the following code in activity  for displaying image :</p><p><strong>Bitmap bm=DownloadImage(piciterator.next().toString());<br>icon.setImageBitmap(bm);</strong></p><p>Here piciterator is iterating arraylist containing URL's.</p><p>Here is DownloadImage function :</p><p>private Bitmap DownloadImage(String URL)<br>    {  </p><pre><code>    Bitmap bitmap = null;    InputStream in = null;      try {        in = OpenHttpConnection(URL);        bitmap = BitmapFactory.decodeStream(in);        in.close();    } catch (IOException e1) {        // TODO Auto-generated catch block        e1.printStackTrace();    }    return bitmap;                }</code></pre><p>And this is OpenHttpConnection function :</p><p>private InputStream OpenHttpConnection(String urlString)     throws IOException  </p><pre><code>{    InputStream in = null;    int response = -1;    URL url = new URL(urlString);     URLConnection conn = url.openConnection();    if (!(conn instanceof HttpURLConnection))                             throw new IOException(""Not an HTTP connection"");    try{        HttpURLConnection httpConn = (HttpURLConnection) conn;        httpConn.setAllowUserInteraction(false);        httpConn.setInstanceFollowRedirects(true);        httpConn.setRequestMethod(""GET"");        httpConn.connect();         response = httpConn.getResponseCode();                         if (response == HttpURLConnection.HTTP_OK) {            in = httpConn.getInputStream();                                         }                         }    catch (Exception ex)    {        throw new IOException(""Error connecting"");                }    return in;     }  </code></pre><p>On debugging i am able to retrieve some of the images on browser. However after 23rd element in arraylist the image opens on browser but application falls on the step :  </p><p><strong>bitmap = BitmapFactory.decodeStream(in);</strong></p><p>On image when seen on browser is comparatively smaller than others but not much smaller.</p><p>The application not even goes to try catch. It just crashes.</p><p>Help in this regard will be really appriciated.</p>","541786","","","","","2011-01-17 14:22:43","Error on displaying image in imageview","<android><imageview>","2","1","","",""
"4712441","1","","","2011-01-17 11:04:21","1","2376","<p>I have a list view in which each data is fetched from List adapter.Each item in list view contains a text view and toggle button.But there occurs a problem when i scroll the list. the checked state of toggle buttons change i.e if i selected a toggle button at index 4, then after scrolling i find that any random button except fourth is selected.</p>","578440","","21234","","2011-01-17 11:24:47","2014-02-27 02:24:15","Toggle button in a list view loose their state when scrolled of screen in Android","<android><android-listview>","3","0","","",""
"4712494","1","5059009","","2011-01-17 11:10:51","0","999","<p>I am following this android droid charts tutorial ... </p><p><a href=""http://w2davids.wordpress.com/creating-charts-with-droidcharts-for-android/"" rel=""nofollow"">http://w2davids.wordpress.com/creating-charts-with-droidcharts-for-android/</a></p><p>At one point he does this </p><blockquote>  <p>setContentView(new  XYLineChart(getApplicationContext()));</p></blockquote><p>I want to specify an xml layout and then add this view to it ... How can I do that ?  ...</p>","435597","","","","","2011-12-31 16:59:57","Droid Charts Android Java Issue","<java><android><android-layout><charts><jfreechart>","2","0","1","",""
"4712601","1","4830223","","2011-01-17 11:24:23","0","2613","<p>I have been able to run TTS from an activity but when I try to execute the same code from a service, it's giving me message that TTS engine is initialised but not speaking anything.</p><p>Has anybody encountered the same issue anytime?     </p><pre><code> public void onCreate() {    super.onCreate();    tts = new TextToSpeech(this, this //TextToSpeech.OnInitListener);    timer.scheduleAtFixedRate( new TimerTask()                           {                                   // In timer          public void run() {          //On some condition          tts.speak(""thank you"", TextToSpeech.QUEUE_ADD, null);     }, 0, 60000);    }  @Override  public void onInit(int status) {    if (status == TextToSpeech.SUCCESS) {  Toast.makeText(BackgroundProcessforTimecheck.this,   ""Text-To-Speech engine is initialized"", Toast.LENGTH_LONG).show(); } else if (status == TextToSpeech.ERROR) {  Toast.makeText(BackgroundProcessforTimecheck.this,   ""Error occurred while initializing Text-To-Speech engine"", Toast.LENGTH_LONG).show();}}</code></pre><p>Can anybody please help?</p>","227943","","635608","","2012-06-16 08:10:21","2013-01-17 10:56:59","TTS doesn't speak from a service whereas it does it from an activity in android","<android><text-to-speech>","2","7","5","",""
"4712656","1","4713028","","2011-01-17 11:32:06","0","810","<p>I want to implement notification in my android app. The case is, I want to show the notifications when my app is closed and turn off when app is opened. So basically I want to show the notifications when the app is closed.</p><p>So what should I use in this situation? Should I use Service + AlarmManager?</p><p>Can anyone give me some example or reference?</p><p>Thanks</p>","435025","","","","","2011-01-17 12:16:46","Pull Notification in Android","<android>","1","0","","",""
"4712661","1","","","2011-01-17 11:32:50","1","3958","<p>I want to upload a video file from my Android application. Any ideas?</p>","448250","","127880","","2011-09-08 15:28:32","2012-05-03 13:40:21","How to upload a video to YouTube in Android?","<android><video><youtube-api>","2","0","","",""
"4712688","1","4718485","","2011-01-17 11:38:05","0","169","<pre><code>case R.id.btn7:    if (mp != null &amp;&amp; mp.isPlaying()) mp.stop();    mp = MediaPlayer.create(a.this, R.raw.aaaa);    mp.start();    break;case R.id.btn8:    if (mp != null &amp;&amp; mp.isPlaying()) mp.stop();    mp = MediaPlayer.create(a.this, R.raw.bbbb);    mp.start();    break;</code></pre><p>How could I use setDataSource in order to stop my app for force close? Please help!If I use it like this, eclipse highlights red the setDataSource;</p><pre><code>public void onClick(View v) {    switch(v.getId()) {        case R.id.btn:            if (mp != null &amp;&amp; mp.isPlaying()) mp.stop();            mp.setDataSource(zoo.this,R.raw.gata);            mp.prepare();            mp.start();            break;</code></pre>","519526","","1465910","","2012-09-29 09:37:19","2012-09-29 09:37:19","App with media Player forces down","<java><android>","2","3","","",""
"4712793","1","4713301","","2011-01-17 11:50:54","8","1675","<p>I'm used to programming in C#, and one thing I miss about Java is that it doesn't seem to have C#'s nice built-in event handling capabilities:</p><pre><code>// define event signaturepublic delegate void SomeEventHandler();class SomeEventGenerator {    // define subscribable event property    public event SomeEventHandler SomeEvent;    protected void OnSomeEvent() {        if (SomeEvent != null) {            SomeEvent();        }    }}class SomeEventClient {    public SomeEventClient(SomeEventGenerator eg) {        // subscribe        eg.SomeEvent += new SomeEventHandler(eg_SomeEvent);        // do some stuff        // unsubscribe        eg.SomeEvent -= new SomeEventHandler(eg_SomeEvent);    }    private void eg_SomeEvent() {        // handle event    }}</code></pre><p>What's the best way to get something similar and lightweight in Java/Android which has the ability to subscribe/unsubscribe multiple event clients and call all subscribed clients at once?</p>","106302","","","","","2011-01-17 12:46:46","Implementing C#-like events in Android/Java","<java><android><events>","1","0","0","",""
"4712796","1","4713201","","2011-01-17 11:51:04","3","3650","<p>i am trying to get the height of a view and it keeps returning 0.</p><p>this is what i have tried:</p><pre><code>View hourView = View.inflate(mContext, R.layout.calendar_hour_item,null);hourViewHeight = hourView.findViewById(R.id.mainLayout).getHeight();</code></pre><p>i also tried <code>hourViewHeight = hourView.getHeight();</code> as well but no joy.</p><p>i call those two lines inside a initialize() method located here:</p><pre><code>@Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.calendar_day_screen);        Intent intent = getIntent();        mDate = new DateTime(intent.getStringExtra(""date""));        circleIcon = (ImageView) findViewById(R.id.circle);        mHoursLayout = (RelativeLayout) findViewById(R.id.dayLayout);        TopBarUtil topBar = new TopBarUtil(getApplicationContext());        circleIcon.setOnClickListener(topBar.onActionClickListener());        mContext = getApplicationContext();        initialize();    }</code></pre><p>here is my xml 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=""wrap_content"" android:id=""@+id/mainLayout"" android:background=""@layout/border""&gt;    &lt;TextView android:text=""12am"" android:id=""@+id/hourTextView""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;/RelativeLayout&gt;</code></pre><p>i basicllay want to get the height of the above xml layout but it always returns 0.</p><p>edit: i have also tried doing this below:</p><pre><code>@Override    protected void onStart() {        // TODO Auto-generated method stub        super.onStart();         final View hourView = View.inflate(mContext, R.layout.calendar_hour_item,null);        ViewTreeObserver observer = hourView.getViewTreeObserver();        observer.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {            @Override            public void onGlobalLayout() {                hourView.getViewTreeObserver().removeGlobalOnLayoutListener(this);                hourViewHeight = hourView.getHeight();                Log.d(TAG, ""hourViewHeight = "" + hourViewHeight);            }        });//      hourViewHeight = hourView.findViewById(R.id.mainLayout).getHeight();//      Log.d(TAG, ""hourViewHeight = "" + hourViewHeight);    }</code></pre>","444668","","444668","","2011-01-17 12:18:33","2011-01-18 06:23:50","android: get viewHeight programatically","<android>","3","0","","",""
"4712842","1","","","2011-01-17 11:55:13","1","208","<p>I need a constant and unified solution to stream audio in Android and IOS web browsers.Actually, I have it in flash based but I want something for mobile web browsers instead of flash.</p><p>Thanks</p>","578476","","","","","2011-01-17 11:59:09","I need a constant and unified solution to stream audio in Android and IOS web browsers","<android><ios><audio><streaming>","1","0","","",""
"4712903","1","4790415","","2011-01-17 12:00:43","0","798","<p>I am using the code at <a href=""http://mindtherobot.com/blog/272/android-custom-ui-making-a-vintage-thermometer/comment-page-1/#comment-14326"" rel=""nofollow"">http://mindtherobot.com/blog/272/android-custom-ui-making-a-vintage-thermometer/comment-page-1/#comment-14326</a> for building custom view.</p><p>I wanted to display the image in place of drawing the hand through code. I have tried setting the texture for the hand but have not got any success.</p><p>Can anyone let me know how can I set the image in place of hand?</p>","261566","","","","","2013-06-10 09:44:46","Texture to Paint object in Android?","<android><view>","2","1","","",""
"4712931","1","4712956","","2011-01-17 12:04:11","2","139","<p>I have an Android Library (e.g. libA) that is referenced by two packages, com.siteA.appA and com.siteB.appB.</p><p>This works fine, but I want to modify the behaviour of the library based on the package (e.g. appB could display ads).</p><p>Is there way I can determine which package is using the Library <em>from</em> the library?</p><p>E.g. within LibA</p><pre><code>if(package == ""com.siteA.appA""){   // Don't display adverts}else{  // Display adverts.}</code></pre>","553978","","119895","","2011-01-17 12:09:12","2011-01-17 12:09:12","Android Library - determine which package is being used","<android><package>","1","0","","",""
"4712945","1","","","2011-01-17 12:06:00","3","1297","<p>Does anyone know how to put the database entries into a gridview in android? Or is there a tutorial out there which explains how to do that.plz help me by giving complete example.</p>","578501","","","","","2011-01-17 12:32:50","showing data in gridview from database","<android><gridview>","2","0","","",""
"4713029","1","4713401","","2011-01-17 12:16:47","0","90","<ol><li>I open my app from launcher - Activity A is launched</li><li>Inside Activity A, I open B (which is a map, that uses lots of bitmaps, therefore lots of memory)</li><li>I open Android Market, go to my app in the Market, and click ""Open"", which launches Activity A of my app</li><li>I open Activity B. Activity stack is now. OutOfMemoryException is thrown, because <strong>both</strong> activities B are using about 90 item bitmap cache.</li></ol><p>The question is obvious - how to solve this?</p>","243225","","","","","2011-01-17 12:59:32","Opening app from Android causes ""stacking"" of Activities","<android><out-of-memory>","1","1","","",""
"4713155","1","4713710","","2011-01-17 12:30:48","5","3143","<p>I'd like to put a custom view multiple times in my main.xml which consists of a RelativeLayout, some controls and then my custom view.This custom view should use the following (simplified) xml:</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=""220px""android:layout_height=""220px""android:background=""@drawable/contextitemshape""&gt;&lt;TextView    android:text=""some caption""    android:textSize=""23px""    android:textColor=""#000000""/&gt;    &lt;FrameLayout    android:id=""@+id/content""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>How can I get it to use this file each time it is created? Is that even possible in android? All the custom views I can find don't use an own layout-xml file.</p><p>Thank you!</p>","578502","","","","","2011-01-17 13:33:33","Bind android custom view to a specific layout xml (is this even possible?)","<android><xml><layout><view>","1","0","1","",""
"4713345","1","4713567","","2011-01-17 12:52:22","1","4169","<p>I want to know how to write notification text only on the notification bar and different text on the Notification layout?</p>","508197","","","","","2014-03-06 22:01:51","notification bar - how to write text there","<android>","3","3","0","",""
"4713541","1","4713609","","2011-01-17 13:15:01","0","780","<p>In my app when i do some long work i'm using a Progress Dialog while the work isn't finished.I'm looking for it in every place but without sucess. Everything that i founded is all about saving user interface elements states. </p><p>Then, i would like to know how i can save progress dialog state correctly ? </p><p>I want this working because when the orientation screen change the app crashes.</p><p>Shoul i use onSaveInstanceState() method ? How ? I try using saving as a bundle but without succes...</p><p>Any advice would be nice...</p><p>thanks </p>","502295","","","","","2012-03-31 09:38:39","How to save a Progress Dialog state correctly?","<android>","4","0","1","",""
"4713592","1","","","2011-01-17 13:21:13","6","5368","<p>I'm trying to check if my alarm is active or not. The alarmIsSet method will return false before the alarm is set, true when the alarm is set. So far so good, however, after the alarm i canceled alarmIsSet will continue to return true until I reboot the device.How do I fix this?</p><pre><code>public class Alarm extends Activity {    private Intent intent = new Intent(""PROPOSE_A_TOAST"");    private void alarm (boolean activate) {        AlarmManager am = (AlarmManager)getSystemService(Context.ALARM_SERVICE);        PendingIntent pi = PendingIntent.getBroadcast(this, 0, intent, 0);        if(activate == true) {            int type = AlarmManager.ELAPSED_REALTIME_WAKEUP;            long interval = 3000;            long triggerTime = SystemClock.elapsedRealtime();                   am.setRepeating(type, triggerTime, interval, pi);               } else {            am.cancel(pi);        }    }    private boolean alarmIsSet() {        return PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_NO_CREATE) != null;    }}</code></pre>","434457","","434457","","2011-01-17 15:48:02","2013-05-12 07:45:52","How to check if alarm is set","<android><alarm><alarmmanager>","3","0","4","",""
"4713598","1","","","2011-01-17 13:21:49","5","929","<p>Do you know how to have a two lines menu item title? I've tried using \n in the string or Html.fromHtml with <br> tag but it doesn't work. Thanks</p>","517558","","","","","2011-01-17 13:29:10","Two line text for MenuItem","<android><menuitem><multiline>","1","2","","",""
"4713744","1","4713824","","2011-01-17 13:37:01","1","3122","<p>Hi i was wondering if android has view that responds to user slides.</p><p>If you want to know exactly what i mean there is one in the galaxy tab for unlocking the phone and muting/activating sound on the bottom of the screen.</p><p>Seems like the iPhone slide to unlock feature. </p><p>Thanks in advance I appreciate the help!</p>","420390","","","","","2011-01-17 13:46:53","Does android have a slider view?","<android><view><slider>","2","0","","",""
"4713808","1","","","2011-01-17 13:44:54","0","513","<p>I want to include two spinners inside a Table row.  If I write the code like below the Width of the first spinner is not getting reduced. Pls help me.</p><p><code>&lt;TableRow android:minHeight=""50dip"" android:gravity=""center_vertical"" android:id=""@+id/credit_card_tr_expdt"" &gt;</code></p><p><code>&lt;Spinner android:id=""@+id/Spinner01"" android:layout_width=""30dip""</code><code>android:layout_height=""wrap_content"" /&gt;</code></p><p><code>&lt;Spinner android:id=""@+id/Spinner01""</code><code>android:layout_width=""30dip""</code><code>android:layout_height=""wrap_content"" /&gt;</code></p><p><code>&lt;/TableRow&gt;</code></p>","555221","","29157","","2011-01-17 15:29:39","2011-01-17 15:29:39","Android Multiple Spinner","<android>","0","2","","",""
"4713812","1","4713915","","2011-01-17 13:45:15","15","22481","<p>In my application I must use a smaller font for the medium density devices. Is it possible to specify that?</p>","460611","","918414","","2012-06-30 02:31:06","2012-07-20 10:41:29","Different font sizes for different screen sizes","<android>","3","0","6","",""
"4713859","1","4713952","","2011-01-17 13:48:49","1","1232","<p>I have a custom view extends RelativeLayout. I know I can modify it's children in the java code, but is that possible in xml too?I want to have something like that in my main.xml:</p><pre><code>&lt;MyCustomView&gt;   &lt;SomeControl /&gt;   &lt;AnotherControl /&gt;&lt;/MyCustomView&gt;&lt;MyCustomView&gt;   &lt;NewControl /&gt;&lt;/MyCustomView&gt;</code></pre><p>Can you give me hints how to achieve that?Thank you for your help!</p>","578502","","578502","","2011-03-29 15:12:20","2011-03-29 15:12:20","How to add children to an android custom view / layout in xml?","<android><layout><view>","1","1","1","",""
"4713884","1","","","2011-01-17 13:51:41","2","2173","<p>This is my problem, I'm developing a software that uses the camera and records video, everything is working but I cannot spot how to manage the settings, for example I've got a Samsung galaxy S that can record video at <strong>1280x720</strong>, but when I set this resolution with:</p><pre><code>CamcorderProfile profile;profile = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH);profile.videoFrameWidth = 1280;profile.videoFrameHeight = 720;profile.videoFrameRate = 30;recorder.setProfile(profile);</code></pre><p>the logcat shows these messages:</p><pre><code>01-17 14:22:28.706: WARN/AuthorDriver(2782): Intended video encoding frame width (1280) is too large and will be set to (128849019680)01-17 14:22:28.706: WARN/AuthorDriver(2782): Intended video encoding frame height (720) is too large and will be set to (1078895784755680)</code></pre><p>and the parameters are automatically scaled to <strong>800x480</strong></p>","538092","","1862545","","2013-04-04 08:29:00","2013-04-04 08:29:00","Camera MediaRecorder / CamcorderProfile","<android><camera><mediarecorder>","1","0","1","",""
"4714004","1","","","2011-01-17 14:02:04","1","323","<p>my problem: if my app is going to be destroyed by a task manager on the phone, after restart the app can't access the sqlite database. it is possible to access it be openOrCreateDatabase but it crashes if I perform some query on the db. the query works if I don't destroy it by task manager! does smbdy has a hint?</p>","433618","","","","","2011-01-17 14:02:04","android app crashes after getting killed by task manager","<android>","0","2","","",""
"4714052","1","4714097","","2011-01-17 14:06:14","0","1440","<p>would like to build an app that can run on any of the new PAD's hitting market.I don't want to limit our users to a specific OS.</p><p>What is the best solution to allow all these pads to use our app.</p><p>The app needs to be able to run offline.</p><p>Thanks!</p>","375250","","","","","2011-12-24 04:28:02","Best platform for programming to IPad and new Windows and Android Pads","<android><windows><ipad>","5","2","2","",""
"4714100","1","4715126","","2011-01-17 14:11:12","0","80","<p>Hi    My question is ""Is it possible that I pick up all values from external file that is present in phone memory and put these values in my textviews,Buttons etc.  ?""if yes then how?</p>","567776","","","","","2011-01-17 15:58:12","How to set values of views from external file in android","<android><views>","1","0","","",""
"4714109","1","4714742","","2011-01-17 14:11:43","1","519","<p>I have an app that uses text to speech to inform the user every 10 mins that 10 mins have passed. It currently works fine but if you sleep the phone (press the power button) it no longer plays the sound.</p><p>How can i play these sounds even when the phone is asleep?</p>","197310","","","","","2011-01-19 11:03:33","Text to speech when phone is asleep - Android","<android><sleep><text-to-speech>","1","4","0","",""
"4714244","1","5546707","","2011-01-17 14:26:17","1","8275","<p>As part of my final year project, I'm designing an Android application that needs to do some web scraping.  I don't have any experience with this, so am wondering if anyone knows of any good links/tutorials they would like to share.</p><p>EDIT: I'm trying to have the app sign into a site and upload details from the phone to the site.</p>","519064","","267702","","2013-07-30 19:45:17","2013-07-30 19:45:17","Web Scraping Android Application","<android><web-scraping>","2","1","3","2013-07-31 06:55:26",""
"4714317","1","4714956","","2011-01-17 14:34:20","0","10493","<p>Normally, when I switch/case my views onClick, I have no problems because they were defined in the XML and have ID's so I use:</p><pre><code>switch(v.getID()){case(R.id.someButton):{  // do something}default: // bla}</code></pre><p>However, I am now defining my views programatically and so they don't have a static ID.</p><p>How should I now switch on these views? if I tried getID() on the views it's not allowed because it isn't static.</p><p>Ideas? Thanks.</p>","353674","","","","","2011-01-17 15:37:58","Android, switch/case on View with programmatically generated views","<android><view><switch-statement>","3","0","","",""
"4714333","1","4714860","","2011-01-17 14:36:00","1","1735","<p>I am having some trouble using intents to pass data between my Activities, specifically their appears to be a problem when I am passing data to a pervious activity when the current activity is paused. </p><p>From the first activity I start it like this:</p><pre><code>//Create the activity we want to run and place it in an Intent  Intent i = new Intent(activity, JVoiceActivity.class);  //Create a bundle for passing some data.  Bundle b = new Bundle();  //Pass that this is a recording.  b.putBoolean(""Record"", true);  i.putExtras(b);  //Start it.  activity.startActivityForResult(i, 0);</code></pre><p>The reason I am using activity instead of just startActivityForResult is because this is another class that I pass the activity to keep my project Object Orientated.</p><p>Then on the new Activity I close it like this:</p><pre><code> public void onPause() {      Bundle bundle = new Bundle();   bundle.putString(""Path"", mPath);   Intent i = new Intent();   i.putExtras(bundle);   setResult(RESULT_OK, i);   super.onPause(); }</code></pre><p>Finally in the first Activity I have the function:</p><pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {  if(data!= null)  {</code></pre><p>This function is being called but the Intent data is always null. I am assuming its the way I close the second activity as I did have this working before when I was testing it, at the time I was calling Finish() straight away from my secound activity after setting mPath for testing purposes.</p><p>Any help is greatly appreciated, thanks.</p>","518118","","","","","2012-11-22 22:55:15","Passing back data to a Paused Activity","<android><data><activity>","3","0","","",""
"4714411","1","4847108","","2011-01-17 14:45:53","28","49947","<p>The Android shell does not have the <strong>cp</strong> command. Android shell also has no <strong>sed</strong> or <strong>grep</strong> or <strong>vi</strong>. I have no <strong>adb</strong> daemon available. There is <strong>mv</strong> command but it rejects to work if source is on a read-only device. </p><ol><li>What to do if I have to copy some directories from read-only device recursively? </li><li>How to change a line in a text file (e.g. ""PATH=/cache"" to be ""PATH=/mnt/asec"") ?</li></ol>","215571","","215571","","2012-03-30 12:46:07","2013-07-30 10:52:56","How to copy and edit files in Android shell?","<android><linux><shell><android-ndk><sh>","8","6","5","",""
"4714616","1","4720083","","2011-01-17 15:07:56","2","1154","<p>How to get the Android unique device ID from the native code (not from java)?</p>","131728","","","","","2011-01-18 02:55:15","Android unique device ID from native code","<android><c><android-ndk><uniqueidentifier>","2","0","","",""
"4714663","1","4714716","","2011-01-17 15:12:31","1","2253","<p>I need to represent the hex color <code>#F0FFF0</code> in an android application (stored as an integer). I am storing this as:</p><pre><code>int color = 0xF0FFF0;</code></pre><p>But the color seems way off when being rendered (in fact, it's black). Am I storing the color incorrectly? </p>","1638","","71059","","2011-01-17 20:09:41","2012-06-13 17:04:21","Help storing color hexadecimals as an integer in Java","<java><android><hex>","4","0","2","",""
"4714711","1","4717760","","2011-01-17 15:16:40","17","26149","<p>I am trying to fix a problem in Eclipse for like 3 hours and I haven't made any progress. Tomorrow is the customer coming to look at my app, and I have no time left. This is really frustrating!</p><p>This morning when I was coding and I wanted to run my app on my device Eclipse crashed all of a sudden. 'aapt.exe has stopped working'</p><p>After this Eclipse wasn't starting anymore. It froze at the splash image.</p><p>I looked on the internet and tried different solutions like going back to Java SE 6 update 20, changing .ini file etc. in the end reinstalling Eclipse did the job.</p><p>Shortly after that the 'aapt.exe has stopped working' returned. I found a solution by changing my projects target. 1.5, 1.6, 2.2 doesn't matter, as long as it's different than the one before.</p><p>Now I get the <code>Error generating final archive: java.io.FileNotFoundException: C:\xxx\bin\resources.ap_ does not exist</code> error.</p><p>I tried clean but that doesn't work. Deleting and automatically regenarting R.java also didn't work.</p><p>I ran the same code in Netbeans with the Android plugin and there it gives me the 'aapt.exe has stopped working' again :(</p><p>Please guys, how can I fix this?</p><p><strong>Edit:</strong> </p><p>I think I <strong>may</strong> have found the reason. These are the error lines in the console:</p><pre><code>org.xmlpull.v1.XmlPullParserException: Binary XML file line #3: &lt;bitmap&gt; requires a valid src attributeat android.graphics.drawable.BitmapDrawable.inflate(BitmapDrawable.java:341)at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:779)at android.graphics.drawable.Drawable.createFromXml(Drawable.java:720)at com.android.layoutlib.bridge.ResourceHelper.getDrawable(ResourceHelper.java:150)at com.android.layoutlib.bridge.BridgeTypedArray.getDrawable(BridgeTypedArray.java:668)at android.view.View.&lt;init&gt;(View.java:1846)at android.view.View.&lt;init&gt;(View.java:1795)at android.view.ViewGroup.&lt;init&gt;(ViewGroup.java:282)    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)[2011-01-17 16:37:20 - gegevens.xml] Unable to resolve drawable ""com.android.layoutlib.utils.ResourceValue@267e33de"" in attribute ""background""</code></pre><p>The file it's talking about is 'bg.png'. It's a small png file which I repeat in a .xml file.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;bitmap xmlns:android=""http://schemas.android.com/apk/res/android""android:src=""@drawable/bg"" android:tileMode=""repeat"" /&gt;</code></pre><p>This file has worked from the first time without any problems.I deleted it from the drawable folder, waited for an error message, and then added it back. The red x next to the foldername got away, but still nothing different...</p>","517460","","517460","","2011-01-17 16:05:21","2012-10-21 09:31:26","Android Packaging Problem: resources.ap_ does not exist","<android><eclipse><build><aapt>","13","2","3","",""
"4714736","1","4715110","","2011-01-17 15:18:33","0","780","<p>I send some parameters to my server with httpGet or httpPost and it works fine when my client is connected to my server. But when it's not, my app crash. However, I have a try/catch...</p><p>Look at my code:</p><pre><code> ((ImageButton)findViewById(R.id.pickSurnom)).setOnClickListener(new OnClickListener(){                    public void onClick(View v) {                            AlertDialog.Builder alert = new AlertDialog.Builder(Postit.this);                            alert.setTitle(""Modifier votre surnom"");                            //alert.setMessage(""Message"");                            // Set an EditText view to get user input                             final EditText input = new EditText(Postit.this);                            alert.setView(input);                            alert.setPositiveButton(""Ok"", new DialogInterface.OnClickListener() {                            public void onClick(DialogInterface dialog, int whichButton) {                                    String surnom = input.getText().toString();                                                                 //Recuperation ""id"" du user dans les préférences partagées                                    SharedPreferences prefs = getPreferences(Context.MODE_PRIVATE);                                    String id = prefs.getString(""id"", null);                            //------------------------ENVOI----------------------------                            StringBuffer stringBuffer = new StringBuffer("""");                            BufferedReader bufferedReader = null;                                    try {                                            HttpClient httpClient = new DefaultHttpClient();                                    HttpGet httpGet = new HttpGet();                                    //httpGet.setURI(new URI(""http://192.168.0.1:8888/user/public""+""?""+""surnom=""+((TextView) findViewById(R.id.surnom)).getText().toString()));                                    httpGet.setURI(new URI(""http://192.168.0.1:8888/user""+""?""+""id=""+id+""surnom=""+ surnom ));                                    HttpResponse httpResponse = httpClient.execute(httpGet);                                    bufferedReader = new BufferedReader(                                                                    new InputStreamReader(httpResponse.getEntity().getContent()));                                                    String ligneLue = bufferedReader.readLine();                                                    Toast.makeText(getApplicationContext(), ""id=""+bufferedReader.readLine() , Toast.LENGTH_LONG).show();                                                    while (ligneLue!=null){                                                            stringBuffer.append(ligneLue);                                                            ligneLue = bufferedReader.readLine();                                                             //Si la réponse = True                                                            //Remplir le bon surnom dans le TextView                                                            ((TextView) findViewById(R.id.surnom)).setText(surnom);                    }                            } catch (Exception e){                                    Toast.makeText(getApplicationContext(), ""Connection error"", Toast.LENGTH_LONG).show();                                    Log.e(""Exception1"", e.getMessage());                            } finally {                                    if (bufferedReader !=null){                                            try{                                                    bufferedReader.close();                                                    Toast.makeText(getApplicationContext(), ""Serveur indisponible"" + surnom, Toast.LENGTH_LONG).show();                                            } catch (IOException e){                                                    Log.e(""Exception2"", e.getMessage());                                            }                                    }                            }                            Log.i(""Exception3"", stringBuffer.toString());</code></pre><p>My LogCat</p><pre><code>01-17 15:45:00.801: ERROR/ActivityManager(58): ANR in com.branchu1 (com.branchu1/.Postit)01-17 15:45:00.801: ERROR/ActivityManager(58): Reason: keyDispatchingTimedOut01-17 15:45:00.801: ERROR/ActivityManager(58): Load: 0.5 / 0.18 / 0.0801-17 15:45:00.801: ERROR/ActivityManager(58): CPU usage from 32503ms to 56ms ago:01-17 15:45:00.801: ERROR/ActivityManager(58):   system_server: 19% = 15% user + 3% kernel / faults: 2075 minor01-17 15:45:00.801: ERROR/ActivityManager(58):   ndroid.launcher: 3% = 2% user + 0% kernel / faults: 1554 minor01-17 15:45:00.801: ERROR/ActivityManager(58):   adbd: 1% = 0% user + 0% kernel01-17 15:45:00.801: ERROR/ActivityManager(58):   ndroid.settings: 0% = 0% user + 0% kernel / faults: 124 minor01-17 15:45:00.801: ERROR/ActivityManager(58):   m.android.phone: 0% = 0% user + 0% kernel / faults: 56 minor01-17 15:45:00.801: ERROR/ActivityManager(58):   ronsoft.openwnn: 0% = 0% user + 0% kernel / faults: 43 minor01-17 15:45:00.801: ERROR/ActivityManager(58):   logcat: 0% = 0% user + 0% kernel / faults: 1 minor01-17 15:45:00.801: ERROR/ActivityManager(58):   events/0: 0% = 0% user + 0% kernel01-17 15:45:00.801: ERROR/ActivityManager(58):   android.protips: 0% = 0% user + 0% kernel / faults: 23 minor01-17 15:45:00.801: ERROR/ActivityManager(58):   zygote: 0% = 0% user + 0% kernel / faults: 135 minor01-17 15:45:00.801: ERROR/ActivityManager(58):   .quicksearchbox: 0% = 0% user + 0% kernel / faults: 27 minor01-17 15:45:00.801: ERROR/ActivityManager(58):   id.defcontainer: 0% = 0% user + 0% kernel / faults: 24 minor01-17 15:45:00.801: ERROR/ActivityManager(58):   com.android.mms: 0% = 0% user + 0% kernel / faults: 25 minor01-17 15:45:00.801: ERROR/ActivityManager(58):   m.android.music: 0% = 0% user + 0% kernel / faults: 23 minor01-17 15:45:00.801: ERROR/ActivityManager(58):   d.process.media: 0% = 0% user + 0% kernel / faults: 25 minor01-17 15:45:00.801: ERROR/ActivityManager(58):   m.android.email: 0% = 0% user + 0% kernel / faults: 34 minor01-17 15:45:00.801: ERROR/ActivityManager(58):   com.svox.pico: 0% = 0% user + 0% kernel / faults: 23 minor01-17 15:45:00.801: ERROR/ActivityManager(58):  +com.branchu1: 0% = 0% user + 0% kernel01-17 15:45:00.801: ERROR/ActivityManager(58):  -com.branchu1: 0% = 0% user + 0% kernel01-17 15:45:00.801: ERROR/ActivityManager(58): TOTAL: 33% = 25% user + 8% kernel + 0% softirq</code></pre>","420574","","420574","","2011-01-17 15:45:50","2011-01-17 20:47:37","Why does my app crash when my server is not connected?","<android><exception><try-catch><http-post><http-get>","3","3","","",""
"4714870","1","","","2011-01-17 15:30:31","1","405","<p>I'm trying to terminate task using code like this:</p><pre><code>import androiddroid = android.Android()running = droid.getRunningPackages()[1]for task in running: if (task.find(""skype"") != -1)  droid.forceStopPackages(task)</code></pre><p>this works properly except killing call </p><pre><code>`droid.forceStopPackages(task)` # When we get here, variable `task` contains ""com.skype.raider"" string</code></pre><p>nothing happens after that. I expected that running skype application will be terminated.</p>","578703","","1253428","","2013-08-29 23:13:13","2013-08-29 23:13:13","Android SL4A (Python) Force Stop Packages fails.","<python><android><task><kill><sl4a>","1","0","1","",""
"4714895","1","4718546","","2011-01-17 15:32:52","3","1353","<p>I made a custom <code>ImageView</code> that supports basic scrolling through calls to <code>View.scrollBy()</code> in a <code>GestureDetector</code>. I wanted to add some feedback on the reaching of scrolling bounds so I enabled fading with:</p><pre><code>setVerticalFadingEdgeEnabled(true);setHorizontalFadingEdgeEnabled(true);</code></pre><p>but the fading works as I expected only on top and left edges, while bottom and right ones don't fade. I'm sure those edges aren't off screen because the view is set to fill_parent in height and width. So what's wrong?</p><hr><p>EDIT: enabling only vertical/horizontal fading edges confirms that only top/left edges get drawn. Now I'm trying to read <a href=""http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/core/java/android/view/View.java&amp;q=view&amp;exact_package=git://android.git.kernel.org/platform/frameworks/base.git&amp;d=4&amp;l=6870"" rel=""nofollow"">View.java (6870 an on)</a>...</p>","503900","","503900","","2011-01-17 21:25:04","2011-01-17 22:18:02","fading edges working only on top and left","<android><scrolling><custom-view><fading>","1","0","","",""
"4714921","1","","","2011-01-17 15:35:25","2","721","<p>I'd like to connect to my MongoDB (hosted on <a href=""https://mongohq.com"" rel=""nofollow"">MongoHQ</a>). I get the following error when I want connect to the database (with the Java driver)</p><pre><code>ERROR/AndroidRuntime(597): java.lang.NoClassDefFoundError: com.mongodb.DBPortPoolERROR/AndroidRuntime(597):     at com.mongodb.DBPortPool$Holder.get(DBPortPool.java:52)ERROR/AndroidRuntime(597):     at com.mongodb.DBTCPConnector._set(DBTCPConnector.java:380)ERROR/AndroidRuntime(597):     at com.mongodb.DBTCPConnector.&lt;init&gt;(DBTCPConnector.java:46)ERROR/AndroidRuntime(597):     at com.mongodb.Mongo.&lt;init&gt;(Mongo.java:138)ERROR/AndroidRuntime(597):     at com.mongodb.Mongo.&lt;init&gt;(Mongo.java:124)ERROR/AndroidRuntime(597):     at com.mongodb.Mongo.&lt;init&gt;(Mongo.java:114)ERROR/AndroidRuntime(597):     at xxx.MainActivity$1.onClick(MainActivity.java:29)</code></pre><p>I use the following code:</p><pre><code>Mongo mng = new Mongo(""flame.mongohq.com"", 27073); // &lt;- errorDB mngDb = mng.getDB(""xxx"");mngDb.authenticate(""xxx"", ""xxx"".toCharArray());DBCollection mngColl = mngDb.getCollection(""xxx"");// mText.setText(""Data Count: ""+Long.toString(mngColl.getCount()));</code></pre><p>I added the driver in Eclipse via Properties>Java Build Path>Libraries>Add Externel JAR</p>","568841","","","","","2012-01-10 20:17:51","Android/MongoDB: ""NoClassDefFoundError: com.mongodb.DBPortPool""","<java><android><mongodb>","2","0","","",""
"4714957","1","4743791","","2011-01-17 15:38:00","2","544","<p>I would like to be able to make temporary drawings on top of my view hierarchy without invoking onDraw() events of the hierarchy.  The glass pane works well for this purpose.  Is there an Android equivalent? </p>","426493","","","","","2011-01-20 05:36:54","Is there an Android equivalent of Java's glass pane?","<android>","1","1","","",""
"4715032","1","","","2011-01-17 15:46:41","0","2553","<p>My app. fails on the line:</p><pre><code>File temp = File.createTempFile(“mediaplayertmp”, “dat”);</code></pre><p>throws <code>“Permission denied”</code> exception.</p><p>Why could this occur?It sounds like I need to change some kind of Java setting to designate a “<code>remp</code>” folder.</p><p>Thanks!</p>","578716","","603744","","2011-06-15 05:02:47","2011-06-15 05:02:47","createTempFile throws ""Permission denied"" exception","<android><eclipse>","3","0","","",""
"4715044","1","4717173","","2011-01-17 15:48:27","18","37985","<p>I have my application that is displaying images with different ratio, resized inside (centerInside) imageView. What I need is to create bitmap from the ImageView including the background (black in this case). </p><p>So for example I have device screen 320x480, full screen imageView with image resized to 280x480. How could I get 320x480 bitmap from it? </p><p>On top of this imageview I have some logos or buttons that I don't want to include to bitmap, they're like on top layer. All I need is bitmap with image and black border from some sides.</p>","475861","","","","","2013-06-25 02:16:45","Android: how to convert whole ImageView to Bitmap?","<android><image><bitmap><screen><imageview>","4","0","10","",""
"4715047","1","","","2011-01-17 15:48:45","0","318","<p>I have this code but the toast wont display any message what is wrong with my code.. I can get the value from link, linknext but title wont bring out any value. ( I am not very bright with writing code so please suggest anything you may feel like.</p><pre><code>        final Button button = (Button) findViewById(R.id.Button01);    button.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            // Perform action on click            try {                URL url = new URL(                        ""http://somelink.com="" + Link.setFirst_link);                DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();                DocumentBuilder db = dbf.newDocumentBuilder();                Document doc = db.parse(new InputSource(url.openStream()));                doc.getDocumentElement().normalize();                NodeList nodeList = doc.getElementsByTagName(""item"");                /** Assign textview array lenght by arraylist size */                for (int i = 0; i &lt; nodeList.getLength(); i++) {                    Node node = nodeList.item(i);                    Element fstElmnt = (Element) node;                    NodeList nameList = fstElmnt.getElementsByTagName(""link"");                    Element nameElement = (Element) nameList.item(0);                    nameList = nameElement.getChildNodes();                    String img = (((Node) nameList.item(0)).getNodeValue());                    NodeList websiteList = fstElmnt.getElementsByTagName(""linknext"");                    Element websiteElement = (Element) websiteList.item(0);                    websiteList = websiteElement.getChildNodes();                    String nextlink = (((Node) websiteList.item(0)).getNodeValue());                    Link.setFirst_link = nextlink;                    Drawable drawable = LoadImageFromWebOperations(img);                    imgView.setImageDrawable(drawable);                    NodeList titleList = fstElmnt.getElementsByTagName(""title"");                    Element titleElement = (Element) titleList.item(0);                    websiteList = titleElement.getChildNodes();                    String title = (((Node) titleList.item(0)).getNodeValue());                    Context context = getApplicationContext();                    CharSequence text = title;                    int duration = Toast.LENGTH_SHORT;                    Toast toast = Toast.makeText(context, text, duration);                    toast.show();                }            } catch (Exception e) {                System.out.println(""XML Pasing Excpetion = "" + e);            }        }    });    /** Set the layout view to display </code></pre><p>*/    }</p><p>Here is the xml file</p><pre><code>&lt;?xml version=""1.0""?&gt; &lt;maintag&gt;   &lt;item&gt;     &lt;link&gt;http://image.com/357769.jpg?40&lt;/link&gt;     &lt;linknext&gt;http://www.image.com&lt;/linknext&gt;     &lt;title&gt;imagename&lt;/title&gt;   &lt;/item&gt; &lt;/maintag&gt; </code></pre>","578720","","","","","2011-01-17 15:57:29","Parsing XML wont display all items","<java><android><xml><parsing>","1","0","1","",""
"4715078","1","4716001","","2011-01-17 15:52:45","0","506","<p>I have an little issues with an ListView component, when I click on a row the Application capture the touch event but but the row isn't focused!</p><p>Any ideas?</p><p>This is the XML of 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:id=""@+id/categoriestab_main""                             android:orientation=""vertical""                             android:layout_width=""fill_parent""                             android:layout_height=""fill_parent""                             android:background=""#FFFFFFFF""                             &gt;                    &lt;ListView                            android:id=""@+id/categorieslist""                            android:layout_width=""fill_parent""                             android:layout_height=""fill_parent""                            android:background=""#FFFFFFFF""                            android:cacheColorHint=""#FFFFFFFF""                    /&gt;             &lt;/LinearLayout&gt;  </code></pre><p>And this is a layout of a single row:</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=""#FFFFFFFF""    &gt;      &lt;ImageView            android:id=""@+id/category_image""            android:layout_width=""60dp""            android:layout_height=""40dp""            android:src=""@drawable/no_foto""        /&gt;         &lt;TextView            style=""@style/categories_title""            android:id=""@+id/category_name""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:singleLine=""true""               android:layout_toRightOf=""@id/category_image""            android:layout_centerVertical=""true""            android:layout_marginLeft=""10dp""        /&gt;&lt;/RelativeLayout&gt;</code></pre>","554892","","1166813","","2012-08-30 19:18:20","2012-08-30 19:18:20","ListView issues","<android><android-listview><listviewitem>","1","2","","",""
"4715085","1","4745905","","2011-01-17 15:53:28","1","264","<p>I am trying to impliment what most media players have, a way of displaying the total time for an audio track as well as the time which it is currently at (which is increased every second). I'm pretty sure I have to use threads but i'm not sure how. I have the audio track saved on the sd card and when it comes to be played all the data put into a short array.</p><p>Ideally I would also like to be able to show the progress using a progressBar, I don't think it would be a massive step to go from displaying it in TextViews to a progress bar. I have looked around on the internet and all the examples (vague as they are) I have found have used MediaPlayer but as i'm using audioTrack it makes it much more difficult I guess. There is no way in my app I can use MediaPlayer to do what I want to do with the audio.</p><p>Can anybody help me out or point me in the right direction?</p>","400406","","","","","2014-02-22 16:07:55","Return the length in seconds of a track to be played using AudioTrack","<java><android><audio><audio-streaming>","2","0","","",""
"4715150","1","","","2011-01-17 16:00:50","0","734","<p>I want to show a status bar notification which contains two texts and one progress bar of a track playing in the background to show the playback progress.  This should be updated every second.</p><p>I am currently using a RemoteViews which contains a ProgressBar, and two TextViews, and I am updating them using RemoteViews.setTextViewText() and RemoteViews.setProgressBar(), then calling NotificationManager.notify() to show the updates on the notification bar.  This works fine, but it gets very slow by time, I saw in the LogCat that it is producing huge amount of garbage and it seems that it is taking too long to collect it.</p><p>Any ideas on how to implement this in a better way?</p><p>Thanks</p>","578741","","","","","2011-01-18 11:58:08","Android Notification timer","<android><notifications><notificationmanager>","1","0","","",""
"4715231","1","","","2011-01-17 16:08:37","1","1131","<p>Okay, I have a strange problem I haven't seen listed anywhere.  I'm developing an android app and I would like to run it on my Huawei Ascend.  I have set up a file in /etc/udev/90-android.rules with the line:</p><p>SUBSYSTEM==""usb"", SYSFS{idVendor}==""12d1"", MODE=""0666""</p><p>where '12d1' is the correct vendor ID for this phone (I verified this with 'lsusb' command).</p><p>When I plug in the phone (it does have debugging on) and restart the adb server I get a connection but the name field does not get set.   The output to 'adb devices' is:</p><pre><code> List of devices attached \n ????????????    device</code></pre><p>Plugging and unplugging the cable doesn't resolve this.  Neither does restarting the adb server.  Nor does a total reboot of both my computer or the phone.</p><p>This is fine as I can get logs and a shell.  The problem is that in the eclipse plugin, the device's name is list as ""????????????"" and so when it tries connect, it quits with an error message of 'device not found' even though the device is listed and 'online'.  Is there something else I need to do?  Do I need to set the name of the device somehow?</p><pre><code>              cocofan</code></pre><p>P.S.:  The app has 'debuggable' set to true in the manifest file.</p>","578755","","","","","2012-02-19 13:24:37","adb doesn't get phone's device name/number","<android>","3","1","","",""
"4715242","1","4715275","","2011-01-17 16:09:40","1","3217","<p>How do i delete a whole table in android through code?</p>","569654","","","","","2011-01-17 16:25:54","How To delete a table","<android>","2","5","","",""
"4715250","1","4720069","","2011-01-17 16:10:10","26","33055","<p>I write an application that attempts to modify phone call state. It works well on Android 2.2 or less, but throw an exception on Android 2.3 because of the lack of permission on   android.permission.MODIFY_PHONE_STATE permission (I declared this permission on AndroidManifest.xml). Any idea? Below is the exception log:</p><pre><code>01-15 09:14:23.210: ERROR/AndroidRuntime(404): FATAL EXCEPTION: main01-15 09:14:23.210: ERROR/AndroidRuntime(404): java.lang.RuntimeException: Unable to start receiver test.PhoneReceiver: java.lang.SecurityException: Neither user 10031 nor current process has android.permission.MODIFY_PHONE_STATE.01-15 09:14:23.210: ERROR/AndroidRuntime(404):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:1780)01-15 09:14:23.210: ERROR/AndroidRuntime(404):     at android.app.ActivityThread.access$2400(ActivityThread.java:117)01-15 09:14:23.210: ERROR/AndroidRuntime(404):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:978)01-15 09:14:23.210: ERROR/AndroidRuntime(404):     at android.os.Handler.dispatchMessage(Handler.java:99)01-15 09:14:23.210: ERROR/AndroidRuntime(404):     at android.os.Looper.loop(Looper.java:123)01-15 09:14:23.210: ERROR/AndroidRuntime(404):     at android.app.ActivityThread.main(ActivityThread.java:3647)01-15 09:14:23.210: ERROR/AndroidRuntime(404):     at java.lang.reflect.Method.invokeNative(Native Method)01-15 09:14:23.210: ERROR/AndroidRuntime(404):     at java.lang.reflect.Method.invoke(Method.java:507)01-15 09:14:23.210: ERROR/AndroidRuntime(404):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)01-15 09:14:23.210: ERROR/AndroidRuntime(404):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)01-15 09:14:23.210: ERROR/AndroidRuntime(404):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","301132","","301132","","2012-07-13 12:44:33","2013-07-19 08:52:52","How to grant MODIFY_PHONE_STATE permission for apps ran on Gingerbread","<android><exception><permissions><telephony>","5","1","22","",""
"4715318","1","4716953","","2011-01-17 16:17:18","0","487","<p>This question is about the concept of what I am attempting to code.</p><p>I Have an Activity ""public class Board extends Activity {"" which has ""setContentView(myBoard)"" where myBoard is an instance of ""class NewBoard extends View implements OnTouchListener{""NewBoard draws graphics with onDraw and also draws graphical buttons. A click on a button called ""Solve"" makes a call to another class""public class SKO {"" which has no visual componants and does a calcuation, the results of which are redrawn by the graphic view.</p><p>This all works well.</p><p>I now want to call a Dialog from more graphically drawn buttons on the NewBoard View.</p><p>In the ""top"" class - Board, I have suitable code in""protected Dialog onCreateDialog(int id) {""I know this code is good because if I add a showDialog(int),(an Alertdialog with a cancel button) to the onCreate of Board,then on running the class Board, the dialog comes up, and when cancelled, my graphics are working underneath.</p><p>My problem is <strong><em>*</em>**<em>*</em></strong> </p><p>that I can't find a way to call the showDialog(int) within Board from my graphics View (NewBoard).</p><p>I have tried adding the ""protected Dialog onCreateDialog(int id) {"" to my graphics View (NewBoard) but I believe it can only be added to an activity.I would very much appreciate some advice.</p>","578689","","21234","","2011-01-17 16:36:06","2011-01-17 19:22:29","How to access a dialog from a view?","<android><dialog>","1","1","1","",""
"4715328","1","4761415","","2011-01-17 16:18:12","0","1118","<p>I manage to active the native heap tab in ddms, but columns were not updated. So  I set libc.debug.malloc to 1 and try to restart the emulator (2.2), but the reboot failded.Any suggestion in order to fix?</p><p>thanks in advance.emanuele</p>","501696","","","","","2011-01-21 16:47:52","native heap and ddms","<android><memory><heap><ddms>","1","0","","",""
"4715593","1","4715679","","2011-01-17 16:45:22","2","7968","<p>I'm a relatively new Android developer and I noticed what seems like an oddity to me that I'm hoping someone can explain. I have LinearLayout ll. </p><p>This line of code fails for me when executed:</p><pre><code>ll.setBackgroundColor(R.color.white);</code></pre><p>However this line of code works:</p><pre><code>ll.setBackgroundResource(R.color.white);</code></pre><p>I assume its simply because I have white defined in my resources. However, I've also tried passing 0xFFFFFF in setBackgroundColor() and that doesn't work either.</p><p>Similarly with my TextView text this line of code fails when executed:</p><pre><code>text.setTextColor(R.color.white);</code></pre><p>I can see my TextView so I know I initialized it correctly (like my LinearLayout which I can also see). So I guess my question boils down to: How do I properly use LinearLayout.setBackgroundColor() and TextView.setTextColor() ?</p><p>Thanks a ton in advance. I've read through the docs and tried to find information online via googling and haven't come up with anything.</p>","473481","","","","","2014-01-06 18:14:10","Changing Color with LinearLayout and TextView in Java (Android)","<java><android><android-widget><android-layout>","3","0","1","",""
"4715648","1","4715920","","2011-01-17 16:51:25","0","356","<p>I would like to know if there is an issue with calling a sharedPeference value  on an appWidget provider class so i can use it for an update. I have this code which i call on a method in the  appWidget provider class, but it keeps giving me compilation error and that i should create a method for it. this is the code:</p><pre><code>prefs = getSharedPreference(""myPrefs"", Context.MODE_PRIVATE);</code></pre><p>is this a known issue and is there any other way i can pass the value from my configuration class, if this is not possible. Thank you</p>","447570","","","","","2011-01-17 17:19:18","Calling SharedPrefences on AppWidget","<android>","2","0","","",""
"4715673","1","4986157","","2011-01-17 16:53:58","1","2320","<p>I'm trying to develop an Android RSS Reader. I would like to use android.sax to read some information from a rss but I'm not sure how to do it. I need a tutorial about android.sax or some example about it. Can somebody help me please?</p>","495239","","","","","2012-11-23 04:45:19","Android RSS reader","<android>","2","0","2","",""
"4715710","1","","","2011-01-17 16:57:15","0","1200","<p>So I am trying to stream a webcam feed from my computer to my android phone.  I am using a simple forwarding server to connect the two so that I don't have to worry about home network IP firewalls ect.  I am using FMJ to capture the video feed and was thinking rtsp protocol would be best because android supports reading it.  My problem is I dont know how to forward the information via the server, is it as simple as forwarding UDP packets?  all programs involved are implemented in java btw.</p>","578797","","","","","2012-12-12 00:06:18","rtsp server forwarding","<java><android><video-streaming><rtsp>","2","0","","",""
"4715826","1","4796633","","2011-01-17 17:09:53","3","2880","<p>I need to read the pitch value (how much the phone is tilted backwards and forwards) both in portrait and landscape modes. using the code bellow in portrait I get my value from value[1] with 0.0 when phone stay laying flat with face up, -90 when standing upright and 180 when lying flat on the device face. All great till now...The problem comes when the device is in landscape mode. At this point I'm using value[2] to measure device tilt, but the problem is with the values : 0 when the phone stay laying flat (OK) rise to 90 when it is standing upright (OK), but when I continue the movement the value drop again below 90 (80, 75, etc...), so basically I can't differentiate between these 2 positions as the values are identical.So, what I'm doing wrong, what other values from the sensors I can read in order to have a full picture of the device tilt both in landscape and portrait mode ? </p><p>Same questoion as here: <a href=""http://groups.google.com/group/android-beginners/browse_thread/thread/c691bbac3e294c7c?pli=1"" rel=""nofollow"">http://groups.google.com/group/android-beginners/browse_thread/thread/c691bbac3e294c7c?pli=1</a></p><p>I Have the following code :</p><pre><code>private void ReadOrientationSensor(){ final SensorManager sensorManager; final TextView text = (TextView) this.findViewById(R.id.TextView01);sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);Sensor sensor = sensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION);SensorEventListener listener = new SensorEventListener() {    @Override    public void onAccuracyChanged(Sensor sensor, int accuracy) {    }    @Override    public void onSensorChanged(SensorEvent event) {        float x,y,z;        x=event.values[0];        y=event.values[1];        z=event.values[2];        //text.setText(String.valueOf(event.values[0]));        text.setText(""x: "" + x + "" y: "" + y + "" z: "" + z);        }    };        sensorManager.registerListener(listener, sensor,SensorManager.SENSOR_DELAY_FASTEST);</code></pre><p>}</p>","467780","","467780","","2011-01-17 18:20:35","2011-01-27 09:12:07","Pitch problems in landscape mode","<android><landscape><sensor><pitch><tilt>","1","0","1","",""
"4715840","1","4716662","","2011-01-17 17:11:19","3","7463","<p>All,</p><p>After I noticed how slow <code>getPixel</code> and <code>setPixel</code> are (not sure which one, guess both are not turbocharged) I quickly coded a container for <code>Bitmap</code> that uses <code>int[]</code> array to handle bitmap operations. </p><p>Already - its noticeably faster, but this is not enough. Please could you advice how to speed it up further? </p><p>My idea is to keep track of what is made ""dirty"" by the <code>setPixel</code> functions and update only this part of <code>Bitmap</code> when <code>getBitmap()</code> is called ... not clear on how to set the <code>setPixels</code> parameters though (something with offset and stride I guess). </p><p>Also - any faster recipe? </p><p>Thanks for all help in advance!</p><pre><code>import android.graphics.Bitmap;public class DrawableBitmapContainer {private Bitmap image;private int width, height;private int[]  pixels;public DrawableBitmapContainer(Bitmap _source ){    image = _source;    width = image.getWidth();    height = image.getHeight();    pixels = new int[width*height];    image.getPixels(pixels,0,width,0,0,width,height);}public int getPixel(int x,int y){    return pixels[x+y*width];}public void setPixel(int x,int y, int color){    pixels[x+y*width]=color;}public Bitmap getBimap(){    image.setPixels(pixels,0,width,0,0,width,height);    return image;}public int getWidth(){    return image.getWidth();}public int getHeight(){    return image.getHeight();}}</code></pre>","206885","","638994","","2012-12-07 15:26:17","2013-07-25 16:29:09","improving speed of getpixel() and setpixel() on Android Bitmap","<java><android><performance><bitmap>","2","2","2","",""
"4715865","1","4716715","","2011-01-17 17:13:45","20","20063","<p>I understand how to get a list of paired devices but how can I tell if they are connected? </p><p>It must be possible since I see them listed in my phone's Bluetooth device list and it states their connection status.</p>","420008","","","","","2013-08-02 02:53:35","How to programmatically tell if a Bluetooth device is connected? (Android 2.2)","<android>","3","0","14","",""
"4715987","1","","","2011-01-17 17:26:54","0","274","<p>Is there any port or library of augmented reality for j2me? If someone has encountered this please let me know. How can I modify the android activity sample and its activity name?</p>","524021","","899344","","2012-08-18 01:07:47","2012-08-18 01:07:47","j2me + augmented reality?","<android><java-me><augmented-reality>","0","2","1","",""
"4716010","1","","","2011-01-17 17:29:39","0","483","<p>I am writing an app that dynamically creates a midi file which I then want to play. Each time I press a button in my app a new midi file is created and written to external storage. I then want the app to read that file and play it. I am using SoundPool to play the file. However, from the samples I have found, SoundPool is initialized during onCreate and therefore my file is only read once. Meaning the same file is played everytime I hit the button regardless of any changes I make to it. I have tried moving the SoundPool initialisation into my Audio1ButtonHandler method but then I get no sound or get a selection of “sample x not ready” errors. The relevant code from my app is here:</p><pre><code>public void onCreate(Bundle savedInstanceState) {            …………  soundPool = new SoundPool(1, AudioManager.STREAM_MUSIC, 0);        soundPoolMap = new HashMap&lt;Integer, Integer&gt;();        soundPoolMap.put(SOUNDPOSITION, soundPool.load(""/sdcard/test.mid"", 1));    }public void Audio1ButtonHandler(View target) {      ArrayList&lt;Integer&gt; chord = new ArrayList&lt;Integer&gt;();      chord = Chord.calculateChord(kSelection, cSelection);      for (int i = 0; i &lt; chord.size(); i++) {            System.out.println(""chord value is "" + chord.get(i).toString());      }      Midi.createMidiFile(chord);        playSound();        releaseSound();     }public void playSound() {        AudioManager mgr = (AudioManager)getSystemService(Context.AUDIO_SERVICE);        float streamVolumeCurrent = mgr.getStreamVolume(AudioManager.STREAM_MUSIC);        float streamVolumeMax = mgr.getStreamMaxVolume(AudioManager.STREAM_MUSIC);        float volume = streamVolumeCurrent / streamVolumeMax;         soundPool.play(soundPoolMap.get(SOUNDPOSITION), volume, volume, 1, 0, 1f);       }public void releaseSound() {        soundPoolMap.clear();        soundPool.release();       }</code></pre><p>As you can see I have tried to release the resources (within releaseSound) to try and force them to be re-read but to no avail.</p><p>Any pointers would be greatly received.Thanks</p>","578856","","526217","","2011-09-02 17:31:38","2011-09-28 07:16:17","Dynamically re-reading a midi file","<android>","1","0","","",""
"4716025","1","4716082","","2011-01-17 17:32:09","1","920","<p>So I am trying to get my layout to look like this:</p><pre>| button       text       button |</pre><p>So that the text is centered between my two buttons. I first tried using LinearLayouts and layout_gravity tags, but that would give me something like:</p><pre>|        buttontextbutton        |</pre><p>and now I have a relative layout with alignParentLeft/Right and centerInParent tags but the layout now looks like</p><pre>| button text buttonnnnnnnnnnnnn |</pre><p>Is there a way to get my layout right with text that changes lengths?</p><p>Thanks,Jake</p>","399306","","","","","2011-01-17 17:54:21","Android layout alignment issues","<android><android-layout>","3","0","1","",""
"4716068","1","4716112","","2011-01-17 17:38:15","-3","296","<p>I need this program running today it reads in a file of phone numbers and it text everyone in the file.  I am getting a error on the file read. Can you please help me ASAP</p><pre><code>package com.smith.johnathan.jssms;//import android.telephony.SmsManager;import android.telephony.gsm.SmsManager;import android.util.Log;import android.widget.Button;import java.io.InputStream;import java.io.InputStreamReader;import java.io.BufferedReader;import android.util.LogPrinter;import java.io.*;import android.app.Activity;import android.app.PendingIntent;import android.content.Context;import android.content.Intent;import android.widget.TextView;import android.os.*;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.Toast;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.Toast;public class JSSMS extends Activity {  public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button button = (Button) findViewById(R.id.Button01);        button.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                Toast.makeText(JSSMS.this, ""Starting SMS"",                               Toast.LENGTH_SHORT).show();                SmsManager sm = SmsManager.getDefault();                String message = ""TESTING JS-JSS"";                String number;                try {                    // open the file for reading                    InputStream instream = openFileInput(Environment.getExternalStorageDirectory().toString()                      + ""/numbers.txt"");                    // prepare the file for reading                    InputStreamReader inputreader = new InputStreamReader(instream);                    BufferedReader buffreader = new BufferedReader(inputreader);                                                                                while ((number = buffreader.readLine()) != null)                                                                                 {                                                                                                Toast.makeText(JSSMS.this, ""Sending text to:"" + number, Toast.LENGTH_SHORT).show();                                                                                                sm.sendTextMessage(number, null, message, null,        null);                                                                                }                                                                instream.close();                                                                } catch (java.io.FileNotFoundException e) {                                                                                Toast.makeText(JSSMS.this,e.toString(), Toast.LENGTH_SHORT).show();                                                } catch (Exception e) {                                                                Toast.makeText(JSSMS.this,e.toString(), Toast.LENGTH_SHORT).show();                                                }                                                                Toast.makeText(JSSMS.this, Environment.getExternalStorageDirectory().toString()                                                                                                + ""/numbers.txt"", Toast.LENGTH_SHORT).show();                                                }         });           }}</code></pre>","2144370","","167958","","2011-01-17 17:43:31","2011-01-17 17:45:20","Will you please help me with this Android based program to text a list of SMS programs?","<java><android><sms>","1","10","","2011-01-17 22:23:17",""
"4716080","1","","","2011-01-17 17:40:18","0","242","<p>I have a simple ListView and I have created a String array in the class and populated the array during the a custom createAdapter method.  The list works fine, but inside the onListItemClick event I can't access the array.</p><p>Is there a way to access the array?</p>","578866","","","","","2011-01-17 17:44:59","Can't access android class variable inside onListItemClick event","<android><events><listview>","1","2","","",""
"4716133","1","","","2011-01-17 17:47:42","0","200","<p>Im using the media recorder in a service. The media recorder will work fine for short calls, but when the call is about 5 min the phone will shut off and restart itself. Im not sure how to get the logs because i cant test the media recorder in the emulator and also whenever im debugging with usb connected to the phone it wont shut off. It only shuts off when its completely disconnected. </p><p>Ive tried to get the logs but when the phone shuts off the only logs i can receive when it comes back on is the logs for the phone starting up. Can anyone offer any insight or assistance in either getting the logs or even sharing any similar experiences or fixes with the media recorder. </p><p>Also I have an LG Optimus T with 2.2</p>","356494","","179850","","2011-02-21 19:12:42","2011-11-02 18:05:42","Android phone shutting off while using mediarecorder and cannot get logs","<android>","1","1","","",""
"4716194","1","4716466","","2011-01-17 17:54:38","2","1658","<p>How can I get notified when a layout pass has finished? Is there something like <code>onLayoutFinished()</code> that I can implement or override somewhere?</p><p>From the <a href=""http://developer.android.com/reference/android/view/View.html"" rel=""nofollow"">View</a> javadoc:</p><blockquote>  <p>Layout is a two pass process: a  measure pass and a layout pass. The  measuring pass is implemented in  measure(int, int) and is a top-down  traversal of the view tree. Each view  pushes dimension specifications down  the tree during the recursion. At the  end of the measure pass, every view  has stored its measurements. The  second pass happens in layout(int,  int, int, int) and is also top-down.  During this pass each parent is  responsible for positioning all of its  children using the sizes computed in  the measure pass.</p></blockquote><p>What I'd like is to execute some logic after the ""second pass"" has finished. In particular, I want to make some changes to a view, and then make changes to another view that depend of the frame (position and size) of the first view.</p>","143378","","143378","","2011-01-17 18:01:07","2011-01-17 18:25:22","Listen for layout changes in Android","<android><layout><view><android-layout>","1","0","2","",""
"4716302","1","4718827","","2011-01-17 18:08:09","2","6982","<p>I am developing a 2D platformer game for the android platform, so I don't really care about the screen DPI, but much more about the actual resolution in pixels. From what I've gathered on the net, there are a couple of different resolutions (and aspect ratios) present. According to my search, the two resolutions that are currently widespread are 480x320 (1.5) and 800x480 (1.666), is that right? I'd like to target these two resolutions to reach most customers.Now, I can deal with the different aspect ratios by showing a black border of 40 pixel for the bigger display, essentialy reducing it to 720x480 pixel and a ratio of 1.5.</p><p>The problem with my game is that it is essential for gameplay that the players see the same amount of the world on each screen. Otherwise, some players would get an unfair advantage. Furthermore, I trigger some events depending on the visibility. For example, an enemy is only allowed to start shooting when the player starts seeing it. Otherwise, the enemies' bullets would seem to come from nowhere.</p><p>So I figured I need to either create my graphics for one resolution and scale them for the other. Or I create separate graphics for each resolution. Is that right? Unfortunately, both ways are suboptimal for pixel graphics.</p><p>On another note: How can I restrict my game to these resolutions only (especially for the Android Market)? I know about the ""supports-screens"" tag in the manifest, but that works depending on the effective screen-size, not the size in pixel, or am I mistaken?I am also interested in personal experiences of other android game developers when it comes to resolution independence.</p><p>Thanks!</p>","184619","","184619","","2011-01-17 20:57:24","2011-01-17 23:02:21","Dealing with different resolutions for pixel based android game","<java><android><screen-resolution>","2","1","2","",""
"4716482","1","4716687","","2011-01-17 18:26:27","1","4828","<p>In my onCreate() method, I'm instantiating an ImageButton View:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.layout_post);    final ImageButton ib = (ImageButton) findViewById(R.id.post_image);...</code></pre><p>In onResume, I want to be able to change the properties of the ImageButton with something like:@Overrideprotected void onResume() {    super.onResume();    ib.setImageURI(selectedImageUri);} //END onResume</p><p>But onResume doesn't have access to the ib ImageButton object.  If this were a variable, I'd simple make it a class variable, but Android does not allow you to define View object in the class.</p><p>Any suggestions on how to do this?</p>","351272","","351272","","2011-01-17 22:03:19","2013-07-31 17:29:45","Android - How can I access a View object instantiated in onCreate in onResume?","<java><android><views>","3","1","","",""
"4716572","1","","","2011-01-17 18:36:33","1","1014","<p>I'm having an issue regarding the Android browser. Not an Android app but a regular HTML5/CSS3 webpage involved webkit based CSS3 animation. Simple enough, I just want a div/section to fade in on the screen. Method I'm showing below works in iOS browser's but not Android browsers. What happens here is the fade in does occur and then the object disappears instead of sticking on the screen:</p><pre><code>section {width: 480px;height: 100px;overflow: hidden;position: absolute;left: 0px;top: 0px;background-image: url(images/home/bkg.jpg);background-repeat: no-repeat;background-position: 0px 0px;z-index: 1;-o-animation-name: fadeIn;-o-animation-duration: 1s;-o-animation-delay: 0s;    -o-animation-fill-mode: both;-moz-animation-name: fadeIn;-moz-animation-duration: 1s;-moz-animation-delay: 0s;    -moz-animation-fill-mode: both;-webkit-animation-name: fadeIn;-webkit-animation-duration: 1s;-webkit-animation-delay: 0s;    -webkit-animation-fill-mode: both;</code></pre><p>}</p>","578926","","","","","2011-04-04 07:32:06","Android/HTML5/CSS3 Fade In issues","<android><browser><html5><webkit><css3>","1","1","","",""
"4716691","1","","","2011-01-17 18:50:05","0","274","<p>I have a serious problem, I'm developing an application that mesures on call time during a call; the problem presents when, with the phone on the ear, the thread that the timer has, blocks and no longer responds before taking off my ear. The next log shows the problem.</p><p>01-11 16:14:19.607 14558 14566 I Estado  : postDelayed Async Service</p><p>01-11 16:14:20.607 14558 14566 I Estado  : postDelayed Async Service</p><p>01-11 16:14:21.607 14558 14566 I Estado  : postDelayed Async Service</p><p>01-11 16:14:22.597 14558 14566 I Estado  : postDelayed Async Service</p><p>01-11 16:14:23.608 14558 14566 I Estado  : postDelayed Async Service</p><p>01-11 16:14:24.017  1106  1106 D iddd    : select() &lt; 0, Probably a handled signal: Interrupted system call</p><p>01-11 16:14:24.607 14558 14566 I Estado  : postDelayed Async Service</p><p>01-11 16:18:05.500  1106  1106 D iddd    : select() &lt; 0, Probably a handled signal: Interrupted system call</p><p>01-11 16:18:06.026 14558 14566 I Estado  : postDelayed Async Service</p><p>01-11 16:18:06.026 14558 14566 I Estado  : postDelayed Async Service</p><p>01-11 16:18:06.026 14558 14566 I Estado  : postDelayed Async Service</p><p>01-11 16:18:06.026 14558 14566 I Estado  : postDelayed Async Service</p><p>01-11 16:18:06.026 14558 14566 I Estado  : postDelayed Async Service</p><p>01-11 16:18:06.026 14558 14566 I Estado  : postDelayed Async Service</p><p>I've been trying with Services, Timers, Threads, AyncTasks and they all present the same problem.</p><p>My Code:</p><pre><code>    @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.main);  HangUpService.setMainActivity(this); objHangUpService = new Intent(this, HangUpService.class);     Runnable rAccion = new Runnable() {      public void run() {          TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);          tm.listen(mPhoneListener, PhoneStateListener.LISTEN_CALL_STATE);          objVibrator = (Vibrator) getSystemService(getApplicationContext().VIBRATOR_SERVICE);          final ListView lstLlamadas = (ListView) findViewById(R.id.lstFavoritos);          final EditText txtMinutos = (EditText) findViewById(R.id.txtMinutos);          final EditText txtSegundos = (EditText) findViewById(R.id.txtSegundos);       ArrayList&lt;Contacto&gt; cContactos = new ArrayList&lt;Contacto&gt;();          ContactoAdapter caContactos = new ContactoAdapter(HangUp.this, R.layout.row,cContactos);          Cursor curContactos =  getContentResolver().query(            ContactsContract.Contacts.CONTENT_URI,            null,            null,            null,            ContactsContract.Contacts.TIMES_CONTACTED + "" DESC"");          while (curContactos.moveToNext()){        String strNombre = curContactos.getString(curContactos.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));        String strID = curContactos.getString(curContactos.getColumnIndex(ContactsContract.Contacts._ID));        String strHasPhone=curContactos.getString(curContactos.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER));        String strStarred=curContactos.getString(curContactos.getColumnIndex(ContactsContract.Contacts.STARRED));           if (Integer.parseInt(strHasPhone) &gt; 0 &amp;&amp; Integer.parseInt(strStarred) ==1 ) {            Cursor CursorTelefono = getContentResolver().query(                  ContactsContract.CommonDataKinds.Phone.CONTENT_URI,                   null,                   ContactsContract.CommonDataKinds.Phone.CONTACT_ID +"" = "" + strID,                   null, null);            while (CursorTelefono.moveToNext()) {             String strTipo=CursorTelefono.getString(CursorTelefono.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE));             String strTelefono=CursorTelefono.getString(CursorTelefono.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));             strNumero=strTelefono;              String args[]=new String[1];                  args[0]=strNumero;             Cursor CursorCallLog = getContentResolver().query(                 android.provider.CallLog.Calls.CONTENT_URI,                  null,                  android.provider.CallLog.Calls.NUMBER + ""=?"",                 args,                  android.provider.CallLog.Calls.DATE+ "" DESC"");             if (Integer.parseInt(strTipo)==2)             {                 caContactos.add(                     new Contacto(                      strNombre,                                   strTelefono                     )                    );             }            }            CursorTelefono.close();           }          }           curContactos.close();          lstLlamadas.setAdapter(caContactos);             lstLlamadas.setOnItemClickListener(new OnItemClickListener() {          @Override          public void onItemClick(AdapterView a, View v, int position, long id) {           Contacto mContacto=(Contacto)lstLlamadas.getItemAtPosition(position);           i = new Intent(HangUp.this, Llamada.class);           Log.i(""Estado"",""Declaro Intent"");           Bundle bundle = new Bundle();               bundle.putString(""telefono"", mContacto.getTelefono());           i.putExtras(bundle);           startActivityForResult(i,SUB_ACTIVITY_ID);                             Log.i(""Estado"",""Inicio Intent"");           blActivo=true;           try {                String strMinutos=txtMinutos.getText().toString();                String strSegundos=txtSegundos.getText().toString();                if(!strMinutos.equals("""") &amp;&amp; !strSegundos.equals("""")){                 int Tiempo = (                   (Integer.parseInt(txtMinutos.getText().toString())*60) +                    Integer.parseInt(txtSegundos.getText().toString())                   )* 1000;                 handler.removeCallbacks(rVibrate);                 cTime = System.currentTimeMillis();                 cTime=cTime+Tiempo;                 objHangUpAsync = new HangUpAsync(cTime,objVibrator,objPowerManager,objKeyguardLock);                 objHangUpAsync.execute();                 objPowerManager.userActivity(Tiempo+3000, true);                 objHangUpService.putExtra(""cTime"", cTime);   //startService(objHangUpService);           } catch (Exception e) {            e.printStackTrace();           } finally {           }          }          });         }     };    }        </code></pre><p>AsyncTask:</p><pre><code>@Overrideprotected String doInBackground(String... arg0) {  blActivo = true;  mWakeLock = objPowerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, ""My Tag"");  objKeyguardLock.disableKeyguard();  Log.i(""Estado"", ""Entro a doInBackground"");  timer.scheduleAtFixedRate(   new TimerTask() {    public void run() {    if (blActivo){     if (cTime&lt;System.currentTimeMillis()){      blActivo=false;      objVibrator.vibrate(1000);      Log.i(""Estado"",""Vibrar desde Async"");      this.cancel();     }else{      try{        mWakeLock.acquire();                           mWakeLock.release(); Log.i(""Estado"",""postDelayed Async Service"");      }catch(Exception e){        Log.i(""Estado"",""Error: "" + e.getMessage());      }     }    }   }   }, 0, INTERVAL);  return null; } </code></pre>","578875","","234039","","2011-01-17 19:24:25","2011-01-17 19:24:25","Thread Blocks During Call","<android><multithreading><service><timer><android-asynctask>","1","0","","",""
"4716750","1","","","2011-01-17 18:57:25","0","241","<p>When computing 2 doubles, 1/81 on the android platform, 0.01234567* was returned. What does the asterisk mean and how can I avoid such an output?</p><pre><code>a=Double.parseDouble(subexp.substring(ss, i));b=Double.parseDouble(subexp.substring(i+1, se+1));subexp=subexp.substring(0,ss).concat(Double.toString(a/b)).concat(subexp.substring(se+1,subexp.length()));</code></pre><p>so basically the piece of offending code is above, with the following values grabbed from the debugger:</p><pre><code>subexp=""1+1/81"" (before code)""1+0.01234567*"" (after code) ss=2, se=5, i=3, a=1.0, b=81.0</code></pre>","578943","","674039","","2011-12-13 01:44:58","2011-12-13 01:44:58","asterisk in arithmetic output","<java><android>","1","5","","",""
"4716764","1","4716843","","2011-01-17 18:58:44","0","755","<p>We are creating an app for a user who has about 350MB of video clips. Since most (if not all) Android phones won't have that much internal storage, I'm not sure how we are going to make this work. Is there a way to push the video clips onto the SD card when the user downloads the app? If not, is there any other way to do this?</p>","469194","","","","","2011-01-17 19:09:37","Automatically saving video files to Android SD card","<android><filesize><android-sdcard>","1","0","","",""
"4716867","1","","","2011-01-17 19:11:51","0","716","<p>How can I check inside the OnRestart method, if the home button was released ?</p><p>or</p><p>When the home button is released then the following intent is called Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.android.launcher/.Launcher }.</p><p>How to check inside the method onRestart that the above Intent was called ?</p><p>Thank you in advance.</p>","568225","","","","","2011-02-07 15:47:59","How to check if the home activity was launched?","<android>","1","1","","",""
"4716959","1","5051234","","2011-01-17 19:23:16","4","1209","<p>Is it possible to set typeface of hint element of TextEdit view? Thanks.</p>","367677","","","","","2011-06-22 21:42:41","Setting typeface of hint in TextEdit","<android><gui><view>","3","0","2","",""
"4716966","1","","","2011-01-17 19:24:03","-1","113","<p>I have 4tab on every tab I have listview, on selecting row(any row) I want to generate activity with 6tab,.</p>","576742","","513838","","2011-01-18 15:23:52","2011-01-18 15:23:52","listview to tab","<android><android-layout><android-tabhost><android-style-tabhost>","1","3","","",""
"4717001","1","","","2011-01-17 19:28:25","0","858","<p>I have Activity A which defines a dialog using AlertBuilder.create etc.  This Activity invokes the dialog using showDialog(dialogID).  dialogID is declared and recognized in all classes/activities. Everything works perfectly in Activity A.</p><p>My question is when trying to invoke this same dialog -- showDialog(dialogID) -- from another Activity (Activity B) the application crashes.  Can anyone help?</p><p>How to invoke a dialog from multiple activities?</p><p>Thanks in advance.</p><p>Andy</p>","578960","","","","","2011-01-18 08:00:50","Invoke a dialog from another activity","<android>","3","0","1","",""
"4717029","1","","","2011-01-17 19:31:42","0","246","<p>I wanted the text on my buttons to switch every time that I click it.  The only way I know how to switch text is Textswitcher, but I can't seem to find a way to use it with the buttons.  I'm sure this is a simple answer and appreciate any help!</p><p>xml file portion... Button  android:id=""@+id/Button_A""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""android:layout_alignParentLeft=""true""  android:textSize=""@dimen/help_text_size""  android:minWidth=""10px""   </p><p>java portion....</p><p>Button alphaButton = (Button) findViewById(R.id.Button_A);        alphaButton.setText(mGameSettings.getString(GAME_PREFERENCES_RIGHT, """"));        alphaButton.setOnClickListener(new View.OnClickListener() {         public void onClick(View v) {          handleAnswerAndShowNextQuestion(""a"");            }        });</p>","578974","","578974","","2011-01-18 23:54:13","2011-05-31 07:15:19","How do you incorporate TextSwitcher on top of a Button?","<android>","1","0","","",""
"4717125","1","","","2011-01-17 19:43:13","5","1605","<p>I would like to know if we can have a link in a SMS that would be handle by my application. For example a link which would look like myapp://blabla. And by clicking on it myapp would be open with the link as an argument. </p><p>This question also refers to email, either from a file with a special extension or a link like in the SMS. </p><p>Thanks a lot for your help. </p><hr><p>Edit 31/01</p><p>Actually, I did what Greg suggested it but it doesn't work. Such a link (myapp://blabla) is not clickable in a SMS/email...When I replace myapp with http as a scheme, it works (Android asks me wether it should open the link with myapp or the browser). But myapp://blabla isn't clickable with myapp as a scheme.Here is my code:</p><pre><code>   &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""android:debuggable=""true""&gt;&lt;activity android:name="".myapp""          android:label=""@string/app_name""          android:theme=""@android:style/Theme.NoTitleBar""          android:launchMode=""singleTask""          android:screenOrientation=""portrait""&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;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=""myapp"" android:host=""blabla"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".SecondActivity""&gt;&lt;/activity&gt;    &lt;activity android:name="".SettingsActivity""&gt;&lt;/activity&gt;&lt;/application&gt;</code></pre>","575481","","575481","","2011-01-31 09:37:59","2011-01-31 09:37:59","Link to an android application from SMS/mail","<android><hyperlink><sms>","1","0","1","",""
"4717345","1","4717443","","2011-01-17 20:06:42","0","318","<p>I am a web developer, new to app development and Java/Android. I am about to follow some tutorials to get started learning but I'm running into a wall. The Android dev site says the recommended way to build Android apps is in Java using the Eclipse plug in. So I downloaded Eclipse Classic and unzipped it on to get this error:</p><p>""A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse.</p><p>No Java virtual machine was found after searching the following locations:/Users//Desktop/eclipse/Eclipse.app/Contents/MacOS/jre/bin/javajava in your current PATH""</p><p>Any idea what the issue is and how I can fix it? Again, newbie to java, jre, android, so I apologize if this question has already been asked. In my research I've discovered that most of the posts or solutions I've found are tough for me to follow. There's always a few unclear items that are probably prohibiting me from getting the answer I need. So I'm hoping someone can walk me through installing or configuring whatever I need to regarding Java so I can continue installing Eclipse and begin learning. </p><p>I should probably note that I'm on Mac OSX 10.6.6 Snow Leopard. Please let me know if you need any other info. Thanks so much in advance for any and all help!!!</p>","579010","","287727","","2011-01-17 20:18:30","2011-01-18 04:29:00","Android newbie installing Eclipse, having issues","<java><android><eclipse>","2","0","","",""
"4717492","1","","","2011-01-17 20:23:35","1","1639","<p>I'm very new to Java and Android development and can't seem to find what I'm after. I have a basic list set up, each list item has a different title, description and icon. What I'd like is when a list item is clicked, a sound is played, this sound would be different for each list item.</p><p>Here's my code so far:</p><pre><code>import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.util.Map;import android.app.ListActivity;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.widget.SimpleAdapter;public class TestingList extends ListActivity {    private static final String ICON_KEY = ""icon"";    private static final String TITLE_KEY = ""title"";    private static final String DETAIL_KEY = ""detail"";    private static final int[] ICONS = new int[] { R.drawable.lista,                    R.drawable.listb, R.drawable.listc, R.drawable.listd };    private static final String[] TITLES = new String[] { ""List 1"", ""List 2"",                    ""List 3"", ""List 4"" };    private static final String[] DETAILS = new String[] {                    ""List 1 description"",                    ""List 2 description"",                    ""List 3 description"",                    ""List 4 description"" };    @Override    public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            List&lt;Map&lt;String, Object&gt;&gt; rows = new ArrayList&lt;Map&lt;String, Object&gt;&gt;();            for (int i = 0; i &lt; ICONS.length; i++) {                    rows.add(createListItemMap(ICONS[i], TITLES[i],                                    DETAILS[i]));            }            String[] fromKeys = new String[] { ICON_KEY, TITLE_KEY, DETAIL_KEY };            int[] toIds = new int[] { R.id.icon, R.id.text1, R.id.text2 };            setListAdapter(new SimpleAdapter(this, rows,                            R.layout.icon_detail_list_item, fromKeys, toIds));    }    public static Map&lt;String, Object&gt; createListItemMap(int icon,                    CharSequence title, CharSequence detail) {            Map&lt;String, Object&gt; row = new HashMap&lt;String, Object&gt;();            row.put(ICON_KEY, icon);            row.put(TITLE_KEY, title);            row.put(DETAIL_KEY, detail);            return row;    }    public static void showView(Context c) {          c.startActivity(new Intent(c, TestingList.class));    }}</code></pre><p>Help much appreciated, thank you.</p>","485702","","","","","2013-03-01 07:21:25","How do I play sound on clicking a list view item?","<android>","2","0","","",""
"4717516","1","4717577","","2011-01-17 20:25:50","1","2689","<p>I am developing a game for Android and have what I imagine to be a very common scenario, but I can't figure out how to do it.</p><p>I have a Title Screen where the user can select ""New Game"".  When they start up a game, I push a GameActivity onto the stack.  Then if the user hits the physical back button the phone, the application goes back to the TitleActivity, as I intend it.  However, I need a way to allow the user to resume the game at this point, but I don't know how to get back to htat instance of the GameActivity.  Any help is appreciated.</p>","469106","","","","","2011-01-18 02:38:41","Hitting Back Button and then Resuming Activity","<android><activity><back-button>","2","0","1","",""
"4717722","1","","","2011-01-17 20:45:45","0","332","<p>I have been searching here in this forum but I cannot find any answer to my question. I have the following problem:</p><p>I have a imageview and two texts, and I want to change the color on selection to show show visual feedback before loading the next activity.</p><pre><code>@Overridepublic void onClick(View v) {   openFormOverviewButton.setColorFilter(0x22FFFFFF, Mode.SRC_ATOP);   openFormOverviewTitle.setTextColor(0xFF00851B);   openFormOverviewText.setTextColor(0xFF00851B);   Intent tki = new Intent();   tki.setClass(getApplication(), DataCollectorFormOverviewActivity.class);   startActivity(tki);}</code></pre><p>I would expect that the button and the texts are changed and then the new activity is started. However, the text does not change and the activity starts. If I invoke the three lines in a runnable on the UI thread (runOnUiThread(new Runnable() {...}) then the changes are applied before the activity is started. This is actually strange, because the onClick method is called on the main thread aka. UI thread.</p><p>Does that mean that changes to the UI thread are not executed imediatelly on the UI thread? Or am I doing something completely wrong?</p><p>Best, Adam</p>","576904","","","","","2011-01-17 21:05:23","How will UI changes be processed in the onClickListener before starting a new activity in Android?","<android><user-interface><listener><ui-thread>","1","0","","",""
"4717791","1","","","2011-01-17 20:55:52","0","206","<p>I'm creating a multi-line ListView using the method that many folks have blogged about - create an ArrayList> and add items to it, create a SimpleAdapter, then call setListAdapter. My (abbreviated) code looks something like this:</p><pre><code>final ArrayList&lt;HashMap&lt;String,String&gt;&gt; myList = new ArrayList&lt;HashMap&lt;String,String&gt;&gt;();HashMap&lt;String,String&gt; temp;for (ProviderResults pr : providerArrayList){    temp = new HashMap&lt;String,String&gt;();    temp.put(""providerName"",pr.getProviderName());    temp.put(""providerAddress"",pr.getAddress());    temp.put(""providerCityStateZip"",pr.getCityStateZip());    temp.put(""providerPhone"",pr.getPhone());    myList.add(temp);}SimpleAdapter adapter = new SimpleAdapter(this, myList, R.layout.custom_row_view,                new String[] {""providerName"",""providerAddress"",""providerCityStateZip"",""providerPhone""},                new int[] {R.id.providerName,R.id.providerAddress, R.id.providerCityStateZip, R.id.providerPhone}        );setListAdapter(adapter);</code></pre><p>It works fine, EXCEPT for the fact that I have to add a delay like this:</p><pre><code>int sum = 0;for (int i = 0; i &lt; 90000; i++) {    sum += 1;}</code></pre><p>... before creating the SimpleAdapter, otherwise I get no data in the ListView. It's almost as though the code is running asynchronously, like the adapter is being created and bound before the ArrayList is populated. The more rows I have in each individual HashMap, the longer I need to delay.</p><p>Any thoughts on what I'm doing wrong?</p><p>Update: I KNOW that this is not an ideal way of implementing a ListView, so I'm not looking for info on how to do a custom adapter, etc., I'm already doing that. This is just something I was playing around with, and I'm trying to figure out why this EXACT code is behaving the way it is, when there's nothing that should cause it to do so...</p>","510085","","510085","","2011-01-20 21:45:47","2011-04-23 20:56:56","Why do I need a delay when creating an Android ListView?","<android><listview>","2","8","","",""
"4717807","1","6461844","","2011-01-17 20:57:25","2","1758","<p>I have multiple views that come and go as the application runs. I want each view to have its own personal preferences that are stored as the ID tag of the view. Above these is the ""General Preferences"" that the sub prefs reference to get their default values when a view it is created.</p><p>Right now I have it set up that the General Preferences are the default SharedPreferences. But I have no Idea how to create the new preferences and set up an activity UI so the user can change them. Is it pretty much the same as setting up the SharedPreferences?</p>","480691","","387076","","2013-08-06 08:37:31","2013-08-06 08:37:31","Separate preferences for each view in an Android app","<android><sharedpreferences><android-view><android-preferences>","3","1","1","",""
"4717836","1","4718255","","2011-01-17 21:01:06","0","856","<p>If i am developing a third party tool. is there a way to interact with that website?</p><p>For example i am making a android Application which allow the user to search a specific website. Is there possible to load the search result in listview?</p><p>This was just an example.</p><p>So get information from a website becuase i want a different layout and so on.</p><p>EDIT* and how do i do it?Thank you!</p>","564612","","564612","","2011-01-17 21:19:23","2011-01-17 21:46:24","Interact with websites?","<android>","1","2","","",""
"4717975","1","","","2011-01-17 21:15:33","2","9110","<p>I added a progressbar to my app but I want to hide it after some doing some action,</p><p>I used <code>hide()</code>, <code>dismiss()</code> and <code>cancel()</code>... but none of them work?</p><p>How can I hide the progressbar?</p>","508377","","759866","","2014-01-01 14:14:08","2014-01-01 14:14:08","How to hide progressbar in Android?","<android>","2","0","0","",""
"4718152","1","","","2011-01-17 21:34:27","0","244","<p>I'm wondering if there is a difference between North American and European Android phones in terms of specific region needs?  In other words, do applications work the same on both US and European Androids?  I'm think that GPS-required apps might be one example of where there could be a problem, but I'm not sure... </p><p>Thanks, Tara </p>","579104","","","","","2011-01-17 22:00:40","North American vs. European Android phones - what's the difference?","<android><gps>","1","1","","",""
"4718158","1","4720520","","2011-01-17 21:35:07","1","118","<p>I am having a fair amount of memory problems with my app. I think I have my bitmaps sorted out, my current problem seems to stem from Strings. I have 2 functions that happen often and need to make sure they are solid.</p><p>First is converting an inputstream to a string.</p><p>The second one is to format a timer display as in a mediaplayer. This happens every second. </p><p>Are there any obvious inefficiencies in these functions?? Thanks</p><p>**edit, did a quick edit of the  maketimestring, for an obvious inneficiency I spotted where I was pulling a string from resources every time.</p><pre><code>    private static StringBuilder sBuilder = new StringBuilder();    private static Formatter sFormatter = new Formatter(sBuilder, Locale.getDefault());    private static final Object[] sTimeArgs = new Object[5];    public static String makeTimeString(String durationFormat, long secs) {        sBuilder.setLength(0);        final Object[] timeArgs = sTimeArgs;        timeArgs[0] = secs / 3600;        timeArgs[1] = secs / 60;        timeArgs[2] = (secs / 60) % 60;        timeArgs[3] = secs;        timeArgs[4] = secs % 60;        return sFormatter.format(durationformat, timeArgs).toString();    }    public static String formatContent(InputStream is) throws IOException {        if (is == null)             return """";        sBuilder.setLength(0);        BufferedReader buffer = new BufferedReader(new InputStreamReader(is));        String line = null;        while ((line = buffer.readLine()) != null) {            sBuilder.append(line).append(""\n"");        }        buffer.close();        buffer = null;        return sBuilder.toString().trim();    }</code></pre>","415422","","415422","","2011-01-17 21:48:01","2011-01-18 04:34:40","Cheap string building/formatting for inputstreams and timer displays?","<android><memory-management><string-formatting>","1","1","","",""
"4718450","1","","","2011-01-17 22:07:25","1","533","<p>I'm making a game that has a 9 by 10 grid that is drawn in a view.  This works, I would like to be able to detect when a user touches one of the cells. I know how to get keyboard events.  I figure there must be a way to get a touch even with the x,y cordernat for my view with the grid.</p>","564653","","","","","2011-01-17 22:32:08","Trying to figure out how to get touch events for Android","<android><events><touch>","2","0","1","",""
"4718643","1","","","2011-01-17 22:31:35","3","3010","<p>I'm having problems using the RecognizerIntent API on Android 2.2. When I call the API using this code:</p><pre><code>Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);startActivityForResult(intent, REQUEST_CODE_VOICE_SEARCH);</code></pre><p>which looks like it should work, the search popup says ""Unknown problem"" on the device and in the logs it states:</p><pre><code>01-17 14:25:30.433: ERROR/RecognitionActivity(9118): ACTION_RECOGNIZE_SPEECH intent called incorrectly. Maybe you called startActivity, but you should have called startActivityForResult (or otherwise included a pending intent).01-17 14:25:30.433: INFO/RecognitionControllerImpl(9118): startRecognition(#Intent;action=android.speech.action.RECOGNIZE_SPEECH;launchFlags=0x800000;component=com.google.android.voicesearch/.IntentApiActivity;B.fullRecognitionResultsRequest=true;S.android.speech.extra.LANGUAGE_MODEL=free_form;end)01-17 14:25:30.433: INFO/RecognitionControllerImpl(9118): State change: STARTING -&gt; STARTING01-17 14:25:30.443: ERROR/RecognitionControllerImpl(9118): required extra 'calling_package' missing in voice search intent01-17 14:25:30.443: ERROR/RecognitionControllerImpl(9118): ERROR_CLIENT01-17 14:25:30.443: ERROR/RecognitionControllerImpl(9118): ERROR_CLIENT</code></pre><p>It looks like the problem is the missing ""calling_package"" extra; on the RecognizerIntent page it states that this extra is:</p><blockquote>  <p>The extra key used in an intent to the speech recognizer for voice  search. Not generally to be used by  developers. The system search dialog  uses this, for example, to set a  calling package for identification by  a voice search API. If this extra is  set by anyone but the system process,  it should be overridden by the voice  search implementation.</p></blockquote><p>As far as I can tell, I don't need to override this extra, so why am I getting this error? How can I fix my code?</p>","764272","","171206","","2011-01-29 00:31:34","2011-02-08 15:56:59","RecognizerIntent not working; ""missing extra calling_package""","<android><speech-recognition>","3","2","","",""
"4718691","1","4762510","","2011-01-17 22:39:47","4","1560","<p>So I've got an Android 1.6 activity using a TableLayout. One of the rows has a RatingBar in. This is my xml:</p><pre><code>&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TableRow&gt;        &lt;TextView android:text=""name""            android:padding=""3dip""/&gt;        &lt;TextView android:text=""@+id/name""            android:padding=""3dip""/&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;          &lt;TextView android:text=""tags""            android:padding=""3dip""/&gt;        &lt;TextView android:id=""@+id/tags""            android:padding=""3dip""/&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView android:text=""rating""            android:layout_width=""wrap_content""/&gt;        &lt;RatingBar android:id=""@+id/rating""            style=""?android:attr/ratingBarStyleIndicator""            android:layout_width=""wrap_content""            android:rating=""4""        android:numStars=""5""/&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView android:text=""long string""            android:padding=""3dip""/&gt;        &lt;TextView android:text=""this is a very very very long string""            android:padding=""3dip""/&gt;    &lt;/TableRow&gt;...&lt;/TableLayout&gt;</code></pre><p>I wanted to put a text label at the left of the table row, then have a 5 star ratings bar on the right. But when I do this, the rating value displays wrongly, and I have lots of spurious empty stars above the specified maximum of 5:</p><p><img src=""http://i.stack.imgur.com/GjWQy.png"" alt=""alt text""></p><p>If I take out the 'rating' TextView, so the RatingBar is on its own table row, the RatingBar displays as expected, showing 4 out of 5 possible stars:</p><p><img src=""http://i.stack.imgur.com/aSEKa.png"" alt=""alt text""></p><p>Does anyone have any idea if it's possible to have a RatingBar on the same row as a TextView? Or do I need to rethink this layout?</p><p>edited to add: I think another row in the table which displays a long text string is causing the problem. Without the 'long string' row in the example above, the RatingBar displays correctly in the same row as the 'rating' text.</p>","538332","","538332","","2011-01-21 14:32:49","2011-01-21 18:39:24","RatingBar displays incorrectly in Android when on same TableRow as TextView","<android><android-layout>","2","2","2","",""
"4718698","1","","","2011-01-17 22:41:11","0","1581","<p>I was searching and googleing this topic for more than 2 hours but maybe there's something wrong with my search, cuz i didnt find anything.</p><p>can somebody help me in this? any topic, tutorial, piece of code?</p><p>I want to monitor incoming calls (I think I'll be able to do this part) and send some of them to voice mail. I'm using Android Level 8 platform 2.2</p><p>thanks...</p>","536853","","","","","2012-11-25 18:08:30","forward calls to voicemail in android?","<java><android><voicemail>","2","2","1","",""
"4718717","1","4719198","","2011-01-17 22:44:49","2","5566","<p>I have list view with custom row layout (list_row.xml) that contains CheckBox element:</p><pre><code>&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""wrap_content""    android:layout_width=""fill_parent""    android:orientation=""horizontal""    android:weightSum=""1.0""&gt;    &lt;TableRow&gt;        &lt;TextView android:id=""@+id/name""            android:layout_weight="".85""            android:layout_width=""0dip""            android:layout_height=""wrap_content""            android:text=""sample""            android:textSize=""24sp""&gt;        &lt;/TextView&gt;        &lt;CheckBox android:id=""@+id/enabled""            android:layout_weight="".15""            android:layout_width=""0dip""            android:layout_height=""wrap_content""             android:focusable=""false""&gt;        &lt;/CheckBox&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>In my list activity I've got ListRowAdapter:</p><pre><code>private static class ListRowAdapter extends ArrayAdapter&lt;ListRow&gt; implements        CompoundButton.OnCheckedChangeListener {    private List&lt;ListRow&gt; items;    private LayoutInflater vi;    private SparseBooleanArray mCheckStates;    public ListRowAdapter(Context context, int textViewResourceId,            List&lt;ListRow&gt; objects) {        super(context, textViewResourceId, objects);        this.items = objects;        this.vi = LayoutInflater.from(context);        this.mCheckStates = new SparseBooleanArray(objects.size());        for(int i=0;i&lt;mCheckStates.size();i++){            mCheckStates.put(i,items.get(i).isEnabled());        }        Log.i(""VIEW"", ""constructor"");    }    public boolean isChecked(int position) {        return mCheckStates.get(position, false);    }    public void setChecked(int position, boolean isChecked) {        mCheckStates.put(position, isChecked);        items.get(position).setEnabled(isChecked);        notifyDataSetChanged();    }    public void toggle(int position) {        setChecked(position, !isChecked(position));    }    public void onCheckedChanged(CompoundButton buttonView,            boolean isChecked) {        ListRow r = (ListRow) buttonView.getTag();        r.setEnabled(isChecked);        mCheckStates.put(items.indexOf(r), isChecked);        Toast.makeText(getContext(), ""row "" + r.getName() + "" changed to ""+isChecked, Toast.LENGTH_SHORT).show();    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        ViewHolder holder;        if (convertView == null) {            Log.i(""VIEW"", ""init holder"");            convertView = vi.inflate(R.layout.list_row, null);            holder = new ViewHolder();            holder.name = (TextView) convertView.findViewById(R.id.name);            holder.enabled = (CheckBox) convertView                    .findViewById(R.id.enabled);            convertView.setTag(holder);        } else {            Log.i(""VIEW"", ""using holder"");            holder = (ViewHolder) convertView.getTag();        }        ListRow row = items.get(position);        if (row != null) {            holder.name.setText(row.getName());            holder.enabled.setTag(row);            holder.enabled.setChecked(mCheckStates.get(position, false));           holder.enabled.setOnCheckedChangeListener(this);        }        return convertView;    }    static class ViewHolder {        TextView name;        CheckBox enabled;    }}</code></pre><p>In my Activity (that extends ListActivity) I do the following:</p><pre><code>private static List&lt;ListRow&gt; rows;private ListRowAdapter lra;</code></pre><p>... and then</p><pre><code>getListView().setItemsCanFocus(false);getListView().setTextFilterEnabled(true);rows = initRows();lra = new ListRowAdapter(this, R.layout.list_row, rows);setListAdapter(lra);</code></pre><p>and that works fine while scrolling. But if I don't use <code>mCheckStates</code> array it fails! I just can't understand why. I have items array as a member of my Activity class and it contains all the states of checkboxes! I update it in <code>onCheckedChanged()</code> method like I update <code>mCheckState</code>. So the following code has to work:</p><pre><code>public boolean isChecked(int position) {    return items.get(position).isEnebled();}public void setChecked(int position, boolean isChecked) {    items.get(position).setEnabled(isChecked);    notifyDataSetChanged();}public void toggle(int position) {    setChecked(position, !isChecked(position));}public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {    ListRow r = (ListRow) buttonView.getTag();    r.setEnabled(isChecked);    Toast.makeText(getContext(), ""row "" + r.getName() + "" changed to ""+isChecked, Toast.LENGTH_SHORT).show();}</code></pre><p>and in <code>getView()</code> method:</p><pre><code>holder.enabled.setTag(row);holder.enabled.setChecked(row.isEnabled());</code></pre><p>But it doesn't. It loses checkbox states while scrolling and I don't know why.</p>","577841","","9314","","2012-06-26 21:41:17","2012-06-26 21:41:17","Refreshing checkbox state in a listview","<android><listview><checkbox>","2","0","1","",""
"4718724","1","","","2011-01-17 22:46:56","1","218","<p>Strange things happen. I have a 2x2 button table layout, which is the following:</p><pre><code>        &lt;TableLayout          xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""         android:layout_below=""@+id/cerca""&gt;        &lt;TableRow            android:layout_width = ""fill_parent""            android:layout_height = ""wrap_content""&gt;            &lt;Button                android:id = ""@+id/btn1""                android:layout_width = ""wrap_content""                android:layout_height = ""wrap_content""                android:layout_weight=""1""                android:text = ""Scarica POI da server""                android:onClick=""downloadFromServer""            /&gt;             &lt;Button                android:id = ""@+id/btn2""                android:layout_width = ""wrap_content""                android:layout_height = ""wrap_content""                android:layout_weight=""1""                android:text = ""Aggiungi POI""                android:onClick=""goCreatePOI""            /&gt;     &lt;/TableRow&gt;    &lt;TableRow        android:layout_width = ""fill_parent""        android:layout_height = ""wrap_content""&gt;             &lt;Button                android:id = ""@+id/btn3""                android:layout_width = ""wrap_content""                android:layout_height = ""wrap_content""                  android:layout_weight=""1""                android:text = ""Rimuovi i POI del server""                android:onClick=""removeServerPOI""            /&gt;               &lt;Button                android:id = ""@+id/btn4""                android:layout_width = ""wrap_content""                android:layout_height = ""wrap_content""                android:layout_weight=""1""                android:text = ""Rimuovi i POI personali""                android:onClick=""removePersonalPOI""            /&gt;      &lt;/TableRow&gt;   &lt;/TableLayout&gt;</code></pre><p>This table layout is nested inside a relative layout, which is nested in a scrollview.</p><p>Now, whenever i click on one of them, everytime the text inside the button change allignment: if before clicking was centered and displayed on two lines, after the click it loses its alignment and is displayed only in one row (cutting off some part of the text).Am I doing something wrong, or maybe it's a bug? </p>","575390","","272824","","2011-01-18 02:58:01","2011-01-18 02:58:01","Button text loses allignment after clicking","<android><button><tablelayout><text-alignment>","0","2","","",""
"4718811","1","","","2011-01-17 23:00:12","2","2520","<p>i have a mapview and overlay items which when tap on shows popuo with text. what I want is when user taps on map outside of these overlay items or popup  hide the popup if its currently visible.</p>","470682","","","","","2011-02-07 15:59:04","android mapview overlay popup hide","<android><popup><overlay><hide><android-mapview>","2","0","","",""
"4718881","1","4719037","","2011-01-17 23:10:11","0","2810","<p>I've got a custom drawable resource to display my items in a ListView, actually two because I wanted my results to have alternating background colors but both to respond to clicks by changing their color. The problem is even when assigning even one of these drawables to my LinearLayout container via the layout XML, it works fine, but via Java code it doesn't. So to be exact, this works:</p><pre><code>&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:background=""@drawable/result_white""android:id=""@+id/result""&gt;</code></pre><p>but this (in my ResultAdapter which extends ArrayAdapter) doesn't:</p><pre><code>LinearLayout result = (LinearLayout) v.findViewById(R.id.result);result.setBackgroundColor(R.drawable.result_white);</code></pre><p>My final objective is of course to have alternating 'result_white' and 'result_ltgray' drawables for results so the first XML solution does not really satisfy my needs. What am I missing in the Java code please?</p>","561498","","","","","2011-01-17 23:31:47","setBackgroundColor(drawable) != android:background=(drawable)?","<android><listview><drawable><listactivity>","3","0","","",""
"4718934","1","4720058","","2011-01-17 23:17:07","8","4346","<p>Recently I have been getting a lot of complaints about the HTC Desire series and it failing while invoking sql statements. I have received reports from users with log snapshots that contain the following.</p><pre><code>I/Database( 2348): sqlite returned: error code = 8, msg = statement aborts at 1: [pragma journal_mode = WAL;] E/Database( 2348): sqlite3_exec to set journal_mode of /data/data/my.app.package/files/localized_db_en_uk-1.sqlite to WAL failed</code></pre><p>followed by my app basically burning in flames because the call to open the database results in a serious runtime error that manifests itself as the cursor being left open. There shouldn't be a cursor at this point as we are trying to open it.</p><p>This only occurs with the HTC Desire HD and Z. My code basically does the following (changed a little to isolate the problem area).</p><pre><code>SQLiteDatabase db;String dbName;public SQLiteDatabase loadDb(Context context) throws IOException{   //Close any old db handle   if (db != null &amp;&amp; db.isOpen()) {      db.close();   }   // The name of the database to use from the bundled assets.  String dbAsset = ""/asset_dir/""+dbName+"".sqlite"";  InputStream myInput = context.getAssets().open(dbAsset, Context.MODE_PRIVATE);  // Create a file in the app's file directory since sqlite requires a path  // Not ideal but we will copy the file out of our bundled assets and open it  // it in another location.  FileOutputStream myOutput = context.openFileOutput(dbName, Context.MODE_PRIVATE);  byte[] buffer = new byte[1024];  int length;  while ((length = myInput.read(buffer)) &gt; 0) {      myOutput.write(buffer, 0, length);  }  // Close the streams  myOutput.flush();  // Guarantee Write!  myOutput.getFD().sync();  myOutput.close();  myInput.close();  // Not grab the newly written file  File fileObj = context.getFileStreamPath(dbName);  // and open the database  return db = SQLiteDatabase.openDatabase(fileObj.getAbsolutePath(), null, SQLiteDatabase.OPEN_READONLY | SQLiteDatabase.NO_LOCALIZED_COLLATORS);}</code></pre><p>Sadly this phone is only available in the UK and I don't have one in my inventory. I am only getting reports of this type from the HTC Desire series. I don't know what changed as this code has been working without any problem. Is there something I am missing?</p>","307990","","","","","2011-08-04 20:49:53","Sqlite issues with HTC Desire HD","<android><sqlite3>","2","0","7","",""
"4719051","1","4719100","","2011-01-17 23:33:10","2","2101","<p>I'm sure I'm missing the point here so I'm hoping someone can explain.</p><p>I want to create a popup when a user touches an ImageView. I had a look at AlertDialog and the docs say...</p><blockquote>  <p>If you want to display a more complex view, look up the FrameLayout called ""custom"" and add your view to it:</p></blockquote><p>...with the following code...</p><pre><code>    FrameLayout fl = (FrameLayout) findViewById(android.R.id.custom);    fl.addView(myView, new LayoutParams(MATCH_PARENT, WRAP_CONTENT));</code></pre><p>So as a test I tried the following in my onCLick() method...</p><pre><code>    TextView tv = new TextView(this);    tv.setText(""Hello World"");    FrameLayout customFrameLayout = (FrameLayout) findViewById(android.R.id.custom);    customFrameLayout.addView(tv, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));</code></pre><p>The last line of the above where I'm calling addView() throws a NullPointerException which makes me think there's a problem with android.R.id.custom.</p><p>So the question is, what is wrong with the above and also is there a better way of creating a custom popup (perhaps by using the Dialog class or extending it)?</p><p>NOTE: I'm only using TextView in this example as a test, I want to add something more complex for my actual popup.</p>","488241","","","","","2011-11-01 13:32:18","Custom AlertDialog - problem with android.R.id.custom","<android>","3","0","0","",""
"4719059","1","4719754","","2011-01-17 23:34:02","0","334","<p>I'm writing an android application that is supposed to get the html from a php page and use the parsed data from thepage.  I've searched for this issue on here, and ended up using some code from an example another poster put up.  Here is my code so far:</p><pre><code>HttpClient client = new DefaultHttpClient();    HttpGet request = new HttpGet(url);    try {        Log.d(""first"",""first"");        HttpResponse response = client.execute(request);        String html = """";        Log.d(""second"",""second"");        InputStream in = response.getEntity().getContent();        Log.d(""third"",""third"");        BufferedReader reader = new BufferedReader(new InputStreamReader(in));        Log.d(""fourth"",""fourth"");        StringBuilder str = new StringBuilder();        String line = null;        Log.d(""fifth"",""fifth"");        while((line = reader.readLine()) != null) {            Log.d(""request line"",line);        }        in.close();    } catch (ClientProtocolException e) {    } catch (IOException e) {        // TODO Auto-generated catch block        Log.d(""error"", ""error"");    }    Log.d(""end"",""end"");}</code></pre><p>Like I said before, the url is a php page.  Whenever I run this code, it prints out the first first message, but then prints out the error error message and then finally the end end message.  I've tried modifying the headers, but I've had no luck with it.  Any help would be greatly appreciated as I don't know what I'm doing wrong.  </p><p>Thanks!</p><p>When I do e.getMessage() and print that out, in the logger all it says is stanford.edu.  Hope that helps.  Here is the stack trace:</p><p>01-17 16:58:27.687: WARN/System.err(452): java.net.UnknownHostException: stanford.edu01-17 16:58:27.947: WARN/System.err(452):     at java.net.InetAddress.lookupHostByName(InetAddress.java:506)01-17 16:58:27.947: WARN/System.err(452):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)01-17 16:58:27.977: WARN/System.err(452):     at java.net.InetAddress.getAllByName(InetAddress.java:256)01-17 16:58:27.977: WARN/System.err(452):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)01-17 16:58:28.027: WARN/System.err(452):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)01-17 16:58:28.027: WARN/System.err(452):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)01-17 16:58:28.047: WARN/System.err(452):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)01-17 16:58:28.057: WARN/System.err(452):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)01-17 16:58:28.057: WARN/System.err(452):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)01-17 16:58:28.117: WARN/System.err(452):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)01-17 16:58:28.117: WARN/System.err(452):     at edu.stanford.cs247.util.ColorHandler.getInfo(ColorHandler.java:44)01-17 16:58:28.217: WARN/System.err(452):     at edu.stanford.cs247.util.ColorHandler.handleMessage(ColorHandler.java:70)01-17 16:58:28.217: WARN/System.err(452):     at android.os.Handler.dispatchMessage(Handler.java:99)01-17 16:58:28.247: WARN/System.err(452):     at android.os.Looper.loop(Looper.java:123)01-17 16:58:28.257: WARN/System.err(452):     at android.app.ActivityThread.main(ActivityThread.java:3647)01-17 16:58:28.257: WARN/System.err(452):     at java.lang.reflect.Method.invokeNative(Native Method)01-17 16:58:28.297: WARN/System.err(452):     at java.lang.reflect.Method.invoke(Method.java:507)01-17 16:58:28.297: WARN/System.err(452):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)01-17 16:58:28.327: WARN/System.err(452):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)01-17 16:58:28.337: WARN/System.err(452):     at dalvik.system.NativeStart.main(Native Method)</p>","445848","","445848","","2011-01-18 01:01:36","2011-01-18 01:42:06","Android: Having trouble getting html from webpage","<php><android><html><request>","3","0","","",""
"4719192","1","8155011","","2011-01-17 23:51:39","2","1434","<p>I have an authority string defined as such:</p><pre><code>public final static String AUTHORITY = ""dsndata.sds2mobile.jobprovider"";</code></pre><p>Followed by an edition to the UriMatcher:</p><pre><code>uriMatcher.addURI(JobMetaData.AUTHORITY, ""/JobNames/*"",                      JOBNAME_SINGLE_URI);</code></pre><p>The uri that gets passed to the switch is:</p><pre><code>content://dsndata.sds2mobile.jobprovider/JobNames/test</code></pre><p>This falls through the switch and hits the default (which throws an IllegalArgumentException).</p><p>Am I missing something? I've searched and can't find anything that would account for the mismatch.</p>","543677","","","","","2011-11-16 16:22:17","Problem with URI matcher in Android","<android><content><uri><provider>","2","0","1","",""
"4719267","1","","","2011-01-18 00:05:25","1","857","<p>So, I've downloaded my own application from the market and installed it on my phone. Now, I am trying to install a temporary new version from Eclipse, but here is the message I get:</p><p><em>Re-installation failed due to different application signatures.<br>You must perform a full uninstall of the application. WARNING: This will remove the application data!<br>Please execute 'adb uninstall com.applicationName' in a shell.<br>Launch canceled!</em></p><p>Now, I really really don't want to uninstall the application, because I will lose all my data. One solution I found is to Export my application, creating new .apk, and then install it via HTC Sync (probably a different program based on what phone you have). The problem is this takes a long time to do, since I need to enter the password for the keystore each time and then wait for HTC Sync. It's a pain in the ass!</p><p>So the question is: Is there a way to make Eclipse automatically use my keystore to sign the application (quickly and automatically)? Or perhaps to replace debug keystore with my own? Or perhaps just tell it to remember the password, so I don't have to enter it every time...? Or some other way to solve this problem?</p>","163668","","","","","2011-06-09 06:59:21","Is there a FAST way to export and install an app on my phone, while signing it with my own keystore?","<android><signing>","4","2","","",""
"4719594","1","4719757","","2011-01-18 01:10:18","6","3988","<p>Is there a nice way in Android to see if a column exists in a table in the application database? (I know there are questions similar to this one already, but there don't seem to be any that are Android specific.)</p>","543677","","543677","","2011-01-18 01:32:46","2013-03-19 08:32:34","Checking if a column exists in an application database in Android","<android><database><sqlite3>","3","0","2","",""
"4719597","1","4719759","","2011-01-18 01:11:01","0","599","<p>I am new to the android. I want to find the end of the video.I am using VideoView to play the video in android.Now the requirement is,""After completing the playing the video in videoview, it automatically invoke the another Activity"" How can I achieve this requirement in android?</p><p>Thanks.</p>","562743","","488434","","2012-02-06 13:28:44","2012-02-06 13:28:44","Finding the end of the video in android","<android><video-processing>","1","0","","",""
"4719748","1","4719935","","2011-01-18 01:40:19","0","272","<pre><code>public List&lt;Afood&gt; getFoodFromCat(String cat) {    String resultado = """";    List&lt;Afood&gt; list = new ArrayList&lt;Afood&gt;();    try {        URL xpto = new URL(""http://10.0.2.2/webservice/nutrituga/get_food_by_cat.php"");        HttpURLConnection conn;        conn = (HttpURLConnection) xpto.openConnection();        conn.setDoInput(true);        conn.connect();        InputStream is = conn.getInputStream();        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();        try {            DocumentBuilder db = dbf.newDocumentBuilder();            Document doc = db.parse(is);            NodeList nl = doc.getElementsByTagName(""item"");            // resultado = String.valueOf(nl.getLength());            for (int i = 0; i &lt; nl.getLength(); i++) {                Node n = nl.item(i);                Node childNode = n.getFirstChild();                while (childNode != null) {                    if (childNode.getNodeType() == Node.ELEMENT_NODE) {                        if (childNode.getNodeName().equalsIgnoreCase(                                ""NAME_FOOD"")) {                            Node valor = childNode.getFirstChild();                            // resultado = resultado + valor.getNodeValue();                            list.add(new Afood(valor.getNodeValue(), """",                                    (int) Math.round(Math.random()), 1, 1,                                    1, 1, 1, 1));                        }                    }                    childNode = childNode.getNextSibling();                }            }            return list;        } catch (ParserConfigurationException e1) {            e1.printStackTrace();        } catch (SAXException e1) {            e1.printStackTrace();        } catch (IOException e1) {            e1.printStackTrace();        }    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    return list;}</code></pre><p>I have this function that receives a xml and copy it to the list. This is well implemented. What i want do to know, is to send a category (that i receive like an argument of the function) and receive only the food from that category.    </p><p>The server is ready to receive the category and to send the food from that category.<br>What do i have to do to send the category and receive the correct xml?</p>","516765","","516765","","2011-01-18 01:47:41","2011-01-18 02:24:53","Parser, send an argument/receive xml (receive already done/ send not)","<android><http><http-post><xml-parsing><http-get>","1","0","","",""
"4719814","1","4720334","","2011-01-18 01:56:23","1","7658","<p>Problem is when I am using a custom progressDrawable in a SeekBar widget (perhaps incorrectly) it is rendered in a very aliased/ugly/low quality form. I have set ""drawingCacheQuality"" to high and there is no difference. Anyone have any ideas?</p><p>Am developing on a Nexus One (OS 2.2.1) with target build for project as API 1.5 (though I would hope that shouldn't matter).</p><p>Here is a sample of what it looks like:</p><p><img src=""http://i.stack.imgur.com/pu88j.png"" alt=""alt text""></p><p>My aim is to create a simple nifty visual switch with two states (on and off), and a slider to move between them. I didn't really see a better widget for this and practically everything is done for me with SeekBar. If someone has a better idea which doesn't involve rewriting tons of boiler plate code that would be nice. It just seems like this should really be doable with minimal effort somehow working with or extending SeekBar. I'm at a bit of a loss where to start though.</p><p>I'm guessing one idea would be to just overlay my on_off image onto the ShapeDrawable and use that as the background (and ""@android:color/transparent"" for progressDrawable), but I'm not too familiar with how to do that...</p><p>Basic code for a new actvitiy</p><pre><code>    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        seek = (SeekBar)findViewById(R.id.seek);        seek.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromTouch) {            }            public void onStartTrackingTouch(SeekBar seekBar) {             }            public void onStopTrackingTouch(SeekBar seekBar) {                if (seek.getProgress() &lt; seek.getMax() / 2.0)                    seek.setProgress(0);                else                    seek.setProgress(seek.getMax());            }        });    }</code></pre><p>main.xml defining the SeekBar</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=""#FFFFFF""&gt;    &lt;SeekBar android:id=""@+id/seek""                android:layout_alignParentTop=""true""                 android:layout_centerHorizontal=""true""                android:layout_height=""wrap_content"" android:layout_width=""200dip""                 android:background=""@drawable/background""                android:padding=""4dip""                 android:drawingCacheQuality=""high""                 android:progressDrawable=""@drawable/slider_on_off""                  android:progress=""99"" android:max=""99""                 android:maxHeight=""100dip""                android:thumb=""@drawable/slider_box""                android:thumbOffset=""0dip""                /&gt;&lt;/RelativeLayout&gt;</code></pre><p>background.xml Background of seekbar</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""     android:useLevel=""false"" &gt;    &lt;corners         android:radius=""4dip"" /&gt;    &lt;solid        android:color=""#FF282828"" /&gt;&lt;/shape&gt;</code></pre>","572002","","572002","","2011-03-10 22:27:54","2013-05-14 07:10:00","Android: Custom Drawable in a SeekBar widget is drawing aliased images","<java><android><widget><seekbar>","2","5","2","",""
"4719856","1","4720983","","2011-01-18 02:06:42","0","383","<p>I am trying to create an app which displays the thumbnails of photos in a folder. I am using GridView for this purpose. I have been able to successfully create the view and populate it with images. However, when I tried to implement a context menu option to delete a selected photo, I get ResourcesNotFoundException. </p><p>In the code below I have indiciated where exactly the error occurs. Any pointers would be greatly appreciated.</p><p>Thank you!</p><p>Joe</p><pre><code>    @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.photos);    this.gridView = (GridView) findViewById(R.id.gridView);    imageArrayAdapter = new ImageArrayAdapter(this, R.layout.thumb_item, photosList);    this.gridView.setAdapter(imageArrayAdapter);    registerForContextMenu(gridView);}@Overridepublic void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {    super.onCreateContextMenu(menu, v, menuInfo);    menu.setHeaderTitle(""File Options"");    menu.add(Menu.NONE, 1, Menu.NONE, R.string.delete).    setIcon(R.drawable.delete).    setAlphabeticShortcut('d');}@Overridepublic boolean onContextItemSelected(MenuItem item) {    try {        AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo();        // Works correctly        Toast.makeText(this, item.getId(), Toast.LENGTH_SHORT).show();        // Causes ResourcesNotFoundException        Toast.makeText(this, item.getId(), Toast.LENGTH_SHORT).show();        // Works well, prints false        Toast.makeText(this, """" + (info == null), Toast.LENGTH_SHORT).show();        // Causes ResourcesNotFoundException        Toast.makeText(this, info.position, Toast.LENGTH_SHORT).show();    } catch(Exception ignore) {        Log.e(""onContextItemSelected"", ignore);    }    return(super.onOptionsItemSelected(item));}</code></pre>","544192","","","","","2011-01-18 06:06:12","Android - ResourcesNotFoundException inside onContextItemSelelcted","<android><gridview>","1","0","1","",""
"4719944","1","","","2011-01-18 02:27:09","0","1872","<p>I am having trouble getting my code to insert data from two text boxes into two seperate columns.</p><p>Input:</p><p>Name=1 Rank=2</p><p>Current output:</p><p>(Row 1) Name=11 Rank=null</p><p>Desired output:</p><p>(Row 1) Name=1 Rank=2</p><p>Any help would be greatly appreciated.</p><p>Code on the add page (text boxes + save button):</p><pre><code>package org.x.x;import org.x.x.R;import android.app.ProgressDialog;import android.content.Intent;import android.os.AsyncTask;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;public class Add extends Foundation { private EditText input, input2; private Button saveButton; @Override public void onCreate(final Bundle savedInstanceState) {  Log.d(MyApplication.APP_NAME, ""onCreate"");     super.onCreate(savedInstanceState);     this.setContentView(R.layout.add);     // get ""Application"" object for shared state or creating of expensive resources - like DataHelper     // (this is not recreated as often as each Activity)     this.application = (MyApplication) this.getApplication();     // inflate views     this.input = (EditText) this.findViewById(R.id.Beverage_Txt);     this.input2 = (EditText) this.findViewById(R.id.Rank_Txt);     this.saveButton = (Button) this.findViewById(R.id.save_button);     //this.deleteButton = (Button) this.findViewById(R.id.del_button);     //this.output = (TextView) this.findViewById(R.id.out_text);     // save new data to database (when save button is clicked)     this.saveButton.setOnClickListener(new OnClickListener() {       public void onClick(final View v) {        new InsertDataTask().execute(Add.this.input.getText().toString(), Add.this.input2.getText().toString());          Add.this.input.setText("""");          Add.this.input2.setText("""");       }       }); } @Override public void onSaveInstanceState(final Bundle b) {  Log.d(MyApplication.APP_NAME, ""onSaveInstanceState"");     if ((this.input.getText().toString() != null) &amp;&amp; (this.input.getText().toString().length() &gt; 0)) {      b.putString(Add.NAME, this.input.getText().toString());     }     if ((this.input2.getText().toString() != null) &amp;&amp; (this.input2.getText().toString().length() &gt; 0)) {      b.putString(Add.RANK, this.input2.getText().toString());     }     super.onSaveInstanceState(b); } @Override public void onRestoreInstanceState(final Bundle b) {  super.onRestoreInstanceState(b);  Log.d(MyApplication.APP_NAME, ""onRestoreInstanceState"");  String name = b.getString(Foundation.NAME);  String rank = b.getString(Foundation.RANK);  if (name != null) {      // use onSaveInstanceState/onRestoreInstance state to manage state when orientation is changed (and whenever restarted)         // put some text in input box, then rotate screen, text should remain         // COMMENT this out, and try again, text won't be there - you need to maintain this state - esp for orientation changes         // (you can rotate the screen in the emulator by pressing 9 on numeric keypad)         this.input.setText(name);  }  if (rank != null) {      // use onSaveInstanceState/onRestoreInstance state to manage state when orientation is changed (and whenever restarted)         // put some text in input box, then rotate screen, text should remain         // COMMENT this out, and try again, text won't be there - you need to maintain this state - esp for orientation changes         // (you can rotate the screen in the emulator by pressing 9 on numeric keypad)         this.input2.setText(rank);  } } private class InsertDataTask extends AsyncTask&lt;String, Void, Void&gt; {       private final ProgressDialog dialog = new ProgressDialog(Add.this);       // can use UI thread here       protected void onPreExecute() {          this.dialog.setMessage(""Inserting data..."");          this.dialog.show();       }       // automatically done on worker thread (separate from UI thread)       protected Void doInBackground(final String... args) {          Add.this.application.getDataHelper().insert(args[0], args[0]);          return null;       }       // can use UI thread here       protected void onPostExecute(final Void unused) {          if (this.dialog.isShowing()) {             this.dialog.dismiss();          }          // reset the output view by retrieving the new data          // (note, this is a naive example, in the real world it might make sense          // to have a cache of the data and just append to what is already there, or such          // in order to cut down on expensive database operations)          //new SelectDataTask().execute();       } } @Override public void onBackPressed() {  this.startActivity(new Intent(Add.this, Compare.class)); }}</code></pre><p>Datahelper code:</p><pre><code>package org.x.x;import android.content.Context;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteStatement;import android.util.Log;import java.util.ArrayList;import java.util.List;public class DataHelper {   private static final String DATABASE_NAME = ""example.db"";   private static final int DATABASE_VERSION = 1;   private static final String TABLE_NAME = ""table1"";   private Context context;   private SQLiteDatabase db;   private SQLiteStatement insertStmt;   private static final String INSERT = ""insert into "" + TABLE_NAME + ""(name, rank) 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 SQLiteDatabase getDb() {      return this.db;   }   public long insert(String name, String rank) {      this.insertStmt.bindString(1, name + rank);      return this.insertStmt.executeInsert();   }   public void deleteAll() {      this.db.delete(TABLE_NAME, null, null);   }   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[] { ""name"", ""rank"" }, null, null, null, null, ""id desc"");      if (cursor.moveToFirst()) {         do {            list.add(cursor.getString(0));            list.add(cursor.getString(1));          } while (cursor.moveToNext());      }      if (cursor != null &amp;&amp; !cursor.isClosed()) {         cursor.close();      }      return list;   }   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, name TEXT, rank 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>Template code (shared resources):</p><pre><code>package org.x.x;import java.util.List;import android.app.Activity;import android.app.ProgressDialog;import android.os.AsyncTask;import android.widget.TextView;public class Foundation extends Activity {   public static final String NAME = ""NAME"";   public static final String RANK = ""RANK"";   public MyApplication application;   public TextView output;   public class SelectDataTask extends AsyncTask&lt;String, Void, String&gt; {       private final ProgressDialog dialog = new ProgressDialog(Foundation.this);       // can use UI thread here       protected void onPreExecute() {          this.dialog.setMessage(""Selecting data..."");          this.dialog.show();       }       // automatically done on worker thread (separate from UI thread)       protected String doInBackground(final String... args) {          List&lt;String&gt; names = Foundation.this.application.getDataHelper().selectAll();          /*List&lt;String&gt; ranks = Foundation.this.application.getDataHelper().selectAll();*/          StringBuilder sb = new StringBuilder();          for (String name : names) {             sb.append(name + ""\n"");          }          /*for (String rank : ranks) {        sb.append(rank + ""\n"");       }*/          return sb.toString();       }       // can use UI thread here       protected void onPostExecute(final String result) {          if (this.dialog.isShowing()) {             this.dialog.dismiss();          }          Foundation.this.output.setText(result);       } }}</code></pre><p>MyApplication code:</p><pre><code>package org.x.x;import android.app.Application;import android.util.Log;public class MyApplication extends Application {   public static final String APP_NAME = ""x"";     private DataHelper dataHelper;      @Override   public void onCreate() {      super.onCreate();      Log.d(APP_NAME, ""APPLICATION onCreate"");      this.dataHelper = new DataHelper(this);         }   @Override   public void onTerminate() {      Log.d(APP_NAME, ""APPLICATION onTerminate"");            super.onTerminate();         }   public DataHelper getDataHelper() {      return this.dataHelper;   }   public void setDataHelper(DataHelper dataHelper) {      this.dataHelper = dataHelper;   }}</code></pre>","576820","","","","","2011-01-18 17:15:54","Android - SQLite3 Multiple Columns","<android><sql><mysql><database><insert>","2","1","","",""
"4719961","1","","","2011-01-18 02:30:25","3","1684","<p>Hope someone may give some pointers (or an out right answer)...Simple app, take an image using the built-in camera app, save the image to a separate application.  Be done.</p><p>Problem:  The camera application saves the image in the default app location (/mnt/sdcard/external_sd/DCIM/Camera) as well as my custom path (in code below).Both files are exactly the same except for the file name.  The external_sd file (the one I want gone) is saved with dashes (-) vs my custom file path saved with underscores.  File sizes are exactly the same.</p><p><strong>How can I stop this double image issue?</strong>Is there an extra intent option I'm missing?Or am I doing this completely wrong, missing something?I'm using a Galaxy S Vibrant.</p><p>Code snippet:</p><pre><code>private static Uri _outputFileUri;private static File _file;private ImageView _image;private SimpleDateFormat _simpleDateFormat = new SimpleDateFormat(""yyyy_MM_dd_HH_mm_ss"");     _takePicture = (Button) findViewById(R.id.takePicture);    _takePicture.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            _intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);                      _file = new File(Environment.getExternalStorageDirectory() +                            ""/Android/data/my own folder/files/"",                             _simpleDateFormat.format(new Date()).toString() +                              "".jpg"");            _outputFileUri = Uri.fromFile(_file);            _intent.putExtra(MediaStore.EXTRA_OUTPUT, _outputFileUri);            startActivityForResult(_intent, CAMERA_ACTIVITY);        }    });   @Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    super.onActivityResult(requestCode, resultCode, data);    if (resultCode == RESULT_CANCELED) {        Toast.makeText(this, ""Activity cancelled"", Toast.LENGTH_LONG).show();        return;    }    switch (requestCode) {          case CAMERA_ACTIVITY:             if (resultCode == RESULT_OK) {                try{                    Bitmap b = MediaStore.Images.Media.getBitmap(getContentResolver(), _outputFileUri);                    _image.setImageBitmap(b);                    _image.invalidate();                }                catch(Exception e){                    e.printStackTrace();                }            }            break;    }}</code></pre>","579316","","","","","2011-08-26 17:46:10","Android Camera Intent woes","<android><android-camera>","3","0","3","",""
"4719993","1","4720856","","2011-01-18 02:36:36","1","494","<p>The Title is almost the entire question but i'll complement it with some things :</p><p>-(1) I have a AsyncTask for get some data from Internet-(2) I have a AsyncTask for display a Progress Dialog</p><p>Before call (1) , I execute (2) dialog.show() and when task (2) ends I call dialog.dimiss(). All is doing right , but while the Progress Bar is showing the Menu Button stay unresponsiveness, ie , nothing happens...</p><p>I would like to know if it is the default behavior or i missing something ?</p><p>I'm looking for it and did found anything that clear me about it..</p><p>Aprecciate any advice</p>","502295","","","","","2011-01-18 05:47:18","Is there a way to onCreateOptionsMenus() continue ""listening"" while a Progress Dialog is showing?","<android>","2","0","","",""
"4720040","1","4720060","","2011-01-18 02:45:15","0","935","<p>I recently asked the precursor to this question and had a great reply. However, when i was working this into my android application i am getting an unexpected error and was wondering if everyone could take a look at my code and help me see what i am doing wrong.</p><p>Link to the initial question: <a href=""http://stackoverflow.com/questions/4717953/passing-reference-of-class-to-another-class"">passing reference of class to another class</a></p><p>My ERROR: ""The constructor ConnectDevice(new View.OnClickListener(){}) is undefined""</p><p>The above is an error detected by eclipse.</p><p>Thanks in advance!</p><p>Below are My code snippets:</p><pre><code>public class SmartApp extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.intro);        final Button connectDeviceButton = (Button) findViewById(R.id.connectDeviceButton);        connectDeviceButton.setOnClickListener(        new View.OnClickListener()        {    @Override   public void onClick(View v) {    Thread cThread = new Thread(new ConnectDevice(this));    cThread.start();   }  });    }}public class ConnectDevice implements Runnable { private boolean connected; private SmartApp smartAppRef; private ObjectInputStream ois; public ConnectDevice(SmartApp smartAppRef) {  this.smartAppRef = smartAppRef; }}</code></pre>","427763","","","","","2011-01-18 02:50:19","passing reference of class to another class android error","<java><android><class><reference>","1","0","","",""
"4720268","1","","","2011-01-18 03:41:58","0","120","<p>The ""Hello Testing"" tutorial is excellent. It is easy to follow and does not assume that you know anything about Eclipse.  It shows exactly how to do each step.  </p><p>When I implemented the ""Hello Testing"" tutorial, I expected it to detect the fact that in my Hello World code, I had changed the printed string from ""Hello World"" to ""Hello World, this is MY string""  </p><p>However the ""Hello Testing"" tutorial code takes the hello string that it expects from the Hello World code itself.  </p><p>I am not saying that this is necessarily wrong.  There is a tradeoff involved here, either you duplicate every string, or you use the same strings both for the application code and the test code.  I personally lean toward duplicating strings as I feel that the test code and application code should share as little as possible.  </p><p>I just feel that this ought to be made explicit somewhere.  And, why is there an unused  strings.xml file in HelloAndroidTest/res/values?  I am confident that it is unused because I changed both of the strings in HelloAndroidTest/res/values/strings.xml.  Doing so did not cause the code to fail.  Furthermore, I added a hello2 string in the ap code itself, i.e. HelloAndroid/res/values and was able to reference this string in HelloAndroidTest/HelloAndroidTest.java.</p><p>Again this is a great tutorial.</p>","579308","","","","","2011-01-18 07:49:56","""Hello Testing"" fails to catch errors","<android><unit-testing><hello-world>","1","2","","",""
"4720402","1","","","2011-01-18 04:08:12","1","542","<p>A ""Data connectivity"" error seams to occurs whenever a web page fails to completly load in less then 30 seconds. For testing purposes we're controlling the time it takes for the test web page to load (by running a loop sequence) </p><p>The phone is running: 2.1-update1, it's a samsung captivate running on AT&amp;T. </p><p>Any, information or ideas on how we might overcome this issue and increase the amount of time the device will wait for the web page to finish loading would be greatly appreciated.</p><p>Thanks in advance.</p>","579398","","","","","2011-01-18 04:08:12","Any idea of why the default Android Browser would time out after about 20 seconds?","<android><browser><connection-timeout>","0","0","1","",""
"4720443","1","","","2011-01-18 04:17:28","2","139","<p>I want to show single page (Fit by width) of my PDF file in the DroidReader. I've Googled about it but found no solution. Please guide me about any parameter or putExtra kinda thing which can be pass to DroidReader to do this.</p><p>Thanks in advance.</p>","556702","","556702","","2011-01-18 05:18:43","2011-01-19 15:20:09","Passing Extras to DroidReader","<android><pdf>","1","0","4","",""
"4720460","1","","","2011-01-18 04:21:59","0","164","<p>I currently have my app using a xml style sheet but all the the test users are asking to set their own colors. I can easily get the data for the user but how do I go about changing everything.</p><p>I could have a class called after every activity was fired and have it reset the colors based on the user preferences.  is there a better way?</p>","528130","","","","","2011-01-18 04:35:31","Android programmatically changes colors to users specs","<android><colors>","1","0","","",""
"4720469","1","4720563","","2011-01-18 04:24:51","13","17504","<p>I have a HorizontalScrollView containing a LinearLayout.  On screen I have a Button that will add new Views to the LinearLayout at runtime, and I'd like the scroll view to scroll to the end of the list when a new View is added.</p><p>I almost have it working - except that it always scrolls one view short of the last view.  It seems like it's scrolling without first calculating the inclusion of the new view.</p><p>In my app I am using a custom View object, but I made a small test application that uses ImageView and has the same symptom.  I tried various things like requestLayout() on both the Layout and ScrollView, I tried scrollTo(Integer.MAX_VALUE) and it scrolled into the netherverse :)  Am I violating a UI thread issue or something?</p><ul><li>Rick</li></ul><p>======</p><pre><code>    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 b = (Button) findViewById(R.id.addButton);             b.setOnClickListener(new AddListener());             add();        }        private void add() {             LinearLayout l = (LinearLayout) findViewById(R.id.list);             HorizontalScrollView s =                  (HorizontalScrollView) findViewById(R.id.scroller);             ImageView i = new ImageView(getApplicationContext());             i.setImageResource(android.R.drawable.btn_star_big_on);             l.addView(i);             s.fullScroll(HorizontalScrollView.FOCUS_RIGHT);        }        private class AddListener implements View.OnClickListener {             @Override             public void onClick(View v) {                 add();             }        }    }</code></pre><p>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""&gt;        &lt;HorizontalScrollView            android:id=""@+id/scroller""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:scrollbarSize=""50px""&gt;            &lt;LinearLayout                android:id=""@+id/list""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:padding=""4px""/&gt;        &lt;/HorizontalScrollView&gt;        &lt;LinearLayout            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""                        android:layout_gravity=""center""&gt;            &lt;Button                android:id=""@+id/addButton""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:layout_gravity=""center""                android:paddingLeft=""80px""                android:paddingRight=""80px""                android:paddingTop=""40px""                android:paddingBottom=""40px""                android:text=""Add""/&gt;        &lt;/LinearLayout&gt;    &lt;/LinearLayout&gt;</code></pre>","579400","","579400","","2011-01-18 04:36:30","2013-05-15 12:17:58","HorizontalScrollView: auto-scroll to end when new Views are added?","<android><gui><user-interface><horizontal-scrolling>","4","0","4","",""
"4720512","1","4731882","","2011-01-18 04:32:46","7","6046","<p>First time here so sorry in advance for any butchered formatting.</p><p>So I am completely new to DSP so I have only a very general understanding of the Fourier Transform. I am trying to build a visualizer app for Android SDK 9, which includes a Visualizer class in android.media.audiofx.Visualizer <a href=""http://developer.android.com/reference/android/media/audiofx/Visualizer.html#getFft%28byte%5b%5d%29"">http://developer.android.com/reference/android/media/audiofx/Visualizer.html</a></p><p>The javadoc for the method getFft(), which is what I am using states:</p><blockquote>  <p>""Returns a frequency capture of  currently playing audio content. The  capture is a 8-bit magnitude FFT. Note  that the size of the FFT is half of  the specified capture size but both  sides of the spectrum are returned  yielding in a number of bytes equal to  the capture size.""</p></blockquote><p>First of all, what does ""both sides of the spectrum"" mean? How does this output differ from a standard FFT?</p><p>Here is some sample output of the byte array, getFft() was given 124 points to keep it simple and I grabbed the first 31 bins. Here are the magnitudes of the first 31 bins:</p><pre><code>{123, -2, -23, -3, 6, -16, 15, -10, -8, -12, 9, -9, 17, -6, -18, -22, -8, 4, -5, -2, 10, -3, -11, 3, -4, -11, -8, 15, 16, 11, -12, 12}</code></pre><p>Any help or explanation would be greatly appreciated!</p><p><strong>Edit:</strong> <s> So after staring at a bunch of graphs it looks like part of my problem is Google does not specify what unit is being used. Almost all other measurements are done in mHz, would it be fair to assume that the FTT output is also in mHz? Is there a place where I can see the source code of the Visualizer class so maybe I can figure out what the hell is actually going on under the hood? </s></p><p>I went ahead and grabbed all of the output of getFft()</p><pre><code>93, -2, -28, -16, -21, 19, 44, -16, 3, 16, -9, -4, 0, -2, 21, 16, -3, 1, 2, 4, -3, 5, 5, 10, 6, 4, -9, 7, -2, -1, 2, 11, -1, 5, -8, -2, -1, 4, -5, 5, 1, 3, -6, -1, -5, 0, 0, 0, -3, 5, -4, -6, -2, -2, -1, 2, -3, 0, 1, -3, -4, -3, 1, 1, 0, -2, -1, -1, 0, -5, 0, 4, -1, 1, 1, -1, 1, -1, -3, 2, 1, 2, -2, 1, 0, -1, -2, 2, -3, 4, -2, -2, 0, 1, -4, 0, -4, 2, -1, 0, -3, -1, -1, -1, -5, 2, -2, -2, 0, -3, -2, 1, -5, -2, 0, 0, 0, -2, -2, -1, -1, -1, -2, 0, 3, -3, -1, 0</code></pre><p>So if I understand this correctly, my output here should be from -N to 0 to N. -N to 0 should look just like 0 to N. But when I look at these amplitudes, I don't see any mirrored data. Google seems to indicate that the output should be from 0 to N just on both sides of the spectrum. So I should be able to take the data from (output.length-1)/2 to output.length-1. The negative amplitudes are moving faster than the sample rate and the positive amplitudes are moving slower than the sample rate. Did I understand this correctly? </p>","579416","","579416","","2011-01-19 19:57:56","2011-12-14 01:09:42","Android 2.3 Visualizer - Trouble understanding getFft()","<android><signal-processing><fft><visualizer><android-sdk-2.3>","2","17","2","",""
"4720593","1","","","2011-01-18 04:53:46","1","3281","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2071614/source-not-found-android"">Source not found Android?</a>  </p></blockquote><p>While executing my android application I am getting source not found message.Because of this error message I am not getting the proper output.Please help me to resolve this issue</p>","572297","","","","","2012-02-27 12:53:26","Source not found error in ""Android""","<android>","2","1","","2012-02-27 12:57:39",""
"4720620","1","","","2011-01-18 04:58:28","0","1931","<p>When orientation changes in landscape mode, start a new activity. After back to this activity when orientation in portrait mode in Android.</p>","579396","","58792","","2012-10-03 22:37:09","2012-10-03 22:37:09","Android: orientation change in landscape mode","<android><orientation>","3","4","","2012-10-04 05:35:34",""
"4720670","1","4720697","","2011-01-18 05:09:03","3","190","<p>I know how to load a PDF file in Android. But if more than one PDF viewers are installed, Android shows a list to choose from. I want to load my PDF file with a specific PDF viewer (say DroidReader). How to do this?</p>","476747","","244296","","2011-01-18 05:16:20","2011-01-18 05:43:54","Starting a specific app in Android","<android><pdf><pdfview>","2","1","","",""
"4720840","1","","","2011-01-18 05:43:48","1","561","<p>Now I can do the page down with the following code.</p><pre><code>listView.setSelection(listView.getLastVisiblePosition());</code></pre><p>But when I want to move up to the first visible positon, there is no way to do as page up.Because after moving to the first visible position, I will never know which item should be moved to.I only can move to the upper-one item but not like a page moving.</p><p>Or is there another way to do this?</p><p>Thanks!</p>","428022","","","","","2011-01-18 05:43:48","How to move the ListView as page up function on Android?","<android><listview><scrolling>","0","2","1","",""
"4720881","1","","","2011-01-18 05:51:30","0","1893","<p>I got my code to connect to my computers php file and output the correct text in a java program.  When I tried to add it to my android project inorder to display high scores It always throws an IOException and I can't figure out why.  Here is my code.  Any help would be appreciated.</p><pre>package com.enophz.spacetrash;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.net.MalformedURLException;import java.net.URL;import java.net.URLConnection;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.TextView;public class Scores extends Activity { //private TextView HscoreText; /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.scores);        Button next = (Button) findViewById(R.id.Button01);        next.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                Intent myIntent = new Intent(view.getContext(), Menu.class);                startActivity(myIntent);            }        });        TextView HscoreText = (TextView) findViewById(R.id.text);        try        {         URL page = new URL(""http://192.168.1.108/score.php"");         URLConnection pageconnection = page.openConnection();         BufferedReader in = new BufferedReader(                    new InputStreamReader(                    pageconnection.getInputStream()));         in.close();            HscoreText.setText(""It Worked!"");        }        catch(MalformedURLException e)        {         HscoreText.setText(""MalformedURL"");        }        catch (IOException e)        {         HscoreText.setText(""IOException"");  }    }}</pre>","559431","","","","","2011-01-18 07:27:13","bufferedReader for URL throws IOException","<android>","1","0","","",""
"4720910","1","4721420","","2011-01-18 05:55:09","0","1375","<p>i'm trying to play a video through videoview , the video file i put in the </p><p>res/raw directory.</p><p>so i tried this  :</p><pre><code>Uri uri = Uri.parse(""android.resource://""+this.getApplicationContext().getPackageName()+""logo.mp4"");        splashVideo.setVideoURI(uri);</code></pre><p>but it can't play , could someone tell me , how should i set my file path in uri??</p>","422405","","","","","2011-01-18 08:12:51","android videoview set path","<android>","2","0","","",""
"4720927","1","4721066","","2011-01-18 05:57:13","5","2034","<p>I just read about maintaining state of my android app and stumbled upon onRetainNonConfigurationInstance. But while reading the <a href=""http://developer.android.com/reference/android/app/Activity.html#onRetainNonConfigurationInstance%28%29"">documentation</a> I noticed this sentence:</p><blockquote>  <p>This function is called purely as an optimization, and you must not rely on it being called.</p></blockquote><p>So I wonder: when does it really make sense to use this method. If I cannot rely on it being called, I need another mechanism to transfer state anyway (which in my case would be some serialization). So unless I experience any performance hits, is there any reason why I should go for onRetainNonConfigurationInstance?</p><p>If it would be guaranteed to be called, I'd love to use it, but if it's not, it seems pretty useless.</p><p>Am I missing something? When do you use this method? How would you keep a network connection or things like that?</p><p>Thanks!</p>","292233","","","","","2011-01-18 06:21:51","Should I implement onRetainNonConfigurationInstance?","<android><state>","1","0","0","",""
"4720952","1","","","2011-01-18 06:01:07","0","488","<p>my code is below but not call this method when screen orientation changed .</p><pre><code>public void onConfigurationChanged(Configuration newConfig) {        super.onConfigurationChanged(newConfig            Intent in=new Intent(""com.world.delailsActivity"")                          startActivity(in)}</code></pre><p>and mainfest.xml file is</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".WorldCup"" 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""                    android:configChanges=""keyboardHidden|orientation"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name="".ScoreActivity"" android:label=""@string/app_name""            android:configChanges=""keyboardHidden|orientation"" &gt;            &lt;intent-filter&gt;                &lt;action android:name=""com.worldcup.ScoreActivity"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;</code></pre>","579396","","244296","","2011-01-18 06:06:11","2011-01-18 06:15:02","orientation change in landscape mode","<android>","2","2","","",""
"4720968","1","","","2011-01-18 06:03:44","0","365","<p>I am developing an app which loads the contacts from phone,i am facing a problem of time taken by the contacts at loading from phone ,it takes much time when the contacts are loaded .I have tried two different views for displaying the contacts but loading time did not get affected.</p><p>I am picking contacts name as well as phone numbers of four types like mobile , work,home and other.Please guide me.Thanks in advance.</p>","555688","","","","","2011-01-18 06:28:38","How to reduce the contacts loading time?","<android>","1","1","0","",""
"4720998","1","4721580","","2011-01-18 06:09:37","0","555","<p>I have nearly completed my application and about to upload it into Android Appstore. I need to divide demo and paid versions - one is free with limited capabilities, another one - paid with full functionality. The question is: how to implement it - the only idea which I have in my mind is following:</p><p>Upload 2 independent applications placed on different packages. But in this case there's one obstacle: let say user installed demo application packaged as <code>my.foo.demo</code> then user decided to buy full version which will be installed in package <code>my.foo.paid</code>. In this case I need to provide user with ability to transfer user files/data/preferences from package <code>my.foo.demo</code> to <code>my.foo.paid</code>. Wow, but it's not very simple task (keeping in mind Android's security model)</p><p>Probably there's another approach? Any ideas?</p>","472270","","","","","2011-01-18 07:39:06","Demo and paid application - how to implement?","<android><app-store><packages><demo><paid>","1","0","1","",""
"4721084","1","4721098","","2011-01-18 06:24:16","0","95","<p>I am designing a screen using XML, and my screen is large in height, and can not displaying whole screen, so I am unable to set some properties to that controls which does not display on design screen. Is there any way to show them in Graphical Layout(I have to set properties of those control from property window).</p>","550966","","2074608","","2014-02-15 03:38:14","2014-02-15 03:38:14","How to edit large screens in android","<android>","1","0","","",""
"4721148","1","","","2011-01-18 06:32:36","0","372","<p>Is there a way to create a real android phone image which can be load by Android SDK. Which mean, the Android SDK will load my actual phone image instead of the SDK image. </p><p>""Not to running on the phone but running the image in the emulator""</p><p>There are similar question out there, but I cannot find the answer that solve this problem, therefore I asked here again. Hope someone can help me.</p>","575319","","","","","2011-01-18 06:48:57","Creating a real android phone image which can be load by Android SDK","<android>","1","0","","",""
"4721196","1","5795923","","2011-01-18 06:39:23","0","1795","<p>I use Webview to load an url using loadUrl(url), is there any way to get headers in Webview? Can we customize the header? Can anyone show me the code? Thanks.</p>","430926","","","","","2011-04-26 20:16:05","webview Header Access","<android><android-webview>","1","2","1","",""
"4721212","1","4721390","","2011-01-18 06:41:38","0","396","<p>Hi in my application i have temporary data , currently am using application context for saving these data, but the problem comes when my app put in to background, i loss the data and my application crashing. any way to solve this problem. With the normal flow i don't get any problem, these problem comes when my app put in to background for long time,when resumes app crashing.</p>","487219","","","","","2011-01-18 07:14:47","Android data storage","<android>","1","1","","",""
"4721240","1","4726647","","2011-01-18 06:46:54","0","1471","<p>Calling a .NET 4.0 Soap based WCF Service. There is no exception during the call and the code is working fine.<br> The problem is that the soap resposne only contains the starting xml tag and its end tag but no body.<br> Maybe there is some issue parsing the XML or do we need a REST Based WCF Service for communication. Also the XML returned is pretty huge(~50-150kb)</p><p>Here is that code that I am using:</p><pre><code>SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);SoapObject param = new SoapObject(NAMESPACE, METHOD_NAME);request.addProperty(""CompanyID"",CompanyId);request.addProperty(METHOD_NAME, param);SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(        SoapEnvelope.VER11);envelope.dotNet = true;envelope.setOutputSoapObject(request);AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);androidHttpTransport.call(SOAP_ACTION,envelope);response = (SoapObject) envelope.getResponse(); //Only starting xml tag is returned</code></pre><p>the response object when seen in debugger contains the usual SoapObject properties and drilling down contains an value object inside SoapPrimitive """". But the web service is returning lots of data inside this element. Where is that?</p><p><strong>UPDATE:</strong> On returning a small xml string the android app using KSOAP is getting the complete xml and able to parse it using the above code. </p><p><strong>EDIT: WCF Web Service Method</strong></p><pre><code>public string GetOffersString(string companyID)        {            DataTable dtGetTopOffers;            dtGetTopOffers = SprocWrapper.PROC_GETTOPOFFERS(companyID);            dtGetTopOffers.TableName = ""GETTOPOFFERS"";            XElement xGetTopOffers = Common.SerializeDataTable(dtGetTopOffers);                        XmlDocument doc = new XmlDocument();            doc.LoadXml(xGetTopOffers.Value);            return doc.InnerXml;}</code></pre>","213469","","213469","","2011-01-18 07:18:25","2011-01-18 16:47:25","Android SOAP WCF Service Call - Partial response","<android><wcf><soap>","1","0","","",""
"4721281","1","","","2011-01-18 06:55:02","3","1620","<p>This is my android application:</p><pre><code>package org.me.sampleandroidservlet;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;import java.io.BufferedReader;import java.io.InputStream;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;public class MainActivity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.main);        TextView output=(TextView)findViewById(R.id.main_label);        String result="""";        try        {            HttpClient http=new DefaultHttpClient();            HttpGet httpget = new HttpGet(                 ""http://localhost:8084/SampleWebUser/SampleUser?hello=hi"");            HttpResponse response = http.execute(httpget);                    result=sb.toString();            output.setText(result);            }        catch(Exception ex)        {            ex.printStackTrace();        }</code></pre><p>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;</p><pre><code>/** * * @author Bert Verhelst &lt;verhelst_bert@hotmail.com&gt; */public class SampleUser 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;message recieved from getmethod is\n""                + request.getParameter(""hello"")+""\n""                + ""&lt;/h1&gt;&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>","579515","","579515","","2011-01-18 12:16:37","2011-01-19 06:10:00","I'm unable to call a servlet from my Android application","<android><servlets>","1","0","","",""
"4721294","1","4790484","","2011-01-18 06:57:48","2","2433","<p>I want to delete user name whose name is Leo. So I am putting delete query as follow</p><pre><code>    int i = getContentResolver().delete(Contacts.CONTENT_URI, Contacts.DISPLAY_NAME +""= 'Leo'"",null);    System.out.println(""rows deleted ""+i);</code></pre><blockquote><pre><code>but it returns ""rows deleted 0""</code></pre></blockquote><p>what is wrong with it.</p><p><em>Edits :</em>The above is not working because the field is read only using <code>Contacts.CONTENT_URI</code>You can see using following URI.<a href=""http://developer.android.com/reference/android/provider/ContactsContract.Contacts.html"" rel=""nofollow"">http://developer.android.com/reference/android/provider/ContactsContract.Contacts.html</a></p>","484073","","484073","","2011-09-14 09:16:36","2013-10-15 12:08:28","How to delete contact in android?","<android><contacts><contact>","3","7","1","",""
"4721323","1","4721425","","2011-01-18 07:03:29","0","980","<p>I now have an app with Andoid, and I want to download files onto my sdcard. The files are in a folder and there might be a folder in the folder. </p><p>How do I download the whole folder from a web server to my sdcard?</p><p>I have edited the manifest.xml in my project and know how to download a file to my sdcard, but how do I download an entire folder without changing the structure.</p><p>Thank you!</p>","51958","","750711","","2012-02-09 19:53:54","2012-02-09 19:53:54","How download files of folder in a web server?","<android><file-download>","1","0","","",""
"4721369","1","4723517","","2011-01-18 07:11:19","2","790","<p>I developed j2me, android and blackberry based applications. I need to showing the demo for clients through my own website. Is there any mobile emulator for showing the demo for my application through website?. </p><p>For example user can choose the both type of mobile and type of application and then see the demo on website. Like Nokia RDA devices. Give me some idea for this? </p>","488433","","488433","","2011-01-18 08:02:09","2011-01-18 18:04:46","Is there any mobile emulator for showing demo on website?","<android><blackberry><java-me><emulator><demo>","4","0","2","",""
"4721375","1","","","2011-01-18 07:12:33","1","1060","<p>I am trying to add a control dynamically to a table layout that is hosted inside a tab control. Though the code runs without throwing any error, the newly added control doesn't appear. I would be grateful if you have a look at the code, and let me know which step is incorrect.</p><p>The code is produced below:</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;TableLayout              android:id =""@+id/aTableLayout""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""&gt;                          &lt;/TableLayout&gt;            &lt;TableLayout              android:id=""@+id/anotherTableLayout""                         android:layout_width=""fill_parent""              android:layout_height=""fill_parent""&gt;                          &lt;/TableLayout&gt;                  &lt;/FrameLayout&gt;         &lt;/LinearLayout&gt;  &lt;/TabHost&gt;package bajaj.dinesh.tablayout.test;import bajaj.dinesh.tablayout.test.R;import android.app.Activity;import android.app.TabActivity;import android.os.Bundle;import android.view.ViewGroup.LayoutParams;import android.widget.Button;import android.widget.FrameLayout;import android.widget.TabHost;import android.widget.TableLayout;import android.widget.TableRow;public class TabLayoutTest extends TabActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TabHost tabHost = getTabHost();        TabHost.TabSpec spec;         // Initialize a TabSpec for each tab and add it to the TabHost        spec = tabHost.newTabSpec(""tag1"").setIndicator(""Tag 1"")                      .setContent(R.id.aTableLayout);        tabHost.addTab(spec); //Tag 1        spec = tabHost.newTabSpec(""tag2"").setIndicator(""Tag 2"")        .setContent(R.id.anotherTableLayout);        tabHost.addTab(spec); //Tag 2          FrameLayout frameLayout = tabHost.getTabContentView();        TableLayout tableLayout = (TableLayout)frameLayout.findViewById(R.id.aTableLayout);       /* Create a new row to be added. */        TableRow tableRow = new TableRow(this);         /* Create a Button to be the row-content. */         Button button = new Button(this);         button.setText(""Dynamic Button"");         button.setLayoutParams(new LayoutParams(                      LayoutParams.FILL_PARENT,                      LayoutParams.WRAP_CONTENT));          /* Add Button to row. */          tableRow.addView(button);         /* Add row to TableLayout. */         tableLayout.addView(tableRow,new TableLayout.LayoutParams(                LayoutParams.FILL_PARENT,                LayoutParams.WRAP_CONTENT));    } // end of definition of onCreate method} // end of definition of TabLayoutTest class</code></pre>","579412","","21234","","2011-01-18 08:40:26","2011-01-27 08:04:39","Problem in adding controls to a tabhost dynamically","<android><android-tabhost>","1","1","","",""
"4721438","1","","","2011-01-18 07:21:12","3","1540","<p>I am trying to develop a custom quick action window to be shown on clicking on the widget.Something similar to what is there in Twitter application (<a href=""http://stackoverflow.com/questions/3059155/android-quick-actions-ui-pattern"">Android Quick Actions UI Pattern</a>). Am facing problems in adding custom quick action view due to limitations of the remote views used in widgets.</p><p>Could any one please help me on this??</p><p>Thanks,Kabini</p>","287299","","287299","","2011-01-19 02:50:12","2011-02-14 10:59:31","Custom quick action on a widget","<android><android-widget>","1","0","","",""
"4721449","1","5305835","","2011-01-18 07:23:03","41","56402","<p>I know that the question about turning on/off GPS programatically on android <a href=""http://stackoverflow.com/questions/3745884/how-to-enable-the-gps-setting-automatic"">has</a> <a href=""http://stackoverflow.com/questions/4015094/android-enable-and-disable-gps"">been</a> <a href=""http://stackoverflow.com/questions/2988314/enable-gps-without-forwarding-the-user-to-settings"">discussed</a> <a href=""http://stackoverflow.com/questions/4689634/android-turn-on-gps-like-gps-on-off-widget"">many</a> <a href=""http://stackoverflow.com/questions/4498075/start-android-gps-service"">times</a>, and the answer is always the same: </p><blockquote>  <p>""You can't for security/privacy reasons, you have to forward to location preferences screen and let the user enable/disable it.""</p></blockquote><p>I understand that, however I recently bought <a href=""http://tasker.dinglisch.net/"">Tasker</a> from the market and, among many other things that you can accomplish with it, you can set rules to auto-enable GPS on entering pre-determined applications and disable it on exit (see <a href=""http://lifehacker.com/5599116/how-to-turn-your-android-phone-into-a-fully+automated-superphone"">here</a> for the tutorial on how to do it, and it just works!) and this app can't be signed with the firmware signing key as it works on many android versions and different devices and you don't even need to be rooted.</p><p>I would like to do this in my app. Of course, I don't want to blow up the users privacy, so I would first ask the user if he wants to turn it on automatically with the typical ""remember my decision"" checkbox and if he answers yes, enable it.</p><p>Does anybody have any idea or clue on how Tasker achieves this?</p>","177954","","194894","","2014-02-06 11:25:18","2014-02-06 11:25:18","How can I enable the GPS programmatically on Android?","<android><gps>","6","2","47","",""
"4721450","1","4721524","","2011-01-18 07:23:23","0","353","<p>i have made one simple button panel.<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=""horizontal""  android:gravity=""bottom""  android:id=""@+id/buttonpanel""&gt;  &lt;ImageButton android:id=""@+id/buttonhome""               android:layout_width=""wrap_content""               android:layout_height=""wrap_content""               android:background=""@drawable/homeselector""               android:focusable=""true""&gt;               &lt;/ImageButton&gt;  &lt;ImageButton android:id=""@+id/buttonsearch""               android:layout_height=""wrap_content""               android:layout_width=""wrap_content""               android:background=""@drawable/searchselector""               android:focusable=""true""&gt;               &lt;/ImageButton&gt;&gt;  &lt;ImageButton android:id=""@+id/buttonreg""               android:layout_height=""wrap_content""               android:layout_width=""wrap_content""               android:background=""@drawable/registerselector""               android:focusable=""true""&gt;               &lt;/ImageButton&gt;&gt;  &lt;ImageButton android:id=""@+id/buttonlogin""               android:layout_height=""wrap_content""               android:layout_width=""wrap_content""               android:background=""@drawable/loginselector""               android:focusable=""true""&gt;               &lt;/ImageButton&gt;&lt;/LinearLayout&gt;</code></p><p>Now my problem is that i am using it in my entire app.suppose i have 4 activity class that includes this panel.</p><p><strong>so i have to write the below  code number of times as activity classess.</strong></p><pre><code>buttonhome=(ImageButton)findViewById(R.id.buttonhome);    buttonhome.setOnClickListener(this);    buttonsearch=(ImageButton)findViewById(R.id.buttonsearch);    buttonsearch.setOnClickListener(this);    buttonreg=(ImageButton)findViewById(R.id.buttonreg);    buttonreg.setOnClickListener(this);    buttonlogin=(ImageButton)findViewById(R.id.buttonlogin);    buttonlogin.setOnClickListener(this);}public void onClick(View view){    int id=view.getId();    switch (id) {    case R.id.buttonhome:        break;    case R.id.buttonsearch:        break;    case R.id.buttonreg:        break;    case R.id.buttonlogin:        finish();        startActivity(new Intent(""com.coupon.main.couponmandi.Login""));        break;    }</code></pre><p>so is there any way that i can make one single class that handles all things.</p><p>thankx</p>","411359","","","","","2011-01-18 07:31:22","how to customize class for imagebutton panel?","<android><android-layout>","1","0","","",""
"4721608","1","","","2011-01-18 07:44:19","5","1694","<p>I'm using Titanium SDK 1.5.1 for both iPhone and Android development.I have an app that loads a map with my current position perfectly on iPhone. But, for android, nothing is showing but an error from the Geolocation API.</p><p>I added my Android Map API key and other properties in the tiapp.xml file:</p><pre><code>&lt;property name=""ti.android.debug"" type=""bool""&gt;false&lt;/property&gt;    &lt;property name=""ti.android.google.map.api.key.development""&gt;xxxxxxxxxxxxxxxxxxx&lt;/property&gt;    &lt;android xmlns:android=""http://schemas.android.com/apk/res/android""&gt;            &lt;uses-permission android:name=""android.permission.INTERNET""/&gt;            &lt;uses-permission android:name=""android.permission.ACCESS_WIFI_STATE""/&gt;            &lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE""/&gt;            &lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""/&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_MOCK_LOCATION""/&gt;    &lt;/android&gt;</code></pre><p>Then, in my js file, I added the two lines:</p><pre><code>Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;Titanium.Geolocation.distanceFilter = 10;</code></pre><p>And, for the call, here is the code:</p><p>Titanium.Geolocation.getCurrentPosition(function(e){</p><pre><code>    if (e.error)    {        alert('Error while retrieving your position!');        return;    }var longitude = e.coords.longitude;var latitude = e.coords.latitude;....</code></pre><p>On my device, the app returns the alert above even if I allow Android to access to my position (in Android Settings).</p><p>So what is the problem?</p><p>Thanks by advance!</p>","231116","","","","","2011-08-08 01:17:38","Android can't retrieve my current position (Appcelerator Titanium)","<android><titanium><appcelerator>","1","2","3","",""
"4721624","1","","","2011-01-18 07:46:43","1","1981","<p>I'm trying to display a full screen swf using the WebView. My goal is to have the swf call back into the javascript->java to call a function.  I've tried embedding my swf using swfobject and doing allowScriptAccess.  This method looks terrible for sizing, but alas, unable to call the external javascript.  The flash looks best when I do a loadUrl(file:///android_asset/file.swf?width=200&amp;height=343) but this method also doesn't allow for external calls to be performed by flash.</p><p>Anyone have this issue?  I can call them fine from my javascript client code. Have the alert working and a couple other links.  Just missing some small piece in flash calls or permissioning i think. </p><p>We've tried in our flash.</p><pre><code>ExternalInterface.call(""window.alert"", ""test"");ExternalInterface.call(""alert"", ""test"");ExternalInterface.call(""window.histree.alert"", ""test"");</code></pre><p>This is my webview setup</p><pre><code>   /* Get the WebView */   wv1 = (WebView) findViewById(R.id.wv1);   wv1.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);    /* Activate JavaScript */    wv1.getSettings().setJavaScriptEnabled(true);    wv1.getSettings().setPluginsEnabled(true);    wv1.setBackgroundColor(R.color.black);    wv1.setWebViewClient(new InsideWebViewClient());    wv1.addJavascriptInterface(new HistreeJavaScriptInterface(), ""histree"");    wv1.setWebChromeClient(new WebChromeClient() {                  @Override        public boolean onJsAlert(WebView view, String url, String message, JsResult result) {            AlertDialog.Builder adb=new AlertDialog.Builder(HistreeView.this);            adb.setMessage(message);            adb.setPositiveButton(R.string.OK, null);            adb.show();                     result.confirm();            return true;        }    });</code></pre>","573716","","573716","","2011-01-18 19:30:46","2011-01-18 19:30:46","Android WebView with embedded Flash not able to make external interface calls","<javascript><android><flash><webview>","0","2","4","",""
"4721626","1","","","2011-01-18 07:46:58","6","17610","<p>I want to use it in my array adapter. When I put <code>this</code> in a sub-activity to create an adapter it does not work.</p>","579568","","2000012","","2013-07-05 11:46:49","2013-07-05 11:46:49","How to get the current context?","<android>","3","0","2","",""
"4721659","1","","","2011-01-18 07:51:29","2","509","<p>Is it possible to write an Android ""application"" that automatically (or manually on custom lock screen) responses the incoming phone call with the pre-recorded voice sound?</p>","2556909","","","","","2011-01-18 07:51:29","Android auto response with pre-recorded voice?","<android><response><voice>","0","0","1","",""
"4721690","1","4722737","","2011-01-18 07:56:13","1","651","<p>In my android project I need to get access for each separate pixel of JPEG image. Image created by built-in photo application. I try to convert JPEG into <code>Bitmap</code> class instance, but <code>OutOfMemoryException</code> was thrown. After searching info about this problem I have found the following solution: resize image! But quality of image is important in my project, and i can't resize it. Is there any way to get each-pixel access?</p>","571914","","","user663896","2011-09-22 18:57:20","2011-09-22 18:57:20","Access to separate pixel of JPEG image in Android","<android><bitmap><jpeg>","2","1","","",""
"4721697","1","4758651","","2011-01-18 07:57:28","2","1392","<p>Is there any way in android to intercept activity method calls (just the standart ones, like ""onStart. onCreate"")?I have a lot of functionality that must be present in every activity in my app, and (since it uses different types of activities (List, Preferences)) the only way to do it is to create my custom extensions for every activity class, which sucks :(</p><p>P.S. I use roboguice, but since Dalvik doesn't support code generation at runtime, I guess it doesn't help much.</p><p>P.S.S. I thought about using AspectJ, but it's too much of a hassle since it requires a lot of complications (ant's build.xml and all that junk) </p>","495663","","136445","","2011-02-03 18:19:17","2013-01-31 04:31:23","Activity interceptor","<android><guice><roboguice>","3","0","","",""
"4721732","1","","","2011-01-18 08:03:22","6","27986","<p>I am Newbee to Database concepts specially i need relative database concepts..I want an example working that uses sqlite database for android..i walked through android developer site but found very little stuff regarding database examples..As i am new to database concepts Can anyone suggest me some good resources for understanding create(),insert(),Query()...etc..and it would be better if i get any sample program working with android..</p><p>Thanks in advance</p>","505580","","","","","2013-12-01 09:03:10","sqlite example program in android","<android><sqlite3>","1","3","8","2013-12-02 04:40:18",""
"4721740","1","","","2011-01-18 08:04:37","-1","681","<p>move screen from finger in android just like a slider please give me a example .</p><p>thanks Ashish</p>","579396","","","","","2013-01-09 11:14:35","move screen from finger","<android>","1","1","","",""
"4721746","1","6426785","","2011-01-18 08:05:25","0","589","<p>I'd like to create an image dynamically which is combined from some other images.</p><p>The other images are being selected randomly from a pre loaded Bitmap images array.How it can be done?</p>","341497","","488657","","2013-03-07 03:58:47","2013-03-07 03:58:47","Create Dynamic Image","<android><graphics><bitmap><drawable>","1","1","","",""
"4721772","1","4721855","","2011-01-18 08:09:13","0","1044","<p>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=""fill_parent""&gt;    &lt;TextView android:id=""@+id/Title"" android:text=""title""        android:layout_width=""fill_parent"" android:layout_height=""wrap_content""        android:singleLine=""true"" android:layout_alignParentTop=""true"" /&gt;    &lt;EditText android:id=""@+id/ReplyText"" android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:gravity=""top""        android:layout_below=""@+id/Title"" android:layout_above=""@+id/Save"" /&gt;&lt;!--    &lt;WebView android:id=""@+id/webview"" android:layout_width=""fill_parent""--&gt;&lt;!--        android:layout_height=""fill_parent"" android:layout_below=""@+id/Title""--&gt;&lt;!--        android:layout_above=""@+id/Save""/&gt;--&gt;    &lt;Button android:text=""Save"" android:id=""@+id/Save""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:layout_centerHorizontal=""true"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Output in sdk 3 (1.5) and sdk 9 (2.3)<img src=""http://i.stack.imgur.com/hgfSs.png"" alt=""alt text""></p><p><strong>Question:</strong> Why EditText is not displaying in 1.5 version?</p><p>There must be a solution of this, because if I replace EditText with WebViewwith a little code added in onCreate method:</p><pre><code>WebView mWebView = (WebView) findViewById(R.id.webview);mWebView.getSettings().setJavaScriptEnabled(true);mWebView.loadData(""test"", ""text/html"", ""utf-8"");mWebView.setWebViewClient(new WebViewClient());</code></pre><p>It displays WebView perfectly in both the version.</p><p><strong>Goal:</strong> I want to set header and footer elements as show in picture and middle element should have full height/width of the rest of the place.</p>","415865","","","","","2011-06-07 12:03:09","Android: Relative layout issue","<android><android-layout>","2","0","","",""
"4721775","1","","","2011-01-18 08:09:45","0","2396","<p>I have the following requirement</p><p>1> When the user clicks on the button , the SD card should be accessible to the user.</p><p>2> The user clicks on a specific image &amp; I need to save the SD card path of the image selected</p><p>3> I need to resize the image before displaying that to the user within the Android application</p><p>Kindly provide me any blog/article link from where I can get the sample code for the same.Thanks in advance.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2011-01-18 15:34:30","Access the SD card files from Android application","<android>","1","1","","",""
"4721895","1","","","2011-01-18 08:27:04","4","1789","<p>I have a properties file.I know that its possible to give </p><pre><code>key = value1, value2,value3</code></pre><p>inside properties file.</p><p>My requirement is like:</p><pre><code>key = value1[1, 2], value2[3,4]</code></pre><p>Is this possible?</p>","504162","","505893","","2011-03-30 09:54:23","2011-03-30 09:54:23","Can we have value inside properties file as an array of values?","<java><android>","2","0","","",""
"4721931","1","","","2011-01-18 08:31:40","0","1162","<p>i set my videoView width &amp; height : ""fill_parent""</p><p>but i want it to fit screen(full screen , don't keep it original ratio)</p><p>how can i scale it?</p>","422405","","","","","2011-08-03 13:35:57","android videoview scalemode","<android>","1","0","","",""
"4722109","1","","","2011-01-18 08:52:52","0","303","<p>i find that there are only two videos that showed at CES2011 on internet and no other information about it. Such as which linux do honeycomb use.</p><p>Does anyone know more about the honeycomb? </p><p>thank you very much!</p>","579639","","750987","","2011-05-29 06:49:11","2011-05-29 06:49:11","information about honeycomb","<android><android-3.0-honeycomb>","3","0","","",""
"4722201","1","","","2011-01-18 09:02:49","0","1045","<p>I'm developing simple javascript game,which should be embeded in Android and Iphone in-app browser.I have problem with sounds. I tried this, works good on PC,but not working on android and works strange with big delays on iphone.</p><p>init:</p><pre><code>var hitSound = new Audio('hit.wav');</code></pre><p>play:</p><pre><code>hitSound.play();</code></pre><p>How to play sounds without delay on Android and Iphone  browser? </p>","544493","","","","","2011-01-18 09:29:07","Javascript sounds in Android and Iphone browser","<javascript><iphone><android><sounds>","2","0","","",""
"4722215","1","4722643","","2011-01-18 09:04:02","0","765","<p>Hi can anybody tell  how to add webview in table layout give example</p><p>thanks</p>","426344","","","","","2011-01-18 09:53:45","how to add webview in table layout in android","<android>","1","0","","",""
"4722517","1","","","2011-01-18 09:35:16","0","5449","<p>I'm trying to create a widget button to run an application activity directly through the home screen.the widget change the image when i press it according to the my_button.xml file.but i can't create an event when i click on it.</p><p>i need to know how to call ""onPress"" event (for example) in order to call a method inside my main activity.I would appreciate your help</p><p>i attached the relevant files.</p><p><strong>widget.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_height=""wrap_content"" android:layout_width=""wrap_content""&gt;  &lt;Button        android:id=""@+id/button_one""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:padding=""10dp""        android:background=""@drawable/my_button"" /&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>my_button.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;item android:drawable=""@drawable/btn1""          android:state_pressed=""true"" /&gt;    &lt;item android:drawable=""@drawable/btn2""          android:state_focused=""true"" /&gt;    &lt;item android:drawable=""@drawable/btn3"" /&gt;&lt;/selector&gt;</code></pre><p><strong>myWidgetProvider.java</strong></p><pre><code>package com.callsift.activity;import android.app.Notification;import android.app.NotificationManager;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;import android.widget.Toast;public class MyWidgetProvider extends AppWidgetProvider {    public static String ACTION_WIDGET_CONFIGURE = ""ConfigureWidget"";    public static String ACTION_WIDGET_RECEIVER = ""ActionReceiverWidget"";        @Override        public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {            Toast.makeText(context, ""onUpdate"", Toast.LENGTH_SHORT).show();            RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget);            Intent configIntent = new Intent(context, CallSift.class);            configIntent.setAction(ACTION_WIDGET_CONFIGURE);            Intent active = new Intent(context, MyWidgetProvider.class);            active.setAction(ACTION_WIDGET_RECEIVER);            active.putExtra(""msg"", ""Message for Button 1"");            //PendingIntent actionPendingIntent = PendingIntent.getBroadcast(context, 0, active, 0);            PendingIntent configPendingIntent = PendingIntent.getActivity(context, 0, configIntent, 0);        //  remoteViews.setOnClickPendingIntent(R.id.button_one, actionPendingIntent);            remoteViews.setOnClickPendingIntent(R.id.button_one, configPendingIntent);            appWidgetManager.updateAppWidget(appWidgetIds, remoteViews);        }        @Override        public void onReceive(Context context, Intent intent) {            // v1.5 fix that doesn't call onDelete Action            final String action = intent.getAction();            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(ACTION_WIDGET_RECEIVER)) {                    Toast.makeText(context, ""blblbl"", Toast.LENGTH_SHORT).show();                    String msg = ""null"";                    try {                        msg = intent.getStringExtra(""msg"");                    //  Toast.makeText(context, ""test"", Toast.LENGTH_SHORT).show();                    } catch (NullPointerException e) {                        Log.e(""Error"", ""msg = null"");                    }                    Toast.makeText(context, ""ttttt"", Toast.LENGTH_SHORT).show();                    PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intent, 0);                    NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);                    Notification noty = new Notification(R.drawable.icon, ""Button 1 clicked"", System.currentTimeMillis());                    noty.setLatestEventInfo(context, ""Notice"", msg, contentIntent);                    notificationManager.notify(1, noty);                } else {                    // do nothing                }                super.onReceive(context, intent);            }        }    }</code></pre><p><strong>androidmainfast.xml - Relavent part</strong></p><pre><code>        &lt;!-- Broadcast Receiver that will process AppWidget updates --&gt;&lt;receiver android:name="".MyWidgetProvider"" android:label=""@string/app_name""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;        &lt;!-- Broadcast Receiver that will also process our self created action --&gt;            &lt;action android:name=""com.callsift.activity.MyWidgetProvider.ACTION_WIDGET_RECEIVER""/&gt;    &lt;/intent-filter&gt;    &lt;meta-data android:name=""android.appwidget.provider"" android:resource=""@xml/button_widget_provider"" /&gt;&lt;/receiver&gt;</code></pre>","552222","","","","","2011-01-19 09:01:38","android widget button on press event","<java><android><android-widget>","2","0","0","",""
"4722575","1","","","2011-01-18 09:42:23","4","41631","<p>I'm writing an application which is supposed to dump data on the SD card and then another application on a pc which should read the data when the device is connected to the pc (in disc drive mode).On my HTC Legend there is a dialog to choose between: Charge only, HTC Sync, Disk drive..</p><p>Is there a possibility to set the mode with which the device is connecting to the pcor at least an intent to ask the user to switch the mode?</p>","2450","","","","","2013-01-04 00:27:33","How to set the Usb connection mode?","<android><usb><connectivity>","4","2","1","",""
"4722637","1","4722816","","2011-01-18 09:52:40","0","815","<p>I need to create an Android application, I'm not sure which is a better way of doing this by better I mean should I use the <code>WebView</code> or create an application .</p><p>I need to implement the existing application which is a ASP.NET application which mainly consists of a login screen, once the user logs in he will see a list a items in probably a gridview based on the selection from the gridview. He then will be shown more detailed info about the selected item.</p><p>The above is a web application I need to implement this as a app on Android phone.</p><p>Also there will be a need to use the GPS where based on the GPS values the department will be selected and also use the camera to take a picture and save it on to the server .</p><p>A solution which I was thinking of was to expose .NET web services and then access it in the android phone!</p><p>But I am very new to Android development and really do not how to go about this. Is there any better solution?</p><p>Can anyone help me as to how do I go about this ?</p>","579715","","561309","","2012-02-20 13:39:42","2012-02-20 13:39:42","Android app accesses web service","<android>","2","1","2","",""
"4722670","1","","","2011-01-18 09:56:19","4","2530","<p>I would like to launch the native android camera and save the image at a specified location. The problem is after I click the photo, the preview comes up with the options to Save/Discard. After I click save the camera launches again, and the image I captured is not saved in the specified location. Rather it gets saved in the default location. Actually I need the location of the image I clicked. Here's the code I use to launch the camera.</p><pre><code>MediaScannerConnection_MSC = null;String fileName = String.valueOf(System.currentTimeMillis())+"".jpg"";f = new File(Environment.getExternalStorageDirectory(), fileName);_imageUri = Uri.fromFile(f);// create new IntentIntent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);intent.putExtra(MediaStore.EXTRA_OUTPUT, _imageUri);startActivityForResult(intent, 1);</code></pre><p>Here's the code after returning from the camera</p><pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {        if (requestCode == 1) {            if (resultCode == RESULT_OK) {                // use imageUri here to access the image                final String imagePath = f.getAbsolutePath();                _MSC = new MediaScannerConnection(this, new MediaScannerConnectionClient() {                    public void onMediaScannerConnected() {                        _MSC.scanFile(imagePath, null);                    }                    public void onScanCompleted(String path, Uri uri) {                        _MSC.disconnect();                        _MSC = null;                    }                });                _MSC.connect();            }        }    }</code></pre><p>what mistake am I doing here</p>","266272","","266272","","2011-01-18 11:08:07","2012-06-21 23:35:05","Android saving image using native camera","<android><android-camera>","1","1","2","",""
"4722724","1","","","2011-01-18 10:01:16","1","1396","<p>in tablelayout how  show a line between two row in android.</p>","579396","","","","","2011-01-18 12:11:04","between table row show a line","<android>","1","0","","2012-08-17 07:48:35",""
"4722781","1","4771910","","2011-01-18 10:06:07","1","763","<p>i have a grid of TextViews shown inside a TableLayout; when the user taps a TextView i need to change the cell's background by adding an ImageView that will go to another cell when other cell will be clicked.Which is the best way to do this in Android?</p><p>Thanks in advance and greetingsc.</p>","339500","","339500","","2011-01-20 14:21:00","2011-01-23 02:17:57","Android: how to show and move ImageView in TableLayout","<android><imageview><tablelayout>","3","2","","",""
"4722808","1","","","2011-01-18 10:09:24","3","2977","<p>I need to develop an application which works in English and Japanese both. </p><p>I need language change for only my application and rest all other phone applications should be in default language.</p><p>Please help me with some code snippet / apis to use in android 2.2</p>","298943","","20402","","2011-01-18 10:10:42","2013-10-28 10:11:33","Code for multilingual support in android","<android><localization><multilingual>","3","1","3","",""
"4722928","1","","","2011-01-18 10:22:57","14","10046","<p>Is there an intent requesting to get multiple images?</p><p>We are aware of <code>Intent.ACTION_PICK</code> or <code>Intent.ACTION_GET_CONTENT</code> for getting a single image. Also our app registers as IntentFilter for <code>android.intent.action.SEN</code>D and <code>android.intent.action.SEND_MULTIPLE.</code></p><p>However, we would like our app to make use of Gallery like applications to pick multiple images. Is there an intent for that?</p>","501976","","1562548","","2013-12-13 04:07:08","2013-12-13 04:07:08","Intent for getting multiple images","<android>","2","2","7","",""
"4722974","1","4722985","","2011-01-18 10:28:23","31","78438","<p>I want some simple example on thread creation and invoking of threads in android.</p>","563593","","713468","","2013-02-18 10:54:26","2013-02-18 10:54:26","threading Example in android","<android><multithreading>","3","0","18","",""
"4723152","1","4724742","","2011-01-18 10:46:19","0","324","<p>I have a website and an Android app. When user visits the website from his Android device, I'd like to offer user a link to install this app, but only if the app is not installed yet. Is there a way to do this?</p>","6533","","","","","2011-01-18 15:21:52","When user opens a website, how to offer to install an app if it is not installed?","<android>","1","0","1","",""
"4723382","1","","","2011-01-18 11:12:42","1","524","<p>Hi i'm trying to set up a quick search for my application but i only get a ClassNotFoundException after clicking the search button. I just want to show the user input in a Log. Here's what i got so far:</p><p><strong>Manifets.xml</strong> </p><pre><code>&lt;activity android:name="".SearchActivity""&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;!-- declare the default searchable Activity for the whole app --&gt;          &lt;meta-data android:name=""android.app.default_searchable""                    android:value="".SearchActivity""/&gt;</code></pre><p><strong>searchable.xml</strong></p><pre><code>&lt;searchable xmlns:android=""http://schemas.android.com/apk/res/android""    android:label=""@string/search_label""    android:hint=""@string/search_hint"" &gt;&lt;/searchable&gt;</code></pre><p><strong>SearchActivity.java</strong></p><pre><code>@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.searchresults);        final Intent queryIntent = getIntent();        final String queryAction = queryIntent.getAction();        if (Intent.ACTION_SEARCH.equals(queryAction)) {            String searchKeywords = queryIntent.getStringExtra(SearchManager.QUERY);            Log.i(""YOU ENTERED"", searchKeywords);        }    }</code></pre><p>What i'm i doing wrong? Any help will be really appreciated.</p><p>Thanks!!</p><p><strong>EDIT</strong>: here is the log file:</p><pre><code>01-18 13:34:03.479: ERROR/AndroidRuntime(28349): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{se.madcoderz.searchExample/se.madcoderz.searchExample.SearchActivity}: java.lang.ClassNotFoundException: se.madcoderz.searchExample.SearchActivity in loader dalvik.system.PathClassLoader[/data/app/se.madcoderz.searchExample-2.apk]01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at android.os.Handler.dispatchMessage(Handler.java:99)01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at android.os.Looper.loop(Looper.java:123)01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at java.lang.reflect.Method.invokeNative(Native Method)01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at java.lang.reflect.Method.invoke(Method.java:521)01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at dalvik.system.NativeStart.main(Native Method)01-18 13:34:03.479: ERROR/AndroidRuntime(28349): Caused by: java.lang.ClassNotFoundException: se.madcoderz.searchExample.SearchActivity in loader dalvik.system.PathClassLoader[/data/app/se.madcoderz.searchExample-2.apk]01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)01-18 13:34:03.479: ERROR/AndroidRuntime(28349):     ... 11 more</code></pre><p>The SDK version i'm using is 1.6</p>","526924","","526924","","2011-01-18 12:42:53","2011-01-18 16:30:10","problem with quick search android","<android>","1","3","","",""
"4723412","1","4723465","","2011-01-18 11:17:12","1","1491","<p>I tried simple stopwatch program from <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ChronometerDemo.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ChronometerDemo.html</a>.</p><p>The following error is coming</p><p>""R.layout.chronometer cannot be resolved or is not a field""</p><p>I don't know how to fix it.</p><p>Thank you.</p>","565106","","","","","2012-10-05 15:43:29","R.layout.chronometer cannot be resolved or is not a field- android error","<android><android-widget><chronometer>","2","0","","",""
"4723453","1","","","2011-01-18 11:22:13","8","8655","<p>Soon I could use a SIP to GSM gateway, because I'll need to make phone calls from Germany to a mobile phone in Czech Republik. Hence, I thought about implementing one.</p><p>Now, the questions are:</p><ul><li>Does such a solution already exist (for a reasonable price)?</li><li>Is it possible to redirect a (voice) stream to a GSM connection with the available Android APIs (SDK or NDK)?</li></ul><p>Ideas, suggestions, comments are highly welcome.</p>","","user346034","1288","","2011-03-09 19:45:31","2012-10-28 14:39:04","Android as SIP to GSM gateway","<android><sip><gsm><gateway>","3","4","7","",""
"4723462","1","4723673","","2011-01-18 11:22:36","0","978","<p>I am using service in my program where i have MainActivity.java and MyService.java in Mainactivity i called intent as </p><pre><code>public void onClick(View src)    {        switch (src.getId()) {        case R.id.ButtonStart:            Log.d(TAG, ""onClick: starting service"");            startService(new Intent(this,com.example.MyService1.class));            break;        case R.id.ButtonStop:            Log.d(TAG,""onClick: stopping service"");            stopService(new Intent(this,com.example.MyService1.class));            break;        }    }</code></pre><p>but i am getting error on Log.d that ""WARN/ActivityManager(68): Unable to start service Intent { cmp=com.example/.MyService1 }: not found"" please tell me solution.</p>","573776","","20402","","2011-01-18 11:26:06","2011-03-04 02:23:09","Getting error source/class not found","<android>","2","0","","",""
"4723500","1","","","2011-01-18 11:27:01","17","12754","<p>Whenever I assign background to a view that is laid out with wrap_content, if the background image is larger than a view, the view is stretched so that it can hold the entire background. Why is it so and how to prevent it? It occurs even if the image is 9-patch and has stretchable areas marked - why isn't the image shrunk to the size of the view?</p>","6533","","","","","2012-02-09 15:25:24","Prevent background image from stretching the view","<android>","6","0","2","",""
"4723506","1","8133852","","2011-01-18 11:27:32","1","1523","<p>I'm currently developing an Android app, which loads events from a server using JSON and stores the event data into a local SQLite database.</p><p>I want to display the calendar events from within the app. If the device is in portrait mode, the calendar should be displayed in month view and if the device is in landscape mode it should be displayed in week view. Of course the events should be clickable.</p><p>Could anyone point me in the right direction by showing me an example of something similar? The whole thing should be possible for Android 1.6 onwards.</p><p>Any help is very much appreciated!</p>","480370","","","","","2012-12-17 02:24:59","Display calendar inside Android app","<android><calendar>","2","0","","",""
"4723636","1","4724616","","2011-01-18 11:43:53","0","8889","<p>Hii every one, am brand new to android,i have a doubt can any one help me</p><p>In this following link </p><p><a href=""http://www.androidpeople.com/android-xml-parsing-tutorial-using-saxparser/"" rel=""nofollow"">http://www.androidpeople.com/android-xml-parsing-tutorial-using-saxparser/</a></p><p>there is a sax parser in which xml file is taken from the internet, using a URL pathHow to change that url to local path in which xml is stored in raw folder of the project,,can any one give me the syntax ,,thanx in advance</p>","571256","","571256","","2011-01-18 11:53:58","2012-08-01 08:59:45","Parsing local xml file in android","<android><xml><parsing>","4","0","","",""
"4723640","1","","","2011-01-18 11:44:22","0","143","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4691422/android-facebook-sdk"">android facebook sdk</a>  </p></blockquote><p>Hello All,    I have downloaded Facebook SDK from git repositry. When i try to execute the sample project given in git repositry it successfully logged in,post wall in Simulator but when i execute my android device htc Get error like <strong>Login Failed: Server Failed to communicate. Try Again Later.</strong></p>","579864","","","","","2011-03-24 13:06:21","Android Facebook SDK","<android>","0","3","","2011-03-24 13:25:27",""
"4723654","1","4732001","","2011-01-18 11:45:55","1","3861","<p>I have html text that I want to show in webview.</p><p>As <a href=""http://developer.android.com/reference/android/webkit/WebView.html#loadData%28java.lang.String,%20java.lang.String,%20java.lang.String%29"" rel=""nofollow"">specification</a>, data must be URI-escaped.So I tried to use URLEncoder.encode() function, but that will not help me, as it converts blank space with plus sign.</p><p>So is there any encoding function available?</p>","415865","","246246","","2012-09-06 22:06:56","2013-01-22 10:48:54","Android: HTML encoder","<java><android><html-encode>","3","4","","",""
"4723681","1","4723829","","2011-01-18 11:48:37","6","19784","<p>I am writing an android project which has Native layer helping the java layer, and am stuck at a place where when i try to do a System.loadLibrary, it is throwing error that it is not able to link it. </p><p>I am using Target specific NDK to build the native layer, and then using ant to compile and create the apk. </p><p>On running on the device i get the following error. </p><p>Unable to dlopen(libsomething.so) Cannot load library: link_image[1995]: failed to link libsomething.so</p><p>The library get bundled into the apk, and is unpacked properly. If i try to remove the library manually and then run it, it then actually throws that library not found. So it is able to find the library, but it throws this error, and i am not able to find out why this error is coming.</p><p>Please help me.</p>","473184","","","","","2013-02-01 11:27:27","Unable to dlopen(libsomething.so) Cannot load library: link_image[1995]: failed to link libsomething.so","<android><android-ndk>","4","0","1","",""
"4723766","1","","","2011-01-18 11:57:19","2","4852","<ul><li>In the class <strong>ConnectivityManager</strong>, I see a method as belows:  </li><li>public int <strong>startUsingNetworkFeature</strong>(int n*<em>etworkType</em>*, String <strong>feature</strong>)</li><li>In my opinion:</li><li><p><strong>networkType</strong> = TYPE_MOBILE or TYPE_WIFI or TYPE_MOBILE_MMS or TYPE_MOBILE_SUPL or TYPE_MOBILE_DUN or TYPE_MOBILE_HIPRI</p><p><strong>- feature = ?</strong></p></li><li><p>Please help me to answer the question ""<strong><em>what value of feature is valid</em></strong>"".</p></li><li><p>Thanks &amp; best regards,</p></li><li>DaiSon</li></ul>","434538","","","","","2011-01-19 21:34:52","What value of feature in method startUsingNetworkFeature(int networkType, String feature) is valid","<android>","1","0","","",""
"4723820","1","4724506","","2011-01-18 12:04:37","0","1072","<p>I'm trying to develop an android application which uses c2dm services. I've read many tutorials and had a look to the chrometophone example. Seems to be an easy task, but still I can't manage to make things work. The last guide I followed is this one:<a href=""http://www.johnhawthorn.com/2010/12/android-cloud-to-device-messaging-1/"" rel=""nofollow"">http://www.johnhawthorn.com/2010/12/android-cloud-to-device-messaging-1/</a>. I really can't understand if I need to create an instance of the class C2DMReceiver or it will be created automatically when the c2dm service will call one of the functions declared in the class, e.g. onRegistered().</p>","579717","","","","","2011-01-18 13:19:57","C2DM: where does C2DMReceiver get instantiated?","<android><android-c2dm>","1","0","1","",""
"4723848","1","4724552","","2011-01-18 12:07:12","0","855","<p>I want to execute a query something like :</p><pre><code>INSERT INTO MyTable VALUES(datetime('now'));</code></pre><p>Where <code>MyTable</code> has schema:</p><pre><code>CREATE TABLE MyTable(mydate DATETIME)</code></pre><p>When executed in SQLite Manager query runs perfectly inserting the current datetime value in <code>mydate</code> column of <code>MyTable</code>.</p><p>But when executed using </p><pre><code>ContentValues cv=new ContentValues();cv.put(MyTable.mydate,""datetime('now')"");getContentResolver.insert(MyTable.CONTENT_URI,cv);</code></pre><p>The value in mydate reads <strong>datetime('now')</strong> and not the actual current date and time.</p><p>I am performing all this from a ContentProvider.</p><p>How can I fix this ?</p>","447238","","","","","2011-01-18 13:24:05","Nested Queries in SQLite3 Android","<android><datetime><insert><sqlite3>","1","0","","",""
"4723853","1","","","2011-01-18 12:07:41","0","1045","<p>How can we fetch displayname and organization.data through ContactsContract APIs using impicit joins so that I can both these values in a single cursor?</p>","193545","","","","","2011-10-15 07:04:44","ContactsContract API - fetch display name and organization title","<android><api><contacts>","3","0","","",""
"4723892","1","","","2011-01-18 12:12:23","1","1381","<p>There are many languages list for countries in the setting menu -> language &amp; keyborad -> Select language....</p><p>so I just want to remove some list it means the device will show 5 language list.for example English, china, japan, korean, france.</p><p>but I could not find the profer source code out to remove lists.this class LocalePicker. I thought the languages is being read from getAssets().getLocales(); by assetManager. </p><p>please let me know the solution how do i remove them. via my email sence4u@hanmail.net.</p><p>thank you. </p>","579905","","","","","2011-01-20 11:39:41","how can I remove the list of language setting in the source level of android?","<android>","1","1","1","",""
"4723941","1","","","2011-01-18 12:18:08","0","133","<p>How can I test whether my app behaves properly when Android OS kills its process due to low memory?</p>","243225","","","","","2011-04-04 11:46:07","How to test if my app behaves properly when Android OS kills its process?","<android>","3","0","","",""
"4723964","1","4724491","","2011-01-18 12:20:12","3","12970","<p>Friends,  I have a problem in parsing the json content directly from url given <a href=""http://samplejson.com/transactions.json"" rel=""nofollow"">http://samplejson.com/transactions.json</a>, but when i store the same url content as a text file in my res/raw folder it parse the data as well,but when fetching the url content from net it shows an exception (i.e)<strong>A JSONArray text must starts with '[' at character 1 of...</strong></p><p>what's the wrong here.help me to fix this problem</p><hr><pre><code>URL url_net = new URL(""http://samplejson.com/transactions.json""); InputStream is = url_net.openStream(); byte [] buffer = new byte[is.available()]; while (is.read(buffer) != -1); String jsontext = new String(buffer); JSONArray entries = new JSONArray(jsontext); x = ""JSON parsed.\nThere are ["" + entries.length() + ""]\n\n""; int i; for (i=0;i&lt;entries.length();i++) { }</code></pre>","393953","","393953","","2012-12-27 06:15:33","2012-12-27 06:15:33","JSON fetch URL content for Android","<android><json>","1","2","6","",""
"4723974","1","4724618","","2011-01-18 12:21:46","5","9473","<p>I am a .NET developer and I am interested in developing android application in C# and I got monodroid.Is there any source from where I can get the monodroid sample applications [with source code] which would help me to develop the application in monodroid. Or detailed articles.</p>","298336","","213136","","2012-05-03 10:50:20","2012-05-03 10:50:20","Monodroid samples/ widgets with source code","<c#><android><monodroid>","1","0","2","",""
"4723977","1","","","2011-01-18 12:22:15","0","757","<p>I took an api key from Google for to use Google Maps for my android app. Yesterday it was working like charm but today i got an error when trying to load map. I opened logcat and it said </p><blockquote>  <p>Failed to find provider info for com.google.settings</p></blockquote><p>Can anyone tell me how to fix this problem?</p><p>EDIT: My real issue is not because of that. That's because i got nullpointer exception error.</p><pre><code>01-18 17:38:18.174: ERROR/AndroidRuntime(1348): Caused by: java.lang.NullPointerException01-18 17:38:18.174: ERROR/AndroidRuntime(1348):     at com.android.listxml.MyMap.onCreate(Map.java:69)</code></pre><p>At this 69th line i have this code:</p><pre><code>View zoomView = mapView.getZoomControls();</code></pre>","579921","","579921","","2011-01-18 16:08:05","2011-01-18 16:48:31","Google Api Key doesn't work","<android><google-maps>","1","8","","",""
"4724024","1","4724183","","2011-01-18 12:26:32","3","4479","<p>I have an Android app that pulls in images from the Web. However when I set:</p><pre><code>&lt;supports-screens android:anyDensity=""true"" /&gt;</code></pre><p>the gallery appears to be set to the minimum supported resolution.</p><p>Here is the gallery layout definition:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8"" ?&gt;&lt;LinearLayout android:id=""@+id/GalleryLayout""              android:layout_width=""fill_parent""               android:layout_height=""fill_parent""              xmlns:android=""http://schemas.android.com/apk/res/android""              android:orientation=""vertical""              android:background=""#000000""              &gt;&lt;Gallery xmlns:android=""http://schemas.android.com/apk/res/android""         android:id=""@+id/gallery""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:layout_gravity=""center""         android:spacing=""1dip""         android:gravity=""center_vertical|center_horizontal|center""/&gt;&lt;/LinearLayout&gt;</code></pre><p>and the getView class:</p><pre><code>ImageView i = new ImageView(mContext);i.setImageDrawable(drawablesFromUrl[position]);i.setLayoutParams(new Gallery.LayoutParams(400, 300));i.setScaleType(ImageView.ScaleType.FIT_XY);i.setBackgroundResource(mGalleryItemBackground);</code></pre><p>Is there a way to detect the resolution used and then resize the images in the gallery so they stretch to the width of the screen?</p>","553978","","","","","2012-07-04 17:48:26","Android - resize image in gallery based on device resolution","<android><image><gallery><resolution>","1","0","","",""
"4724069","1","4724246","","2011-01-18 12:30:29","0","3372","<p>Does the android:clipChildren still works?I have a AbsoluteLayout with a size and set the clipChildren to false. When I add childeren that are bigger then the AbsoluteLayout the childeren are still clipped. </p><p>Anyone got this working? </p><p>Working with Android 2.2 (API level 8)</p><hr><p>Update 20-01-11:</p><p>I can make something similiar with a RelativeLayout, but does the android:clipChildren work on that?btw, it's not needed that my application needs to work on any other platform then Android 2.2. </p>","359156","","359156","","2011-01-20 11:44:08","2011-06-06 17:07:04","Does the android:clipChildren still works?","<android><android-layout><android-2.2-froyo><absolutelayout>","2","1","","",""
"4724154","1","4724175","","2011-01-18 12:41:43","2","552","<p>I have an application that has been exported to an apk. I have stored some <code>.wav</code> music files on <code>/sdcard/audio</code> that are absolutely essential to the application. My question is this:  </p><ol><li>How do I export the wav files and make sure that they are present on the apk? When I export the project, the size of the apk is something like 23kB. It seems that I should have had the wav files somewhere else, in some other directory. I had added the files to /sdcard/audio by using mkdir + push commands in the <code>adb</code>.</li></ol>","350685","","119895","","2011-01-18 12:44:43","2011-01-18 12:56:08","Do music files on /sdcard go into apk?","<android><audio><export><apk>","2","0","1","",""
"4724161","1","4725630","","2011-01-18 12:42:02","0","579","<p>I have created a list view with complex view like including images, text and it has been inflated for list view. Now I am also including check box in the inflated list. Problem is to get the checked id of multiple checks. Cld you please help on it.Also have to delete the selected items from the list according to selection.could you guys help me on it. Please</p>","579936","","462370","","2012-02-05 19:02:59","2012-02-05 19:02:59","Not getting checkbox id from list view","<android><list><view>","1","0","","",""
"4724221","1","4745643","","2011-01-18 12:48:54","0","3078","<p>I started a simple jQuery Mobile Page with a header and a content div. The content div should serve as a map container for openlayers. The map should fill up the entire screen, except for the header bar. </p><p>Sizing the content div with a width/height of 100% didn't work (nothing was displayed), so I'm looking for a CSS approach to pixel-size the div or a relative-size workaround.</p><p>Especially I like to know:</p><ul><li>How can I account for screen orientation changes (landscape/portrait)? </li><li>How can I make my layout ""height-elastic"", i.e. resistant to the toggling of the browser's address bar?</li></ul><p>Here is my markup so far:</p><pre><code>&lt;body&gt; &lt;div data-role=""page""&gt;&lt;div data-role=""header""&gt;    &lt;h1&gt;My Map&lt;/h1&gt;&lt;/div&gt;&lt;div id=""mapcontainer""  data-role=""content""&gt;     &lt;!-- OpenLayers Map goes here --&gt;          &lt;/div&gt;&lt;/div&gt;&lt;/body&gt;</code></pre>","113936","","","","","2013-03-09 00:32:04","How to size a content div to cover the entire content area in jQuery Mobile","<android><css><google-chrome><openlayers><jquery-mobile>","3","0","0","",""
"4724225","1","4724803","","2011-01-18 12:49:17","0","15660","<p>I want to display canvas contents on imageview in android</p><p>i am not understanding the imageview.draw(canvas);</p><p>Heres my code:</p><pre><code>public class Matrix extends Activity {    public Bitmap mybitmap,newbmp,bitmap,bmp;    ImageView imageview;    Paint paint;    @Override    public void onCreate(final Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        imageview=(ImageView)findViewById(R.id.ImageView01);        imageview.setDrawingCacheEnabled(true);    }    protected void onDraw(Canvas canvas)    {        imageview.draw(canvas);        mybitmap=BitmapFactory.decodeResource(getResources(), R.drawable.image);        canvas.drawBitmap(mybitmap, 0, 0, paint);    }}</code></pre>","579957","","1310566","","2013-07-30 15:11:27","2013-07-30 15:11:27","How to take canvas on imageview in android","<android>","2","0","2","",""
"4724332","1","","","2011-01-18 13:00:54","0","488","<p>i am developing simple adroid application. I main program i need to see kaypad(just letters). I have tried to add buttons and then and caption, events, but it takes a lot of time to configure app. Maybe there is another way to display simple letter keypad?</p>","389299","","","","","2013-03-30 07:56:11","Android: how to display keypad","<android><keypad><android-keypad>","1","0","","",""
"4724355","1","5101189","","2011-01-18 13:03:32","2","3969","<p>I've got 30+ single bitmaps (320x240 pixels) that I would like to display one after another in full screen on Android devices resulting in an animation. Currently I implemented the animation using an ImageView and a Timer that sets the next frame and then sends a message that will apply the next frame. The resulting frame rate is very low: &lt; 2 fps.</p><p><em>The timer:</em></p><pre><code>animationTimer.scheduleAtFixedRate(new TimerTask() {    @Override    public void run() {        Drawable frame = getNextFrame();            if (frame != null) {                Message message = animationFrameHandler.obtainMessage(1, frame);                animationFrameHandler.sendMessage(message);            }        }    }, 0, (int) (1000.0d / fps));</code></pre><p><em>The handler:</em></p><pre><code>final Handler animationFrameHandler = new Handler() {    @Override    public void handleMessage(Message message) {        setImageDrawable((Drawable) message.obj);    }};</code></pre><p>Since I want to achieve frame rates up to 30 fps I have to make use of another mechanism and heard of <strong>Canvas.drawBitmapMesh()</strong> and <strong>OpenGL</strong>.</p><p>I would prefer the drawBitmapMesh method since I don't have to dive into OpenGL.</p><p>Did you got any experience on using meshed on Android? Will it be fast enough for my purposes?</p><p>Thank you very charing your experiences!</p>","543875","","44729","","2011-01-18 18:24:05","2011-04-02 10:25:48","Draw high res animations with high frame rate on Android","<android><animation><opengl-es><canvas>","4","0","2","",""
"4724385","1","","","2011-01-18 13:06:47","1","8012","<p>I downloaded and installed Android-NDK on my Archlinux, using <a href=""http://aur.archlinux.org/packages.php?ID=27656"" rel=""nofollow"">this package</a>.</p><p>Got no issues building (and running) the sample <code>hello-jni</code> following the guide on <a href=""http://developer.android.com/sdk/ndk/overview.html"" rel=""nofollow"">this page</a>, but if I try to do the same with <code>hello-gl2</code> I get some errors; it looks like it cannot find some header files:</p><pre><code>$ ../../ndk-build /usr/bin/make -f /opt/android-ndk/build/core/build-local.mkCompile++ thumb  : gl2jni &lt;= gl_code.cpp/opt/android-ndk/samples/hello-gl2/jni/gl_code.cpp:22:23: error: GLES2/gl2.h: No such file or directory/opt/android-ndk/samples/hello-gl2/jni/gl_code.cpp:23:26: error: GLES2/gl2ext.h: No such file or directory--- SNIP ---</code></pre><p><code>GLES2/gl2.h</code> and <code>GLES2/gl2ext.h</code> are however present in <code>$(NDK)/platforms/android-4/arch-arm/usr/include/</code>, and it looks like<code>$(NDK)/build/core/setup-toolchain.mk</code> should set such include path.</p><p>Has anybody encountered the same issue? How can I compile this sample?<br>And then, are there other options to easily build Android-NDK applications? This build system seems quite complicated to me, and I'd prefer using cmake to build my applications.</p>","300805","","","","","2012-10-18 09:10:22","Android-NDK build system (building hello-gl2)","<android><build><android-ndk><sample><toolchain>","3","1","","",""
"4724490","1","","","2011-01-18 13:18:14","0","1480","<p>i am trying to create a dynamic row with an imageview and a textview.Something like this:<br> |_| textview</p><p>So my question is if it's possible to have, at the same row, a textview near imageview in the java source, without using xml file..</p><p>This is my code:</p><p>TableLayout table = (TableLayout)findViewById(R.id.table);         db.open();        Cursor c5 = db.getAllCodes();        </p><pre><code>    if (c5.moveToFirst())    {      do{                  //rows          TableRow tr = new TableRow(this);          tr.setClickable(true);          tr.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));              TextView title = new TextView(this);          title.setTextColor(Color.BLACK);          title.setTextSize(20);          //TextView text = new TextView(this);          //TextView stamp = new TextView(this);          title.setText(c5.getString(6));          //text.setText(c5.getString(1));          //stamp.setText(c5.getString(2));          //tr.addView(iv);          tr.addView(title);            //tr.addView(text);          //tr.addView(stamp);          //add row to layout          getLayoutInflater().inflate(R.layout.image, table, true);           table.addView(tr,new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));     }while (c5.moveToNext());}    db.close();</code></pre><p>The result for this code is to create 2 different rows, one with the image and one with the textview.</p>","579981","","","","","2011-01-18 13:50:39","is it possible to have imageview and textview in the same table row on android project?","<android><table><dynamic>","1","0","","",""
"4724554","1","4724620","","2011-01-18 13:24:21","3","1749","<p>I have a custom view with an ImageView and a TextView on it and implemented the onClickListener for my custom view.The problem is, that the ImageView is consuming the onClick-event (I just want the user be able to click on my control, no matter where). I could listen to the onClick of the Image/TextView too, but it seems dirty to me.</p><p>Is there a way to bubble / route Events in Android? Or possible another good solution?</p>","578502","","246246","","2012-09-04 21:48:21","2012-09-04 21:48:21","Android route / bubble events because a control is consuming the onClick event","<android><events><onclick><route><event-bubbling>","2","0","","",""
"4724585","1","","","2011-01-18 13:28:10","0","2081","<p>In my application one option is there which is used to select the application trigger time that is implemented in RadioButtons like : 10 mins, 20Mins, 30mins and 60mins after selecting one of them the application starts at that time.. up to this working fine.But, now I want to display a count down clock after selecting one option from above from that time onwords one clock, I want to display</p><p>That will useful to user how much time remaining to trigger the application</p><p>if any body knows about this please try to help me</p><p>Thanks for reading</p>","546107","","","","","2012-11-29 13:37:02","how to display Count down clock?","<android>","1","0","","",""
"4724589","1","","","2011-01-18 13:28:20","3","7000","<p>Is there a way to put a <code>EditText</code> element in which i could choose contact's phone number from my contacts list. Just as in generic android sms app. (Auto-complete when typing phone number or contact name!).</p>","579993","","","","","2011-10-25 13:47:19","Android edittext - choose contact's phone number (with auto completion)","<android><autocomplete><contacts><edittext>","2","0","1","",""
"4724594","1","4724798","","2011-01-18 13:28:42","0","1061","<p>Do you have any tutorial for media player lists?i want to create a list with songs and call every song i would like to play!</p>","519526","","1465910","","2012-09-29 09:37:09","2012-09-29 09:37:09","MediaPlayer List","<android><android-mediaplayer>","1","0","","",""
"4724623","1","4724650","","2011-01-18 13:31:07","0","5179","<p>i want to upload xml file to through ftp from android sdcard folder,im trying this code to connect to ftp :</p><pre><code>      FTPClient f = new FTPClient();      f.connect(server,21);      f.login(username,password);      Log.d(""status"",f.getStatus());      f.logout();       f.disconnect();    </code></pre><p>but i getting exception</p><p>Exception:</p><p>java.net.SocketException: Permission denied</p><p>i have no idea why this exception occur because im new to adroid development.Any help regarding this greatly appreciated, it is urgent thanks in advance.     </p>","575218","","","","","2011-03-03 19:40:06","How to upload file through FTP in Android","<android>","1","0","","",""
"4724646","1","","","2011-01-18 13:33:25","3","590","<p>I'm using a custom Launcher application with Widgets that are used to launch (and provide status updates) for an application.</p><p>The application consists of a few Activities - let's call them A, B and C for simplicity.</p><p>A is the launched Activity.  The user proceeds from A to B and then to C (never in any other order).</p><p>At any time the user can press the 'Home' button on the remote control and return to the launcher application.</p><p>If the user then presses the 'Back' button on the remote control they always return to the Activity they were last using (A, B, or C).</p><p>However, if they click on the widget (rather than pressing back) the Activity that is brought to the front seems inconsistent!</p><p>So, here is an example of what happens</p><p>From (custom) launcher, use widget to launch application<br>Activity A appears<br>User presses a button that launches Activity B<br>Activity B appears<br>User presses 'Home'<br>Launcher appears<br>From (custom) launcher, use widget to launch application<br>Activity A appears NOT B</p><p>Sometimes I get Activity B instead of Activity A - but I'm not sure under what circumstances.   I <em>want</em> to get the Activity at the top of the stack to be displayed and <em>never</em> any other Activity (Activity B in the example above).</p><p>I've read Google's documentation about the Activity flags (""single-task"", ""single-instance"", etc...) but nothing seemed to jump out as the solution to my problem.</p><p>In my case, Activities A, B, C only make sense when run in that order - and it never makes sense to see a previous activity unless you explicitly go back to it.</p><p>I'm not sure if the problem is the way the widget is launching the application or whether there is something I need to specify in my manifest or something else.</p><p>Any ideas?</p><p>Thanks,</p><p>Dan</p>","505640","","505640","","2011-01-19 15:01:35","2012-06-13 04:09:40","Launcher not returning to the last-used activity in my application","<android><activity><task>","2","0","1","",""
"4724781","1","4724912","","2011-01-18 13:46:45","0","2569","<p>I have an activity - TimePickerActivity - which creates a TimePickerDialog.  I have a onTimeSetListener which responds to the Set button at the end of which it calls finish() and returns to the activity that called the TimePickerActivity.   I want it to finish and return if the Cancel button is clicked but can't find any way to do this.   I have googled and tried out severall suggestions but none of them seem to work.  Any simple way to do this?   </p>","538847","","","","","2011-07-31 19:37:50","TimePickerDialog cancel button","<android>","2","0","1","",""
"4724899","1","","","2011-01-18 13:57:30","0","1853","<p>I'm new in android and I want to display one TabWidget whose <strong>Tabspec should have the same size</strong>... it doesn't matter what they have inside... Besides, I have added one HorizontallScrollView because I want to display 8 tabs in my activity, not only 3...</p><p>Anybody knows what do I have to add to my xml to have my 8 activities with the same tab size?</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;HorizontalScrollView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;            &lt;TabWidget                android:id=""@android:id/tabs""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                 android:scrollbarAlwaysDrawHorizontalTrack=""true""                android:scrollbars=""horizontal""/&gt;        &lt;/HorizontalScrollView&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>Thank you</p>","580038","","580038","","2011-01-18 14:03:44","2011-03-22 23:54:56","Size of the TabWidget (Tabspec)","<android><tabwidget>","1","0","","",""
"4724909","1","","","2011-01-18 13:58:20","0","315","<p>When the application is started there will be an icon in the status bar that shows; of the application is active. <br /> <br />And when the application have paused the icon remains on.<br /> When the application is closed the Icon should disappear.</p><p>I don't have any idea how I should do this, can anybody help me..some snippets or tutorials are welcome! </p><p>Many Many Many Thanks!</p>","468003","","","","","2011-01-18 15:20:23","Android: Application active","<java><android><xml><interface>","2","1","","",""
"4724999","1","4732481","","2011-01-18 14:07:27","0","536","<p>my dear friends. Could you help me to figure out where do I have memory leak in my application.</p><p>There are two activities.</p><p>In first activity I'v got a rather big static ArrayList consists of bitmaps and another needed information. I made it static, because I need to take it from another activity, and It's loading takes to much time.</p><p>In another activity, I also have one static field, using as a key for getting data which present in an Intent from previous activity.</p><p>If I try to start one activity from another and go back several times, I get shutting down VM.</p><p>To be more clear, here is a snippet of my code:</p><pre><code>public class MoviesGallery extends Activity{...private static ArrayList&lt;Movie&gt; films = new ArrayList&lt;Movie&gt;();...public void contextButtonsClickHandler(View v){    switch(v.getId())    {        case R.id.play_button:            Log.d(""Context Button"", ""Play button has clicked"");            mContextButtonHasPressed = true;            Intent filmData = new Intent(MoviesGallery.this, MovieInfo.class);            filmData.putExtra(MovieInfo.mPOS,mPOSITION_OF_CLICKED_ITEM);            startActivityForResult(filmData, 1);            break;...}</code></pre><p>And this is another activity:</p><pre><code>public class FilmInfo extends Activity{    public static String mPOS = ""pos"";    private int mNumOfFilm = -1;    private LinearLayout mWall;...protected void onCreate(Bundle savedInstanceState){        Bundle extra = getIntent().getExtras();    mNumOfFilm=extra.getInt(mPOS);...              Drawable d = new BitmapDrawable(MoviesGallery.getMoviesArray().get(mNumOfFilm).getWall()));    mWall = (LinearLayout) findViewById(R.id.Wall);    mWall.setBackgroundDrawable(d);    ...        setResult(0);    }</code></pre>","556337","","","","","2011-01-20 09:39:48","Where is the memory leak?","<android><memory-leaks>","1","1","","",""
"4725024","1","4725128","","2011-01-18 14:10:05","12","34828","<p>This one puzzles me since my first steps with Android. I can't make both columns in a 2-column TableLayout exact 50% each.</p><p>Here's an example:</p><pre><code>&lt;ScrollView    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""wrap_content""    android:layout_width=""fill_parent"" &gt;    &lt;TableLayout        android:id=""@+id/tablelayout""        android:layout_height=""wrap_content""        android:layout_width=""fill_parent""        android:paddingRight=""2dip"" &gt;        &lt;TableRow&gt;            &lt;TextView                style=""@style/TextViewStandard""                android_layout_span=""2""                android:layout_weight=""1""                 android:text=""Bla"" /&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;            &lt;TextView                style=""@style/TextViewStandard""                android:layout_weight=""1""                android:text=""Name:"" /&gt;            &lt;EditText                style=""@style/EditTextStandard""                android:id=""@+id/et_name""                android:layout_weight=""1"" /&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;            &lt;TextView                style=""@style/TextViewStandard""                android:layout_weight=""1""                android:text=""URL:"" /&gt;            &lt;EditText                style=""@style/EditTextStandard""                android:id=""@+id/et_url""                android:layout_weight=""1"" /&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;            &lt;Button                style=""@style/ButtonStandard""                android:layout_column=""0""                android:layout_marginTop=""6dip""                android:onClick=""onClickOk""                android:text=""@android:string/ok"" /&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;/ScrollView&gt;</code></pre><p>And here's the corresponding style definition:</p><pre><code>&lt;resources&gt;    &lt;style name=""ButtonStandard"" parent=""@android:style/Widget.Button""&gt;        &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;        &lt;item name=""android:layout_width""&gt;fill_parent&lt;/item&gt;    &lt;/style&gt;    &lt;style name=""EditTextStandard"" parent=""@android:style/Widget.EditText""&gt;        &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;        &lt;item name=""android:layout_marginLeft""&gt;2dip&lt;/item&gt;        &lt;item name=""android:layout_marginRight""&gt;2dip&lt;/item&gt;        &lt;item name=""android:layout_marginTop""&gt;2dip&lt;/item&gt;        &lt;item name=""android:layout_width""&gt;fill_parent&lt;/item&gt;    &lt;/style&gt;    &lt;style name=""TextViewStandard"" parent=""@android:style/Widget.TextView""&gt;        &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;        &lt;item name=""android:layout_marginLeft""&gt;2dip&lt;/item&gt;        &lt;item name=""android:layout_marginRight""&gt;2dip&lt;/item&gt;        &lt;item name=""android:layout_marginTop""&gt;2dip&lt;/item&gt;        &lt;item name=""android:layout_width""&gt;fill_parent&lt;/item&gt;        &lt;item name=""android:textColor""&gt;@android:color/white&lt;/item&gt;    &lt;/style&gt;&lt;/resources&gt;</code></pre><p>This becomes really messed up with a CheckBox involved.</p><p>What's wrong with my definition?</p><p>Many thanks in advance.HJW</p>","471681","","","","","2012-11-07 11:16:57","2-column TableLayout with 50% exactly for each column","<android><layout><resources>","4","0","5","",""
"4725066","1","4725098","","2011-01-18 14:15:00","1","2242","<p>I've read many of the posts regarding this issue and I can't find one that would apply to my code (or at least that I can make the relation to).  </p><p>I have a homescreen widget that displays in both landscape and portrait.  If I continuously change the orientation of the device I get this in my logcat:</p><blockquote>  <p>03-08 10:41:35.793: ERROR/dalvikvm-heap(1159): 4707316-byte external allocation too large for this process.<br>  03-08 10:41:35.793: ERROR/GraphicsJNI(1159): VM won't let us allocate 4707316 bytes<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159): updateAppWidget couldn't find any view, using error view<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159): android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.LinearLayout<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.view.LayoutInflater.inflate(LayoutInflater.java:385)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.widget.RemoteViews.apply(RemoteViews.java:930)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.appwidget.AppWidgetHostView.updateAppWidget(AppWidgetHostView.java:219)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.appwidget.AppWidgetHostView.updateAppWidget(AppWidgetHostView.java:155)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.appwidget.AppWidgetHost.createView(AppWidgetHost.java:218)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at com.android.launcher2.Launcher.bindAppWidget(Launcher.java:2393)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at com.android.launcher2.LauncherModel$Loader$LoaderThread$7.run(LauncherModel.java:1051)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at com.android.launcher2.DeferredHandler$Impl.handleMessage(DeferredHandler.java:48)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.os.Handler.dispatchMessage(Handler.java:99)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.os.Looper.loop(Looper.java:123)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.app.ActivityThread.main(ActivityThread.java:4645)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at java.lang.reflect.Method.invokeNative(Native Method)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at java.lang.reflect.Method.invoke(Method.java:521)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at dalvik.system.NativeStart.main(Native Method)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159): Caused by: java.lang.reflect.InvocationTargetException<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.widget.LinearLayout.(LinearLayout.java:115)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at java.lang.reflect.Constructor.constructNative(Native Method)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     ... 19 more<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.graphics.Bitmap.nativeCreate(Native Method)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.graphics.Bitmap.createBitmap(Bitmap.java:468)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.graphics.Bitmap.createBitmap(Bitmap.java:435)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.content.res.Resources.loadDrawable(Resources.java:1718)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.content.res.TypedArray.getDrawable(TypedArray.java:601)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.view.View.(View.java:1885)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.view.View.(View.java:1834)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     at android.view.ViewGroup.(ViewGroup.java:285)<br>  03-08 10:41:35.793: WARN/AppWidgetHostView(1159):     ... 23 more</p></blockquote><p>My code is this which utilizes remoteViews:</p><pre><code>    public class WidgetLayoutBuilder { public static final String DEG = ""\u00B0""; public static final int LAYOUT_CURRENT  = 1000; public static final int LAYOUT_FORECAST = 1001; /**  * Constructs current conditions layout.  *    * @param context  * @param wd  * @return  */ public static RemoteViews buildCurrentLayout(Context context, int appWidgetId, ACCUWX_WeatherData wd){  Log.d(""########"", ""remoteViews buildCurrentLayout"");  // Return object  RemoteViews toRet = new RemoteViews(context.getPackageName(), R.layout.widget_current_layout);  String cityText = wd.getCityName();  String tempUnits = wd.getMetric() == 0 ? ""F"" : ""C"";  String iconId   = ""icon_"" + wd.getCurrentIconCode();  // Populate views with weather data  toRet.setTextViewText  (R.id.current_location_text,  cityText);  toRet.setTextViewText  (R.id.current_temp_text,   wd.getCurrentTemperature() + DEG + tempUnits);  toRet.setTextViewText  (R.id.current_conditions_text, wd.getCurrentConditions());  toRet.setImageViewResource (R.id.current_condition_image,  ACCUWX.getDrawableId(iconId));  toRet.setTextViewText  (R.id.current_hi_temp,    context.getString(R.string.hi) + "": "" + wd.getForecast().get(0).getDailyHigh() + DEG);  toRet.setTextViewText  (R.id.current_lo_temp,    context.getString(R.string.lo) +"": "" + wd.getForecast().get(0).getDailyLow() + DEG);  // Make alert icon visible if necessary.  int visibility = wd.getAlertIsActive() == 0 ? View.INVISIBLE : View.VISIBLE;  toRet.setViewVisibility(R.id.alert_icon, visibility);  if (MainActivity.mLocations == null)   MainActivity.mLocations = new ArrayList&lt;String&gt;();  if (MainActivity.mLocName == null)   MainActivity.mLocName = new String("""");  if (!MainActivity.mLocations.contains(wd.getZipCode()) || !MainActivity.mLocName.contains(wd.getCityName()))   MainActivity.mLocations.add(wd.getZipCode());  MainActivity.isFromLocationSearchActivity = false;  // Launch SimpleWeather application intent  Intent intentAppLaunch = new Intent(context, MainActivity.class);  intentAppLaunch.putExtra(ACCUWX.Extras.LOCATION_CODE, wd.getZipCode());  intentAppLaunch.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);  PendingIntent pendingAppLaunch = PendingIntent.getActivity(context, appWidgetId, intentAppLaunch, PendingIntent.FLAG_CANCEL_CURRENT);  toRet.setOnClickPendingIntent(R.id.current_layout, pendingAppLaunch);  return toRet; } /**  * Returns pretty names for display purposes in the form 'city name, state name' for the US and 'cityname, countryname (region)' for other countries.  * @return  */ public static String getPrettyName(ACCUWX_WeatherData wd){         String prettyName = ""null"";         String state = wd.getStateName();         String city = wd.getCityName();         String country = wd.getCountryName();         String countryCode = wd.getCountryCode();         if (countryCode.equalsIgnoreCase(""us""))          prettyName = city + "", "" + state;         else          prettyName = city + "", "" + country + "" ("" + state + "")"";         return prettyName; } /**  * Constructs deleted layout.  *   * @param context  * @return  */ public static RemoteViews buildDeletedLayout(Context context){  Log.d(""########"", ""remoteViews buildDeletedLayout"");  return new RemoteViews(context.getPackageName(), R.layout.widget_deleted_layout); }}</code></pre><p>Could the bitmap error be coming from the device itself and not an issue of my application?</p><p>Any help or direction is greatly appreciated!</p>","2186261","","436938","","2012-04-18 11:13:51","2012-04-18 11:15:40","bitmap size exceeds VM budget","<android>","4","2","","",""
"4725135","1","4725247","","2011-01-18 14:24:30","1","3315","<p>please help me and excuse any mistakes it's late and i've been trying all sorts of solutions as i dont like bothering people if i can help it, but i've hit a brick wall.</p><p>I've recently tried to access the debug keystore created by the Eclipse SDK in order to use the Google maps API within my application. Now i know the file exists and have its path.However to access it and recieve an MD5 fingerprint i have to use a keytool command. Now i've been told that this command has to be done in the computers command prompt as there is no keytool GUI. And this is where the problem is as my command prompt doesnt recognise the command im giving it.Here's the command </p><p>keytool -list-alias androiddebugkey-keystore(path_to debug_keystore).keystore-storepass android -keypass android </p><p>(Brackets should be left and right arrows)to which command prompt replies </p><p>keytool is not recognised as an internal or external command, operable program or batch file.Now i tried manually entering the path which i believe would be (C:\Users\Adam.android\debug.keystore).keystore i've also tried variations ofC:\Adam.android\debug.keystore).keystoreAdam.android\debug.keystore).keystore.android\debug.keystore).keystoredebug.keystore).keysotre</p><p>which it then replies  ""the system cannot find the path specified""</p><p>So either command prompt doesn't recognise the command ""keytool"" or im entering the path wrong (which is likely as i dont use command prompt commands often enough to know how to write paths successfully</p><p>Lastly i rang one of my more techy friends and he said it's because i'm running on Windows 7 and that most of the command functionality was ripped out in the windows 7 OS and i'll have to revert to Vista. i'm skeptical on this as i cant believe that all android programmers are restricted to Vista.</p><p>If anyone has experienced this or knows how to solve it please help as im determined to get over this but have truly hit a brick wall.</p><p>so to summarise</p><p>im unable to use keytool to access the debug keystore (or create my own for that matter) and cannot find a solution  </p><p>Thanks for all help in advance and i pray someone helps me as i do enjoy programming and dont want to be stopped at such a small thing. </p><p>Thanks for reading Adam</p>","580070","","","","","2012-11-05 20:40:11","Cannot access the Java Keystore for Android","<java><android><eclipse><keystore><keytool>","2","0","","",""
"4725172","1","4725189","","2011-01-18 14:26:49","0","396","<p>is it possible to define a style for portrait orientation and another for landscape so when the device is rotated the change is automatic, or it has to be done programmatically ?</p><p>Thanks</p>","253944","","","","","2011-01-18 14:28:20","Change style depending on orientation","<android><coding-style><screen-orientation>","1","0","1","",""
"4725235","1","5136988","","2011-01-18 14:32:48","1","1267","<p>friends,</p><p>i am using following custom adapter for android listviewproblem i am facing is wrong position after calling notifydatasetchanged();</p><p>first time when i bind data with list position works perfect but after when i call notifydatasetchanged();i get position parameter wrong </p><p>please guide what mistake am i doing any help would be appreciated.</p><pre><code>    public EfficientAdapter(Context context,List&lt;DalCategories&gt; value) {            mInflater = LayoutInflater.from(context);            obj = value;        }        public View getView(final int position, View convertView,             final  ViewGroup parent) {            ViewHolder holder;            if(convertView == null)            {            convertView = mInflater.inflate(R.layout.list_category_item, null);            holder = new ViewHolder();            holder.TextTitle = (TextView) convertView.findViewById(R.id.list_item_title);            holder.checkBoxes = (CheckBox) convertView.findViewById(R.id.chkSubCategory);              convertView.setTag(holder);              }else              {                  holder = (ViewHolder)convertView.getTag();              }    // while setting checkbox state after notify datasetchanged i get wrong position                    if(obj.get(position).isIs_Selected())                   {                holder.checkBoxes.setChecked(true);            }            holder.checkBoxes            .setOnCheckedChangeListener(new OnCheckedChangeListener() {                @Override                public void onCheckedChanged(                        CompoundButton buttonView, boolean isChecked) {                    if(obj.get(position).isIs_Any() &amp;&amp; isChecked)                    {                            if( adapter != null)                            {                                adapter.notifyDataSetChanged();                            }                    }                }            });            holder.TextTitle.setText(obj.get(position).getTitle());            return convertView;        } class ViewHolder      {        public TextView TextTitle;        public CheckBox checkBoxes;     }    @Override    public Filter getFilter() {        return null;    }    @Override    public long getItemId(int position) {        return 0;    }    @Override    public int getCount() {        return obj.size();    }    @Override    public Object getItem(int position) {        return obj.get(position);    }    }</code></pre>","249991","","","","","2011-02-28 00:02:46","Position problem in Custom list adapter after notifydatasetchange?","<android><listview>","1","1","0","",""
"4725243","1","4725904","","2011-01-18 14:33:11","0","822","<p>I am trying to implement a custom TabHost with colored tabs.  I've been following stackoverflow member Josh Clemm's <a href=""http://joshclemm.com/blog/?p=136"" rel=""nofollow"">excellent example</a>.  The coloring works great.  In the default out of the box TabHost, if the text to be displayed in the tab doesn't fit it, it does this nice scrolling of the text inside the tab itself.  It only does this on the active tab and seems to be on a timer where it will pause and the rescroll the text a few times.</p><p>Now with the custom tabs I've lost that.  Has anyone else run into this and solved this problem already?</p>","418714","","","","","2011-01-18 15:32:17","Android Custom Tab - Text Scrolling","<android><tabs><android-tabhost>","1","0","","",""
"4725346","1","4725890","","2011-01-18 14:41:19","0","2402","<p>The thing is...I want to use PreferenceActivity to add a new row in my custom list view. So my preference ativity will consist of a few EditTextPreferences, my custom TimePickerPreference and a coulpe of ListPreferences... Like this: <a href=""http://www.google.com/help/hc/images/android/android_ug/168567.5.png"" rel=""nofollow"">http://www.google.com/help/hc/images/android/android_ug/168567.5.png</a> . The question is how they added buttons on the bottom? And.. is it possible to use OnClickListener for obtaining inputed values and how? Thanks!</p>","577841","","","","","2011-01-18 15:31:15","Android: add buttons to a preference screen","<android><button><preferenceactivity>","1","0","2","",""
"4725390","1","5316769","","2011-01-18 14:44:18","1","330","<p>I'm writing an image manipulation app (e.g. operations include blurring, rotating, scaling, merging, flood filling) and I'm worried about memory use.</p><p>The problem I'm having is that I need to make use of Bitmap+Canvas so that I can take advantage of existing features to manipulate images and I also need to put copies of the image in int arrays to modify the pixels as it's too slow to modify Bitmaps using the  set/getPixel function for some operations like blurring and flood fill. </p><p>My current memory usage is:</p><ul><li>A Bitmap object for the image itself.</li><li>An offscreen Bitmap object that I use to perform image manipulation tasks using Canvas.</li><li>An alpha-only bitmap used for masking.</li><li>Two int arrays that each have enough pixels to contain a copy of the main image.</li></ul><p>For example, I use the two int arrays to perform the flood fill operation: I copy the main image to one array, put a grayscale version of the main image in the other array (where the grayscale representation is created using the offscreen Bitamp and Canvas first), use the grayscale image when making color comparisons to perform the flood fill operation in the first array and then copy the final image back to the main image Bitmap. I could perhaps eliminate the offscreen bitmap for this operation, but e.g. I use the offscreen bitmap for performing painting operations.</p><p>Are there any tricks I can use to reduce my memory usage? For example, are there any quick ways to modify pixels that don't involve making int array copies of Bitmap objects? Can I use a Canvas object to directly modify an int array?</p><p>I want to add layers functionality (i.e. the main image would be composed of several bitmaps) but I'm already getting short on memory.</p>","580100","","","","","2011-03-15 19:14:57","Memory usage for image manipulation app","<java><android><image-processing><mobile>","1","2","","",""
"4725455","1","","","2011-01-18 14:49:24","1","384","<p>I just want to make the seekbar as shown in the image. How can I achieve this?</p><p><img src=""http://i.stack.imgur.com/nHHrk.png"" alt=""alt text""></p><p>thankx</p>","411359","","18061","","2012-10-18 05:04:33","2012-10-18 05:04:33","How to make two way slider bar?","<android><android-layout>","1","0","2","",""
"4725542","1","","","2011-01-18 14:57:25","0","415","<p>i have created a live wallpaper and in that there is a ""setting"" button which loads PreferenceActivity but without clicking on ""settings"" but i want to access the SharedPreferences within subclass of Engine or WallpaperService. As i just want to access the small single string so i don;t want user to go into settings and access that string.So i want to execute this code inside Subclass of Engine or WallpaperSerivce</p><pre><code>SharedPreferences  mPrefs = getPreferenceManager().getSharedPreferences();String option = mPrefs.getString(this.getResources().getString(R.string.name),this.getResources().getString(R.string.option));</code></pre>","405383","","19750","","2011-08-31 14:25:36","2011-08-31 14:25:36","access preferences in live wallpaper","<android><live-wallpaper>","1","0","","",""
"4725587","1","4725720","","2011-01-18 15:01:39","2","293","<p>Is there an example about how to measure the strength of pressing the screen? I know there is a command, i just cant find it.</p>","571648","","1016716","","2012-04-30 08:13:26","2012-04-30 08:13:26","Android Button press strength","<android><touch><screen>","1","0","","",""
"4725593","1","","","2011-01-18 15:01:53","1","1874","<p><strong>My goal</strong></p><p>I want to insert multiple records into sqlite in batches (transactionally).</p><p><strong>My question</strong></p><p>I found the method <code>android.content.ContentResolver</code>.<a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/content/ContentResolver.java;hb=HEAD#l650"" rel=""nofollow"">bulkInsert</a>(..) interesting but the javadoc states:</p><blockquote>  <p>This function make no guarantees about the atomicity of the insertions.</p></blockquote><p>Why would android provide a method that is crippled ? Can you name me usecases for non-atomic insertions ? I am going to obviously going to override <code>ContentProvider.bulkInsert(..)</code> to ensure atomicity myself so I'm not sure why it is phrase like this.</p>","450278","","","","","2013-02-01 17:21:52","What is the point of ContentResolver.bulkInsert(..)?","<android>","2","0","","",""
"4725704","1","6030524","","2011-01-18 15:11:26","1","567","<p>I wanna show checkbox on top of the screen to allow the user to enable screenLock and I want to show that checkbox only if he opens the optionsMenu.I am able to do this by overridinbg these 2 methods</p><pre><code>@Overridepublic boolean onMenuOpened(int featureId, Menu menu) {    checkbox.setVisibility(View.VISIBLE);    return super.onMenuOpened(featureId, menu);}@Overridepublic void onOptionsMenuClosed(Menu menu) {    checkbox.setVisibility(View.GONE);    super.onOptionsMenuClosed(menu);}</code></pre><p>However when I touch the checkbox, in order to check it, the menu closes itself and the checkbox disappears before I can check it. </p><p>So my question si simple: How can I prevent the options menu from closing when I touch the checkbox?</p>","522545","","","","","2011-05-17 12:06:28","Prevent OptionsMenu from closing when clicking on checkbox","<android><menu>","1","0","","",""
"4725773","1","","","2011-01-18 15:18:15","108","56692","<p>I have got FFMPEG compiled (libffmpeg.so) on Android. Now I have to buld either an application like RockPlayer or use existing android MM framework to invoke FFMPEG.</p><ol><li><p>Do you have steps / procedures / code / example on integrating FFMPEG on Android / StageFright?</p></li><li><p>Can you please guide me on how can I use this library for MM playback?</p></li><li><p>I have a requirement where I have already Audio and Video TS, which I need to feed to FFMPEG and get it decoded / rendered. How can I do this on Android, since IOMX apis are OMX based and cannot plug-in FFMPEG here.</p></li><li><p>Also I could not find documentation on the FFMPEG apis which need to be used for playback.</p></li></ol><p>Can you please help me with these questions and get me started on this? Your help is greatly appreciated.</p>","580133","","139010","","2011-01-23 06:33:37","2013-09-21 17:54:52","FFMPEG on Android","<android><ffmpeg>","5","6","112","",""
"4725779","1","","","2011-01-18 15:18:44","2","5909","<p>I was wondering if there is a way to receive an SMS from Android emulator, perhaps on a TCP port.I know it's possible to send SMS to emulator by opening a TCP socket on the emulator port and using ""send sms"" command, but is it also possible to receive an SMS this way?</p><p>I'll elaborate - I have a java application running on a Tomcat server. I also have an Android emulator running on the same machine. I can send SMS messages from the application to the emulator using the ""sms send"" command. Can I also receive SMS messages in some way?</p>","580153","","580153","","2011-01-19 07:14:47","2014-02-17 01:24:30","Is it possible to recieve an SMS from Android emulator?","<android>","5","0","1","",""
"4725807","1","","","2011-01-18 15:21:25","3","791","<p>I am looking for any kind of website, blogpost, wiki, discussion, book, magazine, scientific paper, which on good authority could explain the internals of memory management in Android. I know very well that a big part is Linux and this is where I should go first, but Android has dalvik, which is, as far as I understand, deeply integrated with the Kernel, also, Android is unloading apps if it runs out of memory, which is probably what Linux does not do. So, I am looking for an authoritative answer about memory management in Android. Topics include, but are not limited to:</p><ul><li>How to interpret values from <em>adb shell dumpsys meminfo</em>, i.e. what is the meaning of each value: size, alloc, free, Pss, priv dirty, shared dirty, what kind of data is it stored there?</li><li>What would be the best metric to evaluate memory consumption on the device?</li><li>Where is each *.so loaded to? Or does Android have execution in place implemented?</li><li>Are there any limits on how much memory an application can consume?</li><li>Does OS assign a contiguous chunk of memory, which can grow as long as it is contiguous, or some kind of fragmentation is permitted?</li><li>Etc.</li></ul><p>There is a great answer in this thread <a href=""http://stackoverflow.com/questions/2298208/how-to-discover-memory-usage-of-my-application-in-android"">How to discover memory usage of my application in Android</a>, but I want some more in-depth explanation, thus asking for an external resource.</p>","2877","","","","","2011-12-19 16:25:14","What would be a good resource to learn about memory management in Android OS?","<android><memory><internals>","1","1","","",""
"4725815","1","4725877","","2011-01-18 15:22:30","9","6315","<p>Is there a way to open the Facebook app from my own application?</p><p>For example, I'm using the Facebook-api to post something on the logged in users wall. When I get a call back that the post was successfully added I would like to open the Facebook app (if application is installed on the device) on the users wall to show them their post is there.</p><p>Answers for iPhone or Android or both would be much appreciated.</p>","331293","","1046868","","2012-10-31 11:47:58","2012-10-31 11:47:58","Open Facebook app from other app","<iphone><android><facebook>","1","0","6","",""
"4725883","1","","","2011-01-18 15:30:27","2","2117","<p>The scenario is the following:</p><ul><li>I've got an android app that basically consists of a mapview.</li><li>This app queries various web services such us foursquare or wikipedia to obtain a list of locations and plot them into the map.</li></ul><p>The question,</p><ul><li>Does anybody know how to build a Content Provider where the data source is a web service (like the ones mentioned above) and not a db? It'd be great if you could point me in the right direction.</li></ul><p>Thanks!</p>","513284","","701884","","2011-09-28 13:19:32","2013-02-08 12:30:37","ContentProvider with WebService as source","<android><google-maps><android-contentprovider><point-of-interest>","2","1","1","",""
"4725923","1","4726046","","2011-01-18 15:34:20","0","143","<p>Does anybody know of a way to have my application constantly check firstly if there is internet connectivity..and secondly if there is internet connection to call a function...It needs to check for internet coverage say every 10 minutes etc?</p>","569654","","","","","2011-01-18 16:12:56","Constant live update","<android>","1","0","","",""
"4725947","1","4726245","","2011-01-18 15:38:07","-1","1662","<p>I am trying to show an alert inside of an onTouchListener but I can't get it to show. I am pretty new at this but I have been following some good tutorials to no avail.This is part of the code...any ideas why this alert won't show?</p><pre><code>mSwitcher.setOnTouchListener(new OnTouchListener(){   public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id)   {   }   @Override public boolean onTouch(View v, MotionEvent event)   {      // the attempt at the alert      AlertDialog.Builder builder = new AlertDialog.Builder(this);      builder.setMessage(""Are you sure you want to exit?"")             .setCancelable(false)             .setPositiveButton(""Yes"", new DialogInterface.OnClickListener()                {                   public void onClick(DialogInterface dialog, int id)                   {                      MyActivity.this.finish();                   }                })             .setNegativeButton(""No"", new DialogInterface.OnClickListener()                {                   public void onClick(DialogInterface dialog, int id)                   {                      dialog.cancel();                   }                });      AlertDialog alert = builder.create();      return false;   }});</code></pre><p>I think my structure is ok, but I can't even compile.</p>","580162","","1331671","","2013-07-22 07:43:34","2013-07-22 07:43:34","android alert dialog not showing","<android><dialog><alert><alertdialog>","2","0","","",""
"4726008","1","4979632","","2011-01-18 15:45:50","2","1882","<p>I'm new to android and programming in general so go easy!</p><p>I have created a - probably overcomplicated but it does what I want - main.xml with my layout which goes something like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/main_scrollview""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    &gt;&lt;LinearLayout    ...    &gt;    &lt;TextView          android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:text=""@string/title""        android:gravity=""center""    /&gt;    &lt;TableLayout        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:layout_gravity=""center""        android:stretchColumns=""0""        &gt;        &lt;TableRow&gt;            &lt;TextView/&gt;            &lt;Spinner/&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;            &lt;TextView/&gt;            &lt;Spinner/&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;    &lt;TableLayout        android:id=""@+id/main_tablelayout2""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:layout_gravity=""center""        android:stretchColumns=""*""        &gt;        &lt;include            android:id=""@+id/include""            layout=""@layout/price0""        /&gt;        &lt;TableRow&gt;            &lt;TextView/&gt;            &lt;EditText/&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>This is one of the options that I'm trying to include (price1.xml):</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;TableRow&gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:text=""@string/price1""        android:gravity=""center_vertical""    /&gt;    &lt;EditText        android:id=""@+id/price1""    /&gt;&lt;/TableRow&gt; &lt;/merge&gt;</code></pre><p>I am trying to dynamically change the include depending on what value one of the spinners has, but I get a force close on starting the app.</p><p>The logcat error is:</p><pre><code>01-18 15:31:42.826: ERROR/AndroidRuntime(719): FATAL EXCEPTION: main01-18 15:31:42.826: ERROR/AndroidRuntime(719): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at android.view.ViewGroup.addViewInner(ViewGroup.java:1976)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at android.view.ViewGroup.addView(ViewGroup.java:1871)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at android.widget.TableLayout.addView(TableLayout.java:421)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at android.view.ViewGroup.addView(ViewGroup.java:1828)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at android.widget.TableLayout.addView(TableLayout.java:403)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at android.view.ViewGroup.addView(ViewGroup.java:1808)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at android.widget.TableLayout.addView(TableLayout.java:394)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at com.kavi.eta.Calculate$1.onItemSelected(Calculate.java:36)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at android.widget.AdapterView.fireOnSelected(AdapterView.java:871)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at android.widget.AdapterView.access$200(AdapterView.java:42)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:837)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at android.os.Handler.handleCallback(Handler.java:587)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at android.os.Handler.dispatchMessage(Handler.java:92)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at android.os.Looper.loop(Looper.java:123)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at android.app.ActivityThread.main(ActivityThread.java:3647)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at java.lang.reflect.Method.invokeNative(Native Method)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at java.lang.reflect.Method.invoke(Method.java:507)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)01-18 15:31:42.826: ERROR/AndroidRuntime(719):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Looks like I'm doing the java code wrong but I can't figure out how to properly remove the default include and replace it with another layout:</p><pre><code>public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1, int position, long id) {             int index = formatSpinner.getSelectedItemPosition();            if (index == 0) {                TableLayout tl = (TableLayout)findViewById(R.id.main_tablelayout2);                tl.removeView(findViewById(R.id.include));                LayoutInflater inflater = getLayoutInflater();                tl.addView(inflater.inflate(R.layout.price1, tl, true));            }</code></pre><p>Sorry about the long post but I've searched everywhere and can't find a clear answer. Hopefully this'll at least provide a decent-ish example...</p>","576316","","418183","","2011-02-12 18:10:57","2013-12-27 10:21:29","Dynamically changing UI using merge and include tags depending on click","<android><android-layout>","3","0","","",""
"4726017","1","4726276","","2011-01-18 15:47:14","0","679","<p>I want to use a java class from android/frameworks/base/.... How can I import the class to my project in Eclipse? </p>","511853","","","","","2011-01-18 16:12:40","How to Import a Class From Android Source While Developing an Android Application","<java><android><eclipse><frameworks><import>","2","0","1","",""
"4726033","1","","","2011-01-18 15:48:47","1","3442","<p>I have problem in testing the ""LICENSED"" response of LVL. I already changed the test license response in dashboard in edit profile in market web site.</p><p>When I set to ""NOT LICENSED"", it will prompt to buy or exit, but if I set to LICENSE, after waiting for ""CHECKING LICENSE"" progress bar, it will not load my main activity page, the check license loops infinitely, and I need to force close the process. I already added licensecheck Java file name in the manifest and included the intent section.</p><p>The following is what I have captured in logcat. Anyone have an idea what's going on? How do I fix my code?</p><pre><code>I/LICENSE (  312): checkLicenseI/LicenseChecker(  312): Binding to licensing service.I/ActivityManager(   59): Start proc com.android.vending for service com.android.vending/.licensing.LicensingService: pid=320 uid=10019 gids={3003}I/LicenseChecker(  312): Calling checkLicense on service for com.test.apps1I/ActivityManager(   59): Displayed activity com.test.apps1/.MActivity: 3586 ms (total 3586 ms)I/LicenseChecker(  312): Start monitoring timeout.I/ARMAssembler(   59): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x305798:0x305854] in 914005 nsD/GoogleLoginService(  170): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService }I/LicenseChecker(  312): Received response.I/LicenseChecker(  312): Clearing timeout.E/LicenseValidator(  312): CORI APP LICENSED!W/ServerManagedPolicy(  312): License validity timestamp (VT) missing, caching for a minuteW/ServerManagedPolicy(  312): License retry timestamp (GT) missing, grace period disabledW/ServerManagedPolicy(  312): Licence retry count (GR) missing, grace period disabledD/LicenseChecker(  312): AllowI/ActivityManager(   59): Starting activity: Intent { cmp=com.test.apps1/.MActivity }I/LICENSE (  312): checkLicenseD/dalvikvm(  312): GC_FOR_MALLOC freed 3870 objects / 267592 bytes in 92msI/LicenseChecker(  312): Using cached license responseD/LicenseChecker(  312): AllowI/ActivityManager(   59): Starting activity: Intent { cmp=com.test.apps1/.MActivity }I/LICENSE (  312): checkLicenseI/LicenseChecker(  312): Using cached license responseD/LicenseChecker(  312): AllowI/ActivityManager(   59): Starting activity: Intent { cmp=com.test.apps1/.MActivity }I/LICENSE (  312): checkLicenseI/LicenseChecker(  312): Using cached license responseD/LicenseChecker(  312): AllowI/ActivityManager(   59): Starting activity: Intent { cmp=com.test.apps1/.MActivity }I/LICENSE (  312): checkLicenseI/LicenseChecker(  312): Using cached license responseD/LicenseChecker(  312): AllowI/ActivityManager(   59): Starting activity: Intent { cmp=com.test.apps1/.MActivity }I/LICENSE (  312): checkLicenseI/LicenseChecker(  312): Using cached license responseD/LicenseChecker(  312): AllowI/ActivityManager(   59): Starting activity: Intent { cmp=com.test.apps1/.MActivity }I/LICENSE (  312): checkLicenseW/ActivityManager(   59): Launch timeout has expired, giving up wake lock!W/ActivityManager(   59): Activity idle timeout for HistoryRecord{44003148 com.test.apps1/.MActivity}</code></pre><pre><code>public void allow() {    Log.d(""LicenseChecker"",""Allow"");    //Log.i(""LICENSE"", ""allow"");    if (isFinishing())     {        // Don't update UI if Activity is finishing.        return;    }    // Should allow user access.    displayResult(getString(R.string.allow));    // Should allow user access.    startMainActivity();}</code></pre><p>Is this related to the cache response timestamp? If yes, how can I change and modify it?</p><pre><code>W/ServerManagedPolicy(  312): License validity timestamp (VT) missing, caching for a minuteW/ServerManagedPolicy(  312): License retry timestamp (GT) missing, grace period disabledW/ServerManagedPolicy(  312): Licence retry count (GR) missing, grace period disabled</code></pre><hr><p>Do I need to modify ServerManagedPolicy?</p><pre><code>public boolean allowAccess() {    long ts = System.currentTimeMillis();    if (mLastResponse == LicenseResponse.LICENSED) {        // Check if the LICENSED response occurred within the validity timeout.        if (ts &lt;= mValidityTimestamp) {            // Cached LICENSED response is still valid.            return true;        }    } else if (mLastResponse == LicenseResponse.RETRY &amp;&amp;               ts &lt; mLastResponseTime + MILLIS_PER_MINUTE) {        // Only allow access if we are within the retry period or we haven't used up our        // max retries.        return (ts &lt;= mRetryUntil || mRetryCount &lt;= mMaxRetries);    }    return false;}</code></pre><p>Also, how can I do the following?</p><ol><li><p>When there is no license (either no license in Google server or no cached license), then prompt disallow and go to market.</p></li><li><p>When there is a cached license, allow user to run apps (no matter if there is no network or no network connection).</p></li><li><p>When there is a license in Google server (network mode), but no cached license, allow user to run apps.</p></li></ol>","471567","","496830","","2011-08-15 17:38:29","2011-08-15 17:38:29","Android license ""LICENSED RESPONSE"" error","<android><licensing><response>","1","0","1","",""
"4726097","1","4726800","","2011-01-18 15:55:22","2","1445","<p>I'm writing an image manipulation tool and, for image quality reasons, want to edit the image in as large a size as possible.</p><p>I need to be careful that I don't run out of memory while my app is running. In addition, I want to take advantage of devices with lots of memory. For example, I'd like to support medium size images on less powerful devices like the G1 and let more powerful devices like the Samsung Galaxy S support large images.</p><p>Is there a reliable way to gauge how much memory my app can use?</p><p>My current idea is that, when deciding on the image size to load, the device could calculate the image size that brings memory usage for the app as close to about 70% as possible (i.e. not 100% as you don't want the app crashing on small allocations later or because of memory fragmentation)</p><p>I've found I can use the following code to return a percentage of the available memory:</p><pre><code>double totalMemoryUsed = (Runtime.getRuntime().totalMemory() + android.os.Debug.getNativeHeapAllocatedSize());int percentUsed = (int)(totalMemoryUsed / Runtime.getRuntime().maxMemory() * 100);</code></pre><p>New bitmaps add to the native heap allocated part. This seems reliable in that my app will predictably crash with an out of memory error when percentUsed goes above 100%. Are there any caveats to the above calculation I need to be aware of?</p>","580100","","","","","2011-01-18 17:03:48","How to tell how much memory an Android app has left to use?","<java><android><image-processing><mobile>","1","2","1","",""
"4726129","1","4726767","","2011-01-18 15:58:27","3","2960","<p>I have a 1000x1500 pixel bitmap of which I want to make a mutable copy in Android.</p><p>When I run the following code...</p><pre><code>// int width = original.getWidth(); // 1000px// int height = original.getHeight(); // 1500pxfinal Bitmap result = original.copy(original.getConfig(), true);original.recycle();</code></pre><p>...I get an <code>OutOfMemoryError</code> on the <code>copy</code> line:</p><pre><code>java.lang.OutOfMemoryError: bitmap size exceeds VM budgetERROR/GraphicsJNI(419): VM won't let us allocate 6000000 bytes</code></pre><p>Why does the copy instruction need <strong>6MB</strong> (!) for a 1000x1500 pixel bitmap?</p><p>How can I create a mutable bitmap from a non-mutable one in more memory-efficient way?</p><h2>Edit</h2><p><a href=""http://developer.android.com/reference/android/graphics/BitmapFactory.html"" rel=""nofollow"">BitmapFactory</a> returns inmutable bitmaps. Apparently, the only way of creating a mutable bitmap from an immutable one is to copy it into a new mutable bitmap. In the case of a 1000x1500 bitmap, this apparently requires <strong>12MB</strong> (1000x1500x4x2), which causes an OutOfMemoryError in most Android devices.</p><p>Is this problem unsolvable in Android then?</p>","143378","","143378","","2011-01-18 16:34:46","2013-04-09 19:50:31","Why so much memory?","<android><bitmap><out-of-memory>","4","1","4","",""
"4726193","1","4726263","","2011-01-18 16:04:35","-1","314","<p>Can iphone apps run on windows or android phones? </p><p>Is there any tool or framework available?</p>","570002","","127880","","2013-02-17 06:50:00","2013-02-17 06:50:00","iphone app on windows or android mobile","<iphone><android><objective-c><windows><cross-compiling>","2","2","","",""
"4726229","1","","","2011-01-18 16:08:21","5","10209","<p>is it possible to write an auto answering machine for android ? for example when incoming call  event occurs, this application start to play voice.</p><p>how can i do this ? </p><p>thanks</p>","377983","","563735","","2012-08-24 11:42:24","2013-11-17 01:12:10","how to create auto answering machine for android","<android><call>","4","0","3","",""
"4726283","1","","","2011-01-18 16:13:11","8","3529","<p>My app copies files over from res/raw to the sdcard on first run. I want it to update those files on every subsequent app update. How can i have it reset the firstrun preference to true on every app update?</p><p>Here is the relevant code:</p><pre><code>/**     * get if this is the first run     *     * @return returns true, if this is the first run     */        public boolean getFirstRun() {        return mPrefs.getBoolean(""firstRun"", true);     }     /**     * store the first run     */     public void setRunned() {        SharedPreferences.Editor edit = mPrefs.edit();        edit.putBoolean(""firstRun"", false);        edit.commit();     }     SharedPreferences mPrefs;     /**     * setting up preferences storage     */     public void firstRunPreferences() {        Context mContext = this.getApplicationContext();        mPrefs = mContext.getSharedPreferences(""myAppPrefs"", 0); //0 = mode private. only this app can read these preferences     }     public void setStatus(String statustext) {         SharedPreferences.Editor edit = mPrefs.edit();         edit.putString(""status"", statustext);         edit.commit();      }}</code></pre>","580217","","","","","2012-04-27 15:03:23","Android: How to reset FirstRun SharedPreferences when my app is updated?","<android>","3","0","6","",""
"4726490","1","4726649","","2011-01-18 16:34:22","7","30542","<p>I'm trying to get a Spinner to load up with no selected value. once the user selects a value it then takes them to another page. </p><p>This is proving to be a problem because at present, the page just loads straight away before the user gets a choice to choose.</p><p>My spinner class is setup the same way as googles: <a href=""http://developer.android.com/resources/tutorials/views/hello-spinner.html"">http://developer.android.com/resources/tutorials/views/hello-spinner.html</a></p><p>So basically, is it possible have a spinner that loads with nothing selected because at present, it loads the first item in my string array.</p><p>Thanks Everyone</p>","560679","","1007169","","2012-04-30 20:42:21","2012-07-08 03:49:33","Android - Set Spinner Default Value to null","<android><spinner>","4","2","3","",""
"4726546","1","","","2011-01-18 16:39:12","1","441","<p>Well i've been looking at Android's Documentation and i don't seem to understand how they can query a database to show suggestions while the user is typing. Can you guys tell me what listener to implement? I tried <code>onContentChanged()</code> but it didn't work.</p><p>Thanks in advance.</p>","526924","","","","","2011-01-18 17:18:16","search suggestions problem android","<android>","1","0","","",""
"4726637","1","","","2011-01-18 16:46:24","2","1104","<p>I have an android WebView that has a JavaScript interface added with addJavajavascriptInterface(). </p><p>Is it possible to save the state of the WebView (webpage state, html, css, javascript) and then restore it on onCreate? If yes, how?</p><p>The code I have so far keeps crashing:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    if (savedInstanceState != null) {        final WebBackForwardList list = mWebView.restoreState(savedInstanceState);        if (savedInstanceState.containsKey(""currentPicture"")) {            final File f = new File(savedInstanceState.getString(""currentPicture""));            mWebView.restorePicture(savedInstanceState, f);            f.delete();        }    } else {        mWebView.getSettings().setJavaScriptEnabled(true);        mWebView.addJavascriptInterface(new MyJavaScriptInterface(this), ""AndroidApp"");        mWebView.loadUrl(url);    }}public void onSaveInstanceState(Bundle outState) {    final WebBackForwardList list = mWebView.saveState(outState);    File mThumbnailDir = getDir(""my-thumbnails"", 0);    if (list != null) {        final File f = new File(mThumbnailDir, mWebView.hashCode() + ""_pic.save"");        if (mWebView.savePicture(outState, f))        outState.putString(""currentPicture"", f.getPath());    }}</code></pre>","580233","","580233","","2011-01-19 12:42:12","2011-01-19 12:42:12","Android: How to saveState of a WebView with an addJavascriptInterface attached?","<javascript><android><webview><savestate>","0","1","1","",""
"4727032","1","5061043","","2011-01-18 17:24:16","2","1416","<p>I know that some methods and some classes that are implemented in Android are not exported to the Android public SDK. I've been able to create an application that uses some of these functions by compiling my application placing it inside the Android tree.Would it be possible to export these functions to the Android SDK by recompiling it from the sources? How can this be done? Can I include custom classes and functions in the Android SDK as well (supposing of course I create a new SDK and a new firmware)?Thanks!</p>","427544","","","","","2011-02-21 00:00:21","Modifying and recompiling the Android SDK","<android><android-sdk-2.2>","2","0","3","",""
"4727114","1","4732212","","2011-01-18 17:32:01","20","15633","<p>I got struck because of <code>IllegalStateException</code> in the following code. Can anybody please help me? Code:</p><pre><code>import java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.security.MessageDigest;import java.security.NoSuchAlgorithmException;import java.util.ArrayList;import java.util.List;import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;import org.apache.http.NameValuePair;import org.apache.http.ParseException;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.HttpPost;import org.apache.http.impl.client.DefaultHttpClient;import org.apache.http.message.BasicNameValuePair;import org.apache.http.protocol.HTTP;import org.apache.http.util.EntityUtils;import org.json.JSONObject;import android.app.Activity;import android.os.Bundle;import android.telephony.gsm.GsmCellLocation;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.Toast;public class Login extends Activity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.login);        Button bt = (Button) findViewById(R.id.logbt);        final EditText user = (EditText) findViewById(R.id.loguser);        final EditText pw = (EditText) findViewById(R.id.logpw);        bt.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                if (user.getText().toString() != """" &amp;&amp; pw.getText().toString() != """") {                    Thread t = new Thread() {                        public void run() {                            try {                                HttpClient client = new DefaultHttpClient();                                String postURL = ""http://surfkid.redio.de/login"";                                HttpPost post = new HttpPost(postURL);                                ArrayList&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();                                params.add(new BasicNameValuePair(""username"", user.getText().toString()));                                params.add(new BasicNameValuePair(""password"", md5(pw.getText().toString())));                                UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params, HTTP.UTF_8);                                post.setEntity(ent);                                HttpResponse responsePOST = client.execute(post);                                HttpEntity resEntity = responsePOST.getEntity();                                final JSONObject jObject = new JSONObject(EntityUtils.toString(resEntity));                                Log.e(""XXX"", EntityUtils.toString(resEntity));                            } catch (Exception e) {                                Log.e(""XXX"", e.toString());                            }                        }                    };                    t.start();                    // Log.e(""XXX"",s);                }            }        });    }    private String md5(String in) {        MessageDigest digest;        try {            digest = MessageDigest.getInstance(""MD5"");            digest.reset();            digest.update(in.getBytes());            byte[] a = digest.digest();            int len = a.length;            StringBuilder sb = new StringBuilder(len &lt;&lt; 1);            for (int i = 0; i &lt; len; i++) {                sb.append(Character.forDigit((a[i] &amp; 0xf0) &gt;&gt; 4, 16));                sb.append(Character.forDigit(a[i] &amp; 0x0f, 16));            }            return sb.toString();        } catch (NoSuchAlgorithmException e) {            e.printStackTrace();        }        return null;    }}</code></pre><p>Logcat message:</p><blockquote>  <p>01-18 18:39:53.383: ERROR/XXX(7113):  java.lang.IllegalStateException:  Content has been consumed</p></blockquote>","547995","","1128737","","2012-01-14 08:33:40","2014-03-03 06:25:24","IllegalStateException: Content has been consumed","<android>","4","11","7","",""
"4727117","1","5736670","","2011-01-18 17:32:15","0","122","<p>This should be simple but I can't find a solution:I have a custom view and it scales to 200% if the user clicks on it. It stays on that size until the user clicks on it again.</p><p>That works, but only in the old (=smaller) area of the control. It seems that it is not existent (although it is shown) in the area which it now covers.Do I need to call some method after scaling to fix my problem?</p><p>Thank you!</p>","578502","","","","","2011-04-20 21:09:59","android weird (at least for me) behaviour of control after scaling / doesn't accept input in it's whole area","<android><input><view><scaling>","1","2","","",""
"4727443","1","","","2011-01-18 18:07:47","0","550","<p>Is there a way to iterate through the objects on a form and find all the types.  In VBNet you would do something like:</p><pre><code>For each control on form  print typename(control)</code></pre><p>What I mean by a form is the UI that the user can see, I guess that is the Context?  If I have an XML that say has 2 buttons and a textview, is there a way from the java code to see what all of the object are that has been loaded from the XML.</p><p>I am trying to make a generic class that I can use on all UI classes that will look through every object and if its a button then change the colors on that button.</p><p>Alternately I could do this manually for every UI and object.</p>","528130","","528130","","2011-01-19 18:02:54","2011-01-19 18:02:54","android iterate through objects on xml and find the type","<java><android><xml><iteration>","1","3","","",""
"4727460","1","4760373","","2011-01-18 18:09:13","1","2331","<p>I've got two services running. They do their work and then reschedule themselves via the AlarmManager. In the BroadcastReceiver the only thing that happens is the launching of the service via Context.startService(). Both services are IntentServices, which as far as I can tell shouldn't be causing timeout problems. I've tried IntentServices, threading, and AsyncTasks but am repeatedly bumping up against the timeout error in the receivers themselves.</p><p>The timeout message is:01-18 11:29:04.200: WARN/ActivityManager(73): Timeout of broadcast BroadcastRecord{433a4168 my.package.action.a} - receiver=android.os.BinderProxy@4339997801-18 11:29:04.210: WARN/ActivityManager(73): Receiver during timeout: ResolveInfo{43394a30 my.package.MyReceiverA p=0 o=0 m=0x108000}</p><p>The basic structure of the two receivers:</p><pre><code>public class MyReceiverA extends BroadcastReceiver {    public static final String ACTION_TO_BROADCAST = ""my.package.action.a"";    public void onReceive(Context context, Intent intent) {        // start the service        Intent serviceIntent = new Intent().setClassName(context,                 MyServiceA.class.getName());        context.startService(serviceIntent);    }}</code></pre><p>And the services:</p><p>public class MyServiceA extends IntentService {        public ActivityMonitorService() {            super(TAG);        }</p><pre><code>public IBinder onBind(Intent intent) {        // We don't allow anyone to bind to us        return null;}public void onCreate() {    super.onCreate();    _context = getApplicationContext();    _config = new Config();    if (_handler == null) {        _handler = new Handler();    }}    /**     * Schedules an alarm to run ourselves again after ALARM_INTERVAL has passed.     */    private void reschedule() {        Intent intent = new Intent(MyReceiverA.ACTION_TO_BROADCAST);        PendingIntent pendingIntent = PendingIntent.getBroadcast(_context, 0, intent, 0);        AlarmManager manager = (AlarmManager) _context.getSystemService(Context.ALARM_SERVICE);        manager.set(AlarmManager.RTC, now + delay, pendingIntent);    }private void doWork() {    // Do some work. This could take a while. It also accesses a database that the two     // services share through synchronized blocks of code in static accessor functions.}protected void onHandleIntent(Intent intent) {    try {        doWork();    } catch (Exception e) {        // log it    } finally {        reschedule();    }}</code></pre><p>}</p>","556444","","556444","","2011-01-18 21:10:10","2011-01-21 15:12:45","Timeout in BroadcastReceivers using IntentServices","<android>","1","8","","",""
"4727694","1","","","2011-01-18 18:34:28","1","1571","<p>WHen in native code <code>__android_log_print()</code> is used it prints adds an <code>/n</code> at the end of the text.</p><p>I am trying to get the same behavior as <code>printf</code>, where when <code>/n</code> not used it prints the next sting on the same line.</p><p>I need to write a data dump so I need to be able to to structure the data. Now, I know I can store things in a temp buffer but I don't want to do that.</p><p>As I am working on an embedded device with an extremely small runtime memory.</p>","498584","","119895","","2012-01-31 12:15:59","2012-01-31 12:16:11","__android_log_print printing with out '/n' newline CR","<android><c><logging><printf><native>","1","1","2","",""
"4727695","1","4727755","","2011-01-18 18:34:41","0","689","<p>Ive been attempting to work out how to take the text from an edittext box and move it into a string array located in strings.xml.</p><p>Basically its a user form which the user fills in, onClick it adds the information to the database and is then viewable in a listview. The listview and everything works fine but i cant work out to put in information using edittext boxes.</p><p>Any hints or techniques would be very much appreciated.</p><p>Thanks</p>","560679","","","","","2011-12-29 11:41:44","Android - EditText to StringArray stored in xml","<android><arrays><string><edittext>","3","0","1","",""
"4727770","1","4998671","","2011-01-18 18:43:37","1","510","<p>Now with the release of new android NDK, given the fragmentation of android devices, what testing measures one should employ to test over different phones, tablets and/or google tv based devices?</p>","81012","","","","","2011-02-14 23:50:07","android ndk practices","<android><testing><android-ndk><google-tv>","1","0","","",""
"4727800","1","4729068","","2011-01-18 18:46:51","3","4498","<p>How can I detect which one of 4 sides of the phone is up.</p><p>I can detect portrait/landscape mode, but how do I tell <strong>landscape-turned-on-left-side</strong> from <strong>landscape-turned-on-right-side</strong>?</p><p>Basically I want to make a nice transition animation when user turns phone. You know, like in iPhone's Safari: a swift 400ms rotation from the previous layout to the new.</p>","140739","","","","","2012-11-16 12:35:33","Detect Android orientation: landscape-Left v. landscape-Right","<android>","3","0","3","",""
"4727841","1","","","2011-01-18 18:51:48","1","638","<p>seems like the Android ADT's new graphical layout has changed, but it's a pain to add/drop stuff, especially because I do not have control over the layout on the outline where I can drop something inside a linearlayout for example. Does anyone know if it's possible to come back to the old graphical layout?</p>","522559","","21234","","2011-07-25 22:34:37","2011-07-25 22:34:37","android's graphical layout","<android><layout>","1","0","","",""
"4727880","1","4744313","","2011-01-18 18:56:31","0","1214","<p>I'm working on a mobile version of a website and I really wanted to use the HTML5 input field types <code>number</code>, <code>email</code> and <code>tel</code>.  When I do this both Android and iOS show the keyboards I want them to when the user has those fields selected, but in Android the CSS attributes for the fields are ignored now that I changed it from <code>type=""text""</code>, specifically the CSS <code>width</code> attribute.  </p><p>I updated my CSS file to make sure the values for <code>input[type=""text""]</code> also applied to <code>input[type=""email""]</code> etc.. and this works great on iOS.  Is there some trick to get the Android browser to pick up CSS attributes on the new HTML5 input field types?</p><p>I'm testing on a Droid X running Android 2.2 with the default Android browser.</p>","13070","","","","","2011-01-20 06:58:34","Android browser ignoring CSS on HTML5 input tags","<android><css><html5>","1","0","1","",""
"4727926","1","4728135","","2011-01-18 19:01:30","4","150","<p>I can't tell if I'm being respectful and courteous to the user or if I'm unnecessarily handicapping the utility of my app in the name of treating the phone like a china doll.</p><p>I have a successful app in the Android Market. One main functionality is that it records sports stats from a game the user is scoring. The current level of detail is fairly basic: a row for each player and a field for each basic stat. However, I could conceivably <em>dramatically</em> increase the detail and level of usefulness of the app if I recorded additional information, blowing this up to numerous relational tables and conceivably thousands upon thousands of records.</p><p>My question is, is this a responsible thing to do? Up to this point, I've shied away from it, thinking that ""it's just a phone"" and ""it's just <em>SQLite</em>"", but I've never really looked at whether that's a legitimate reason to hold back on doing things that I wouldn't give a second thought to doing on a web or desktop app.</p><p>So with that, how much data (very quantifiable, I know) is it reasonable to expect a phone app to do in regards to storing and sifting through database records?</p><p><strong>EDIT:</strong>To be clear, I'm not simply talking about adding more fields as I know the impact of that is trivial. I'm talking about going from the level of detail of ""This player has 5 singles and 3 homers"" to storing information about each pitch that comprised each at-bat that lead to 5 singles and three homers. Obviously this will call for additional tables and conceivably a great many records.</p>","8117","","8117","","2011-01-18 19:48:20","2011-01-19 01:50:47","Am I babying the platform/hardware?","<android><performance><sqlite>","2","1","","",""
"4727957","1","4729026","","2011-01-18 19:05:07","1","3093","<p>I am developing an Android application that relies on the camera API, using an HTC EVO as my testing device. No matter what I've tried so far, the only time the camera preview looks right is in landscape mode (90 degrees rotation, to be specific). It seems as though there is no way to orient the preview correctly when in portrait mode (0 degrees rotation).</p><p>The default camera application on the device (for HTC Sense) allows for any kind of rotation without any problem, so I know that there is no hardware limitation. I even downloaded some source code from HTC's developer <a href=""http://developer.htc.com/"" rel=""nofollow"">site</a>, but it's all in C - kernel stuff, apparently.</p><p>Can anyone point me in the right direction for solving this problem? Is there a way to rotate the preview correctly in Android 2.1 or 2.2?</p><p>Thank you.</p><p>P.S. Here is the code I'm using, in case it helps...</p><pre><code>package spikes.cameraSpike03;import java.util.List;import android.app.Activity;import android.graphics.PixelFormat;import android.hardware.Camera;import android.hardware.Camera.Size;import android.os.Bundle;import android.util.Log;import android.view.Surface;import android.view.SurfaceHolder;import android.view.SurfaceView;import android.view.Window;import android.view.WindowManager;public class MainActivity extends Activity implements SurfaceHolder.Callback { private static final String LOG_TAG = ""spikes.cameraSpike03 - MainActivity""; private Camera _camera; private boolean _previewIsRunning = false; private SurfaceView _svCameraView; private SurfaceHolder _surfaceHolder;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        getWindow().setFormat(PixelFormat.TRANSLUCENT);        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);        setContentView(R.layout.main);        _svCameraView = (SurfaceView)findViewById(R.id.svCameraView);        _surfaceHolder = _svCameraView.getHolder();        _surfaceHolder.addCallback(this);        _surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);    } @Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {  if(_previewIsRunning){   _camera.stopPreview();  }  try{   Camera.Parameters parameters = _camera.getParameters();   //Get the optimal preview size so we don't get an exception when setting the parameters    List&lt;Size&gt; supportedPreviewSizes = parameters.getSupportedPreviewSizes();   Size optimalPreviewSize = getOptimalPreviewSize(supportedPreviewSizes, width, height);   parameters.setPreviewSize(optimalPreviewSize.width, optimalPreviewSize.height);   _camera.setParameters(parameters);   _camera.setPreviewDisplay(holder);  }  catch(Exception ex){   ex.printStackTrace();   Log.e(LOG_TAG, ex.toString());  }  _camera.startPreview();  _previewIsRunning = true; } @Override public void surfaceCreated(SurfaceHolder holder) {  _camera = Camera.open(); } @Override public void surfaceDestroyed(SurfaceHolder holder) {  _camera.stopPreview();  _previewIsRunning = false;  _camera.release(); } 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;    }}</code></pre>","398641","","","","","2011-01-18 21:08:24","Android: Camera Preview Orientation on HTC EVO (Android 2.1 or 2.2)","<android><camera><orientation><android-sdk-2.2><android-sdk-2.1>","1","0","1","",""
"4728026","1","","","2011-01-18 19:13:36","2","901","<p>Hi i am wondering how (possible?) to use the QuickContactBadge widget found when pressing on a contact in for example the phone app of android. but i dont want to use it on a contact, i want to use as an options menu with my own options inside the widget.</p>","525726","","","","","2011-05-10 13:44:54","using QuickContactBadge menu for something else than contacts","<android><menu>","1","0","","",""
"4728085","1","","","2011-01-18 19:21:42","4","3873","<p>I'm trying to play movies on the Android device from our server. It is not a media server, just a regular Apache server. We use the same API to access the videos on the iPhone and it works fine. </p><p>On the Android device, certain videos work, and others do not. They were all created the same way, except the majority of the ones that don't work are composed of still images and audio.</p><p>We have tried re-encoding them with Videora, and tried hinting them with MP4Box. All of the videos play perfectly fine when stored on the SD card. We have also tried first downloading the video from the server to the SD card, saving it as a file, and then playing it from the file, but this does not work either.</p><p>Help would be amazing. I am massively confused.Thanks.</p><p>Edit - Logcat:</p><pre><code>01-19 08:19:12.669: DEBUG/MediaPlayer(1878): Couldn't open file on client side, trying server side01-19 08:19:14.119: INFO/ActivityManager(1172): Displayed activity com.myproject/.VideoClass: 1966 ms (total 1966 ms)01-19 08:19:15.779: ERROR/PlayerDriver(1071): Command PLAYER_INIT completed with an error or info UNKNOWN PVMFStatus01-19 08:19:15.789: ERROR/MediaPlayer(1878): error (200, -32)01-19 08:19:15.789: ERROR/MediaPlayer(1878): Error (200,-32)01-19 08:19:15.789: DEBUG/VideoView(1878): Error: 200,-3201-19 08:19:15.849: WARN/PlayerDriver(1071): PVMFInfoErrorHandlingComplete</code></pre><p><strong>UPDATE</strong>:Here a pastebin of the video analysis for three different videos. The first streams on the app from the server. The second video will not stream, but can be downloaded then played from the device.The third can neither be streamed or downloaded to be played.<a href=""http://pastebin.com/9qChSkFz"" rel=""nofollow"">http://pastebin.com/9qChSkFz</a></p><p>WTF. </p>","580434","","580434","","2011-01-19 19:11:16","2011-12-01 01:22:08","Cannot play certain videos","<android><video><video-processing><video-encoding><h.264>","1","7","1","",""
"4728177","1","","","2011-01-18 19:30:30","0","1157","<p>I can't imagine why it won't let me import this?</p>","580162","","","","","2011-01-19 20:19:11","The import android.app.WallpaperManager cannot be resolved","<android><import>","2","0","","",""
"4728234","1","5736780","","2011-01-18 19:37:41","0","59","<p>I have a custom view that is scaling to 200% when the user clicks on it.Now I want to prevent some controls/views in that custom view from beeing scaled.</p><p>Is there some way to do this?</p>","578502","","","","","2011-04-20 21:20:28","is there a way to prevent views from beeing scaled in android?","<android><view><scaling>","1","0","","",""
"4728374","1","14612722","","2011-01-18 19:52:12","0","349","<p>In my application I need to process images taken by Android's built-in applications. They're saved into JPEG format, and I need to get access to each pixel. I tried to create a <code>Bitmap</code> instance from the jpeg image, but very often I get an <code>OutOfMemoryException</code>. I can't resize or crop image. Does a solution exist?</p>","571914","","23897","","2011-01-18 19:56:12","2013-01-30 20:08:03","Opening jpegs on Android - I get an OutOfMemoryException","<android><image><bitmap><jpeg>","2","2","1","",""
"4728387","1","4730270","","2011-01-18 19:53:34","1","436","<p>In my webview there is no long click and show up a context menu where i can save link as save image and so on.</p><p>Here is my work so far:</p><pre><code>registerForContextMenu(mWebView);public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {      super.onCreateContextMenu(menu, v, menuInfo);          menu.setHeaderTitle(""Menu"");          menu.add(0, v.getId(), 0, ""Save As... Or save image"");  }@Override  public boolean onContextItemSelected(MenuItem item) {          if(item.getTitle()==""Action 1""){function1(item.getItemId());}      else {return false;}  return true;  }  public void function1(int id){      // HOW DO I SAVE??    }</code></pre><p>SO i cannot really find a working code how to save the selected online image...!Can you guys help me out?And have i done the context menu wrong??</p><p>Thank you!</p>","564612","","564612","","2011-01-18 20:34:07","2011-01-18 23:39:02","Android Development: Save","<android>","1","1","","",""
"4728400","1","4728784","","2011-01-18 19:55:53","0","1301","<p>i'm a new android dev. Actually i'm moving from iPhone to Android :-)</p><p>well, i'm modifying the source of one of the examples (MediaPlayerDemo_Video.java) here: <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/media/index.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/media/index.html</a></p><p>well, the point is that i want to play a video that is inside the project.</p><p>my questions:</p><ol><li>where should i place the video file?, i guess inside the assets folder.</li><li>how do i get the correct video file path?</li></ol><p>thanks in advance</p>","580468","","","","","2011-01-18 20:40:04","MediaPlayer android, playing a file that's is inside the project","<android><android-emulator>","2","0","","",""
"4728720","1","","","2011-01-18 20:32:27","0","340","<p>I'm a complete newbie to Android but played with the idea to port an app to Android to learn it. After doing some first steps with the SDK and looking at the UI samples, I'm still unsure whether the particular ui layout of this conference schedule/timetable app you can see here</p><p><a href=""http://www.youtube.com/watch?v=dJ5rDybL8es"" rel=""nofollow"">http://www.youtube.com/watch?v=dJ5rDybL8es</a></p><p>is possible with Android.</p><p>I particular, the layout consists of something like a table with a fixed column on the left showing the times, which is always visible, and a column to the right which shows sessions that take place in the room displayed at the columns top.By swiping left/right on the right column, you can change the room and see the corresponding session.(In landscape view all three rooms are shown next to each other, but I'm particularly interested in that scroller possibility of the portrait layout)</p><p>I've seen that there is a ViewFlipper class, but I'm unsure whether that could scroll parts of the screen (the right ""column"" in my example) and also if by swiping.</p><p>I would be very happy if someone with Android experience could give me some advice with which view elements I can replicate that layout on Android, if possible.</p><p>Thanks</p>","580482","","","","","2011-01-18 20:57:27","Is this UI layout possible with Android (java based)?","<android><android-layout>","1","0","","",""
"4728733","1","5134146","","2011-01-18 20:33:51","7","6575","<p>I am developing for Android in Eclipse Helios. I'm using the latest ADT plugin 8.0.1. Previously, I could see method javadoc description, when moving my mouse over a method name and waiting for about a second. Now it stopped working for some reason.</p>","243225","","","","","2011-02-27 15:57:39","I can't see Android SDK javadoc in Eclipse","<java><android><eclipse>","2","0","3","",""
"4728761","1","4728829","","2011-01-18 20:37:26","1","4912","<p>I apologize if this seems really simple but I can't figure it out. I have an ImageButton that I want to change the image of at run-time based on a button click. I have 5 images in my res folder. When the user hits the ""Next"" button, I want it to go to the next image. The file names of the images are image1.png, image2.png, etc.</p><p>I know I you can change the image by doing:</p><pre><code>imgButton.setImageResource(R.drawable.image2);</code></pre><p>I have a counter (int) to keep track of the image number being displayed. But how would i change the image to the next image? Any help would be appreciated.</p>","469194","","","","","2013-03-11 02:53:45","Accessing Android drawable resource with a string","<android><imageview><imagebutton>","2","0","1","",""
"4728908","1","5285577","","2011-01-18 20:55:46","25","5894","<p>This is confusing me:</p><p>As far as I read a view with setVisibility(View.GONE); should not receive any more touch- or click events.My layout has two parts which where each will be visible or gone so that only one of them is visible and useable at a time but View.GONE doesn't do the trick.I can't see the GONE view as expected, but it still reacts to onClick (and consumes the event the other view should get).</p><p>Can you help me?</p><p><em>Maybe of interest:When I start my project one view is GONE, the other visible. This time it will work as expected (the GONE view is basically ignored), but after setting View.GONE through the code it'll stop working.</em></p>","578502","","","","","2011-10-13 21:03:16","android View with View.GONE still receives onTouch and onClick","<android><view><onclick><visibility>","5","4","7","",""
"4729037","1","","","2011-01-18 21:09:39","2","410","<p>Using an <code>AutoCompleteTextView</code>, it creates a drop down like list from the <code>EditText</code> field.  However, if you rotate the phone to landscape, it uses a horizontal scrolling list for the autocomplete.</p><p>Some devices that have autocomplete in their keyboard use this horizontal scrolling list.  </p><p>Is there a way to have it use that view instead of the drop down in portrait mode?  If not, is that a View that can be customized?</p><p>Thanks</p>","445348","","881286","","2013-08-18 01:53:19","2013-08-18 01:53:19","Is there a way to have AutoCompleteTextView use the horizontal version?","<android><autocomplete>","0","0","1","",""
"4729088","1","4729720","","2011-01-18 21:13:07","1","542","<p>when android phone is in SLEEP State 0r Locked State What is the state of WIFI ?is it active or not?</p>","413770","","413770","","2011-01-18 21:26:25","2013-05-20 15:59:23","android WIFI state when phone is locked","<android>","3","2","","",""
"4729169","1","4730262","","2011-01-18 21:19:29","3","470","<p>I found that you can change the background of a <code>PreferenceActivity</code> by using <code>getListView().setBackgroundResource(R.drawable.bg);</code></p><p>However, if you go to any deeper PreferenceScreens the background returns to being black.</p><p>There don't appear to be any methods in <code>PreferenceScreen</code> that would allow changes to the background either.</p>","445348","","","","","2011-01-18 23:30:49","Is it possible to change the background of a sub screen (PreferenceScreen) of a PreferenceActivity?","<android><background><preferenceactivity>","1","0","1","",""
"4729172","1","","","2011-01-18 21:19:40","0","656","<p>I am able to run an android app in two virtual devices when degugging.(Galaxy tab and phone). When I close the app in debug mode the icon is not showing in the virtual device.</p><p>The same thing occurs when I load a signed .apk file to the actual devices.</p><p>The app icon shows when I go into manage applications. I can uninstall the app. Thats all I can do. I cannot launch the app since the icon is not visible with the other app icons.</p><p>I am using platform 2.2 with google api's 8.</p><p>What am I doing wrong? How can I get the app icon to show with other apps and be able to launch?</p><p>Here is my manifest file.Any help is appreciated.</p><p></p><pre><code>&lt;uses-permission     xmlns:android=""http://schemas.android.com/apk/res/android""     android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;uses-permission     xmlns:android=""http://schemas.android.com/apk/res/android""     android:name=""android.permission.ACCESS_FINE_LOCATION""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.SET_DEBUG_APP""&gt;&lt;/uses-permission&gt;&lt;application     android:label=""@string/app_name""    android:icon=""@drawable/appicon""    android:name="".ApplicationController""    android:debuggable=""true"" &gt;    &lt;uses-library android:name=""com.google.android.maps"" /&gt;    &lt;activity android:name="".MainActivity""            android:screenOrientation=""portrait""              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="".MainFlippingActivity""            android:screenOrientation=""portrait""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MainFlipping"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".PrefsTabWidget""            android:screenOrientation=""portrait""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.PrefsTabWidget"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".PrefsTaskingActivity""            android:screenOrientation=""portrait""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.PrefsTasking"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".SatelliteSelectionActivity""            android:screenOrientation=""portrait""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.SatelliteSelection"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name=""MainSettingsActivity""            android:screenOrientation=""portrait""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MainSettings"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name=""ClassificationActivity""            android:screenOrientation=""portrait""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.Classification"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name=""ListItemPrefActivity""            android:screenOrientation=""portrait""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.ListItemPref"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name=""TimeOnTargetActivity""            android:screenOrientation=""portrait""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.TimeOnTarget"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name=""LatLonActivity""            android:screenOrientation=""portrait""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.LatLon"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name=""QuantityActivity""            android:screenOrientation=""portrait""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.Quantity"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name=""IncidenceAngleActivity""            android:screenOrientation=""portrait""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.IncidenceAngle"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name=""SendUrlActivity""            android:screenOrientation=""portrait""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.SendUrl"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name=""TestActivity""            android:screenOrientation=""portrait""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.Test"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name=""Slide""            android:screenOrientation=""portrait""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.Slide"" /&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;</code></pre><p> </p>","580577","","","","","2012-09-19 09:59:08","Android app icon shows on device to allow uninstall but does not allow to execute","<android>","3","1","","",""
"4729188","1","4729292","","2011-01-18 21:21:15","9","11973","<p>I have an android client that communicates with the server via REST-ful endpoints and JSON. Because of this, I have the need to retrieve the full server response prior to converting it into a Hash. I have this code in place to do that (found on the internet someplace):</p><pre><code>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>The code works for the most part, however I am seeing reports of crashes in the field from clients with an OutOfMemory exception on the line:</p><pre><code>    while ((line = reader.readLine()) != null) {</code></pre><p>The full stack trace is:</p><pre><code>java.lang.RuntimeException: An error occured while executing doInBackground()    at android.os.AsyncTask$3.done(AsyncTask.java:200)    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)    at java.util.concurrent.FutureTask.setException(FutureTask.java:124)    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)    at java.util.concurrent.FutureTask.run(FutureTask.java:137)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)    at java.lang.Thread.run(Thread.java:1102)Caused by: java.lang.OutOfMemoryError    at java.lang.String.(String.java:468)    at java.lang.AbstractStringBuilder.toString(AbstractStringBuilder.java:659)    at java.lang.StringBuilder.toString(StringBuilder.java:664)    at java.io.BufferedReader.readLine(BufferedReader.java:448)    at com.appspot.myapp.util.RestClient.convertStreamToString(RestClient.java:303)    at com.appspot.myapp.util.RestClient.executeRequest(RestClient.java:281)    at com.appspot.myapp.util.RestClient.Execute(RestClient.java:178)    at com.appspot.myapp.$LoadProfilesTask.doInBackground(GridViewActivity.java:1178)    at com.appspot.myapp.$LoadProfilesTask.doInBackground(GridViewActivity.java:1)    at android.os.AsyncTask$2.call(AsyncTask.java:185)    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)    ... 4 more</code></pre><p>My question: is there any way to solve this problem aside from sending smaller chunks of data from the server? </p><p>Thanks!</p>","61072","","","","","2013-07-08 08:17:47","Android: Convert Stream to String without running out of memory","<java><android><json><out-of-memory>","5","2","7","",""
"4729255","1","4730170","","2011-01-18 21:28:32","10","8442","<p>I would like to have onZoomListener on my MapView.The code below is what I have done. It registers if zoom buttons are tapped. Since all new phones now supports pinch to zoom, this is useless. Does anybody have idea how to do real onZoomListener? Thanks.</p><pre><code>   OnZoomListener listener = new OnZoomListener() {   @Override   public void onVisibilityChanged(boolean arg0) {    // TODO Auto-generated method stub   }   @Override   public void onZoom(boolean arg0) {    Log.d(TAG, ""ZOOM CHANGED"");    // TODO Auto-generated method stub   }  };  ZoomButtonsController zoomButton = mapView.getZoomButtonsController();  zoomButton.setOnZoomListener(listener);</code></pre>","507153","","","","","2011-10-06 10:19:39","How to implemennt OnZoomListener on MapView","<android><zoom><listener><android-mapview><eventlistener>","7","0","5","",""
"4729273","1","","","2011-01-18 21:30:14","1","704","<p>I'm on a Mac Pro, OS version 10.5.8.</p><p>Installed android SDK, and was successfully launching and using emulators all morning.  Then this afternoon, the emulator CRASHES every single time I try to launch one.  </p><p>The sequence is: select (or create a new) AVD targeting Android 2.3, Skin is set to WVGA854... click ""start""... emulator device launches, shows the black screen with ""Android _ "" for about 1-2 seconds, then crashes.  </p><p>Tried restarting the mac, deleted android SDK along with the hidden .android folder it creates, then reinstalled SDK, tried different settings on the AVD device, all lead to the same result.</p><p>Pasted below is the error log from the last crash.</p><p>Anyone know what I can do to fix??</p>","267942","","","","","2011-12-02 04:13:11","Launching Android AVD device crashes after 2 secs (mac). How to fix?","<android><osx><sdk><terminal>","1","0","","",""
"4729286","1","4729329","","2011-01-18 21:31:54","0","634","<p>how do i save file from a website for example an image?</p>","564612","","","","","2011-01-18 21:37:20","Save file from web?","<android>","1","3","","",""
"4729472","1","4729503","","2011-01-18 21:52:35","0","1813","<p>I created a java program that would just read a webpages code... google's for example and it works fine.  However I have tried to implement the same code in an android application both in the emulator and on the actual device-Droid X.</p><p>I've tried two separate ways and have found either way it is the same line that throws the IOException.  It is the line that creates the new bufferReader.  I don't know if it is the bufferReader or the InputStreamReader.  Also I don't really know how to get anymore information out of the exceptions other than to print out IOException.  Here is the important code stripped down. Thanks.</p><pre>try        {//method 1         URL page = new URL(""http://192.168.1.108/score.php"");         URLConnection pageconnection = page.openConnection();         BufferedReader in = new BufferedReader(                    new InputStreamReader(                    pageconnection.getInputStream()));//method 2         HttpURLConnection conn = (HttpURLConnection) url.openConnection();            conn.connect();            BufferedReader rd  = new BufferedReader(new InputStreamReader(conn.getInputStream()));while ((inputLine = rd.readLine()) != null)             System.out.println(inputLine);          in.close();          rd.close();            HscoreText.setText(""It Worked!"");        }        catch(MalformedURLException e)        {         HscoreText.setText(""MalformedURL"");        }        catch (IOException e)        {         HscoreText.setText(""IOException"");        }</pre>","559431","","","","","2011-01-19 05:04:11","bufferReader or InputStreamReader always throws exception","<java><android><web-services>","3","2","","",""
"4729551","1","4924207","","2011-01-18 22:02:09","1","6691","<p>I am attempting to lookup the phone number for contacts by their contactId, bll results are returning - Phone Number: 1</p><p>I've tried using other examples around SO but I keep getting a 0 count on the cursor</p><pre><code>Uri uri = ContentUris.withAppendedId(Data.CONTENT_URI, contactId);Log.i(TAG, ""Locate Contact by Id: "" + contactId + "" at Uri: "" + uri.toString());Cursor cursor = this.getContentResolver().query(uri, null, null, null, null);try {    if (cursor.moveToFirst()) {        Log.i(TAG, ""Phone Number: "" + cursor.getString(cursor.getColumnIndex(Phone.NUMBER)));    }} finally {    cursor.close();}</code></pre>","398012","","","","","2011-02-07 17:12:53","ContactsContract lookup Phone Number by Contact Id","<android><uri><contactscontract>","2","0","1","",""
"4729561","1","","","2011-01-18 22:03:22","1","1313","<h2>Background</h2><p>We are handing out phones for people to use while visiting our exhibition, and in those phones we are running a j2me app. The people will be using the device on their own while walking around, and returning it when leaving. </p><h2>Problem</h2><p>While our app is made specifically to be easy to use and understand for someone who has never used it before, the phone OS is not... (Currently HTCs with Brew MP)</p><p>People are accidentally pressing the front buttons and are thrown back into the menus, or the screen locks and they dont know how to get back.</p><h2>Solution?</h2><p>The only solution I can think of is to create a custom Android version that we can use in our phones.</p><p>The thing I would like to change is to disable all hardware buttons and special swipes. So people are essentially locked into our app when it is launched.</p><p>A few questions comes to mind:</p><ul><li>How hard it is to get a custom built android version up and running on a device?</li><li>Does disabling buttons mean I have to dig deep into the kernel, or is it easily accessible?</li><li>Are some handsets better suited for running custom android? (We are currently planning on using ZTE Blade)</li><li>Does android come with drivers for GSM/camera/GPS etc for most chipsets, or will that be a problem?</li></ul><p>Am I over-complicating things? Perhaps regular apps can override what the buttons do already? </p>","39991","","","","","2013-02-27 01:15:44","What steps are required to create a custom Android version?","<android>","4","0","1","",""
"4729639","1","5122477","","2011-01-18 22:11:32","1","824","<p>Is there some way that an Android app written in Air can send data (text, images, etc.) to another Android app, in the way that native apps do through the ""Share Via"" dialog that appears when the Intent filter is used?</p><p>Thanks!</p>","164545","","","","","2014-02-14 07:26:16","Can I use Intent (or some equivalent) to get a ""Share Via"" prompt from my Air app running on Android?","<android><flex><air><android-intent><share>","1","1","","",""
"4729642","1","4729673","","2011-01-18 22:11:50","0","543","<p>Is it possible to create an Android app for an existing web application which doesn't provide any API? </p><p>Webview just provides a crude view of the same web app in Android, but interface with webview looks crappy.</p>","203018","","","","","2011-01-18 23:01:13","Android app for a web application without an API","<java><android>","2","0","0","",""
"4729796","1","","","2011-01-18 22:29:44","0","620","<p>Can I get a string of XML from a SAX Element class in Android? For example, in DOM parsing in .NET, we can get the OuterXml or InnerXml of a node. Unless I'm overlooking something, it seems that there is no way to do that either using SAX or DOM parsing in Android. Am I right about that (I hope not)?</p><p>Using SAX, we can do something like:</p><pre><code>Element childElt = rootElt.getChild(CHILD_ELT_NAME);if(childElt != null) { childElt.setEndTextElementListener(new EndTextElementListener() {  @Override  public void end(String body) {   //Do something with the body string  } });}</code></pre><p>That will allow us to get at the ""value"" of the child element. Is there anything similar that will allow us to get at the XML representation of the element and its children?</p><p>Thank you.</p>","398641","","","","","2011-01-18 23:21:32","Android: Get XML from SAX Element","<android><xml><element><sax>","2","2","","",""
"4729919","1","4729946","","2011-01-18 22:45:03","2","518","<p>Im trying to parse some html code line by line. However, when i search for a line that start with <code>&lt;td class=""departure""</code>, i cant manage to syntax it correctly because of the string delimiter signs ("") (what is the name of this sign in english anyway?) in the html. It sees two strings and departure as a variable in between.</p><p>Can anyone help me with this?</p><pre><code>if (line.startsWith(""   &lt;td class=""departure"""")){   result += Html.fromHtml(line) + "" "";}</code></pre>","580657","","","","","2011-01-18 22:47:48","Android, parsing html, problem with strings in strings","<java><android><html><string>","1","1","","",""
"4730035","1","4730098","","2011-01-18 22:59:15","0","280","<p>In the broadcast receiver's onReceive() method, how can I tell which app send me the Intent?</p><p>Thank you.</p>","286802","","168175","","2011-01-18 23:05:45","2011-01-18 23:07:43","In my boardcast receiver 's onreceive() method, how can i tell the origin of the Intent","<android><android-intent>","1","2","","",""
"4730100","1","4730143","","2011-01-18 23:07:45","17","12616","<p>In the Java code of an Android project if you want the reference for a view resource you can do something like:</p><pre><code>View addButton = findViewById(R.id.button_0);</code></pre><p>In the above R.id.button_0 is not a String. Is it possible to dynamically refer to a resource by a string, such as ""<code>R.id.button_0</code>""?</p><p>I'd like to refer to a button by ""<code>R.id.button_%i</code>"" where <code>%i</code> is replaced by some valid index.</p>","283311","","","","","2012-06-11 16:36:13","Android and getting a view with id cast as a string","<java><android><layout>","2","0","9","",""
"4730247","1","","","2011-01-18 23:28:53","8","5173","<p>I need to paint the background of my Canvas one color with shading/gradient applied, but each onDraw call I would like to potentially change the color.</p><p>I am having trouble doing this without creating a new object each onDraw call. Anyone have any ideas?  If I use drawPaint() and set a new shader() to my paint, then I have created a new shader object and if I create a new GradientDrawable() I have as well.  I want to avoid GC.</p><p>I thought I could reuse one GradientDrawable() object and call the .setColor() method, but this just resets any gradient data associated it and paints the drawable as that solid color.</p><p>Anyone?</p>","580702","","","","","2011-01-18 23:45:44","How to paint a gradient color in Android on a Canvas with the color changing?","<android><canvas><gradient><shader>","2","0","3","",""
"4730268","1","","","2011-01-18 23:31:34","1","3777","<p>In my preferences I have a ListPreference which opens DialogPreference. Now I would like to create a simple dialog without Cancel button and title Category. I want just the list of options, which I would like to make custom too. I already looked at the source code and I'm a bit confused because do I have to write my own dialog preference class just to remove title and cancel button? Or I can just extend DialogPreference to create all the customizations? There are also some widgetLayout/dialogLayout attributes, but I don't see an option how to remove a title/cancel button from there. Or should I extend ListPreference? Any suggestions would be greatly appreciated, because I'm running out of ideas.<a href=""http://i.stack.imgur.com/fDncB.png"" rel=""nofollow"">dialog</a></p>","524384","","","","","2011-01-19 00:38:00","Custom DialogPreference/ListPreference","<android>","1","0","0","",""
"4730372","1","","","2011-01-18 23:51:09","2","420","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/9045779/how-to-add-postal-address-to-contacts-in-android-programmaticaly"">How to add postal address to contacts in android programmaticaly?</a>  </p></blockquote><p>I am trying to save postal address to contacts in my android application, but all I am able to save is email and phone number. Postal address is never saved to that contact.Please help me how to proceed with this.</p>","580726","","","","","2011-01-18 23:51:09","How to add/save Postal Address to Contacts in Android Application","<android><contactscontract><android-contacts>","0","0","","2012-11-01 10:20:38",""
"4730438","1","4739153","","2011-01-19 00:01:24","0","339","<p>I'm trying to create a SurfaceView that contains a GLView showing 9 planes.I'm trying to get planes oriented in a diamond shape around the origin. Essentially it will have the top layer all point in towards the origin at a 120 degree angle separated in a circular shape by 120 degrees. The middle layer will also be separated by 120 degrees but be perpendicular to the x axis and parallel to the y. The bottom layer will be an inverse of the top layer.</p><p>So far I have tried loops (didn't end well, the planes were scattered across creation) and going by plane by plane to make sure that the yaw and pitch were properly set. Neither have worked. </p><p>If you have any ideas please tell me or point me in the direction of a decent tutorial.</p><p>Thanks~Aedon</p><p>Here is my line by line code snippet: </p><p>dyaw &amp; dpitch: 120 degrees</p><p>w &amp; h: width(2) and height(3) accordingly</p><p>spacing: .5f</p><pre><code>// Top LayermGL.glRotatef(dyaw, 0, 1f, 0);mGL.glRotatef(dpitch, 0, 0, 1f);mGL.glTranslatef(0, h + spacing, 0);mPanels[0].drawColorful(mGL);mGL.glRotatef(dyaw, 0, 1f, 0);mPanels[1].drawColorful(mGL);mGL.glRotatef(dyaw, 0, 1f, 0);mPanels[2].drawColorful(mGL);// Middle LayermGL.glRotatef(dyaw, 0, 1f, 0);mGL.glRotatef(-dpitch, 0, 0, 1f);mGL.glTranslatef(0, -(h + spacing), 0);mPanels[3].drawColorful(mGL);mGL.glRotatef(dyaw, 0, 1f, 0);mPanels[4].drawColorful(mGL);mGL.glRotatef(dyaw, 0, 1f, 0);mPanels[5].drawColorful(mGL);// Bottom LayermGL.glRotatef(dyaw, 0, 1f, 0);mGL.glRotatef(-dpitch, 0, 0, 1f);mGL.glTranslatef(0, -(h + spacing), 0);mPanels[6].drawColorful(mGL);mGL.glRotatef(dyaw, 0, 1f, 0);mPanels[7].drawColorful(mGL);mGL.glRotatef(dyaw, 0, 1f, 0);mPanels[8].drawColorful(mGL);</code></pre>","480691","","44729","","2011-01-19 01:12:44","2011-01-19 18:28:03","OpenGL placing planes","<android><opengl-es><translation><rotation><surfaceview>","1","0","","",""
"4730513","1","4979850","","2011-01-19 00:17:03","2","1677","<p>I am following this tutorial: <a href=""http://webcache.googleusercontent.com/search?q=cache%3aU2ENWxCHB20J%3awww.kaloer.com/android-preferences+android+preference+screen&amp;cd=3&amp;hl=hu&amp;ct=clnk&amp;gl=hu"" rel=""nofollow"">link text</a></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>}</p><p>PreferencesTutorial.java:</p><pre><code>public class PreferencesTutorial extends Activity{@Overridepublic void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button prefBtn = (Button) findViewById(R.id.prefButton);        prefBtn.setOnClickListener(new OnClickListener() {                public void onClick(View v) {                        Intent settingsActivity = new Intent(getBaseContext(),                                        Preferences.class);                        startActivity(settingsActivity);                }        }); }</code></pre><p>}</p><p>Preferences.xml:<img src=""http://i.stack.imgur.com/5FsxE.jpg"" alt=""alt text""></p><p>When application starts, and i click the prefButton, an error occures: ""The application PreferencesTutorial (process PreferencesTutorial.com.examples) has stopped unexpectedly. Please try again""</p><p>I haven't found any mistakes in the code.I would also like to show my filestructure if that helps:<img src=""http://i.stack.imgur.com/3CY4T.jpg"" alt=""alt text""></p><p>AndroidManifest.xml:<img src=""http://i.stack.imgur.com/Of7LT.jpg"" alt=""alt text""></p><p>What is wrong with the code?</p><p>Even if i add (where the cursor is)</p><pre><code>&lt;activity        android:name="".Preferences""        android:label=""@string/set_preferences""&gt;    &lt;/activity&gt;</code></pre><p>i still get the error.</p>","571648","","571648","","2011-01-19 09:45:28","2012-05-10 23:12:02","Android preferences problem","<android><preferences>","4","4","","",""
"4730547","1","4730568","","2011-01-19 00:23:15","5","6006","<p>In android/java, I'm trying to replace the space in some strings with a <code>+</code>, but it doesn't seem to work. Am I doing it wrong?    </p><pre><code>String string=""Hello world"";string.replace("" "", ""+"");</code></pre>","580657","","244296","","2011-01-24 02:42:07","2011-04-12 23:52:30","Strings in android/java, replacing spaces","<java><android><string><replace><space>","3","2","1","",""
"4730558","1","4731316","","2011-01-19 00:24:47","0","862","<p>I've created a view that installs an alarm via AlarmManager, which will in turn execute a BroadcastReceiver subtype specified by me.</p><p>In this BroadcastReceiver, I would like to call a method of my view: I need to clean up after the alarm happened. Can I somehow call my view from the BroadcastReceiver?</p><p>I've tried to solve the issue by turning my BroadcastReceiver into an inner class, but I couldn't make it work with Context.registerReceiver(), plus I'd rather have it as a top level type for clarity.</p>","580684","","580684","","2011-01-19 00:49:01","2011-01-19 02:49:30","Execute a callback method from a BroadcastReceiver","<android><callback>","1","0","","",""
"4730652","1","","","2011-01-19 00:44:15","2","2022","<p>I have a basic widget that displays a text field. I'm trying to figure out how to launch a website url when a user clicks on the widget itself. I can't seem to find any code on the matter.</p>","562537","","","","","2013-12-30 12:39:11","How to launch website on widget click?","<android><url><widget><onclick>","5","0","1","",""
"4730662","1","","","2011-01-19 00:45:49","1","653","<p>I need to move zoom buttons from bottom center to bottom right position on MapView? Is that possible? Thanks.</p>","507153","","","","","2011-01-19 01:12:14","How to move Zoom buttons on MapView to different place?","<android><button><reference><position><zoom>","1","1","","",""
"4730691","1","4856003","","2011-01-19 00:50:34","11","13421","<p>Have read over a number of related questions here at SO, as well as looked through the Android docs and source to try to figure this out, but I am stumped, although given that the listSelector seems to only apply styles on selected items, I'm not shocked...</p><p>I have a Listview defined in main.xml here:</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;ListView      android:id=""@android:id/list""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:fadingEdgeLength=""5dp""    android:divider=""#000000""        android:dividerHeight=""1dp""        android:listSelector=""@drawable/list_selector"" /&gt;    &lt;TextView     android:id=""@android:id/empty""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:gravity=""center""        android:singleLine=""false""        android:text=""@string/message_list_empty"" /&gt;&lt;/FrameLayout&gt;</code></pre><p>The listSelector referenced is here (borrowed largely from the default Android State List found in the SDK: /android/platforms/android-8/data/res/drawable/list_selector_background.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;!-- the window has lost focus, disable the items --&gt;    &lt;item         android:state_window_focused=""false""        android:drawable=""@drawable/shape_row_disabled"" /&gt;    &lt;!-- the list items are disabled --&gt;    &lt;item         android:state_enabled=""false""        android:state_focused=""true""         android:state_pressed=""true""        android:drawable=""@drawable/shape_row_disabled"" /&gt;    &lt;item         android:state_enabled=""false""        android:state_focused=""true""         android:drawable=""@drawable/shape_row_disabled"" /&gt;    &lt;item         android:state_enabled=""false""        android:drawable=""@drawable/shape_row_disabled"" /&gt;    &lt;!-- the list items are enabled and being pressed --&gt;    &lt;item         android:state_focused=""true""         android:state_pressed=""true""        android:drawable=""@drawable/shape_row_transition"" /&gt;    &lt;item         android:state_focused=""false""         android:state_pressed=""true""        android:drawable=""@drawable/shape_row_transition"" /&gt;    &lt;!-- the list items are enabled and being used --&gt;    &lt;item        android:state_focused=""true""        android:drawable=""@drawable/shape_row_selected"" /&gt;    &lt;!-- the default item --&gt;    &lt;item         android:drawable=""@drawable/shape_row"" /&gt;&lt;/selector&gt;</code></pre><p>The drawables referenced are shapes, rounded rectangles, like so:</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;gradient         android:startColor=""#EF6100""        android:centerColor=""#FF8E00""         android:endColor=""#EF6100""         android:angle=""270"" /&gt;     &lt;corners         android:bottomRightRadius=""7dp""         android:bottomLeftRadius=""7dp""        android:topLeftRadius=""7dp""         android:topRightRadius=""7dp"" /&gt; &lt;/shape&gt;</code></pre><p>So, the end result should be a ListView with items with a @drawable/shape_row background by default, and then different colored backgrounds depending on the state.  When I fire up my list, everything works fine in terms of when states are active, such as an item gets focus, is pressed, etc, but the items themselves have a transparent background when none are selected (i.e. the default view state).  I had hoped that the last rule of the State List, </p><pre><code>&lt;item android:drawable=""@drawable/shape_row"" /&gt;</code></pre><p>would capture that state, but for some reason it is not working.  I have moved things around and tried different settings, and nothing.  If I edit the row.xml file which I use to define the list items in the ListView and try to add a specific android:background that points to @drawable/shape_row, every row gets the correct background, BUT on pressed, on focus, etc states fail to process (or at least, can't be seen as the background never changes).</p><p>Can anyone point me in the right direction here?  I am SO close to putting this one to bed, but after trying nearly everything, just can't get the ListView items to take a default background AND respond to the implemented State List via android:listSelector.</p><p>Thanks,</p><p>Paul</p><p>EDIT:</p><p>Also just tried adding android:itemBackground=""@drawable/shape_row"" to the ListView in main.xml, and unsurprisingly no luck (the docs state it should be used to specify menu items' backgrounds, but thought it was worth a shot with list items).</p><p>Another thing tried, adding android:visible=""true"" to each of the selector and item definitions.  The StateListDrawable docs seem to indicate that the <a href=""http://developer.android.com/reference/android/graphics/drawable/StateListDrawable.html#attr_android%3avisible"">""Provides initial visibility state of the drawable; the default value is false""</a>, but adding this changed nothing.</p><p>EDIT2: So, based on the research done below by Qberticus, it seems that there can be only one set of list selectors per view, which confirms the list selector behavior.  I can also confirm that setting the android:drawSelectorOnTop does move the selector IN FRONT of the selected item, but this of course obscures the item itself such that I only see the selector itself (which in my case is a colored shape).</p><p>Here is what the list looks like with backgrounds set:</p><p><img src=""http://i.stack.imgur.com/nyc0D.png"" alt=""normal, unselected list with background set""></p><p>Due to the set background, there is no change in appearance when items are selected.  If I change the android:drawSelectorOnTop directive to true and select an item, I get:</p><p><img src=""http://i.stack.imgur.com/fejrN.png"" alt=""selected, with drawSelectorOnTop set to true""></p><p>And finally, if I set no background image for the list items, the selector works as expected, but of course, there are no background images as the last rule of the StateSelector does not appear to be followed (shouldn't it act as a catchall?) for non-selected items meaning no nice custom rounded shapes:</p><p><img src=""http://i.stack.imgur.com/PpRBS.png"" alt=""selected, no background""></p><p>So, my problem remains; if I don't set a background for each list item, I can see the selector working BUT the items have no background when not selected.  If I set a background for the item, they look great when not selected, but the background obscures the selector.  Is it simply not possible to have a uniquely shaped list item with working selectors?</p><p>Thanks for anyone else who can weight in.</p>","357801","","357801","","2011-01-28 21:01:06","2013-01-23 15:48:03","Android ListView State List not showing default item background","<android><listview><background><state>","3","0","5","",""
"4730854","1","","","2011-01-19 01:21:52","0","250","<p>Does anyone have an opinion on the difference in performance between using Drawables and drawing sprites with OpenGL es?</p><p>I've started writing a game engine based on what I leaned in the Lunar Lander sample. I'm just wondering if I will get a better frame rate by using OpenGL. My game isn't super complex or anything, but there will be at least 8-10 sprites on screen at all times. I plan to target 2.1+.</p><p>Assuming OpenGL es is the better avenue, would I want to use the Texture2D class to render sprites on a 2d plane?  I've used OpenGL but never es and it's been a while at that.</p><p>Thanks!</p>","450050","","","","","2011-01-19 01:21:52","Android Sprite Work","<android><graphics>","0","2","","",""
"4730896","1","4730914","","2011-01-19 01:29:56","0","1425","<p>I'm sure this is something really basic that I'm overlooking but compared with all the articles I've researched, I seem to be doing it right.</p><p>I have a DialogPreference that has edittexts for both username and password and a button to save the data to preferences. Upon creation, I'd like to query the preferences and fill the edittext boxes with previously saved data to be edited, otherwise leave the boxes blank. Currently, if no previous data exists, I'm having no issues, but if data does exist, my app crashes when trying to open the DialogPreference.</p><p>My DialogPreference code:</p><pre><code>public class AccDialog extends DialogPreference implements DialogInterface.OnClickListener {    private EditText mUserbox, mPassbox;    CharSequence mPassboxdata, mUserboxdata;    private Context mContext;    private int mWhichButtonClicked;    public AccDialog(Context context, AttributeSet attrs) {        super(context, attrs);        mContext = context;    }    @Override    protected View onCreateDialogView() {        // Access default SharedPreferences        @SuppressWarnings(""unused"")        SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(mContext);        // Register listener        final OnCheckedChangeListener mShowchar_listener;        // Run the following methods onCreate        existingData();        @SuppressWarnings(""unused"")        LinearLayout.LayoutParams params;        LinearLayout layout = new LinearLayout(mContext);            layout.setOrientation(LinearLayout.VERTICAL);            layout.setPadding(10, 10, 10, 10);            layout.setBackgroundColor(0xFF000000);            mUserbox = new EditText(mContext);                mUserbox.setSingleLine(true);                   mUserbox.setSelectAllOnFocus(true);            mPassbox = new EditText(mContext);                mPassbox.setSingleLine(true);                mPassbox.setSelectAllOnFocus(true);            layout.addView(mUserbox);            layout.addView(mPassbox);        return layout;      }       private void existingData() {        SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(mContext);        String Unamedata = pref.getString(""usernamekey"", """");        String Pworddata = pref.getString(""passwordkey"", """");        if((Unamedata.length() != 0) &amp;&amp; (Pworddata.length() != 0)) {            mUserbox.setText(Unamedata);            mPassbox.setText(Pworddata);        }    }}</code></pre>","576952","","","","","2011-01-19 01:33:25","Filling EditText with existing data from SharedPreferences","<android><edittext><settext>","1","0","","",""
"4730982","1","","","2011-01-19 01:44:02","3","3469","<p>I have an app working that can take a picture via the full code at bottom.  My question is regarding how to either access the thumbnail that is stored in the jpeg or generate a new thumbnail.  Either putting the code in this class or a separate class that checks the folder based on an event or schedule and generates the thumbnails is fine.</p><p>Specifically, I have set for there to be a Thumbnail, but can not access it in anyway.  I have tried implementing the ExifInterface and also tried manually resizing the photo.  I was able to put other parameters into the Jpeg Exif (put some random numbers in for latitude and longitude).  Viewing the file confirmed that the numbers were written.  Many thanks.</p><pre><code>    public void surfaceChanged(SurfaceHolder holder,int format, int width, int height) {        Camera.Parameters parameters=camera.getParameters();        parameters.setPreviewSize(width, height);        parameters.setPictureFormat(PixelFormat.JPEG);        parameters.setJpegThumbnailQuality(50);        parameters.setJpegThumbnailSize(192, 256);        camera.setParameters(parameters);        camera.startPreview();    }</code></pre><p>This is what I tried and failed with using the Exif interface:</p><pre><code>                ExifInterface myEI = new ExifInterface(photo.getPath());                byte[] thumbArray = myEI.getThumbnail();                File thumbFolder = new File(appFolder.getPath(), ""thumbnails"");                if (!thumbFolder.exists())                {                    thumbFolder.mkdirs();                }                File thumbnail=new File(thumbFolder, picFile.getName());                if (thumbnail.exists()) {                    thumbnail.delete();                }                Bitmap bitmap = BitmapFactory.decodeByteArray(thumbArray, 0, thumbArray.length);                FileOutputStream fos = openFileOutput(thumbnail.getPath(), MODE_WORLD_READABLE);                bitmap.compress(CompressFormat.JPEG, 50, fos);                fos.close();</code></pre><p>Full Code of Class.</p><pre><code>public class PictureTaker extends Activity {private static final String TAG = ""PictureTaker"";private SurfaceView preview=null;private SurfaceHolder previewHolder=null;private Camera camera=null;String filename;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.camera);    preview=(SurfaceView)findViewById(R.id.preview);    previewHolder=preview.getHolder();    previewHolder.addCallback(surfaceCallback);    previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);}@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    if (keyCode==82 || keyCode==KeyEvent.KEYCODE_SEARCH) {        takePicture();        return(true);    }    return super.onKeyDown(keyCode, event);}private void exitCamera() {    finish();    super.onStop();}private void takePicture() {    camera.takePicture(null, null, photoCallback);}SurfaceHolder.Callback surfaceCallback=new SurfaceHolder.Callback() {    public void surfaceCreated(SurfaceHolder holder) {        camera=Camera.open();        try {            camera.setPreviewDisplay(previewHolder);        }        catch (Throwable t) {            Log.d(TAG, ""Exception in setPreviewDisplay()"", t);        }    }    public void surfaceChanged(SurfaceHolder holder,int format, int width, int height) {        Camera.Parameters parameters=camera.getParameters();        parameters.setPreviewSize(width, height);        parameters.setPictureFormat(PixelFormat.JPEG);        parameters.setJpegThumbnailQuality(50);        parameters.setJpegThumbnailSize(192, 256);        camera.setParameters(parameters);        camera.startPreview();    }    public void surfaceDestroyed(SurfaceHolder holder) {        camera.stopPreview();        camera.release();        camera=null;    }};Camera.PictureCallback photoCallback=new Camera.PictureCallback() {    public void onPictureTaken(byte[] data, Camera camera) {        new SavePhotoTask().execute(data);        camera.startPreview();    }};class SavePhotoTask extends AsyncTask&lt;byte[], String, String&gt; {    @Override    protected String doInBackground(byte[]... jpeg) {        filename = Utilities.getTimeString() + "".jpg"";        File photo=new File(filename);        if (photo.exists()) {            photo.delete();        }        try {            FileOutputStream fos=new FileOutputStream(photo.getPath());            fos.write(jpeg[0]);            fos.close();        }        catch (java.io.IOException e) {            Log.d(TAG, ""Exception in photoCallback"", e);        }        return(null);    }}</code></pre><p>}</p>","580793","","","","","2012-08-29 09:10:35","Saving a thumbnail after taking picture in Android","<android><jpeg><thumbnails><exif><bitmapfactory>","2","0","","",""
"4731017","1","4780033","","2011-01-19 01:51:11","1","295","<p>I think this task is easier for Android emulator. We just create new images and reboot emulator. Though it takes a long cycle to boot emulator, it is safe. But I am wondering, can we just upload several .so files on device and test the HAL driver? If so, it would be great to test the driver since on emulator we do not have enough hardware to play with.</p><p>Thanks!</p>","547589","","","","","2011-01-24 08:40:37","Is it possible to install a HAL driver on Android device when it is on?","<android><hal>","1","0","","",""
"4731034","1","4731290","","2011-01-19 01:54:13","3","9112","<p>When i reach the bottom of my ListView (Scroll down until the end), how do i load more items?<br>Here is my class (maybe it will help)  </p><p>public class ListFood extends Activity {</p><pre><code>int userid;String cat;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.list_food);  ListView lv = (ListView) findViewById(R.id.ListView01);  TextView tv = (TextView) findViewById(R.id.TextView01);  Webservice ws = new Webservice();  List&lt;Afood&gt; list = new ArrayList&lt;Afood&gt;();  int i;  Bundle bundle = getIntent().getExtras();  userid = bundle.getInt(""userid"");  cat = bundle.getString(""cat"");  list = ws.getFoodFromCat(cat);  String [] food = new String [list.size()];  for(i=0;i&lt;list.size();i++)  {    food[i] = list.get(i).name;    }  if(cat.equalsIgnoreCase(""FastFood""))      tv.setText(""Fast Food"");  else      tv.setText(cat);  lv.setAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list, food));       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>}</p>","516765","","516765","","2011-01-19 01:59:42","2011-01-19 02:44:04","Reach bottom of listview, load more items","<android><events><listview><scrolling>","1","2","","",""
"4731082","1","","","2011-01-19 02:01:54","3","1113","<p>I am trying to implement one of the solutions found <a href=""http://stackoverflow.com/questions/4065134/is-there-a-listener-for-when-the-webview-displays-its-content/4235759#4235759"">here.</a></p><p>My problem is that I'm not sure if I am implementing and using my subclass correctly.I am subclassing a WebView here:</p><pre><code>public class myWebView extends WebView{  public myWebView(Context context) {    super(context);    // TODO Auto-generated constructor stub}  @Overrideprotected void onSizeChanged(int w, int h, int ow, int oh) {    // TODO Auto-generated method stub      scrollTo(xScroll - (widthScroll/2), yScroll - (heightScroll/2));    super.onSizeChanged(w, h, ow, oh);}   }}</code></pre><p>It should be private but forget that for now.  I have the code inside of one of my activities that has an inner webview in the view hierarchy.  Outside of the onCreate method of that activity.</p><p>Inside the onCreate method, I have:<code>myWebView mapImage = (myWebView) findViewById(R.id.mapcroppic);</code></p><p>This gives me a ClassCastException for that call. (Does the xml layout file need to use <code>&lt;myWebView&gt;</code>? Can it?)  How do I use this the correct way?</p>","487840","","244296","","2011-01-19 02:07:33","2011-01-19 02:08:16","How do you properly write and use a View subclass in Android?","<android><webview><android-layout><subclassing>","1","0","","",""
"4731102","1","","","2011-01-19 02:05:52","0","673","<p>I was working on the formStuff samples and I am getting a error adding the <code>EditText</code>.</p><p>This is the line I am getting a error one:</p><pre><code>edittext.setOnKeyListener(new OnKeyListener() {</code></pre><p>This is the error:</p><blockquote>  <p>Multiple markers at this line   - OnKeyListener cannot be resolved to a type   - The method setOnKeyListener(View.OnKeyListener)  in the type View is not applicable for  the    arguments (new  OnKeyListener(){})</p></blockquote><p><a href=""http://developer.android.com/resources/tutorials/views/hello-formstuff.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-formstuff.html</a></p>","2144370","","493939","","2013-01-06 15:26:28","2013-01-06 15:26:28","Working on the formStuff","<android><android-edittext>","2","0","","",""
"4731153","1","4731287","","2011-01-19 02:15:10","3","1419","<p>I've created a virtual device with the 2.3 platform (api level 9) and I just launched it and tried to fix GPS location via telnet, as follows:</p><pre><code>telnet localhost 5554geo fix 41.41 174.64</code></pre><p>The emulator returns an ""OK"" message as the output of my command, and I am simply trying to see if the Google Maps/Latitude app will be able to see these coordinates as my location, but when I load them they will simply reboot the emulator (actually the OS does not come back, I have to close the emulator and launch it again).</p><p>Am I doing anything wrong or is there a bug in the emulator?</p>","138680","","","","","2011-01-19 02:43:03","Android emulator reboots if I try to fix the gps coordinates","<android><android-emulator><gps>","1","0","","",""
"4731313","1","6724563","","2011-01-19 02:49:16","2","687","<p>Am trying to show a popup dialog or custom view on clicking of the widget (Something similar to quick contact badge). Am able to launch the Quick Contact badge on click of the widget but am not able to display this right next to the widget :(</p><p>Could you anyone give me any example source code to display a pop up dialog right next to the widget?</p>","287299","","","","","2011-07-17 14:43:40","Showing a popup dialog or custom popup view on click of a widget","<android><android-widget><android-layout>","1","1","2","",""
"4731314","1","","","2011-01-19 02:49:21","7","13020","<p>Is there any other way to write a file somewhere else than on the SD card?</p><p>I tried many different path on the filesystem but fopen always return NULL, except for any file that I write/read inside the /sdcard/...</p><p>Is there something else equivalent to:</p><p></p><p>That allow you to write like on the file system or something?</p>","579622","","","","","2011-05-27 14:17:40","Android NDK Write File","<android><android-ndk>","2","0","2","",""
"4731315","1","4731662","","2011-01-19 02:49:23","3","642","<p>I'm not sure if this is just something that is up to developer opinion but I am creating an android app and have a Listview that displays a custom view.  My layout basically consists of a View (as an xml resource file and a class that derives from the view that is the root), a Domain Model object (has the data to be bound to the view) and an adapter which derives from BaseAdapter that binds the data from the Domain Model to the View in the getViewMethod as follows:</p><p>Model: <strong>SampleItem</strong><br>Custom View: <strong>SampleView</strong><br>Adapter: <strong>(code below)</strong></p><pre><code>   public View getView(int position, View convertView, ViewGroup parent) {  SampleView sampleView;  SampleItem item = (SampleItem)getItem(position);  if(convertView == null) {   sampleView = new SampleView(_context);  }  else {   sampleView = (SampleView)convertView;  }  sampleView.setTitle(item.getTitle());  sampleView.setContentText(item.getContent());  sampleView.setItemRowNumer(item.getRowNumber());  ... //etc  return sampleView;}</code></pre><p>This is how I've always seen it done, but I wonder is this the right way to do it.  </p><p>My thought, coming from a different approach to data binding, is that the actual view class doesn't have a concept of what it's model is, and diverting the control to how data is bound to it to an adapter class that may not exist if moved elsewhere.  </p><p>I was thinking that the custom view class has a reference to the object that is bound to it and in it's  constructor it populates the view based on the data.  So the adapter is essentially a shell class that only does this:</p><pre><code>   public View getView(int position, View convertView, ViewGroup parent) {  SampleView sampleView;  SampleItem item = (SampleItem)getItem(position);  if(convertView == null) {   sampleView = new SampleView(_context, item);  }  else {   sampleView = (SampleView)convertView;  }  return sampleView; }</code></pre><p>And the actual constructor for the view would know its model and populate itself as opposed to the Adapter doing work that seems outside of it's responsibility.  </p>","499646","","","","","2011-01-19 04:13:37","Android Binding strategy, should the adapter do the work, or the view?","<java><android><listview>","1","0","","",""
"4731484","1","","","2011-01-19 03:33:06","2","589","<p>i need to find whether speaker phone is on or not through programmability.</p><p>I know that we can find using below method whether it is on or not.</p><pre><code>AudioManager.isSpeakerphoneOn();</code></pre><p>in my case even it is returning false, even though the speaker is on by some how.</p><p>I need to know below 2 things.</p><p>1.is there any broadcast action to find speaker state.</p><p>2.is there any way to find speaker phone state change</p>","388269","","","","","2014-04-16 13:34:30","how to find whether speakerphone is on or not in android","<android>","3","3","1","",""
"4731589","1","5013360","","2011-01-19 03:57:52","2","2917","<p>I've searched a lot about taking screenshot of my OpenGL object on Android and come up with <a href=""http://stackoverflow.com/questions/3310990/taking-screenshot-of-android-opengl/4666820#4666820"">this</a> solution. It worked great but in my case I have camera view and opengl view(with transparent background) on top of camera view. So what I want to do is to get opengl screenshot with transparent background instead of black. As I said I have tried link above and it worked but I'm stuck with black background. It's little bit complicated to figure out how to get rid of the black background in this particular case. Hope somebody could help me and asap if it's possible(also I think the solution is easy, I'm just missing something simple).Thank you.</p>","235015","","","","","2013-06-26 20:16:11","Android OpenGL Screenshot","<android><opengl-es><screenshot><pixels>","2","0","2","",""
"4731593","1","4731690","","2011-01-19 03:58:31","3","8104","<p>This is driving me crazy.  Like these people, <a href=""http://stackoverflow.com/questions/1554099/slow-android-emulator/2049798#2049798"">slow-android-emulator</a>, I'm finding running the emulator from eclipse is slow and problematic.  As suggested, I've tried running the emulator seperately.  But then I don't get my latest changes.  I don't know eclipse that well, but I would like something like 'build' and then somehow load the latest image into the emulator.</p><p>Also, I've tried keeping the emulator open and the continually use run->debug, but after 2 or 3 times, I get errors like the following:</p><pre><code>Failed to install HelloAndroid.apk on device 'emulator-5554': timeoutLaunch canceled!emulator: ERROR: the user data image is used by another emulator. abortingWaiting for HOME ('android.process.acore') to be launched...emulator-5554 disconnected! Cancelling 'com.example.helloandroid.HelloAndroid activity launch'!java.lang.NullPointerExceptionat com.android.ddmlib.Client.sendAndConsume(Client.java:571)at com.android.ddmlib.HandleHello.sendHELO(HandleHello.java:142)at com.android.ddmlib.HandleHello.sendHelloCommands(HandleHello.java:65)at com.android.ddmlib.Client.getJdwpPacket(Client.java:670)at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:317)at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)</code></pre><p>I've tried killing and restarting the adb server to no avail.</p><p>Once again, briefly, I would just like a 'system' where I can effectively make changes, load them into the emulator and test.</p>","573927","","105224","","2011-07-15 07:09:24","2013-04-04 09:21:42","Android: Problems debugging with the emulator from eclipse","<android><eclipse><debugging><emulator><cycle>","2","0","","",""
"4731629","1","","","2011-01-19 04:04:58","1","572","<p>I have a dialog Layout that has several views that are initialised as Visibility Gone. However the space for each of the Views still appears to be being allocated resulting in a very large gap between the top two permanent views and the bottom Button.</p><p>Below is the Layout file I'm using.</p><p>If anyone has any ideas that would be great.</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;Spinner     android:id=""@+id/SearchTypeSpinner""     android:layout_height=""wrap_content""     android:layout_width=""fill_parent""    android:prompt=""@string/SearchPrompt""    android:entries=""@array/SearchTypes""&gt;    &lt;/Spinner&gt;  &lt;EditText    android:id=""@+id/SearchText""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@+id/SearchTypeSpinner""    android:imeOptions=""actionDone""&gt;    &lt;/EditText&gt;  &lt;TextView    android:id=""@+id/RadiusLabel""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""Search Radius""    android:layout_below=""@+id/SearchText""    android:visibility=""gone""    style=""@style/headerText""&gt;    &lt;/TextView&gt;  &lt;EditText    android:id=""@+id/RadiusText""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@+id/RadiusLabel""    android:visibility=""gone""    android:imeOptions=""actionDone""&gt;    &lt;/EditText&gt;  &lt;Spinner    android:id=""@+id/StateSpinner""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@+id/RadiusText""    android:entries=""@array/states""    android:prompt=""@string/StatePrompt""    android:visibility=""gone""&gt;    &lt;/Spinner&gt;     &lt;Button    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:id=""@+id/ShowResultsButton""    android:text=""Show Results""    android:layout_alignBottom=""true""&gt;    &lt;/Button&gt;&lt;/RelativeLayout&gt;</code></pre>","487076","","","","","2011-01-19 04:04:58","Views with Visibility Gone appear to be taking up space still","<android><android-layout>","0","2","2","",""
"4731643","1","4731722","","2011-01-19 04:09:21","3","2277","<p>How to Enable Internet Connection Through Proxy in Android in Windows?</p>","504130","","457982","","2011-01-19 05:30:21","2011-09-12 06:45:02","Enabling Internet Connection Through Proxy in Android in Windows","<android><windows>","2","0","2","",""
"4731673","1","4731754","","2011-01-19 04:15:42","0","174","<p>How do I get access to other companies' databases?  For example, if I were to write an Android app to display the FBI most wanted list; how do I get to their data?</p><p>Thanks!</p>","580883","","","","","2011-01-19 04:32:11","Accessing 3rd party data for my Android App","<android><database><third-party>","1","0","","",""
"4731727","1","4789729","","2011-01-19 04:27:35","0","385","<p>I need two SeekBars for setting a minimum and maximum, and the thumb on each SeekBar cannot move past the other. Is there a way to disallow moving the SeekBar past a specific point?</p>","355039","","","","","2011-01-25 03:35:50","Prevent SeekBar from moving past a dynamic point","<android><seekbar>","1","0","","",""
"4731738","1","4731846","","2011-01-19 04:29:36","3","4271","<p>How to create an offline web application in Android using android.webkit package?</p>","504130","","","","","2011-01-19 04:52:23","Creating Web Application in Android","<android>","2","0","5","",""
"4731779","1","4731984","","2011-01-19 04:36:55","0","10185","<p>Basically what I want to do in my Android app is use TextView to display two different pieces of text at once. So in code, I want to be able to do something like this:</p><pre><code>    LinearLayout ll = new LinearLayout(this);    TextView text = new TextView(this);    text.setTextColor(0xFF000000);    text.setGravity(Gravity.CENTER_HORIZONTAL);    text.setTextSize(20f);    text.setText(""Text1"");    text.setTextSize(14f);    text.setColor(0xFF0000FF);    text.setText(""\nText2"");    ll.addView(text);</code></pre><p>To clarify, I am trying to display a black ""Text1"" and a blue ""Text2"" at once using only a single TextView. Obviously this doesn't work out using the code above. I've considered using a second TextView but that seems like a waste of effort and memory to me. I'm sure the brilliant minds here can come up with the best solution to this.</p><p>Thank you very much in advance for your time and your assistance.</p>","473481","","473481","","2011-01-19 15:29:52","2011-01-19 15:29:52","Dynamically Displaying Text with TextView (Android)","<java><android><android-layout><textview>","5","0","","",""
"4731785","1","","","2011-01-19 04:38:05","4","3298","<p>Is it possible to open a socket between 2 Android phones?  How can this be done so the devices can communicate between each other?</p>","580909","","","","","2011-01-19 04:52:17","Opening sockets between 2 Android phones","<android><sockets><mobile><open><phone>","1","1","2","",""
"4731798","1","4731954","","2011-01-19 04:40:30","0","123","<p>Hi i am new to android. i developed an android app using 2.1 version in eclipse Ganymede. i used SQLite data base to store data and it will show the stored values when loading page My app is running perfectly in Sony Ericsson Xperia but it was not working in motorola droid which is having os Android 2.1 i dont know what is the cause. is there need to give any special permissions in manifest file to run app in droid or other mobile comapanies or any other issue occured by using the SQLite database?</p><p>Please respond for my request</p>","501733","","","","","2011-01-19 05:11:08","android app unable run in Motorola droid","<android>","1","1","","",""
"4731953","1","4732017","","2011-01-19 05:10:53","0","193","<p>Iam new to Android, and got some doubts regarding the Android OS. My question is, there are certain libraries and framework specified in the Android Architecture.So is there any possibility to add any other libraries based on my requirements and how is it possible.Please reply me even if Iam not clear in my question.</p><p>Thanks and Best Regards </p>","357739","","","","","2011-01-19 05:29:46","Possiblity of adding libraries to android architecture","<android>","2","0","","",""
"4732030","1","","","2011-01-19 05:28:59","0","291","<p>This <em>should</em> be simple but it's proving to be a real head-scratcher...</p><p>I have a texture with an alpha channel. On one render pass I want to render the texture but ignore the alpha channel. No matter what settings I use, pixels with alpha less than 1 are <em>not</em> drawn.</p><p>Surely any alpha testing/rejection/blending should be disabled by these commands?</p><pre><code>gl.glDisable(GL10.GL_BLEND);gl.glDisable(GL10.GL_ALPHA_TEST);</code></pre><p>I realise that I could work with two versions of the texture, one with alpha and one without. But surely there is a way to just ignore the alpha channel?</p>","522858","","44729","","2011-01-19 05:36:08","2011-01-20 21:25:22","Ignore alpha when rendering texture?","<android><opengl-es>","1","0","","",""
"4732139","1","","","2011-01-19 05:47:05","0","160","<p>m developing android application in android platform 2.2,, i am not able to debug applications..m facing a problem wherein there are no errors in the program, but whenevr i run the application on emulator, it gets launched but stops unexpectedly n m forced to close the application.</p>","576605","","","","","2011-01-19 05:54:57","Cant debug android application","<android>","1","5","","",""
"4732170","1","4732377","","2011-01-19 05:53:26","1","430","<p>Suppose I have an array of shorts of length 1,000,000 and that I need this to be generated or loaded into RAM (ideally within a few seconds) when my app starts and before I get an activity thread timeout.</p><p>I'll then have quick access to its entries during runtime.</p><ol><li><p>How would you go about loading this to memory from file? Loading from txt file? From an SQLite file (with two integer columns in a single table, one for index and the other for value)?</p></li><li><p>Is it possible for an activity to request a longer idle time before it's deemed to have timed out?</p></li></ol>","283311","","","","","2011-01-19 06:30:23","Loading a large array of shorts in Android","<android><arrays>","1","3","","",""
"4732184","1","4732249","","2011-01-19 05:55:53","19","31015","<p>I need to finish a android application . For that i wrote </p><pre><code>@Overridepublic void onBackPressed() {    AlertDialog.Builder builder = new AlertDialog.Builder(this);    builder.setMessage(""Are you sure You want to exit"")        .setCancelable(false)        .setPositiveButton(""YES""),        new DialogInterface.OnClickListener() {            // On            // clicking            // ""Yes""            // button            public void onClick(DialogInterface dialog,int id) {                System.out.println("" onClick "");                closeApplication(); // Close Application method called            }        })        .setNegativeButton(""NO""),        new DialogInterface.OnClickListener() {            // On            // clicking            // ""No""            // button            public void onClick(DialogInterface dialog,int id) {                dialog.cancel();            }        });        AlertDialog alert = builder.create();        alert.show();    }    private void closeApplication() {        System.out.println(""closeApplication "");        this.finish();    }}</code></pre><p>But if any activity is not finished in the applcaition, when i tried to exit the application that activity is finished first and the applciation is not exiting.. i tried 2 times to exit this application ... How i can finish all the activities in an application when i need to exit...or is there any way to finish the entire application</p>","548218","","243203","","2011-03-31 22:44:47","2013-11-04 22:12:47","How to finish an android application?","<android>","6","0","9","",""
"4732303","1","","","2011-01-19 06:18:32","0","682","<p>my xml is below in xml we have declare a view height how we declare view height in dynamically.</p><p></p><p></p><pre><code>    &lt;/TableRow&gt;    &lt;View android:layout_height=""1dip"" android:background=""#FF909090"" /&gt;</code></pre>","579396","","","","","2011-01-19 06:45:08","declare a view height dynamically","<android>","1","0","0","",""
"4732304","1","","","2011-01-19 06:18:38","0","132","<p>Have a great day...</p><p>I am still stuck with my bug...I am using an android app. to login a website using the twitter account..I am using the twitter4j api for this...I have imported the classes from the jar files to my activity...I also have my activity 'MainActivity'added in the manifest file..but still the application is force closing ...!Any one have an Idea..?</p><p>LogCat Error:<a href=""http://paste.org/pastebin/api/27529"" rel=""nofollow"">Error</a></p>","573700","","573700","","2011-01-19 06:32:48","2011-07-17 09:23:53","using reference libraries in android","<android><packages>","1","3","","",""
"4732344","1","","","2011-01-19 06:25:54","0","509","<p>I working on one project which Android device is act like a Server.  I mean, when I send any requests to my device, then I will get a response.</p><p>If any one have any idea so please tell me.  I am waiting for the reply.</p>","343678","","501557","","2011-01-19 06:29:57","2011-01-19 06:58:07","Android Device act like Server","<java><android><sockets>","1","1","","",""
"4732425","1","4738636","","2011-01-19 06:39:07","0","8618","<p>I have the following screen setup in android. A button on screen1 on clicking which you are taken to screen2. Screen2 has 2 buttons at the bottom of the screen. One button that displays a searchable listView and the other that takes you back to screen1. The code for screen1:  </p><pre><code>screen1.java  package com.example.screenchange;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.util.Log;import android.view.View;import android.widget.Button;public class ScreenChange extends Activity {    /** Called when the activity is first created. */    private Button button01;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        button01 = (Button)findViewById(R.id.button01);        button01.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                Log.v(this.toString(), ""Inside on click listener for screen 2."");                Intent intent = new Intent(v.getContext(), screen2.class);                Log.v(this.toString(), ""Intent created. Moving to start activity."");                startActivity(intent);            }        });    }}   </code></pre><p>screen1.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;Button        android:id=""@+id/button01""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Move to screen 2""        /&gt;&lt;/LinearLayout&gt;  </code></pre><p>Screen2.java:  </p><pre><code>package com.example.screenchange;import java.util.ArrayList;import java.util.List;import android.app.ListActivity;import android.content.Intent;import android.os.Bundle;import android.util.Log;import android.view.View;import android.widget.ArrayAdapter;import android.widget.Button;public class screen2 extends ListActivity {    private Button button02;    private Button button03;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.screen2);        button02 = (Button)findViewById(R.id.button02);        button02.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                Log.v(this.toString(), ""Button02 clicked."");                Intent intent = new Intent();   //takes control back to screen1.                finish();            }        });        button03 = (Button)findViewById(R.id.button03);        button03.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                Log.v(this.toString(), ""Button03 clicked."");                ArrayAdapter&lt;String&gt; listView = new ArrayAdapter&lt;String&gt;(v.getContext(), R.layout.listview, COUNTRIES);                setListAdapter(listView);                getListView().setTextFilterEnabled(true);            }        });    }    static final String[] COUNTRIES = new String[] {        ""Afghanistan"", ""Albania"", ""Algeria"", ""American Samoa"", ""Andorra"",        ""Angola"", ""Anguilla"", ""Antarctica"", ""Antigua and Barbuda"", ""Argentina"",        ""Armenia"", ""Aruba"", ""Australia"", ""Austria"", ""Azerbaijan"",        ""Bahrain"", ""Bangladesh"", ""Barbados"", ""Belarus"", ""Belgium"",        ""Belize"", ""Benin"", ""Bermuda"", ""Bhutan"", ""Bolivia"",        ""Bosnia and Herzegovina"", ""Botswana"", ""Bouvet Island"", ""Brazil"", ""British Indian Ocean Territory"",        ""British Virgin Islands"", ""Brunei"", ""Bulgaria"", ""Burkina Faso"", ""Burundi"",        ""Cote d'Ivoire"", ""Cambodia"", ""Cameroon"", ""Canada"", ""Cape Verde"",        ""Cayman Islands"", ""Central African Republic"", ""Chad"", ""Chile"", ""China"",        ""Christmas Island"", ""Cocos (Keeling) Islands"", ""Colombia"", ""Comoros"", ""Congo"",        ""Cook Islands""}  </code></pre><p>screen2.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=""fill_parent""  android:text=""Welcome to screen 2""&gt;  &lt;Button    android:id=""@+id/button02""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Get back to screen 1.""    android:layout_alignParentBottom=""true""    android:layout_alignParentLeft=""true""    android:clickable=""true""&gt;  &lt;/Button&gt;  &lt;Button    android:id=""@+id/button03""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    android:layout_alignParentRight=""true""    android:text=""Display countries.""    android:clickable=""true""&gt;  &lt;/Button&gt;  &lt;ListView    android:id=""@+android:id/android:list""    android:layout_height=""fill_parent""    android:layout_width=""wrap_content""    android:text=""@id/text1""&gt;  &lt;/ListView&gt;   &lt;/RelativeLayout&gt;  </code></pre><p>listview.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:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:id=""@+id/text1""&gt;&lt;/TextView&gt;  </code></pre><p>android-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.example.screenchange""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".ScreenChange""                  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="".screen2""            android:label=""Screen 2 - New actvity.""&gt;        &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt;   </code></pre><p>The problems I get are as follows:<br>1. The buttons on screen2 go unresponsive the moment I switch to screen2. No output on the logcat, no nothing.<br>2. There might even be errors in getting the listview to display, but I am not able to see any.  </p><p>Any help is welcome,<br>Sriram.</p>","350685","","","","","2011-04-09 02:24:55","Moving from one activity to another - android","<android><listview><activity>","3","4","","",""
"4732426","1","","","2011-01-19 06:39:12","1","2671","<p>How can we get address or location name from latitude and longitude in android In my application I have set of latitude and longitude, But I need an API which will return me the location name corresponding to the latitude and longitude.thanks.</p>","581011","","","","","2011-08-01 12:54:58","android location finder from latitude and longitude","<android><location><finder>","2","0","1","",""
"4732448","1","","","2011-01-19 06:43:54","2","4190","<p>I want to force the screen orientation to landscape on button click by setting setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);</p><p>It works fine. Now I want the application to follow the sensor so that orientation is brought back to portrait when tilted back to portrait. I know this is possible by setting setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); but don't know where to set it. If the orientation is forced to landscape, orientation will remain in landscape no matter you tilt in any direction. Can anyone specify how to reset the orientation flag?</p>","1538225","","","","","2011-01-19 07:08:11","Android screen orientation to sensor","<android>","2","0","2","",""
"4732471","1","","","2011-01-19 06:48:46","0","367","<p>I am very new to the Android platform. Now in my app I want to create service and so please give me some info that how to create a service and consume it in my app. And how to start the service when the OS starts up?</p>","563593","","1104926","","2011-12-19 13:59:13","2011-12-19 13:59:13","How to create service in Android and consume it?","<android>","1","0","","",""
"4732605","1","4732713","","2011-01-19 07:08:17","0","263","<p>i just need to create an edit box with keyboard below..Below keyboard,,there should be an Slide finger on the keyboard link area while looking at the keyboard.As the finger slides, the key corresponding to the location of the finger on the keyboard link area is highlighted.And when i click on dragger,the corresponding letter should be printed on edittext.How could i do this.?.Thanks..</p>","555948","","","","","2011-01-19 07:22:39","Slide finger on keyboard area to print a key","<android>","1","0","","",""
"4732634","1","4743923","","2011-01-19 07:12:19","10","18604","<p>Hi can anybody tell  how to set fixed  header and footer for relative layout  and center point  i want to add scrollable  and adding array of  webview dynamically  when i want scroll center point only scrollable in android can anybody give example?</p><p>I tried but center part webview is not coming properly is there anything to change?</p><p>my xml code is </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/mainrelativelayout""  android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt; </code></pre>                                                                                                                                                                                              <p>&lt;---------- adding footer-----------></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:id=""@+id/imglinear""  android:background=""@color/white""  android:layout_alignParentBottom=""true""  &gt;&lt;ImageView android:id=""@+id/ImageView15"" android:src=""@drawable/quest_i"" android:layout_gravity=""center""  android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;</code></pre><p>&lt;--------------finishing footer-------></p><p>&lt;------------ center point of screen---------></p><pre><code>&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:orientation=""vertical""  android:background=""@color/white""  android:id=""@+id/mainlinear3""  android:layout_above=""@+id/imglinear""  android:layout_below=""@+id/mainlinear2""   &gt;  &lt;ScrollView android:id=""@+id/ScrollView01""      android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;   &lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:orientation=""vertical""  android:background=""@color/white""  android:id=""@+id/relative3""&gt;  &lt;/RelativeLayout&gt;  &lt;/ScrollView&gt;&lt;/RelativeLayout&gt;</code></pre><p>&lt;-----------center point finishing----------></p><pre><code>&lt;/RelativeLayout&gt;</code></pre><p>thanks</p>","426344","","426344","","2011-01-19 15:23:10","2011-09-02 09:16:30","how to set the header and footer for linear layout in android","<android><android-layout>","1","2","6","",""
"4732649","1","4733268","","2011-01-19 07:13:41","0","324","<p>I am developing a app.. When i start the app my GPS is enabled but on exit it should disable the GPS. how to do it? please help</p>","527933","","","","","2012-07-25 10:13:06","GPS disabling feature","<android>","3","0","","",""
"4732656","1","5040675","","2011-01-19 07:14:25","62","38884","<p>The new documentation on <a href=""http://developer.android.com/guide/developing/tools/proguard.html"">ProGuard for Android</a> says to add a line to the default.properties file in the project home directory. However, on opening this file, I read at the top: </p><pre><code># This file is automatically generated by Android Tools. # Do not modify this file -- YOUR CHANGES WILL BE ERASED! </code></pre><p>Am I missing something?</p><p>Also, is there a way to enable ProGuard only for a production build from Eclipse (i.e., when exporting the finished product)?</p>","535871","","","","","2014-01-23 12:14:49","Enabling ProGuard in Eclipse for Android","<android><eclipse><proguard>","5","3","55","",""
"4732765","1","","","2011-01-19 07:30:09","1","271","<p>I have a rss feed reader application. The goal is to store the title and image for each item in a custom object named RSSItem, and oll the RSSItem objects in another object named RSSFeed. The problem is that if an item element does not have an enclosure element SaxException is thrown. How should I handle the errors with this parser? Here is the parser code:</p><pre><code>    public class Parser { private final String RSS_ELEMENT = ""rss""; private final String CHANNEL_ELEMENT = ""channel""; private final String ITEM_ELEMENT = ""item""; private final String ENCLOSURE_ELEMENT = ""enclosure""; private final String TITLE_ELEMENT = ""title""; private final String URL_ATTRIBUTE = ""url""; private final String TYPE_ATTRIBUTE = ""type""; private final String IMAGE_TYPE = ""image/jpeg""; RSSItem rssItem; RSSFeed rssFeed; final URL mFeedUrl; public Parser(String feedUrl) {    try {            mFeedUrl = new URL(feedUrl);       } catch (MalformedURLException e) {        Log.e(e.getClass().getSimpleName(), e.getMessage());           throw new RuntimeException(e);       }  rssFeed = new RSSFeed(); } protected InputStream getInputStream() {  try {   return mFeedUrl.openConnection().getInputStream();  } catch (IOException e) {   Log.e(e.getClass().getSimpleName(), e.getMessage());   return null;  } } public RSSFeed parse() {  InputStream istream = getInputStream();  RootElement root = new RootElement(RSS_ELEMENT);  Element channel = root.requireChild(CHANNEL_ELEMENT);  Element itemElement = channel.requireChild(ITEM_ELEMENT);  Element enclosure = itemElement.requireChild(ENCLOSURE_ELEMENT);    Element title = itemElement.requireChild(TITLE_ELEMENT);  enclosure.setStartElementListener(new StartElementListener() {   public void start(Attributes attrs) {    String imageType = attrs.getValue(TYPE_ATTRIBUTE);    if (imageType.equals(IMAGE_TYPE)) {     try {      String imageUrl = attrs.getValue(URL_ATTRIBUTE);      Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL(imageUrl).getContent());      rssItem.setImage(bitmap);     } catch (MalformedURLException e) {      e.printStackTrace();     } catch (IOException e) {      e.printStackTrace();     }    }   }  });  title.setEndTextElementListener(new EndTextElementListener() {   public void end(String body) {    rssItem.setTitle(body);   }  });  itemElement.setStartElementListener(new StartElementListener() {   public void start(Attributes arg0) {    rssItem = new RSSItem();   }  });  itemElement.setEndElementListener(new EndElementListener() {   public void end() {    rssFeed.addItem(rssItem);   }  });  try {   Xml.parse(istream, Xml.Encoding.UTF_8, root.getContentHandler());  } catch (Exception e) {   e.printStackTrace();  }  return rssFeed; }}</code></pre>","460611","","","","","2011-02-13 19:11:56","Handle errors for rss parser","<android>","1","0","","",""
"4733021","1","4738172","","2011-01-19 08:06:33","1","17249","<p>I'm developing a Scorekeeping Application for the card game ""Spades"".</p><p>Upon a button click at the end of each hand, I would like to store some information about the hand into a TextView and display all of the hand histories in a ScrollView.</p><p>How can I modify an .XML layout or otherwise add a new TextView to a layout in code?</p><p>I have tried...</p><pre><code>public static LinearLayout gamehistory;gamehistory = (LinearLayout) findViewById(R.id.gamehistory);public void setClickListener1(){lockwagersButton.setOnClickListener(new View.OnClickListener() {public void onClick(View v) {setContentView(R.layout.results_layout);gameHistory.addView(new TextView(...));       //  I can't get this to work             ...</code></pre><p>Thanks!-K.H.</p>","581104","","-1","","2012-06-12 09:38:04","2012-09-02 10:29:41","Add New View to Layout Upon Button Click in Android","<android><view>","3","0","2","",""
"4733022","1","","","2011-01-19 08:06:47","1","376","<p>I have a school project and I have this idea for my android phone.</p><p>But I don't really know if it can be done and I don't know how I could do it.</p><p>Does someone know if it can be done? If not can you write a programme for android using python? What is the easiest way? </p>","581097","","275567","","2012-09-29 16:32:51","2012-09-29 16:32:51","How to make an voice command program to android using python?","<android><python><voice-recognition>","1","2","1","",""
"4733025","1","4733201","","2011-01-19 08:07:18","5","1566","<p>I've attached a picture to better illustrate what I'm going for.</p><p>I have two <code>LinearLayout</code>s positioned side by side. Both are able to expand vertically, using wrap_content. I would like to position another container (HorizontalScrollView) below whichever one has the greater height. It's currently set to go below the right-most column, as generally it is taller, but in some cases the ScrollView will cover up the content in the left-most column. Is there a way to set this in the .xml file or will I need to resort to setting this in my onCreate method?</p><p><img src=""http://i.stack.imgur.com/P5aEm.jpg"" alt=""Example screen""></p>","508912","","","","","2011-01-19 08:37:02","Android Layout: position element below lowest view","<android><android-layout>","2","0","","",""
"4733035","1","4733092","","2011-01-19 08:09:26","6","844","<p>I've the default (comes with the SDK) and Samsung Galaxy Tab emulators in my SDK. I want to know what other third party (Motorola, LG, Sharp, etc) emulators are available, so that I can test my apps for more devices. Please provide the names with links.</p>","533635","","488433","","2011-06-14 10:24:09","2013-07-08 17:57:24","Various Android Emulators","<android><android-emulator><emulator>","3","0","6","",""
"4733079","1","4733372","","2011-01-19 08:15:32","2","6217","<p>I am attempting to change the background of a tab of my application by selecting a Radio Button from a RadioGroup, however I am not sure how to go about this.</p><p>So far I haveFavs.java:</p><pre><code>import android.app.Activity;import android.os.Bundle;public class Favs extends Activity {public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.favs);  }}</code></pre><p>which points to this .xml file -> favs.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:layout_width=""fill_parent""              android:orientation=""vertical""            xmlns:android=""http://schemas.android.com/apk/res/android""               android:layout_height=""fill_parent""&gt;   &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""What is your favorite color?""             android:padding=""3dip""/&gt;   &lt;RadioGroup android:layout_width=""fill_parent""               android:layout_height=""wrap_content""               android:orientation=""vertical""&gt;       &lt;RadioButton android:id=""@+id/radio_red""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:text=""Red""                     android:onClick=""onClick"" /&gt;       &lt;RadioButton android:id=""@+id/radio_yellow""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:text=""Yellow"" /&gt;    &lt;/RadioGroup&gt;&lt;/LinearLayout&gt;</code></pre><p>I understand that the android:onClick=""onClick"" needs to be there however I have no idea what to do after this.</p>","581112","","581112","","2011-01-19 08:22:32","2011-11-10 14:08:43","Changing background color with Radio Buttons Android","<android><background><onclick><radio-group>","1","0","","",""
"4733177","1","","","2011-01-19 08:32:45","3","15695","<pre><code>I have a form in android upon submit im inserting it into database using servlet i have to show to user that form was inserted successfully. this is my applicationimport java.io.IOException;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import java.sql.Connection;import java.sql.DriverManager;import java.sql.Statement;import java.util.ArrayList;/** * * @author trainee */public class form extends HttpServlet {String name;String password;Connection con = null;Statement stmt = null;/** * 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 */        /* TODO output your page here        out.println(""&lt;html&gt;"");        out.println(""&lt;head&gt;"");        out.println(""&lt;title&gt;Servlet form&lt;/title&gt;"");          out.println(""&lt;/head&gt;"");        out.println(""&lt;body&gt;"");        out.println(""&lt;h1&gt;Servlet form at "" + request.getContextPath () + ""&lt;/h1&gt;"");        out.println(""&lt;/body&gt;"");        out.println(""&lt;/html&gt;"");        */@Overrideprotected void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {   try  {  }  catch(Exception ex)  {  }} /**  * 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 */@Overrideprotected void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {  try  {     Class.forName(""com.mysql.jdbc.Driver"");     con =DriverManager.getConnection (""jdbc:mysql://localhost:3306/Login"",""root"", """");     String nn=request.getParameter(""name"");     String pass=request.getParameter(""pass"");     String email=request.getParameter(""email"");     stmt=con.createStatement();     String query=""insert into users values('""+nn+""','""+pass+""','""+email+""');"";     int v=stmt.executeUpdate(query);     ArrayList&lt;String&gt; arr=new ArrayList&lt;String&gt;();     arr.add(""inserted"");System.out.println(""sent response back..."");  }  catch(Exception ex)  {  }}/**  * Returns a short description of the servlet. * @return a String containing servlet description */@Overridepublic String getServletInfo() {    return ""Short description"";}// &lt;/editor-fold&gt;}</code></pre><p>this is my android application</p><pre><code>package org.me.loginandroid;import java.io.BufferedReader;import java.io.InputStream;import java.io.InputStreamReader;import java.util.ArrayList;import java.io.*;import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;import org.apache.http.NameValuePair;import org.apache.http.client.HttpClient;import org.apache.http.client.entity.UrlEncodedFormEntity;import org.apache.http.client.methods.HttpPost;import org.apache.http.impl.client.DefaultHttpClient;import org.apache.http.message.BasicNameValuePair;import org.json.JSONArray;import org.json.JSONObject;import android.app.Activity;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;import android.widget.EditText;import android.widget.TextView;import org.apache.http.client.methods.HttpGet;public class MainActivity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button btn1 = (Button) findViewById(R.id.submit);        btn1.setOnClickListener(listener_login);    }    private OnClickListener listener_login = new OnClickListener() {        boolean check = false;        public void onClick(View v) {            EditText emailText = (EditText) findViewById(R.id.email);            EditText passText = (EditText) findViewById(R.id.password);            EditText nameText = (EditText) findViewById(R.id.uname);            String name = nameText.getText().toString();            String email = (emailText.getText().toString());            String pass = (passText.getText().toString());            String result = """";            ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();            nameValuePairs.add(new BasicNameValuePair(""name"", name));            nameValuePairs.add(new BasicNameValuePair(""pass"", pass));            nameValuePairs.add(new BasicNameValuePair(""email"", email));            try {                HttpClient httpclient = new DefaultHttpClient();                HttpPost httppost = new HttpPost(""http://10.0.2.2:8084/Login/form"");                httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));                HttpResponse response = httpclient.execute(httppost);                HttpEntity entity = response.getEntity();                InputStream is = entity.getContent();                BufferedReader reader = new BufferedReader(new InputStreamReader(is, ""iso-8859-1""), 8);                StringBuilder sb = new StringBuilder();                String line = null;                while ((line = reader.readLine()) != null) {                    sb.append(line + ""\n"");                }                is.close();                result = sb.toString();                TextView lbl = (TextView) findViewById(R.id.lbl);                lbl.setText(result);            } catch (Exception e) {                TextView tv = (TextView) findViewById(R.id.err);                tv.setText(""Error parsing data "" + e.toString());                System.out.println(""Error parsing data "" + e.toString());            }            //parse json data            try {                boolean check=false;               ArrayList&lt;String&gt; arrays=new ArrayList&lt;String&gt;();               for(int i=0;i&lt;arrays.size();i++)               {                   if(arrays.get(i).equals(""Inserted""))                   {                        check=true;                   }                   else                   {                   }               }               if(check)               {                   Intent myintent = new Intent(MainActivity.this, welcome.class);                   startActivity(myintent);               }               else               {                    TextView tv = (TextView) findViewById(R.id.err);                    tv.setText(""Data was not inserted properly"");               }            } catch (Exception e) {                //setContentView(R.layout.notify);                TextView tv = (TextView) findViewById(R.id.err);                tv.setText(e.toString());                System.out.println(""log_tag"" + ""Error parsing data "");            }        }    };}</code></pre>","579515","","114066","","2011-01-19 09:10:26","2013-04-18 07:16:58","how to pass data from servlet to android application","<java><android><servlets>","4","3","0","",""
"4733258","1","","","2011-01-19 08:43:13","0","680","<p>I wondered what installing apk files into emulator or device means and tried to install manually with eclipse first. I opened file explorer tab in ddms section in eclipse and realized that all files with apk extension are in app folder. I selected app directory and clicked push a file onto device button on the top. With selecting apk file i want it was installed to the emulator. However, i am getting this error<img src=""http://i.stack.imgur.com/RUmhZ.png"" alt=""alt text""> when try to run app ,     </p><p>Is this error about my installation method or caused by something different ?</p>","459904","","21234","","2011-01-19 08:45:10","2011-09-28 19:04:05","android installing apk file manually error","<android><apk>","2","0","","",""
"4733284","1","","","2011-01-19 08:47:13","0","287","<p>I'm starting the Contactpicker by pressing a button (launching an intent) in my app.</p><pre><code>public void pickAcontact(View view) {            Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,                     android.provider.ContactsContract.Contacts.CONTENT_URI);                    startActivityForResult(contactPickerIntent, CONTACT_PICKER_RESULT);    }</code></pre><p>I chose a contact and want to insert the contacts phonenumber to an EditText.</p><p>Found a lot of howtos and tried but I can't get it work using the new API (contactscontract).Would highly apreciate some advices how to handle the activities result and query properly.</p><p>regards</p>","581132","","","","","2011-01-19 15:01:14","Contactpicker retrieve phonenumber and insert to EditText","<android>","1","0","","",""
"4733311","1","4733421","","2011-01-19 08:51:18","2","3351","<p>I needs to make a call to a webservice for 5 times(as there are 5 different parameters) one by one or all at once. Once a particular call completed, in background a textview should be updated with text as: ""1st completed"", ""2nd Completed"" and so on.</p><p>TextView value should be updated in background.</p><p>What should i do ? I am knowing the concept of AsyncTask, but i am confused that should i write 5 AsyncTask and then for each i write execute() method to execute the AsyncTask? </p><p>I am successful for only 1 one call, as i set ""1st completed"" in postExecute() method. But confused for the 5 times call.</p><p>Please suggest me a better way or exact solution.</p>","379693","","114066","","2011-01-19 09:11:42","2011-01-19 10:06:53","Android - Problem with AsyncTask","<android><android-asynctask>","1","1","2","",""
"4733322","1","4916450","","2011-01-19 08:53:51","3","2275","<p>I have a service tha launch a thread after 15 sec. This is a snippet of my code:</p><pre><code>        Handler mHandler = new Handler();        OverclockThread ocThread = new OverclockThread();        ocThread.ocPreference = readPreference(""oc"");        ocThread.serviceOn = true;        if (Intent.ACTION_SCREEN_ON.equals(action)) {            ocThread.screenOff = false;            mHandler.postDelayed(ocThread, 15000);        }</code></pre><p>Now I'd like to add the ability to stop the launching of my ocThread before these 15 seconds...for example by pressing a button or a checkbox...which command I have to use to stop a thread launched with postDelayed?</p><p>thanks</p><p>simone</p>","570488","","","","","2011-02-06 22:00:13","How to stop the launch of a thread done with postDelayed","<android><multithreading><postdelayed>","1","1","2","",""
"4733326","1","4733369","","2011-01-19 08:54:15","2","2594","<p>I want to generate random,unique color code. Is there any algorithm ?</p>","309990","","1534123","","2012-11-15 14:02:55","2012-11-15 14:02:55","android generate randomly unique color code","<android><algorithm><random>","1","0","","2012-11-15 17:41:50",""
"4733434","1","","","2011-01-19 09:08:54","2","10128","<p>I am trying to change the height of linear layout programatically. When i use </p><pre><code>ll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));</code></pre><p>i am getting </p><pre><code>java.lang.ClassCastException: android.view.ViewGroup$LayoutParams </code></pre><p>exception. If anyone knows about this your help will be appreciable.</p><p>thanks<br>venu</p>","461975","","1862545","","2013-05-24 16:56:32","2013-05-24 16:56:32","change linear layout height programatically in android","<android><android-layout>","3","0","2","",""
"4733480","1","4887187","","2011-01-19 09:15:50","5","902","<p>I have made a custom Dialog, and I want the title to have a background like the AlertDialog.</p><p>Better said:</p><p>The place where it says ""Custom Dialog""</p><p><img src=""http://i.stack.imgur.com/fNtuv.png"" alt=""alt text""></p><p>Needs to have a 'header' like this:</p><p><img src=""http://i.stack.imgur.com/lEKuL.png"" alt=""alt text""></p><p>I don't want to just add the image left to the text, but really implement the complete UI style shown.</p><p>Is this possible?</p><p>Here's the code I used for my custom dialog: <a href=""http://stackoverflow.com/questions/4302439/adding-image-to-custom-alertdialog"">Adding Image to Custom AlertDialog</a></p>","517460","","116938","","2011-02-08 21:54:11","2011-02-08 21:54:11","Change Custom Dialog 'header' to AlertDialog 'header'","<android><layout><dialog><alertdialog>","2","0","3","",""
"4733567","1","4733733","","2011-01-19 09:26:19","0","511","<p>In my application i have added a frame-by-frame animation to my button's selector. So, when I press the button the application is started and another activity is launched. The problem is that if I press the button very quickly the application reaches only to the second frame. I would like to launch the next activity after the animation is ended. Is that possible?</p><p>Thanks a lot</p><p>Gratzi</p>","460611","","","","","2011-01-19 10:07:09","Execute button's command after the animation","<android>","3","0","","",""
"4733617","1","4734088","","2011-01-19 09:31:43","0","147","<p>Ok i know how to send a file to the server...What i am looking for is code which looks in a folder on the sd card and then sends all the text files in there and then deletes them..However it needs to keep looking in there until there is internet connection so that it completes the job, otherwise it keeps looking in there every 30 seconds..? hope i explained correctly</p>","569654","","","","","2011-01-19 10:30:01","Android scheduled files to server","<android>","1","0","","",""
"4733659","1","4734026","","2011-01-19 09:36:11","2","198","<p>I want to make a simple lunar lander varient with asteroids. I've got asteroids, but I'm stumped on how to make them defined areas with bounds that if my ship crosses causes the player to lose. Any tips about defining a circle pixel area? If it helps, I know the exact coordinates of my asteroids.</p><p>Thanks for your advice.</p><p>(Looking for collision-detection advice)</p><p><strong>Edit:</strong> My personal solution, slightly more verbose but no more helpful than the solution below :)</p><pre><code>public boolean collisionDetection(double xa, double ya, double ra, double xb, double yb, double rb) {        double distance = Math.sqrt(Math.pow(xa-xb, 2) + Math.pow(ya-yb, 2));         if (distance &lt; ra+rb)            return true;        else             return false;    }</code></pre>","387064","","387064","","2011-01-19 10:59:56","2011-01-19 15:37:40","Defining a circular area for bounds in an Android game","<android><graphics><2d><collision-detection>","1","2","","",""
"4733754","1","5556842","","2011-01-19 09:47:15","15","9635","<p>What is the average time it takes for a application to be reviewed by the <a href=""https://developer.amazon.com"">Amazon AppStore</a>?</p><p><em>(small, non-controversial, quality application, popular on the Android Market)</em></p><p>I know it is variable, so rough figures (3 days? 3 weeks? 3 months?) of minimum/maximum would be extremely helpful, I am just looking for some real-world examples.</p>","226958","","226958","","2011-01-20 08:27:38","2011-07-30 17:23:48","How long for an app to be approved for Amazon AppStore?","<android><amazon-appstore>","8","1","0","2011-08-04 23:31:18",""
"4733755","1","12598392","","2011-01-19 09:47:15","8","4033","<p>Can I load layout from xml during onCreateView call, I tried: </p><ul><li>setLayoutResource(R.layout.test);</li><li>setWidgetLayoutResource(R.layout.test);</li></ul><p>it crashes and I don’t know what to return a ViewGroup parent from a method arguments?I also tried: </p><ul><li>View view = View.inflate(getContext(), R.layout.test, parent) but it didn’t worked as well.</li></ul><p>I named root layout widget_frame but it didn’t helped</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:padding=""1dp"" android:clickable=""false"" android:id=""@+id/widget_frame""&gt; &lt;LinearLayout ....</code></pre><p>Could you tell me what I’m doing wrong or point me to some working example.Thanks</p><p><strong>Update</strong></p><p>Below is a woking solution on how to inflate above layout:</p><pre><code>    LayoutInflater inflater =  (LayoutInflater)getContext().                              getSystemService(Context.LAYOUT_INFLATER_SERVICE);     View view = inflater.inflate(R.layout.test, parent, false);</code></pre>","31207","","31207","","2011-01-26 11:05:48","2012-09-26 11:15:36","Loading layout in onCreateView for custom preference","<android><layout><preferences>","1","1","","",""
"4733762","1","","","2011-01-19 09:48:05","0","298","<p>i am getting error while using the custom class for spinner from below link.</p><p><a href=""http://stackoverflow.com/questions/867518/how-to-make-an-android-spinner-with-initial-text-select-one"">How to make an Android Spinner with initial text ""Select One""</a></p><p>can anyone suggest me how can i use it</p><p>thankx</p>","411359","","","","","2011-01-19 10:28:32","help for custom spinner?","<android><android-layout>","1","3","","",""
"4733798","1","4733832","","2011-01-19 09:51:51","2","2568","<p>I need to start a process only when the gallery stop scrolling. ""onItemSelected"" doesn't cut it as it will be called continuously as if scroll by.</p><p>So how to detect or callback when the gallery stop scrolling?</p>","42340","","","","","2011-01-19 09:54:50","How to know when gallery widget stop scrolling?","<android><android-widget>","1","0","1","",""
"4733873","1","4883402","","2011-01-19 09:59:20","1","385","<p>Yesterday I submitted my application to the Amazon AppStore. I did not upload a video, because I haven't made one and it seemed optional, because I was able to submit the app without one.</p><p>Today I checked the app's status, it says ""Status: Incomplete (Missing Multimedia)"" with a link to the multimedia section whose video field says ""Video &lt; none uploaded >"".</p><p>So I made a video, but I can not add it because it says ""Cannot edit application while in review.""</p><p>I used the ""Feeback"" link to send a message to Amazon, I might even get a reply, but do anyone already know a solution to this problem?</p>","226958","","226958","","2011-01-20 08:27:17","2011-02-03 07:21:35","App submitted to Amazon AppStore is both ""Status: Incomplete"" and ""Cannot edit application while in review""","<android><amazon-appstore>","1","0","","",""
"4733874","1","4734412","","2011-01-19 09:59:22","-1","2359","<p>Bitmap picture = BitmapFactory.decodeResource(getResources(),R.drawable.phscale);</p><p>apart from above code any other ways to get the bitmap from drawables</p>","550796","","759866","","2014-02-20 17:14:24","2014-02-20 17:14:24","android getting pictures from drawables","<android>","3","1","","",""
"4733912","1","4733963","","2011-01-19 10:03:35","0","919","<p>I want to read xml from url:</p><pre><code>URL url = new URL(""http://192.168.2.20/test.xml"");DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();DocumentBuilder db = dbf.newDocumentBuilder();Document doc = db.parse(new InputSource(url.openStream()));doc.getDocumentElement().normalize();</code></pre><p>This works. But when I want to read from a url that needs authentication this method fails.So for</p><pre><code>url = new URL(""http://admin:pass@192.168.2.20/test.xml"");</code></pre><p>it does not work.</p><p>Any ideas?</p>","401025","","","","","2011-01-19 10:08:41","Use Url to receive xml","<android><url><android-xml>","1","0","1","",""
"4734030","1","4736684","","2011-01-19 10:14:13","2","14986","<p>Is there anyway in which I can use the Voice to Text feature of Android in offline mode.</p><p>In the given example VoiceRecognition.java, it starts and activity with the intent RecognizerIntent.ACTION_RECOGNIZE_SPEECH.</p><p>Does it mean that any other apk needs to be installed before hand for this to work or do I need to write my own application to launch on this intent.</p><p>I have been searching for this for a long time but is getting confused...</p><p>Here is the code I used..</p><pre><code>private static final int VOICE_RECOGNITION_REQUEST_CODE = 1234;private ListView mList;/** * Called with the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Inflate our UI from its XML layout description.    setContentView(R.layout.voice_recognition);    // Get display items for later interaction    Button speakButton = (Button) findViewById(R.id.btn_speak);    mList = (ListView) findViewById(R.id.list);    // Check to see if a recognition activity is present    PackageManager pm = getPackageManager();    List&lt;ResolveInfo&gt; activities = pm.queryIntentActivities(            new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);    if (activities.size() != 0) {        speakButton.setOnClickListener(this);    } else {        speakButton.setEnabled(false);        speakButton.setText(""Recognizer not present"");    }}/** * Handle the click on the start recognition button. */public void onClick(View v) {    if (v.getId() == R.id.btn_speak) {        startVoiceRecognitionActivity();    }}/** * Fire an intent to start the speech recognition activity. */private void startVoiceRecognitionActivity() {    Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);    intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,            RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);    intent.putExtra(RecognizerIntent.EXTRA_PROMPT, ""Speech recognition demo"");    startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);}/** * Handle the results from the recognition activity. */@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    if (requestCode == VOICE_RECOGNITION_REQUEST_CODE &amp;&amp; resultCode == RESULT_OK) {        // Fill the list view with the strings the recognizer thought it could have heard        ArrayList&lt;String&gt; matches = data.getStringArrayListExtra(                RecognizerIntent.EXTRA_RESULTS);        mList.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,                matches));    }    super.onActivityResult(requestCode, resultCode, data);}</code></pre><p>On running this code it gives Recognizer not present which means no such activity is present. How to resolve this?</p>","544631","","544631","","2011-01-19 10:29:07","2011-03-23 17:15:53","Voice to text on Android in offline mode","<android><speech-recognition>","1","2","6","",""
"4734037","1","","","2011-01-19 10:14:56","0","165","<p>i need to display four names continues in listviewfor example</p><p>aravind</p><p>bose</p><p>guru</p><p>moorthy</p><p>aravind</p><p>bose</p><p>guru</p><p>moorthy</p><p>the set of values to be displayed in listview for ""n"" number of times if i have mension 10times.the four names should be display for 10 times in listview.help me</p>","581239","","581239","","2011-01-19 10:54:05","2011-03-24 10:18:44","listview in android","<android>","3","4","","",""
"4734083","1","","","2011-01-19 10:20:36","0","3501","<p>anyone whether scrollview works only on Linearlayout because i tried absolute layout but there is a problem in scrolling it</p><p>thanks in advance</p>","550796","","","","","2011-01-24 09:56:18","android scrollview","<android><android-layout>","1","2","","",""
"4734180","1","5684707","","2011-01-19 10:30:45","1","446","<p>I'm using RecognizerIntent to record user voice. I'm using following code:</p><pre><code>@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    if (requestCode == VOICE_RECOGNITION_REQUEST_CODE &amp;&amp; resultCode == RESULT_OK) {        ArrayList&lt;String&gt; matches = data.getStringArrayListExtra(                RecognizerIntent.EXTRA_RESULTS);        mList.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,                matches));    }    super.onActivityResult(requestCode, resultCode, data);}</code></pre><p>Here I'm getting the recorded speech as string. I want to obtain the recorded voice file to store it on sdcard.</p><p>How should I get it?</p><p>Thanx in advance.</p>","227943","","","","","2011-04-16 05:35:59","How to get the recorded voice in the form of a file recorded using ACTION_RECOGNIZE_SPEECH android","<android><voice-recognition>","1","3","1","",""
"4734242","1","4736350","","2011-01-19 10:36:37","1","336","<p>I am planning to develop a web and mobile application. Have a look on this <a href=""http://answers.onstartups.com/questions/19073/i-have-a-great-idea-for-a-startup-a-web-app-business-how-and-where-to-start"">Question on OnStartups</a></p><p>I have some PHP &amp; MySql knowledge, however I didn't do any major projects so far.</p><p>My skills on a scale of 5  </p><ul><li>PHP&amp;MySql 3/5,</li><li>Javascript 3/5</li><li>CSS 3/5</li><li>Android 1.5/5</li><li>IPhone    0/5</li><li>web development (2/5)</li><li>web    design(2/5)</li><li>Software Development &amp;    management(1.5/5)</li><li>My app, as said in one of the answersin the question, is not much complexas Mint. If the complexity of Mint israted 8. My app would be 5/8</li></ul><p>I have lot of interest in programming. Only thing bothering and bogging me is the time to make the app live. I don't understand how to estimate the time as I am not so experienced. </p><p>Should I start developing the app and learn all the concepts on the way?</p><p>or </p><p>should I wait learn programming completely first and then develop the app.?</p><p>Edit: A small Edit based on below answers. How should I test myself to know whether I have the minimum web development knowledge to start developing the application. </p>","517525","","517525","","2011-01-19 11:14:51","2011-01-19 14:26:50","What to do, Learn while Developing the app or Learn first and then develop the app","<php><iphone><android>","6","0","","2012-09-08 19:43:26",""
"4734365","1","","","2011-01-19 10:51:25","1","8802","<p>I have a ""contacts.xml"" file, its structure is:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;Contacts&gt;   &lt;Contact&gt;      &lt;ContactId&gt;1&lt;/ContactId&gt;       &lt;ContactName&gt;Aditya  Kothari&lt;/ContactName&gt;      &lt;MobilePhone1&gt;NA&lt;/MobilePhone1&gt;       &lt;MobilePhone2&gt;NA&lt;/MobilePhone2&gt;       &lt;OfficePhone1&gt;NA&lt;/OfficePhone1&gt;      &lt;OfficePhone2&gt;NA&lt;/OfficePhone2&gt;      &lt;OfficePhone3&gt;NA&lt;/OfficePhone3&gt;      &lt;HomePhone1&gt;999-367-3944&lt;/HomePhone1&gt;      &lt;HomePhone2&gt;NA&lt;/HomePhone2&gt;       &lt;TokenId&gt;mtn&lt;/TokenId&gt;    &lt;/Contact&gt;   &lt;Contact&gt;       &lt;ContactId&gt;2&lt;/ContactId&gt;      &lt;ContactName&gt;Jai  Mandloi &lt;/ContactName&gt;      &lt;MobilePhone1&gt;NA&lt;/MobilePhone1&gt;      &lt;MobilePhone2&gt;NA&lt;/MobilePhone2&gt;       &lt;OfficePhone1&gt;NA&lt;/OfficePhone1&gt;      &lt;OfficePhone2&gt;NA&lt;/OfficePhone2&gt;      &lt;OfficePhone3&gt;NA&lt;/OfficePhone3&gt;      &lt;HomePhone1&gt;800-742-9678&lt;/HomePhone1&gt;      &lt;HomePhone2&gt;NA&lt;/HomePhone2&gt;      &lt;TokenId&gt;mtn&lt;/TokenId&gt;   &lt;/Contact&gt;&lt;/Contacts&gt;</code></pre><p>Now i am doing this-</p><pre><code>File xmlFile = new File(""E:\\contacts.xml"");InputStream is = new FileInputStream(xmlFile);XMLInputFactory factory = XMLInputFactory.newInstance();XMLStreamReader reader = factory.createXMLStreamReader(is);while(reader.hasNext()){    if(reader.hasText()    {        System.out.println(reader.getText());    }    reader.next();}</code></pre><p>I do not want values of ""ContactId"" and ""TokenId"" elements of xml.How should i code?  </p>","574114","","","","","2011-05-21 14:00:04","How to parse xml file using XMLReader","<java><android>","2","0","","",""
"4734423","1","4734533","","2011-01-19 10:57:48","2","10335","<p>I have a simple layout as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;  &lt;LinearLayout  android:id=""@+id/widget30""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:background=""@color/translucent_red""  android:orientation=""vertical""  xmlns:android=""http://schemas.android.com/apk/res/android""&gt;</code></pre><p></p><p>My colors.xml file is as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;  &lt;color name=""opaque_red""&gt;#f00&lt;/color&gt;  &lt;color name=""translucent_red""&gt;#80ff0000&lt;/color&gt;&lt;/resources&gt;</code></pre><p>When I compile in VS2010 I get an error ""System.InvalidOperationException: Command failed...."" I have tried to place the colors.xml in res/values and res/color but I stillget the error. If I reference the color directly like:</p><pre><code>android:background=""#80ff0000""</code></pre><p>everything works fine.</p><p>Does anyone know if the colors.xml is supported by MonoDroid and if so why I'm getting this error?</p><p>Thanks for the help!</p>","319721","","","","","2012-03-28 13:02:59","MonoDroid - setting background color from colors.xml throws InvalidOperationException","<android><exception><colors><embedded-resource><monodroid>","2","0","","",""
"4734430","1","7224771","","2011-01-19 10:58:16","0","1836","<p>i am suffering with a problem that in android 2.2 emulator, camera doesn't work. it closes down the camera automatically. But this problem is not happening in android 1.5 emulator.Why it is happening? can any body help? </p>","489762","","1471203","","2013-01-10 05:51:05","2013-01-10 05:51:05","camera issue in emulator 2.2 in android","<android>","1","0","","",""
"4734531","1","","","2011-01-19 11:10:31","0","471","<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/address"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""android:autoLink=""map"" /&gt; &lt;TextView android:id=""@+id/postcode"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""android:autoLink=""map"" /&gt; &lt;ListView android:id=""@android:id/list"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""/&gt; &lt;/LinearLayout&gt; </code></pre>","528057","","496830","","2011-08-02 15:53:26","2011-08-02 15:53:26","What do I do to make the TextView (address+postcode) clickable & to open google maps?","<android><textview>","1","0","","",""
"4734539","1","4734670","","2011-01-19 11:11:56","2","5567","<p>So I have my tab layout working as demonstrated in the <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">Android example</a>:</p><pre><code>super.onCreate(savedInstanceState);setContentView(R.layout.main);Resources res = getResources(); // Resource object to get DrawablesTabHost tabHost = getTabHost();  // The activity TabHostTabHost.TabSpec spec;  // Resusable TabSpec for each tabIntent intent;  // Reusable Intent for each tab// Create an Intent to launch an Activity for the tab (to be reused)intent = new Intent().setClass(this, ArtistActivity.class);// Initialize a TabSpec for each tab and add it to the TabHostspec = tabHost.newTabSpec(""artists"").setIndicator(""Artists"", res.getDrawable(R.drawable.ic_tab_artists)).setContent(intent);tabHost.addTab(spec);// Do the same for the other tabsintent = new Intent().setClass(this, AlbumsActivity.class);spec = tabHost.newTabSpec(""albums"").setIndicator(""Albums"", res.getDrawable(R.drawable.ic_tab_artists)).setContent(intent);tabHost.addTab(spec);intent = new Intent().setClass(this, SongsActivity.class);spec = tabHost.newTabSpec(""songs"").setIndicator(""Songs"", res.getDrawable(R.drawable.ic_tab_artists)).setContent(intent);tabHost.addTab(spec);</code></pre><p>Now, in one of the tab's activities I've declared a button and would like to bring in a new view. If I create a new intent it will push a new view and the tabs are gone. Is it possible to switch the currently selected view with a new view?</p>","143979","","143979","","2011-01-19 11:21:02","2011-01-19 11:28:16","Changing the view within the Android Tab Widget","<java><android><tabwidget>","1","0","","",""
"4734703","1","","","2011-01-19 11:31:35","1","4312","<p>Where can I get the code of a Twitter client for Android? Possibly a recent one using the latest SDK. Thanks</p>","581343","","","","","2012-05-24 19:23:51","Android Twitter open source client","<android>","6","0","3","",""
"4734797","1","4734850","","2011-01-19 11:40:34","0","705","<p>Is it possible to create implicit intent to call our own activity? If possible is it useful or better option is Explicit Intent?</p>","550966","","","","","2011-01-19 11:46:53","Can we create implicit Intent to call our own Activities","<android>","1","2","","",""
"4734863","1","","","2011-01-19 11:48:25","0","286","<p>this:</p><blockquote>  <p>[2011-01-19 12:25:46 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for C:\Praxiseinsatz\AndroidManifest.xml: Element or attribute do not match QName production: QName::=(NCName':')?NCName. </p></blockquote><p>This the alert I get no matter what I do in my android project.</p><p>When I try to start my app I am being given the alert:</p><blockquote>  <p>The app has stopped working unexpectedly </p></blockquote><p>and I am going nuts!I hope you can help me and tell me what to do :(</p>","581361","","186535","","2011-12-02 12:15:14","2011-12-02 12:15:14","Error Alert in the Eclipse Console","<android><sql><database><console>","1","0","","",""
"4734869","1","","","2011-01-19 11:49:32","1","1876","<p>I need to calculate the measured height of my views without measuring all views, because these views contain images fetched from the internet. When I measure the views, they download images to memory and I an catch out of memory exception. I use custom ScrollViews, which work like ListViews, display some part of views and when scroll, add to bottom or top.</p><p>How can I calculate the height of all my views without throwing out of memory exceptions?</p><p>Or how can I make ListView calculate its height before rendering views?</p>","480362","","496830","","2011-08-23 00:28:52","2011-08-23 00:28:52","How can I find the measured height of views?","<android><height><scrollview><measure>","2","3","","",""
"4734886","1","4735642","","2011-01-19 11:52:01","1","4724","<p>How one we avoid this exception??</p><pre>01-19 17:16:16.024: WARN/SQLiteCompiledSql(477): Releasing statement in a finalizer.    Please ensure that you explicitly call close() on your cursor: SELECT * FROM test01-19 17:16:16.024: WARN/SQLiteCompiledSql(477): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here01-19 17:16:16.024: WARN/SQLiteCompiledSql(477): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here01-19 17:16:16.024: WARN/SQLiteCompiledSql(477):     at android.database.sqlite.SQLiteCompiledSql.(SQLiteCompiledSql.java:62)01-19 17:16:16.024: WARN/SQLiteCompiledSql(477):     at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:80)01-19 17:16:16.024: WARN/SQLiteCompiledSql(477):     at android.database.sqlite.SQLiteQuery.(SQLiteQuery.java:46)</pre>","548218","","226829","","2011-10-04 05:29:34","2012-12-17 15:44:47","How can one avoid DatabaseObjectNotClosedException","<android>","4","0","","",""
"4734928","1","","","2011-01-19 11:56:47","3","5910","<p>I'm facing a kind of curse about asset accessing with Android. I'm using NetBeans 6.9.1 and testing on a 2.3 Android Virtual Device. I'm trying to access a database file (""database.db"") stored in the assets folder (though I've had to make the directory by myself because it didn't even existed in my project folder) and I'm simply unable to do it after more than 3 days lost looking for a solution. Here a summary of my tragic process:</p><ul><li>I've created a directory called ""assets"" in my NetBeans project directory (just where the ""res"" or the ""src"" folders are).</li><li>I've copied the ""database.db"" file inside and even a ""sample.txt"", which I've also stored in the ""assets/sub"" subdirectory as I'm testing everything humanly possible.</li><li><p>I have a class that inherits from ""SQLiteOpenHelper"" where I'm simply trying to access my database file and, after seeing that it's nearly impossible, I'm just trying to see what my assets folder contains:</p><pre><code>public class DataBaseHelper extends SQLiteOpenHelper{private static String DB_PATH = ""/data/data/org.me.androidbt/databases/"";private static String DB_NAME = ""database.db"";private SQLiteDatabase myDataBase;private final Context myContext;public DataBaseHelper(Context context) {    super(context, DB_NAME, null, 1);    this.myContext = context;}private void myFunction() throws IOException{//Firs try, explodes terribly at the first lineInputStream is = myContext.getAssets().open(""sub/sample.txt"");BufferedReader br = new BufferedReader(new InputStreamReader(is));String line = null;int number = 0;while ((line = br.readLine()) != null) {    // Just used to check the ""line"" value when debugging    number++;}br.close();// Second try, didn't explodesAssetManager mngr = myContext.getResources().getAssets();String[] str = mngr.list("""");// String only contains three elements: ""images"", ""sounds"" and ""webkit""// (an there aren't such things in my assets folder)// Real try to open the DB, dies horribly and blowns up my PCInputStream myInput = myContext.getAssets().open(DB_NAME);</code></pre></li></ul><p>I've also tried to access it from the MainActivity itself:</p><pre><code>try{        AssetManager mng = this.getAssets();        String[] str = mng.list("""");        // The same three elements...        // And this explodes in a nuclear toxic cloud that kills a thousand birds        InputStream is = this.getAssets().open(""sub/sample.txt"");        BufferedReader br = new BufferedReader(new InputStreamReader(is));        String line = null;        int number = 0;        while ((line = br.readLine()) != null) {            number++;        }        br.close();    }catch(Exception e){        // Life is sad...    }</code></pre><p>And now, some questions: What I'm doing wrong? Is my assets folder correctly placed? Are my files correclty copied? Is my code correctly placed?</p>","575560","","578215","","2011-11-01 11:19:09","2013-05-17 00:58:08","Unable to access Android assets (and no post or tutorial works for me), please help!","<android><file><local><assets>","1","2","","",""
"4734932","1","","","2011-01-19 11:57:11","0","395","<p>I am creating fixed header and fixed footer for <code>RelativeLayout</code>. In the center part I am adding array of <code>WebView</code> when it come <code>ScrollView</code> it hide header and footer.</p><p>How can I avoid that?</p><p>This is my layout file:</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/mainrelativelayout""     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;     &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:background=""@color/white""          android:id=""@+id/mainlinear2""          android:layout_alignParentTop=""true""        android:orientation=""vertical""&gt;        &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""            android:layout_width=""fill_parent""              android:layout_height=""15dip""              android:orientation=""horizontal""              android:id=""@+id/linear5""&gt;            &lt;TextView android:text="" ""                android:id=""@+id/txtwebservice""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textSize=""12dip""                android:textColor=""@color/gray2""&gt;&lt;/TextView&gt;        &lt;/LinearLayout&gt;        &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""            android:layout_width=""fill_parent""               android:id=""@+id/linear1""            android:layout_height=""6dip""            android:orientation=""horizontal""&gt;            &lt;ImageView android:id=""@+id/ImageView08""                android:layout_gravity=""center""                android:background=""@drawable/line""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;        &lt;/LinearLayout&gt;        &lt;LinearLayout mlns:android=""http://schemas.android.com/apk/res/android""            android:layout_width=""fill_parent""              android:id=""@+id/linear1""            android:layout_height=""wrap_content""            android:orientation=""horizontal""&gt;            &lt;TextView android:paddingRight=""75dip""                android:paddingLeft=""20dip""                android:text=""Index""                android:id=""@+id/TextView01""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textColor=""@color/black""                android:textStyle=""bold""&gt;&lt;/TextView&gt;            &lt;TextView android:paddingRight=""60dip""                android:text=""Last""                android:id=""@+id/TextView02""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textColor=""@color/black""                android:textStyle=""bold""&gt;&lt;/TextView&gt;            &lt;TextView android:text=""Change""                android:id=""@+id/TextView03""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textColor=""@color/black""                android:textStyle=""bold""&gt;&lt;/TextView&gt;        &lt;/LinearLayout&gt;        &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""            android:layout_width=""fill_parent""               android:id=""@+id/linear1""            android:layout_height=""6dip""            android:orientation=""horizontal""&gt;            &lt;ImageView                android:id=""@+id/ImageView08""                android:layout_gravity=""center""                android:background=""@drawable/line""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""&gt;&lt;/ImageView&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:id=""@+id/linear2""              android:orientation=""horizontal""&gt;               &lt;ImageView android:id=""@+id/ImageView05""                android:paddingTop=""5dip""                android:layout_gravity=""center""                 android:background=""@drawable/down""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;            &lt;TextView                 android:paddingRight=""30dip""                android:paddingLeft=""10dip""                  android:text=""""                android:id=""@+id/txtindex0""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textColor=""@color/black""                android:textSize=""12dip""&gt;&lt;/TextView&gt;            &lt;TextView                 android:paddingRight=""55dip""                 android:text=""""                android:id=""@+id/txtlast0""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textColor=""@color/black""                android:textSize=""12dip""&gt;&lt;/TextView&gt;            &lt;TextView android:text=""""                android:id=""@+id/txtchange0""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textSize=""12dip""                android:textColor=""@color/red1""&gt;&lt;/TextView&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:id=""@+id/linear3""              android:orientation=""horizontal""&gt;            &lt;ImageView android:id=""@+id/ImageView02""                android:layout_gravity=""center""                android:background=""@drawable/up""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;            &lt;TextView                 android:paddingRight=""46dip""                 android:paddingLeft=""10dip""                   android:text=""""                android:id=""@+id/txtindex1""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textColor=""@color/black""                android:textSize=""12dip""&gt;&lt;/TextView&gt;            &lt;TextView android:paddingRight=""64dip""                 android:text=""""                android:id=""@+id/txtlast1""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textColor=""@color/black""                android:textSize=""12dip""&gt;&lt;/TextView&gt;            &lt;TextView android:text=""""                android:id=""@+id/txtchange1""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textSize=""12dip""                android:textColor=""@color/green1""&gt;&lt;/TextView&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:id=""@+id/linear4""               android:orientation=""horizontal""&gt;            &lt;ImageView android:id=""@+id/ImageView03""                android:layout_gravity=""center""                android:background=""@drawable/up""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;            &lt;TextView android:paddingRight=""69dip""                 android:paddingLeft=""10dip""                 android:text=""""                android:id=""@+id/txtindex2""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textColor=""@color/black""                android:textSize=""12dip""&gt;&lt;/TextView&gt;            &lt;TextView android:paddingRight=""67dip""                 android:text=""""                android:id=""@+id/txtlast2""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textColor=""@color/black""                android:textSize=""12dip""&gt;&lt;/TextView&gt;            &lt;TextView android:text=""""                android:id=""@+id/txtchange2""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textSize=""12dip""                android:textColor=""@color/green1""&gt;&lt;/TextView&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:id=""@+id/linear4""            android:orientation=""horizontal""&gt;            &lt;ImageView android:id=""@+id/ImageView04""                android:layout_gravity=""center""                android:background=""@drawable/up""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;            &lt;TextView android:paddingRight=""61dip""                android:paddingLeft=""10dip""                  android:text=""""                android:id=""@+id/txtindex3""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textColor=""@color/black""                android:textSize=""12dip""&gt;&lt;/TextView&gt;            &lt;TextView android:paddingRight=""65dip""                 android:text=""""                android:id=""@+id/txtlast3""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textColor=""@color/black""                android:textSize=""12dip""&gt;&lt;/TextView&gt;            &lt;TextView android:text=""""                android:id=""@+id/txtchange3""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textSize=""12dip""                android:textColor=""@color/green1""&gt;&lt;/TextView&gt;        &lt;/LinearLayout&gt;        &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""            android:layout_width=""fill_parent""               android:id=""@+id/linear1""            android:layout_height=""4dip""            android:orientation=""horizontal""&gt;            &lt;ImageView                android:id=""@+id/ImageView08""                android:layout_gravity=""center""                android:background=""@drawable/line""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;        &lt;/LinearLayout&gt;            &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""            android:layout_width=""fill_parent""              android:layout_height=""15dip""              android:id=""@+id/linear5""              android:orientation=""horizontal""&gt;            &lt;TextView android:text=""Market data delayed at least 15 minutes ""                android:id=""@+id/TextView16""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textSize=""12dip""                android:textColor=""@color/gray2""&gt;&lt;/TextView&gt;        &lt;/LinearLayout&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:id=""@+id/linear8""          android:background=""@color/white""          android:layout_alignParentBottom=""true""&gt;        &lt;ImageView android:id=""@+id/ImageView15""            android:src=""@drawable/quest_i""                android:layout_gravity=""center""             android:layout_width=""wrap_content""            android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""          android:layout_height=""200dip""          android:background=""@color/white""          android:id=""@+id/mainlinear3""          android:layout_above=""@+id/linear8""          android:layout_below=""@+id/mainlinear2""        android:layout_weight=""1""&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;&lt;!--&lt;/ScrollView&gt;--&gt;</code></pre>","426344","","418183","","2011-01-19 17:21:12","2011-01-19 17:21:12","layout problem in android","<android>","1","2","","",""
"4735021","1","","","2011-01-19 12:06:33","0","1263","<p>is there any way to move the Rect drawn by touching</p><p>it should keep on moving when touch action_move..... any one could help with a solution?</p><p>thanks in advance</p>","550796","","","","","2011-01-19 13:05:01","android draw rect","<android>","1","1","","",""
"4735041","1","","","2011-01-19 12:08:28","1","212","<p>I need to create a keyboard .when i drag over keyboard,a highlighted  pointer should move according to its position on keys.How could i do that?Coding is much better for me.Thanks.</p>","555948","","","","","2011-04-03 16:35:58","Mouse dragger on keyboard in android","<android>","1","1","","",""
"4735077","1","","","2011-01-19 12:12:26","0","1251","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4723636/parsing-local-xml-file-in-android"">Parsing local xml file in android</a>  </p></blockquote><p>Hi every one, In this folowing link there is a xml parser </p><p><a href=""http://www.androidpeople.com/android-xml-parsing-tutorial-using-saxparser/#idc-cover"" rel=""nofollow"">http://www.androidpeople.com/android-xml-parsing-tutorial-using-saxparser/#idc-cover</a></p><p>instead of usingurl can i use the xml file stored locally, means inside ""res/xml/*.xml""can any one provide me a code for dat...(am brand new to android, pls help me) </p>","571256","","","","","2012-09-30 12:33:56","local xml parsing in android","<android><xml><parsing>","3","0","","2011-05-09 22:27:38",""
"4735168","1","4735455","","2011-01-19 12:23:40","2","812","<p>I have a service running with a background thread polling for XMPP messages. I want to issue a toast from the Thread. Previous stackoverflow questions have dealt with this by using the runOnUiThread Activity method, however this is not available in a Service. My question is what is the suggested method in a Service?Many thanks in advance </p>","572615","","","","","2012-01-03 10:15:27","Displaying a toast from a Service","<android><multithreading><background>","1","1","","",""
"4735182","1","4735731","","2011-01-19 12:25:18","1","2098","<p>I'm a newbie, I use the android sdk on ubuntu and downloaded a few free android apps, when I tried to load them onto the sdk using eclipse, it gives an XML parser error. I am unable to view the source code of the application too.</p><p>If I try opening the xml file using a browser, I get</p><pre><code>XML Parsing Error: not well-formedLocation: file:///home/Downloads/apks/BlueFTP.apk_FILES/AndroidManifest.xmlLine Number 1, Column 1:</code></pre><p>Has anyone encountered such a problem? Any solutions please?</p><p>Content of manifest.xml</p><pre><code>  &lt;    ü      &gt;                        4   @   N   Z   x   ž   ²   À   Ô   æ   ô     6  R  p  Œ  ¤  ¶      $  8  b  n  ˆ  œ  ¬  Ê  Ú    &amp;  j  z  ¼  ô  &gt;  J  T  v  ˆ     ¼    l  ~  Ô  *  &gt;  ˆ  Ô  ê    4  H  j  ¤  à  (  l  Â   v e r s i o n N a m e    v e r s i o n C o d e    i c o n    l a b e l    n a m e    c o n f i g C h a n g e s    s c r e e n O r i e n t a t i o n    m i m e T y p e    t h e m e    e x p o r t e d    e n a b l e d    v a l u e    m i n S d k V e r s i o n    t a r g e t S d k V e r s i o n    s m a l l S c r e e n s    n o r m a l S c r e e n s    l a r g e S c r e e n s    a n y D e n s i t y    a n d r o i d   * h t t p : / / s c h e m a s . a n d r o i d . c o m / a p k / r e s / a n d r o i d        p a c k a g e    m a n i f e s t    i t . m e d i e v a l . b l u e f t p    2 . 5 0    a p p l i c a t i o n    a c t i v i t y    . A M a i n    i n t e n t - f i l t e r    a c t i o n    a n d r o i d . i n t e n t . a c t i o n . M A I N    c a t e g o r y     a n d r o i d . i n t e n t . c a t e g o r y . L A U N C H E R    . A S e n d    a n d r o i d . i n t e n t . c a t e g o r y . D E F A U L T    a n d r o i d . i n t e n t . a c t i o n . S E N D   # a n d r o i d . i n t e n t . a c t i o n . S E N D _ M U L T I P L E    d a t a    * / *    . A C o n t a c t P i c k e r    . A A b o u t    . A S e t t i n g s    . B u g s M e s s a g e   * . b l u e t o o t h _ s e r v e r s . o p p _ s e r v e r . N o t i f y M e x O P P   * . b l u e t o o t h _ s e r v e r s . f t p _ s e r v e r . N o t i f y M e x F T P    s e r v i c e   ) . b l u e t o o t h _ s e r v e r s . o p p _ s e r v e r . O P P _ S e r v i c e   ) . b l u e t o o t h _ s e r v e r s . f t p _ s e r v e r . F T P _ S e r v i c e    r e c e i v e r   # . b l u e t o o t h _ s e r v e r s . S e r v i c e s L a u n c h e r   $ a n d r o i d . i n t e n t . a c t i o n . B O O T _ C O M P L E T E D        m e t a - d a t a    A D M O B _ P U B L I S H E R _ I D    a 1 4 a a e 1 d 0 8 3 a 7 1 0    u s e s - s d k    u s e s - p e r m i s s i o n    a n d r o i d . p e r m i s s i o n . I N T E R N E T    a n d r o i d . p e r m i s s i o n . B L U E T O O T H   "" a n d r o i d . p e r m i s s i o n . B L U E T O O T H _ A D M I N     a n d r o i d . p e r m i s s i o n . R E A D _ C O N T A C T S   ) a n d r o i d . p e r m i s s i o n . W R I T E _ E X T E R N A L _ S T O R A G E    s u p p o r t s - s c r e e n s     € P        &amp;     $ p„…†l        ÿÿÿÿ       `      ÿÿÿÿÿÿÿÿ                  ÿÿÿÿ                    ÿÿÿÿ            L      ÿÿÿÿÿÿÿÿ                  ÿÿÿÿ         ÿÿÿÿ  ,  t      ÿÿÿÿÿÿÿÿ                  ÿÿÿÿ                       ÿ  </code></pre>","520214","","20770","","2012-01-06 19:12:40","2012-01-06 19:12:40","manifest.xml XML Parsing Error: not well-formed","<android><xml><eclipse><android-manifest>","3","0","","",""
"4735227","1","","","2011-01-19 12:28:47","2","686","<p>I am developing an application with utilities in Android. I have developed a wireless network scanner and I would also have to scan the available mobile operators. I managed to get my mobile operator and nearby cells.</p><p>A greeting and thank you very much</p>","581406","","","","","2011-01-19 12:28:47","How to scan the nearby mobile operators?","<android><phone><scan>","0","2","1","",""
"4735270","1","","","2011-01-19 12:33:22","0","643","<p>I'm testing my app out on my brand new Galaxy Tab and I encountered something strange.</p><p>I have Twitter integration in my app. What it basically does is open a WebView and use Oauth to autheticate. After that it sends a CallBack back to my app with the secret token and there I use it for tweeting purposes. You can get more info about how I do this here: <a href=""http://stackoverflow.com/questions/4387631/callback-after-twitter-authentication"">CallBack after Twitter authentication</a></p><p>This workes on all devices, but on the Galaxy Tab it doesn't go back to my app. In stead, it gives me the ""Web page not available"" page in the browser with the correct CallBack URL in the adresbar.</p><p>How come it doesn't work on the Galaxy Tab?</p><p>EDIT:</p><p>Could it be because the Galaxy Tab use their own browser that doesn't support CallBack?</p>","517460","","517460","","2011-01-19 13:26:00","2011-02-13 01:09:12","CallBack not working on Galaxy Tab, but does work on all other devices","<android><callback><webview><galaxy>","2","0","","",""
"4735341","1","","","2011-01-19 12:41:25","0","404","<p>i did the GPS application which gets the current location.It is working in android emulator by using DDMS perspective(by passing mock location).But it is not working in android phone and phone is Samsung gt-i5801.please help me.And one more thing i want to ask you guys.(Why i need Gps) bcozin my appln i want to display the nearest cinema theatres by using latitude and longitude.Is there any other way to do that.Please tell me.</p>","537819","","","","","2011-01-19 12:50:27","android Gps Application","<android><android-emulator>","2","0","","",""
"4735363","1","","","2011-01-19 12:43:35","1","2355","<p>Can anyone give me a link of a tutorial(specially a simple project which deserialize a XML on android using <a href=""http://simple.sourceforge.net/download/stream/doc/javadoc/"" rel=""nofollow"">Simple API</a>. I need this badly.</p>","581411","","769831","","2014-04-11 14:03:53","2014-04-11 14:03:53","XML deserialization on android using Simple API","<android>","1","0","1","",""
"4735433","1","5575527","","2011-01-19 12:50:46","12","30603","<p>I am using android 2.2 and if I run my project these errors occur. I am new to programming android applications. Can anyone help me?</p><p>1) Description Resource Path Location Type: The project was not built since its build path<br>   is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then   try building this project </p><p>Java Problem</p><p>2) Description Resource Path Location Type: Unable to resolve target 'android-5'    </p><p>Android Target Problem</p><p>3) Description Resource Path Location Type: Unable to resolve target 'android-5' until the    SDK is loaded.    </p><p>Android Target Problem</p><p>4) Description Resource Path Location Type: The type java.lang.Object cannot be resolved.    It is indirectly referenced from required .class files </p><p>VirtualKeypad.java  /MojoGBAMulti/src/com/momojo/gba/input line 1    </p><p>Java Problem</p>","486554","","631051","","2011-04-07 04:53:49","2014-04-11 22:06:16","Resolving Description Resource Path Location Type errors","<java><android>","4","1","1","",""
"4735677","1","","","2011-01-19 13:17:20","1","429","<p>I currently have glibc 2.10.2 on my system. I upgraded an android installation on this same system the other day. Post the upgrade, however, I am unable to run the emulator. The emulator shuts down after posting an error which says something like: ""Need glibc 2.11"". My question is as follows:  </p><p>Is there any way that I can use two versions of glibc on the same system at the same time?  There are some very important C/C++ programs that depend on the current installation of glibc.  </p><p>Please let me know in case my question is not clear. Any help is most welcome.<br>Sriram.<br>Edit: I found some questions on stackoverflow about this issue. However, those questions were unanswered. Hoping this does not go down the same path!</p>","350685","","","","","2011-01-19 13:51:31","Two versions of glibc on the same system","<c++><android><c><glibc><library-path>","1","2","","",""
"4735691","1","","","2011-01-19 13:18:37","1","1006","<p>I downloaded the source (Android.mk) version from RockPlayer. I placed the contents inside ffmpeg folder and placed the folder inside /root/android/external/ffmpeg.</p><p>When I try to compile this with the default Android.mk provided by RockPlayer, I am getting a bunch of undefined reference errors from libavformat.</p><p>I am trying to compile for passion target - ARM tool chain. The given Android.mk does not seem to work fine.</p><p>Has anyone encountered this error? Is anything wrong with the Android.mk provided by ROckPlayer?</p><p>Please help me since I am blocked in this compiling issue.</p><p>Thanks</p>","580133","","580133","","2011-01-19 13:27:01","2011-01-19 13:27:01","Anyone compiled FFMPEG provided by Rockplayer?","<android><ffmpeg>","0","1","1","",""
"4735697","1","4735786","","2011-01-19 13:19:13","0","4111","<p>I access a web service from the andriod emulator and am able to but the output i get is something like this as shown <a href=""http://i.stack.imgur.com/h91dv.png"" rel=""nofollow"">below</a> :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8"" ?&gt;  &lt;ArrayOfQuestionnaire xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns=""http://tempuri.org/""&gt;  &lt;Questionnaire&gt;   &lt;QuestionnaireId&gt;0&lt;/QuestionnaireId&gt;   &lt;QuestionnaireName&gt;Microsoft 0&lt;/QuestionnaireName&gt;    &lt;/Questionnaire&gt;  &lt;Questionnaire&gt;   &lt;QuestionnaireId&gt;1&lt;/QuestionnaireId&gt;   &lt;QuestionnaireName&gt;Microsoft 1&lt;/QuestionnaireName&gt;    &lt;/Questionnaire&gt;  &lt;Questionnaire&gt;   &lt;QuestionnaireId&gt;2&lt;/QuestionnaireId&gt;   &lt;QuestionnaireName&gt;Microsoft 2&lt;/QuestionnaireName&gt;    &lt;/Questionnaire&gt;  &lt;Questionnaire&gt;   &lt;QuestionnaireId&gt;3&lt;/QuestionnaireId&gt;   &lt;QuestionnaireName&gt;Microsoft 3&lt;/QuestionnaireName&gt;    &lt;/Questionnaire&gt;  &lt;Questionnaire&gt;   &lt;QuestionnaireId&gt;4&lt;/QuestionnaireId&gt;   &lt;QuestionnaireName&gt;Microsoft 4&lt;/QuestionnaireName&gt;    &lt;/Questionnaire&gt;  &lt;Questionnaire&gt;   &lt;QuestionnaireId&gt;5&lt;/QuestionnaireId&gt;   &lt;QuestionnaireName&gt;Microsoft 5&lt;/QuestionnaireName&gt;    &lt;/Questionnaire&gt;  &lt;Questionnaire&gt;   &lt;QuestionnaireId&gt;6&lt;/QuestionnaireId&gt;   &lt;QuestionnaireName&gt;Microsoft 6&lt;/QuestionnaireName&gt;    &lt;/Questionnaire&gt;  &lt;Questionnaire&gt;   &lt;QuestionnaireId&gt;7&lt;/QuestionnaireId&gt;   &lt;QuestionnaireName&gt;Microsoft 7&lt;/QuestionnaireName&gt;    &lt;/Questionnaire&gt;  &lt;Questionnaire&gt;   &lt;QuestionnaireId&gt;8&lt;/QuestionnaireId&gt;   &lt;QuestionnaireName&gt;Microsoft 8&lt;/QuestionnaireName&gt;    &lt;/Questionnaire&gt;  &lt;Questionnaire&gt;   &lt;QuestionnaireId&gt;9&lt;/QuestionnaireId&gt;   &lt;QuestionnaireName&gt;Microsoft 9&lt;/QuestionnaireName&gt;    &lt;/Questionnaire&gt; &lt;/ArrayOfQuestionnaire&gt;</code></pre><p>I want to be able to parse data to the JSON format . Isnt it suppose to send data in the JSON format ?</p><p>When i try to access with the code </p><blockquote>  <p>JSONObject JResponse = new  JSONObject(content);    String  sMessage =  JResponse.getString(""QuestionnaireName"");     int success =  JResponse.getInt(""QuestionnaireId"");</p></blockquote><p>Anyways i get the error saying </p><pre><code>   Value &lt;?xml of type java.lang.String cannot be converted to JSONObject ????</code></pre><p>Any idea on how to go about this ?</p><p>Regards</p>","581157","","440502","","2011-01-19 13:27:32","2011-01-19 13:29:00","Error converting java.lang.String to JSONObject","<android>","1","0","","",""
"4735754","1","5138870","","2011-01-19 13:25:51","5","8767","<p>According to the release notes, StageFright replaces the OpenCore framework in the GingerBread release. It seems that there have been numerous discussion that says: Apple's HTTP Live streaming is supported by default since Android 2.3. Even the <a href=""http://en.wikipedia.org/wiki/Android_%28operating_system%29#Features"">Wikipedia</a> mentions this.<br>However, when I try to run the <a href=""http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8"">test stream</a> provided by Apple using the  <code>MediaPlayerDemo_Video.java</code> bundled with API Demos I get thefollowing exceptions: </p><pre><code>setDataSource('http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8')connect to devimages.apple.com:80/iphone/samples/bipbop/gear1/prog_index.m3u8 @0INFO/NuCachedSource2(34): ERROR_END_OF_STREAMerror (1, -2147483648)ERROR/MediaPlayerDemo(667): error: Prepare failed.: status=0x1java.io.IOException: Prepare failed.: status=0x1at android.media.MediaPlayer.prepare(Native Method)atcom.video.stream.MediaPlayerDemo_Video.playVideo(MediaPlayerDemo_Video.java:125)atcom.video.stream.MediaPlayerDemo_Video.surfaceCreated(MediaPlayerDemo_Video.java:181)  ...    surfaceChanged called    Displayed com.video.stream/.MediaPlayerDemo_Video: +1s652ms (total    +7s427ms)    GC_EXPLICIT freed 2K, 55% free 2514K/5511K, external 716K/1038K,    paused 183ms    GC_EXPLICIT freed 17K, 52% free 2782K/5767K, external 716K/1038K,    paused 87ms    GC_EXPLICIT freed 68K, 50% free 2972K/5895K, external 2544K/3109K,    paused 104ms    request time failed: java.net.SocketException: Address family not    supported by protocol </code></pre><p>---relevant code(MediaPlayerDemo_Video.java):</p><pre><code>path = ""http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8"";mMediaPlayer = new MediaPlayer();mMediaPlayer.setDataSource(path);mMediaPlayer.setDisplay(holder);mMediaPlayer.prepare();mMediaPlayer.setOnBufferingUpdateListener(this);mMediaPlayer.setOnCompletionListener(this);mMediaPlayer.setOnPreparedListener(this);mMediaPlayer.setOnVideoSizeChangedListener(this);mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);</code></pre><p>Questions:<br>1. Does GingerBread build really support Apple's HTTP Live Streamingprotocol?<br>2. What went wrong above?</p><p>Please help. </p>","236128","","","","","2012-09-11 13:12:19","MediaPlayer Framework on GingerBread and Apple's HTTP Live Streaming Support","<android><http-live-streaming><stagefright>","2","4","7","",""
"4735847","1","4737192","","2011-01-19 13:35:54","8","9788","<p>I have two layouts: main.xml and buttonpanel.xml.  In buttonpanel.xml, in main linearlayout I set gravity to bottom.  Now i am trying to add the buttonpanel layout using the following code.</p><pre><code>setContentView(R.layout.main);LinearLayout layout=(LinearLayout)findViewById(R.id.mainlinearlayout);LayoutInflater inflater= (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);View view=inflater.inflate(R.layout.buttonpanel,null);layout.addView(view);</code></pre><p>My problem is that the panel is added to the top though i have set gravity to bottom in buttonpanel.xml.  If I add buttonpanel.xml to main.xml using include it works fine.</p><p>Can anyone help me what is the wrong with my code?</p>","411359","","13793","","2011-03-04 14:49:24","2012-07-03 12:43:06","help for using layoutinflator to add views at runtime?","<android><android-layout>","2","2","3","",""
"4735894","1","4737876","","2011-01-19 13:41:58","0","891","<p>I want to display a large number of images(say 500).i am currently displaying them in a scrollable grid layout by lazyloading images(very similar to fedor's lazylist). but i am having issues while scrolling the grid. when i scroll the grid, the views get refreshed and the actual images are reloaded. so, even the images that were displayed earlier are refetched from SD card. this causes a very slow UI. is there any solutions for this.(i.e is there a way to tell the grid view not to refesh views on scrolling).</p><p>or </p><p>is there any other better way to display large number of images.</p>","569838","","","","","2011-01-19 16:28:41","scrolling issues in gridview when displaying a large number of images in android","<android><android-layout><android-listview><android-image><android-gridview>","1","2","","",""
"4735918","1","4735967","","2011-01-19 13:45:38","2","1046","<p><br>Is it good practice in Android to implement our own back button rather than using device's backbutton. May I know what are the disadvantages of using our own back button in Application rather than device provided one.</p><p>Thanks in Advance,</p>","429501","","","","","2011-01-19 13:50:25","Is it good practice in Android to implement our own back button rather than using device's backbutton","<android>","2","2","1","",""
"4735942","1","4736013","","2011-01-19 13:47:31","6","4818","<p>i need to get the current user location on an android app, so i've read some tutorials and samples on the web, but i see that in all the examples, the location is retrived from a ""onLocationChange"" that mean that every time the location change, the code in the ""onLocationChange"" is executed.</p><p>i need only to get the user location at the moment the app is started.</p><p>Thanks for your help! </p>","561438","","","","","2013-08-14 19:12:13","Android - Get Location Only One Time","<java><android><location>","4","0","3","",""
"4735977","1","4736222","","2011-01-19 13:51:39","8","13364","<p><br>Whenever i send a .apk file via email as an attachment and then open the .apk-file in my phone from my email-account, i get a parsing error.<br>However if i put the .apk on my website and provide a URL to it, it works like a charm.</p><p>A bug? Just me? Am i doing it wrong?<br>Thanks</p>","580627","","","","","2013-05-30 12:16:36","Installing APK from email attachment","<android><email><apk>","4","3","","",""
"4736042","1","4756434","","2011-01-19 13:57:36","1","1711","<p>Below is the code I am using to send SOAP requests in my Android app and it works fine with all requests except one. This code throws <strong>IOException : Content-length exceeded</strong> on <code>wr.flush();</code> when there are chinese characters in <code>requestBody</code> variable.</p><p>The content-length in that case is <code>409</code></p><pre><code>            URL url = new URL(Constants.HOST_NAME);            HttpURLConnection connection = (HttpURLConnection) url.openConnection();            // Modify connection settings            connection.setRequestMethod(""POST"");            connection.setRequestProperty(""Content-Type"", ""text/xml; charset=utf-8"");            connection.setRequestProperty(""SOAPAction"", soapAction);            String requestBody = new String(soapRequest.getBytes(),""UTF-8"");            int lngth = requestBody.length();            connection.setRequestProperty(""Content-Length"", (""""+lngth));            // Enable reading and writing through this connection            connection.setDoInput(true);            connection.setDoOutput(true);            // Connect to server            connection.connect();            OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream(), ""UTF-8"");            wr.write(requestBody);            wr.flush();            wr.close();</code></pre><p>Any clue what is going wrong when there are chinese characters in the string?</p><p>EDIT: I have removed the 'content-lenght' header field and it works, but why?</p>","181111","","1079354","","2012-05-20 20:43:20","2012-05-20 20:43:20","OutputStreamWriter's flush method throws IOException when trying to write chinese characters","<android><soap><httpurlconnection><cjk><ioexception>","3","0","","",""
"4736050","1","4736804","","2011-01-19 13:58:40","1","628","<p>Good morning folks,</p><p>I'm working on an Android app and I've run into a bit of a problem. I have created a new class that extends View.  I have overridden the appropriate methods (the Constructor, onDraw, onMeasure) and am instantiating the View through the applications layout XML (which is called main.xml). </p><p>Within the source code of my app I have the following code:</p><pre><code>public class CustomViewTest extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);/* I *think* I need to setContentView before I actually can use any of the widgets on the form. */        setContentView(R.layout.main);               Button b = (Button)findViewById(R.id.button);        b.setOnClickListener(new OnClickListener() {   @Override   public void onClick(View v) {    // TODO Auto-generated method stub// my new widgetnewWidget s = (newWidget)findViewById(R.id.testWidget);s.setRequestedViewSize(300);   }        });    }}</code></pre><p>the problem here, is that s.setRequestedViewSize(300) throws a NullPointerException. Has anyone run into this before or can lend me some advice?</p><p>[EDIT]The main.XML looks like this:</p><p>It returning null, but the 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;com.testing.CustomViewTest02.newWidget        android:id=""@+id/testWidget""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" /&gt;    &lt;Button android:id=""@+id/button""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            &gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>Thanks you!Sam</p>","581511","","581511","","2011-01-19 14:14:15","2012-04-05 12:31:48","Custom widget throws a NullPointerException on setRequestedViewSize","<android>","3","0","","",""
"4736212","1","4736373","","2011-01-19 14:13:34","16","11841","<p>I am completely new to android and want to know the purpose of the <code>@Override</code> statement in Android.</p>","359187","","61654","","2011-11-10 04:37:26","2011-11-10 04:37:26","meaning of android @override","<java><android><annotations><override>","7","0","6","",""
"4736317","1","","","2011-01-19 14:23:22","1","179","<p>I have a very weird issue with my application.  I have a file in my Assets folder of size around 2MB. On some of the devices it reads the file and parses it and creates the DB and everything works fine.   If i run the same app on the emulator then the file doesn't get read and nothing comes on my UI.  So i thought the issue could be with some space allocation on emulator.But the same issue comes up even with some Android devices and on some devices it works fine.   i got to make it work for all the devices. So how can i solve this issue?? Is there any solution for this issue? people say they have around 1.5GB free space in their mobiles....still they are not able to read the file. Is available space only the problem or is there any other issue??   Any help is greatly appreciated. </p><p>Thanks in advance</p>","508152","","508152","","2011-01-19 15:27:41","2011-01-19 15:27:41","Device/Memory Specific issue in reading a file Android","<android>","1","3","","",""
"4736354","1","4736431","","2011-01-19 14:27:10","2","4132","<p>I have one toggle button which desides to enable and disable autolock in app,so how can we do that in app pls help me out here.</p><p>Thanks in advance.</p>","500420","","","","","2013-05-03 12:22:50","How to enable or disable autolock in android?","<android>","3","1","","",""
"4736465","1","","","2011-01-19 14:38:26","1","157","<p>Irrespective of what application is running, I'd like to be able to mirror it - hence on both  the vertical and horizontal planes.</p><p>How could I go about it?</p><p>RegardsGuy</p>","581578","","","","","2011-01-19 14:38:26","I want to invert (horizontally and/or vertically) an Android display","<android><fullscreen>","0","1","1","",""
"4736468","1","","","2011-01-19 14:38:29","5","12650","<p>I am trying to create a app on android that uses bluetooth to communicate with my PC. I want to send text from android app and receive text/events from PC app. Can anyone guide me on how to make the two communicate? or guide me to some resource?</p>","","PrincessP","213269","","2011-01-19 14:50:51","2013-03-03 06:45:56","Bluetooth programming on Android","<android><bluetooth><communication>","3","0","2","",""
"4736482","1","4736549","","2011-01-19 14:39:17","1","870","<p>Should I just mute the volume onResume and set the volume level back onPause with AudioManager?</p><p>Or is there another proper way to do this?</p><p>Thanks!</p>","428022","","","","","2011-01-19 14:44:17","How to mute the sound of pressing volume keys only in my app on Android?","<android><audio><key><volume><mute>","1","2","2","",""
"4736498","1","7474541","","2011-01-19 14:40:26","2","885","<p>The closest thing I could find related to this was the following:</p><p><a href=""http://stackoverflow.com/questions/1773717/android-maps-how-to-determine-map-center-after-a-drag-has-been-completed"">android maps: how to determine map center after a drag has been completed</a></p><p>I want to determine the final ""resting place"" of the center of the map after the user has ""flung"" it.  I am intercepting the touch event, when the user is lifting their finger up, but this doesn't work when the map is flung with a swipe motion, as the map continues to move at that point.  Is there a callback that can be implemented when the map animation is complete?  I looked at the documentation for the MapView, Overlay, MapController etc classes and I haven't seen anything that seems to help.</p>","581574","","","","","2011-09-19 17:04:05","Android MapView, finding center of map, determining end of animation from fling gesture","<android>","1","0","1","",""
"4736523","1","4736569","","2011-01-19 14:42:05","4","29323","<p>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=""de.androidbuch.rechner""  android:versionCode=""1""  android:versionName=""1.0""&gt;  &lt;uses-sdk android:minSdkVersion=""7""&gt;&lt;/uses-sdk&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""android:theme=""@android:style/Theme.Light""&gt;    &lt;activity android:name="".FormularActivity""        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>     </p><p>is my <code>AndroidManifest.xml</code> and in lines 8 &amp; 11 I get the error:</p><blockquote>  <p>no resource found that matches the  given name(at ""label"" with value  ""@string/app_name"")</p>    <p>no resource found that matches the  given name(at ""label"" with value  ""@string/app_name"")</p></blockquote><p>This is really strange and I did not move the values Folder anywhere.</p>","581361","","321731","","2014-02-14 08:51:39","2014-02-14 08:51:39","no resource found that matches the given name","<android><resources><manifest>","3","0","","",""
"4736535","1","","","2011-01-19 14:43:04","1","291","<p>I want to generate the following layout(s):</p><p>In the first step, there are two layouts, layout 1 and layout 2, layout 1 and layout 2 have  50%-width/height of the display.</p><p>If i click on Layout 1, this layout should overlay the layout 2 with a small animation and at the place of layout 1 a sublayout should be shown. The sublayout is a gridview 2x2.</p><p>Has anyone a solution how to setup the layout?</p><p>I have tried the following way:</p><ul><li>I have used a LinearLayout for the left and the right layout, that means i have two container</li><li>One Layout has two possible sublayouts. If i start, the sublayout 1 is shown. If i click on the layout, the sublayout2 is shown. In this case, i set the size of the sublayout1 to 0,0 and now it no longer hides the sublayout2. This works.</li><li>Now i want to translate the sublayout1 to hide the other conatiner. I have made a small translation, but the sublayout1 does for example not overlay the other container. At this point i have asked me, if i have used the right approach to solve the whole problem.</li></ul><p>fesp</p>","566994","","566994","","2011-01-19 15:16:10","2011-01-19 15:16:10","Translate an androidlayout to another position","<android><android-layout>","0","1","","",""
"4736775","1","4736848","","2011-01-19 15:01:34","0","720","<p>I have 40KB HTML page and I want to find certain patterns in it.</p><p>I can read it by 1K buffer but I want to avoid situation that pattern that I'm searching would be split between two buffer reads.</p><p>How to overcome this problem?</p>","296427","","","","","2011-01-19 15:57:33","Find patterns in long string?","<java><android><html><string>","4","0","","",""
"4736902","1","","","2011-01-19 15:12:08","2","448","<p>Why an Android may delete data saved under Media.EXTERNAL_CONTENT_URI after unmount/mount SD card action? How to avoid this?</p><p>I save ringtones using this URI and the default content resolver from context.</p><p>The code is similar to that:</p><pre><code>ContentValues values = new ContentValues();values.put(Media.DATA, AudikoFileStorageAccessor.getInstance().getAbsolutePathForRingtone(ringtone.getId()));values.put(Media.TITLE, ringtone.mSong);values.put(Media.DISPLAY_NAME, ringtone.mSong);values.put(Media.ARTIST, ringtone.mArtist);values.put(Media.MIME_TYPE, ""audio/mpeg"");values.put(Media.SIZE, ringtone.mSize * 1024);values.put(Media.IS_RINGTONE, (RingtoneManager.TYPE_RINGTONE == type || type == 0));values.put(Media.IS_NOTIFICATION, (RingtoneManager.TYPE_NOTIFICATION == type));values.put(Media.IS_ALARM, (RingtoneManager.TYPE_ALARM == type));values.put(Media.IS_MUSIC, false);Uri newUri = mContext.getContentResolver().insert(                Media.getContentUriForPath(AudikoFileStorageAccessor.getInstance().getAbsolutePathForRingtone(                        ringtone.getId())), values); RingtoneManager.setActualDefaultRingtoneUri(mContext, type, newUri);</code></pre><p>Everything works fine, but after I unmount SD card and then mount it again this ringtone doesn't exist anymore and couldn't be found within this table.</p><p>Should I handle UNMOUNT event and backup somehow my saved data and restore it as soon as SD card is available again?</p>","385302","","","","","2011-01-19 15:52:42","Why an Android may delete data saved under Media.EXTERNAL_CONTENT_URI?","<java><android>","1","0","1","",""
"4736912","1","","","2011-01-19 15:13:17","5","2054","<p>I need the browser to start my app whenever I enter the ""myapp://blah.com/a?b=1&amp;c=2"" in the browser. I have searched a lot on this topic, but non of the answers really helped me. Could you please help to understand what I'm missing?</p><pre><code>&lt;activity android:name="".MyAppMain""              android:label=""@string/app_name""              android:configChanges=""keyboardHidden|orientation""               android:screenOrientation=""portrait""&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;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"" /&gt;         &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>After installation from Eclipse (Run As Android application) my app can work ok on its own, but when I type in ""myapp://blah.com/a?b=1&amp;c=2"", the browser is simply googling for this string. Could you point out what else I'm missing? Do I need after installation to somehow register in the system that I want to handle ""myapp://"" urls?</p>","789175","","750987","","2011-06-17 00:04:40","2012-01-23 04:36:27","How to start app from Android browser, when I type in ""myapp://"" in address bar","<android><android-manifest><android-intent>","2","6","2","",""
"4737019","1","","","2011-01-19 15:22:33","5","7832","<p>I'm developing an Android app which uses SSLSocket to connect to a server. This is the code I'm using:</p><pre><code>            // Connect         if (socket == null || socket.isClosed() || !socket.isConnected()) {          if (socket != null &amp;&amp; !socket.isClosed())           socket.close();          Log.i(getClass().toString(), ""Connecting..."");          if (sslContext == null) {           sslContext = SSLContext.getInstance(""TLS"");           sslContext.init(null, trustAllCerts, new SecureRandom());           }          SSLSocketFactory socketFactory = sslContext.getSocketFactory();                socket = (SSLSocket)socketFactory.createSocket(host, port);                socket.setSoTimeout(20000);                socket.setUseClientMode(true);                connected = true;                Log.i(getClass().toString(), ""Connected."");         }         // Secure         if (connected) {          Log.i(getClass().toString(), ""Securing..."");                SSLSession session = socket.getSession();                secured = session.isValid();                if (secured) {                 Log.i(getClass().toString(), ""Secured."");                }                else                 Log.i(getClass().toString(), ""Securing failed."");         }</code></pre><p>The problem is that it takes about 5 seconds or event more to do the TLS handshake in the line below:</p><pre><code>SSLSession session = socket.getSession();</code></pre><p>I have made a similar iPhone app, the handshake takes just 1 second there, so I think the problem is not in the server I'm connecting to, it's maybe in the code above. The connection itself is fast enough, just the TLS handshake is slow.Does anybody know if its normal in Android, or if it is not, how to make it faster?</p><p>Thank you.</p><p>EDITED on 21.01.11:</p><p>I have found out, that the handshake is fast when I connet to another server, for example paypal.com:443.But I had been connecting to another server before - a .NET service written by me. As I had said before, I did not think the problem was in that server because if I connect to it with my iPhone App the handshake is fast. Now I don't know why it is fast on iPhone and slow on Android. After the connection is established, the only thing I do in the .NET server is:</p><pre><code>Console.WriteLine(""New client connected."");            this.sslStream = new SslStream(tcpClient.GetStream(), true);            this.sslStream.ReadTimeout = 15000;            this.sslStream.WriteTimeout = 15000;            Console.WriteLine(""Beginning TLS handshake..."");            this.sslStream.AuthenticateAsServer(connection.ServerCertificate, false, SslProtocols.Tls, false);            Console.WriteLine(""TLS handshake completed."");</code></pre>","580059","","1288","","2011-05-27 12:09:05","2011-12-15 16:53:54","TLS connection using SSLSocket is slow in Android OS","<java><android><sockets><ssl><tls>","4","0","1","",""
"4737036","1","4737077","","2011-01-19 15:23:44","3","321","<p>I am searching for the cheapest Android 1.5 device <strong>suitable for developing on it</strong>. As the emulator is too sluggish for my needs, I want a real device. Can you recommend any source where to get such an old device? I looked at eBay, but do not know which device to search for. Maybe you can recommend a list of Android 1.5 devices still available?</p>","537865","","537865","","2011-01-20 10:50:49","2011-01-20 10:50:49","The cheapest Android 1.5 device","<android>","4","2","","2011-01-19 17:03:01",""
"4737065","1","","","2011-01-19 15:26:11","0","394","<p>I have an EditText that can contain images (emoticons). When I copy this text and paste it elsewhere, I get ""obj"" square instead of the image.</p><p>Is there a way to change what is to be put in clipboard when copying (so that I can change the image object into a string)?</p><p><strong>Edit 1</strong>:I guess I could create my own EditText class and override the method that is used when copying the text. Anyone knows what method should I override? I tried ""getText()"", but it doesn't work...</p><p><strong>Edit 2</strong>:Actually, it worked, but overriding this method changes the text in EditText, so it still isn't usefull...</p>","133648","","133648","","2011-01-21 14:22:37","2012-07-16 05:55:57","EditText: change images to string when copying?","<android><copy-paste><edittext>","3","0","","",""
"4737096","1","4737227","","2011-01-19 15:28:22","2","1389","<p>I've been trying to get this working for some time... Is there any way to put a transparent fixed header on a listview, so it looks kind of like this:</p><p><img src=""http://i.stack.imgur.com/qca9C.jpg"" alt=""Transparent sticky header""></p><p>As you scroll up, the header will eventually be a regular header with item 1 below it.</p><p>I guess I'll have to implement onScrollListener and do something like when the first visible item is item 2 in the list, start moving the listview margins by 1 pixel, until it is below the header? Or are there better ways? Any ideas on how one would do something like that?</p>","397060","","","","","2011-01-19 16:20:10","Attaching a fixed, transparent, header to a ListView?","<android><listview>","2","0","","",""
"4737310","1","","","2011-01-19 15:46:44","0","886","<p>I want write an application which shows an PDF with some other content on it, like Video and image.</p><p>Generically I want shows an pdf with some other View on it.I am concern about PDF, I read some article which explaine how to show an PDF but I want show an PDF with some other stuff.</p><p>Do you recommend me some solution or a right way?</p><p>Thanks a lot.</p>","554892","","","","","2011-01-19 15:52:22","Pdf Reader Android","<android>","1","0","","",""
"4737402","1","4738290","","2011-01-19 15:53:51","0","267","<p>ok i think it's throwing an exception. unfortunately i am not getting an error.it loads on the emulator and my phone but won't perform. it just says, ""The application MyApp (process com.myapp) has stopped unexpectedly. Please try again.""  and then a ForceClose button. :(</p><p>once again here is my code:</p><pre><code>public void onClick(DialogInterface dialog, int id) {    try {        MyActivity.this.setWallpaper(mContext.getDrawingCache());         finish();    } catch (IOException e) {        e.printStackTrace();    }}</code></pre><p>on my own research i saw someone  getting the bit map from getDrawingCache and converting it to a bitmap? but the documentation on view.getDrawingCache says it is already a bitmap, and setWallpaper is supposed to set a bitmap...i am out of ideas here.</p>","580162","","109825","","2011-01-19 15:55:27","2011-01-19 17:05:43","set wallpaper should be this hard :(","<android><exception-handling><wallpaper>","1","7","","",""
"4737423","1","4737521","","2011-01-19 15:55:05","2","200","<p>I am not planning on releasing my app through the market, however I also do not want the user to have to check the unknown sources to be able to install it.  Is there some way of signing it where I can avoid it or another work around?</p>","408079","","","","","2011-01-19 16:19:09","Is there a way to sign my app so the user doesn't have to check unknown sources?","<android><signing>","3","0","1","",""
"4737443","1","4738401","","2011-01-19 15:56:24","0","928","<p>I make arabic virtual keyboard, and I have a problem.</p><p>If you write only arabic characters - all works (written right to left). But the numbers and punctuation marks are written to the right of the previous word. Although should be written to the left of the word. For example:</p><p>You write:</p><p><strong>word_2011</strong> where '<strong>_</strong>' is space</p><p>Must be:</p><p>'<strong>2011_drow</strong>' (look right to left, numbers read left to right)</p><p>but is:</p><p>'<strong>_drow2011</strong>'</p><p>Now more interesting. If you write '<strong>NOW</strong>' you get</p><p>'<strong>_drow201WON1</strong>' (must be '<strong>WON2011_drow</strong>')</p><p>This is Android problem? Or is it possible to solve it?</p>","544533","","","","","2011-01-19 17:14:36","Android. Problem with arabic keyboard","<android><keyboard><arabic>","1","0","","",""
"4737458","1","","","2011-01-19 15:57:22","14","1160","<p>I am trying to get a better understanding of <strong>android audio framework</strong> (froyo onwards in particular).</p><p>I've almost got the distinction into <em>streams</em>. The AudioFlinger maps each stream into a ""strategy"" and then routes a strategy to the proper ""device"" (BT, Headset, Speaker..)</p><p>However I still struggle to understand:1) How multiple apps play onto the same stream? can they just 'play' or do they have to handle the focus (request, abandon and listen for changes)? </p><p>2) When multiple streams are playing...what is the priority of one stream respect to another? surely the <em>in-call</em> stream has top priority but are there any ""rules"" to understand how things really work.</p><p>If anyone with more confidence on this matter has got any doc/resource to study.. it would be great.</p><p>Thanks!Marco</p>","491125","","","","","2012-04-11 14:09:23","Audio Framework: stream, strategies, devices","<android><audio>","1","0","","",""
"4737582","1","4737625","","2011-01-19 16:06:26","3","4074","<p>i'm new in Android developing. <br>I've to start a new Activity. Commonly, i would write the following code:<br></p><pre><code>Intent i = new Intent(Activity1.this, Activity2.class);Activity1.this.startActivity(i);</code></pre><p>but now i need to start a new activity from an instance of that activity (because i don't want to start a generic activity of that type, i need to call his constructor to define his attributes). Something like this:<br></p><pre><code>Activity2 instance = new Activity2(parameters);Intent i = new Intent(Activity1.this, instance);Activity1.this.startActivity(i);</code></pre><p>Is it possible?</p>","555336","","","","","2011-11-08 12:14:36","Android - How To Start New Activity From an Instance","<android><activity><android-intent><instance>","1","1","","",""
"4737599","1","4739223","","2011-01-19 16:08:19","0","519","<p>I have the below image (the white bubble in the image) to draw in a canvas. When I draw the image using the code.., the image 's edge is getting black circle and rounded .. the edge's alpha is 0x00.</p><p>image.setBounds(left, top, right, bottom);</p><p>image.draw(canvas);</p><p>Expected <img src=""http://i.stack.imgur.com/GEBRo.png"" alt=""alt text"">    When I draw  <img src=""http://i.stack.imgur.com/edIld.png"" alt=""alt text""></p><p>How could I remove the black circle??? Is the image wrong?? or Anyone know the clue, Please give me a clue.. Thanks in advance..</p><p>^^ </p>","417294","","417294","","2011-01-19 16:26:24","2011-01-20 07:47:33","Drawing translucency drawable in Android, but black edge","<android><canvas><alpha><drawable>","1","0","0","",""
"4737807","1","","","2011-01-19 16:23:15","0","1603","<p>I have 3 AVD's set up, each for a different API level.  I want to make 3 corresponding run configurations for my project so I can easily test under each API level.  When I go to the target tab of the Run Configuration manager, I only see one of the available AVD's.  I can set it up as a Manual target selection and when I run it I can select from among the three AVD's, but I'd like to just set up 3 different Run Configurations.  Any idea what I might be doing wrong?</p>","581746","","","","","2011-01-19 19:46:59","Missing AVD's in Target tab of Run Configuration","<android><configuration><avd>","2","0","","",""
"4737906","1","","","2011-01-19 16:31:36","0","1453","<p>i'm just starting to use the ndk-r5 and i need to import a library thatuses std::numeric_limits, std::sort and a couple of more functions from stl.</p><p>i'm not sure is those functions are supported using the stlport and if that is the case, whatconfiguration should i use for building?what i read from the docs is that you have to include APP_STL := stlport_static on the Application.mk. thats the only additional thing i'm doing but its not working, i get compilation errors when the compiler is on the mentioned functions.</p><p>Thanks for any suggestions.</p>","369372","","","","","2011-03-25 02:18:13","Android ndk-r5 calling std:: functions","<c++><android><stl><box2d><android-ndk>","3","1","","",""
"4738157","1","4738716","","2011-01-19 16:54:51","1","1280","<p>I am trying to transfer images quickly between my Android phone and my PC over wifi. I have written code to do this but it can 4-5 seconds to transfer one 640x480px image across. I am wondering is my method flawed and is there a faster way to do this?</p><p>Here is the Server code</p><pre><code>void main(String[] args){        try {             ServerSocket serverSocket = new ServerSocket(5555);             Socket clientSocket = serverSocket.accept();             long startTime = System.currentTimeMillis();             InputStream clientInputStream = clientSocket.getInputStream();             BufferedImage BI = ImageIO.read(clientInputStream);             long endTime = System.currentTimeMillis();             ImageIO.write(BI,""png"",new File(""test.png""));             System.out.println((endTime - startTime) + "" ms."");             } catch (IOException e)              {                e.printStackTrace();             }     }}</code></pre><p>Here is the Android client code</p><pre><code>public void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Bitmap imageToSend = BitmapFactory.decodeResource(this.getResources(),R.drawable.img);    try     {        Socket socket = new Socket(""192.168.1.1"",5555);                 imageToSend.compress(CompressFormat.PNG,0 , socket.getOutputStream());              }            catch (Exception e) {        e.printStackTrace();    }}</code></pre><p>Thank you for any help you can give.</p>","581794","","","","","2011-01-19 17:43:13","Android: Looking for a way to speed up Image Transfer from Android to PC over wifi","<android><image><sockets><networking>","1","0","","",""
"4738243","1","4738284","","2011-01-19 17:01:49","2","129","<p>I have to find out if a method return type is a subclass of a certain base class. So far I can find no built in way to do this, I can only find a way to test for an exact class match. I can also do this using annotations, but the idea is that I don't want to have to add extra code if I happen to add a new subclass. I thought of testing against all possible subclasses, or creating an untyped object and testing the instance of it using ""instanceof"", but nothing seems ideal. Ideally:</p><pre><code>if (m.getReturnType() Extends Superclass.class)</code></pre><p>but there is no ""extends"" with functionality similar to ""instanceof"" with actual instances. Is there a conditional operator that I don't know about? Thank you in advance for any ideas.</p><p>This is actually for an android project, so I might not be able to implement all possibilities.</p>","415422","","","","","2011-01-19 17:27:16","test for subclass with getType in conditional in java","<java><android><conditional>","1","0","","",""
"4738249","1","4738632","","2011-01-19 17:02:12","2","1442","<p>I have a customer preference widget (xml) which basically contains a TextView and next to that a right aligned ImageButton.</p><p>What I am trying to do is set the image for my image button to whatever is used as default by the preferences system.  For example see the attached image where I've highlighted the type of image I want to use.</p><p>I've tried looking online and saving the ic_btn_round image into my drawables and using that, but it just doesn't look right.</p><p>Any advice welcome, thank you</p><p><img src=""http://i.stack.imgur.com/lrQ1e.jpg"" alt=""alt text""></p>","333276","","","","","2011-01-19 17:44:58","How to reference the system select button image for custom preference in Android","<android><android-widget>","1","0","1","",""
"4738294","1","4739048","","2011-01-19 17:05:55","4","5816","<p>The following applies to the Android operating system.</p><p>I am trying to estimate how dark (or light) it is in the room where the phone is located using the camera.</p><p>The idea is that the camera can return a certain brightness level, which I can use to determine the amount of light in the surroundings of the phone.</p><p>My question is simple: how do I use the camera (either the front of back camera) to get this amount of brightness (the ""amount of light"")?</p><p>Thanks in advance.</p>","45974","","","","","2011-06-18 05:10:11","Android: detect brightness (amount of light) in phone's surroundings using the camera?","<java><android><camera><brightness>","5","2","3","",""
"4738309","1","4738327","","2011-01-19 17:06:57","2","10712","<p>I want to change the style of a button dynamically, i.e. in Java code, something like:</p><pre><code>((Button)findViewById(id)).setStyle(""@styles/foo"")&lt;resources&gt;    &lt;style name=""foo""&gt;        &lt;item name=""android:adjustViewBounds""&gt;true&lt;/item&gt;        &lt;item name=""android:maxHeight""&gt;100px&lt;/item&gt;        &lt;item name=""android:maxWidth""&gt;200px&lt;/item&gt;    &lt;/style&gt;&lt;/resources&gt;</code></pre><p>I have not seen nothing like setStyle, so:</p><p>do I have to change every single property or I can change the whole style?</p>","248183","","223391","","2011-01-19 17:09:16","2013-12-27 01:36:56","How can I change a button style dynamically in Android?","<android><button><coding-style>","3","0","","",""
"4738450","1","","","2011-01-19 17:20:24","0","34","<p>i have this exception i did not see any real answer to that on the web:</p><p>""Could not initialize class com.ibm.icu.impl.Java TimeZone eclipse""</p><p>thank you for your help</p>","581828","","","","","2011-01-19 17:20:24","android eclpise Exception","<android>","0","2","","",""
"4738792","1","","","2011-01-19 17:53:08","0","671","<p>Hi all I have looked at the tutorial for creating tab layout on android on here:<a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">link</a></p><p>which didn't work so I looked on here to find that there where errors with it. So I applied these and still I'm not getting anywhere with it.The app loads on 2.1 emulator on eclipse and also on my phone but the application force closes each time which leads me to think that  its a manifest problem. Here is my 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.Android.fitnessap""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".TabLayout""                  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""/&gt;    &lt;activity android:name="".HistoryActivity""/&gt;    &lt;activity android:name="".SettingsActivity""/&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt;</code></pre><p>I've been stuck on this for hours now.Thanks.</p><p>edit logcat:</p><pre><code>01-19 18:37:09.316: ERROR/AndroidRuntime(126): ERROR: thread attach failed01-19 18:37:10.945: ERROR/MediaPlayerService(31): Couldn't open fd for content://settings/system/notification_sound01-19 18:37:10.955: ERROR/MediaPlayer(52): Unable to to create media player01-19 18:37:15.345: ERROR/AndroidRuntime(170): ERROR: thread attach failed01-19 18:37:17.215: ERROR/AndroidRuntime(197): Uncaught handler: thread main exiting due to uncaught exception01-19 18:37:17.315: ERROR/AndroidRuntime(197): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.Android.fitnessap/com.Android.fitnessap.TabLayout}: java.lang.ClassNotFoundException: com.Android.fitnessap.TabLayout in loader dalvik.system.PathClassLoader@43b868e001-19 18:37:17.315: ERROR/AndroidRuntime(197):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)01-19 18:37:17.315: ERROR/AndroidRuntime(197):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)01-19 18:37:17.315: ERROR/AndroidRuntime(197):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)01-19 18:37:17.315: ERROR/AndroidRuntime(197):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)01-19 18:37:17.315: ERROR/AndroidRuntime(197):     at android.os.Handler.dispatchMessage(Handler.java:99)01-19 18:37:17.315: ERROR/AndroidRuntime(197):     at android.os.Looper.loop(Looper.java:123)01-19 18:37:17.315: ERROR/AndroidRuntime(197):     at android.app.ActivityThread.main(ActivityThread.java:4363)01-19 18:37:17.315: ERROR/AndroidRuntime(197):     at java.lang.reflect.Method.invokeNative(Native Method)01-19 18:37:17.315: ERROR/AndroidRuntime(197):     at java.lang.reflect.Method.invoke(Method.java:521)01-19 18:37:17.315: ERROR/AndroidRuntime(197):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)01-19 18:37:17.315: ERROR/AndroidRuntime(197):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)01-19 18:37:17.315: ERROR/AndroidRuntime(197):     at dalvik.system.NativeStart.main(Native Method)01-19 18:37:17.315: ERROR/AndroidRuntime(197): Caused by: java.lang.ClassNotFoundException: com.Android.fitnessap.TabLayout in loader dalvik.system.PathClassLoader@43b868e001-19 18:37:17.315: ERROR/AndroidRuntime(197):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)01-19 18:37:17.315: ERROR/AndroidRuntime(197):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)01-19 18:37:17.315: ERROR/AndroidRuntime(197):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)01-19 18:37:17.315: ERROR/AndroidRuntime(197):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)01-19 18:37:17.315: ERROR/AndroidRuntime(197):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)01-19 18:37:17.315: ERROR/AndroidRuntime(197):     ... 11 more01-19 18:37:17.375: ERROR/dalvikvm(197): Unable to open stack trace file '/data/anr/traces.txt': Permission denied</code></pre>","581863","","581863","","2011-01-19 18:43:02","2011-01-19 18:43:02","Android Tab Layout 2.1","<android><xml>","1","2","","",""
"4738830","1","","","2011-01-19 17:56:26","3","1139","<p>I have a Periodic table of elements app for android that stores most of it's data in string arrays.  I am now trying to use an sqlite database instead of the arrays but am having a small problem.  If I type 'android:text=""&amp;#185;""' directly into a TextView it will display a superscript 1(like this-> &#185;), but if I store '&amp;#185;' as text in a sqlite database and then use a cursor to populate that same TextView, instead of the superscript 1 being displayed I just see ""&amp;#185;"" exactly as I typed it.  How can I get the TextView to display special characters when being populated by a sqlite database?  I have been struggling for a while and am stumped so any suggestions would be appreciated.  Thanks!</p>","581843","","","","","2011-01-19 19:10:14","displaying special characters in android app from sqlite database","<android><sqlite><cursor><textview>","1","0","1","",""
"4738867","1","","","2011-01-19 17:59:52","5","2117","<p>Can anyone help or has had the same problem with webviews and Galaxy S:</p><p>Opening a simple webpage (html, css, images) in a webview takes very, very long (40-50 seconds). Opening the same webpage within the browser take a tenth of a second. </p><p>The same app with the same webview and webpage on the same wlan works perfectly on any other given device - even on the Galaxy Tab it works great.</p><p>Just on the Galaxy S the webview takes ages to load the webpage. We have no idea what's going on here and we would appreciate any help.</p><p>Thanks a lot ...</p>","581882","","","","","2011-02-09 11:39:11","Webview behaviour with Galaxy S loading webpage takes ages","<android><performance><webview><galaxy>","2","4","1","",""
"4738881","1","","","2011-01-19 18:01:26","4","934","<p>So I have read the LVL docs backward and forward, and have it working with my app. I have seen the questions about the response being cached. But it still leaves me wondering, based on some of the wording in the LVL docs, does Google want us to call the license checker every time the app is initialized? Is that the safest way to implement this? Using the ServerManagedPolicy like Google suggests, do we just call the license check, and either run our app or do whatever we choose if they fail? One of my small concerns is the use of network data. They drill into us the need to be cautious of using resources without informing the user, and it seems to me this is a use of network data without letting the user know.</p><p>To add to this, is anyone experiencing any type of delay to their app due to this code? Due to the nature of my app, opening it and then waiting every time for an ok to come through the network would definitely distract from its use. Should I cache the response myself, or am I way over thinking this?</p>","581854","","581854","","2011-01-19 18:17:32","2013-02-21 18:35:02","Android: Should I call the LicenseChecker every time the app is opened?","<android><android-lvl>","4","0","3","",""
"4738907","1","4748393","","2011-01-19 18:03:27","0","88","<p>For whatever reason the following layout places the arrow in the top left of the screen and I would like it centered horizontally and at the top</p><p></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;RelativeLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_gravity=""center_horizontal""          &gt;             &lt;com.google.android.maps.MapView                android:id=""@+id/map2""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:apiKey=""0bjRuqXOuK5dP5guXo0LV5aUbn_s-aYzsmeuawA""                android:clickable=""true""           /&gt;            &lt;edu.elon.ecs.GreenArrow                android:id=""@+id/greenarrow""                android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                 android:gravity=""center""                                android:src=""@drawable/greenarrow""            /&gt;        &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt;</code></pre>","180825","","180825","","2011-01-20 14:34:05","2011-01-20 14:37:46","I need an Arrow to be at the Top Center of my Android Screen","<android>","1","3","","",""
"4738925","1","4739565","","2011-01-19 18:05:20","1","2308","<p>When using a database for an Android application, is it possible to use a MySQL database, or do you have to use SQLite?</p><p>What I'm trying to do is make an app that allows users to see events on a map. These events are updated by admin staff from the office from a Java-based application that works with the MySQL database.</p>","229616","","496830","","2011-11-08 13:59:26","2011-11-08 13:59:26","Can I use MySQL with Android or do I have to use SQLite?","<android>","6","1","","",""
"4739088","1","","","2011-01-19 18:20:14","0","210","<p>Works fine on my Droid X and Droid, both running 2.2.1.  I've tried it on several friends' phones including a Galaxy S on 2.2.0 and it simply crashes when trying to load the xml.  I've tried doing the http request with both an AsyncTask and with a Handler.  Both result in crashes.  The application can be found in the market by searching for ""truxmap""   This has been driving me insane -- does anyone have any idea why this may be happening?</p><pre><code>java.lang.RuntimeException: java.lang.NullPointerExceptionat com.truxmap.Map$GrabAndParse.onPostExecute(Map.java:432)at com.truxmap.Map$GrabAndParse.onPostExecute(Map.java:1)at android.os.AsyncTask.finish(AsyncTask.java:417)at android.os.AsyncTask.access$300(AsyncTask.java:127)at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:143)at android.app.ActivityThread.main(ActivityThread.java:4701)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.NullPointerExceptionat com.truxmap.Map$GrabAndParse.onPostExecute(Map.java:334)... 12 more</code></pre>","216363","","118587","","2011-01-19 19:42:31","2011-01-19 19:42:31","Android App crashes when attempting to parse Xml with any OS version under 2.2.1","<android><xml><android-emulator><android-sdk-2.1>","0","7","","",""
"4739125","1","4739215","","2011-01-19 18:24:57","1","1180","<p>I can't figure out what it is going on here...after hours...</p><p>This is the activity in question (that I have made super-easy in order to narrow down the problem):</p><pre><code>public class UserAuthenticationActivity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        Log.e(""MYAPP"", ""step1"");        super.onCreate(savedInstanceState);         setContentView(R.layout.user_authentication);        Log.e(""MYAPP"", ""step2"");    }    @Override        public void onStart()    {        super.onStart();    }}</code></pre><p>And this is layout/user_authentication:</p><pre><code>&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""    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:scrollbars=""vertical""            android:padding=""15sp""        &gt;      &lt;TextView          android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:text=""hello!""        android:paddingTop=""15sp""          android:paddingBottom=""5sp""            android:textSize=""15sp""                /&gt;        &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>I get the error screen when I launch the application. The log doesn't show my debug messages but just this exception:</p><pre><code>I/ActivityManager( 1032): Starting activity: Intent { comp={com.myapp.android.app/com.myapp.android.app.activity.UserAuthenticationActivity} }D/Database( 1990): hook db is called for:/data/data/com.myapp.android.app/databases/myappDatabase.dbD/Database( 1990): hook not enabled for /data/data/com.myapp.android.app/databases/myappDatabase.dbE/QC-DSS-LIB(  981): unrecognized ifindex 6W/dalvikvm( 1990): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)E/AndroidRuntime( 1990): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime( 1990): java.lang.NullPointerExceptionE/AndroidRuntime( 1990):    at android.widget.ListView.measureScrapChild(ListView.java:1039)E/AndroidRuntime( 1990):    at android.widget.ListView.measureHeightOfChildren(ListView.java:1120)E/AndroidRuntime( 1990):    at android.widget.ListView.onMeasure(ListView.java:1031)E/AndroidRuntime( 1990):    at android.view.View.measure(View.java:7236)E/AndroidRuntime( 1990):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2875)E/AndroidRuntime( 1990):    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888)E/AndroidRuntime( 1990):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:350)E/AndroidRuntime( 1990):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)E/AndroidRuntime( 1990):    at android.view.View.measure(View.java:7236)E/AndroidRuntime( 1990):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2875)E/AndroidRuntime( 1990):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)E/AndroidRuntime( 1990):    at android.view.View.measure(View.java:7236)E/AndroidRuntime( 1990):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)E/AndroidRuntime( 1990):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)E/AndroidRuntime( 1990):    at android.view.View.measure(View.java:7236)E/AndroidRuntime( 1990):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2875)E/AndroidRuntime( 1990):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)E/AndroidRuntime( 1990):    at android.view.View.measure(View.java:7236)E/AndroidRuntime( 1990):    at android.view.ViewRoot.performTraversals(ViewRoot.java:698)E/AndroidRuntime( 1990):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1482)E/AndroidRuntime( 1990):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime( 1990):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 1990):    at android.app.ActivityThread.main(ActivityThread.java:3948)E/AndroidRuntime( 1990):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 1990):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 1990):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)E/AndroidRuntime( 1990):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)E/AndroidRuntime( 1990):    at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I hope somebody can help me. I don't have any clue.</p><p>Thanks,<br>Dan</p>","354742","","354742","","2011-01-19 18:43:30","2011-01-19 19:16:55","Android - Extra-weird uncaught exception on a basic activity","<android>","1","5","0","",""
"4739159","1","4772650","","2011-01-19 18:29:20","5","1716","<p>I was wondering is it possible to extend the Android Contacts database?</p><p>From here - <a href=""http://d.android.com/reference/android/provider/ContactsContract.html"" rel=""nofollow"">http://d.android.com/reference/android/provider/ContactsContract.html</a></p><p>It says:</p><blockquote>  <p>ContactsContract defines an extensible  database of contact-related  information</p></blockquote><p>Extensible would suggest to me that I can add in more data to the contacts application outside the normal values such as Name, number, email, work number, home number etc..</p><p>However the examples of this page - <a href=""http://d.android.com/reference/android/provider/ContactsContract.RawContacts.html"" rel=""nofollow"">http://d.android.com/reference/android/provider/ContactsContract.RawContacts.html</a> only show how to insert the standard values like name and not how to add a new field to a contact.</p><p>Furthermore a search on the web does not turn up much information on extending the contacts data. </p><p>So I was wondering is it even possible or does the extensible refer to some other part of the contacts?</p><p>For example I would like to add in an additional field for contacts that have special privileges within my app so when a user looks at the contacts he or she knows what users they can use my app with.</p><p>Is this possible?</p>","243999","","","","","2012-07-24 21:40:13","Can I extend Androids Contacts database?","<android><contacts><android-contentprovider><extensible>","1","0","4","",""
"4739181","1","","","2011-01-19 18:31:57","1","558","<p>I write an activity for a gallery. I have ImageView elements in GridView and I see a green border on ImageView when I focus on a given element. How can I change this default color of the border? Is it possible? I don't see any method which enables it.</p><p>Any advice will be appreciated.</p>","581920","","581920","","2011-01-21 10:19:01","2011-01-21 10:19:01","Color of border on ImageView","<android><gridview><imageview>","1","0","","",""
"4739222","1","4739350","","2011-01-19 18:37:01","0","1718","<p>I currently have an app which, when a button is pressed, and after a certain period of time, a statusbar notification is set.</p><p>Everything works fine apart from the fact if the user does not have the application open, when the notification appears, the app also reopens. This is not what i would like to happen. I would like the notification to appear on it's own (wherever the user is).</p><p><strong>On my button press i use:</strong></p><pre><code>    // get a Calendar object with current timeCalendar cal = Calendar.getInstance();// add minutes to the calendar objectcal.add(Calendar.SECOND, time);Intent alarmintent = new Intent(getApplicationContext(), AlarmReceiver.class);alarmintent.putExtras(bundle);// In reality, you would want to have a static variable for the request code instead of 192837PendingIntent sender = PendingIntent.getBroadcast(getApplicationContext(), HELLO_ID, alarmintent, 0);// Get the AlarmManager serviceAlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender);</code></pre><p><strong>This calls my AlarmReceiver.class, which uses this code to call my notification class:</strong></p><pre><code>        Intent myIntent = new Intent(context, Note.class);    myIntent.putExtras(bundle2);     myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TOP);    context.startActivity(myIntent);</code></pre><p><strong>notification.class:</strong></p><pre><code>public class Note extends Activity {    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        String ns = Context.NOTIFICATION_SERVICE;        final NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);        int icon = R.drawable.launcher;        CharSequence tickerText = ""Remind Me!"";        long when = System.currentTimeMillis();        final Notification notification = new Notification(icon, tickerText, when);    notification.flags |= Notification.FLAG_AUTO_CANCEL | Notification.FLAG_NO_CLEAR;    final Context context = getApplicationContext();    CharSequence contentTitle = ""Remind Me!"";    CharSequence contentText = param1;    Intent notificationIntent = new Intent(context, Completed.class);    PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);    notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);            mNotificationManager.notify(HELLO_ID, notification);            HELLO_ID++;         }}</code></pre>","574940","","","","","2011-01-19 18:48:39","AlarmManager starting application instead of just sending notification","<android><notifications><android-intent><alarmmanager>","1","0","2","",""
"4739326","1","","","2011-01-19 18:46:30","0","404","<p>First-time poster here - thanks in advance for your help.</p><p>I'm spec'ing a proprietary, single-purpose Android app for use with a corporation, and some interesting functional requirements have come up.  Each user will have a phone that is dedicated to this app, to be used only during work hours, with restrictions and filtering established for some of the basic phone features.  (FWIW, I'm relatively new to Android, but I'm an experienced C++ and C# developer, and I also have some Java experience.)  The app will likely have the following requirements, and I need to get a handle on level-of-difficulty, or if they're even possible.  #1 and #2 below are high priority, and the rest are lower priority.</p><p>1) app and/or phone needs to be configurable such that only specific websites may be accessed in a browser, with access to all others being blocked2) a special case of #1 would be to disable access to Android Market, so that no additional apps can be installed3) app and/or phone configured to restrict texting to only incoming texting (no outgoing)4) app and/or phone configured to restrict outgoing and incoming phone calls to a specified set of phone numbers, all others blocked</p><p>Granted - it does seem like an odd set of requirements.  The client essentially wants complete control of each phone to limit it to very specific work-related uses.  I've read a lot of related posts here but I'm not sure if I understand things well enough.  </p><p>Thanks in advance for your help.</p>","567004","","567004","","2011-01-19 19:29:50","2011-01-19 19:29:50","Filtering/Restricting Android Calls, Texting, and URL Access","<android><filtering><blocking>","0","4","1","",""
"4739349","1","4739420","","2011-01-19 18:48:39","0","483","<p>i have a MyDBAdapter class, that can do selects, but i also need to do DELETE FROM user Where emal=""given value by variable Sring""</p><p>i dont know how to do deletes on MyDBAdapter with android, im very newbie with this, can someone complete my class adding that function to delete users by email please?</p><p>this is my class:</p><pre><code>public class MyDbAdapter {private static final String TAG = ""NotesDbAdapter"";private DatabaseHelper mDbHelper;private SQLiteDatabase mDb;private static final String DATABASE_NAME = ""gpslocdb"";private static final String PERMISSION_TABLE_CREATE = ""CREATE TABLE permission ( fk_email1 varchar, fk_email2 varchar, validated tinyint, hour1 time default '08:00:00', hour2 time default '20:00:00', date1 date, date2 date, weekend tinyint default '0', fk_type varchar, PRIMARY KEY  (fk_email1,fk_email2))"";private static final String USER_TABLE_CREATE = ""CREATE TABLE user ( email varchar, password varchar, fullName varchar, mobilePhone varchar, mobileOperatingSystem varchar, PRIMARY KEY  (email))"";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(""DROP TABLE IF EXISTS user"");        db.execSQL(""DROP TABLE IF EXISTS permission"");        db.execSQL(PERMISSION_TABLE_CREATE);        db.execSQL(USER_TABLE_CREATE);    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        //db.execSQL(""DROP TABLE IF EXISTS user"");        //db.execSQL(""DROP TABLE IF EXISTS permission"");        //onCreate(db);    }</code></pre><p>@Override  public void onOpen(SQLiteDatabase db) {   super.onOpen(db);            //onCreate(db);  }  public void clearDb(SQLiteDatabase db){   db.execSQL(""DROP TABLE IF EXISTS user"");            db.execSQL(""DROP TABLE IF EXISTS permission"");            onCreate(db);  }</p><pre><code>}/** * Constructor - takes the context to allow the database to be * opened/created *  * @param ctx the Context within which to work */public MyDbAdapter(Context ctx) {    this.mCtx = ctx;}/** * Open the 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 MyDbAdapter open() throws SQLException {    mDbHelper = new DatabaseHelper(mCtx);    mDb = mDbHelper.getWritableDatabase();    return this;}public void close() { //clearDB();    mDbHelper.close();}public long createUser(String email, String password, String fullName, String mobilePhone, String mobileOperatingSystem) {    ContentValues initialValues = new ContentValues();    initialValues.put(""email"",email);    initialValues.put(""password"",password);    initialValues.put(""fullName"",fullName);    initialValues.put(""mobilePhone"",mobilePhone);    initialValues.put(""mobileOperatingSystem"",mobileOperatingSystem);    return mDb.insert(""user"", null, initialValues);}public long createPermission(String email1, String email2, String validated, String hour1, String hour2,</code></pre><p>String date1, String date2, String weekend, String fk_type)     {        ContentValues initialValues = new ContentValues();        initialValues.put(""fk_email1"",email1);        initialValues.put(""fk_email2"",email2);        initialValues.put(""validated"",validated);        initialValues.put(""hour1"",hour1);        initialValues.put(""hour2"",hour2);        initialValues.put(""date1"",date1);        initialValues.put(""date2"",date2);        initialValues.put(""weekend"",weekend);        initialValues.put(""fk_type"",fk_type);        return mDb.insert(""permission"", null, initialValues);    }</p><pre><code>public void clearDB() { mDbHelper.clearDb(mDb);        }public Cursor fetchAllUsers() {    return mDb.query(""user"", new String[] {""email"", ""password"", ""fullName"", ""mobilePhone"", ""mobileOperatingSystem""}, null, null, null, null, null);}public Cursor fetchAllPermissions() {    return mDb.query(""permission"", new String[] {""fk_email1"", ""fk_email2"", ""validated"", ""hour1"", ""hour2"", ""date1"", ""date2"", ""weekend"", ""fk_type""}, null, null, null, null, null);}public Cursor fetchUser(String email) throws SQLException {    Cursor mCursor = mDb.query(true, ""user"", new String[] {""email"", ""password"", ""fullName"", ""mobilePhone"", ""mobileOperatingSystem""}        , ""email"" + ""="" + email, null, null, null, null, null);    if (mCursor != null) {        mCursor.moveToFirst();    }    return mCursor;}public void deleteUser(String email) throws SQLException{ Delete From permission Where fk_email1='pablo@upv.es' and fk_email2='fanny@test.es'}public List&lt;Friend&gt; retrieveAllFriends() { List &lt;Friend&gt; friends=new ArrayList&lt;Friend&gt;(); Cursor result=fetchAllUsers(); if( result.moveToFirst() ){        do{            friends.add(new Friend(result.getString(result.getColumnIndexOrThrow(""email"")),result.getString(result.getColumnIndexOrThrow(""password"")), result.getString(result.getColumnIndexOrThrow(""fullName"")),result.getString(result.getColumnIndexOrThrow(""mobilePhone"")),result.getString(result.getColumnIndexOrThrow(""mobileOperatingSystem""))));        }while( result.moveToNext() );    } return friends;}public List&lt;Permission&gt; retrieveAllPermissions() { List &lt;Permission&gt; permissions=new ArrayList&lt;Permission&gt;(); Cursor result=fetchAllPermissions(); if( result.moveToFirst() ){        do{         permissions.add(new Permission(result.getString(result.getColumnIndexOrThrow(""fk_email1"")),           result.getString(result.getColumnIndexOrThrow(""fk_email2"")),            Integer.parseInt(result.getString(result.getColumnIndexOrThrow(""validated""))),           result.getString(result.getColumnIndexOrThrow(""hour1"")),           result.getString(result.getColumnIndexOrThrow(""hour2"")),           result.getString(result.getColumnIndexOrThrow(""date1"")),           result.getString(result.getColumnIndexOrThrow(""date2"")),           Integer.parseInt(result.getString(result.getColumnIndexOrThrow(""weekend""))),           result.getString(result.getColumnIndexOrThrow(""fk_type""))));        }while( result.moveToNext() );    } return permissions;}</code></pre><p>}</p>","479886","","","","","2011-01-19 18:59:37","How can i do delete querys with MyDbAdapter on Android?","<android><sql><sqlite>","2","0","","",""
"4739374","1","4739401","","2011-01-19 18:52:06","23","40878","<p>A simple question, relating to the default 'home' directory when an app writes to the internal memory.  By default, any files created are placed by the OS (2.2) in:</p><p>/data/data/your.package/files</p><p>When reading in files, the same default is used, when keeping in proper context via openFileInput(), openFileOutput().  But if I need to check file existence, for instance, using the File class, I need to specify the whole path in the constructor.</p><p>I see there are Environment.getDataDirectory() (returns /data), Environment.getRootDirectory() (returns /system), etc, but nothing related to getting the app's 'home' directory.</p><p>It's not a huge deal, but I'd rather not hard-code the full path into my App for File to use (say the package name changes, say the path changes in a future OS release) if there is some way to reference the app's 'home' directory programatically.</p><p>Thanks,</p><p>Paul</p>","357801","","","","","2013-09-12 07:49:22","Android Get Application's 'Home' Data Directory","<android><context><home>","3","0","9","",""
"4739403","1","","","2011-01-19 18:54:46","0","571","<p>I want to draw a rectangle that fills the entire screen on all Android phones, all resolution, all screen densities.Everything... :)First from what I understand Canvas.drawRect use as dimensions values in pixel. Hope this is correct.Being new to Android I thought that if I simply write like this it will be sufficient, since at this moment there is no Android device with a resolution higher than 1024x1024 pixels:</p><pre><code>ScreenWidth = 1024;ScreenHeight = 1024;canvas.drawRect(0,0, ScreenWidth, ScreenHeight, mLoadPaint);</code></pre><p>But it seems that on some devices this Rectangle doesn't fill the entire screen. What is strange and I can't explain myself is that this doesn't happens always but at a point in time...Anyway it seems that there is a problem with the code so I would like to change it to look something like this, but now sure it metrics.widthPixels and metrics.heightPixels will solve my problem:</p><pre><code>wm = (WindowManager) getSystemService(WINDOW_SERVICE);DisplayMetrics metrics = new DisplayMetrics();wm.getDefaultDisplay().getMetrics(metrics);canvas.drawRect(0,0, metrics.widthPixels, metrics.heightPixels, mLoadPaint);</code></pre><p>I want to know if this is correct, and if this piece of code will cover all screens, and the rectangle will fill the entire screen.Of course with this approach I will have to take care also of the screen orientation, as it seems that the values are swapped between them when the screen is in Landscape.</p>","467780","","345717","","2011-01-19 18:57:21","2011-04-01 04:21:20","Filling the entire screen in multiple screen resolutions, densities","<android><drawrect><pixels><screens>","1","9","","",""
"4739452","1","4741609","","2011-01-19 18:59:40","1","193","<p>I am having issues getting keyboard input for my game. I am currently just trying to get it to print either ""KEY DOWN"" or ""KEY UP"" to the log to see that it worked. All I get when I press any keys (whether it is the menu key or any other keys on my phone's physical keyboard), is a log printout saying:</p><p>01-20 02:53:57.718: WARN/System.err(13847): No Keyboard Setting saved.</p><p>I don't know what that means, and a google search has not been helpful. I did not put that log output in myself. I am basing my game off the lunar lander example. Has anyone seen this before?</p><p>The code I am using to test:</p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent msg) {    if (keyCode == KeyEvent.KEYCODE_MENU)             {                Log.i(""myActivity"",""KEY DOWN"");                return true;            }    else return false;}@Overridepublic boolean onKeyUp(int keyCode, KeyEvent msg) {    if (keyCode == KeyEvent.KEYCODE_MENU)             {                Log.i(""myActivity"",""KEY UP"");                return true;            }    else return false;}</code></pre><p>EDIT: Note that it never prints out either KEY DOWN or KEY UP, and even if I move either log output out of the ""if (keycode==...)"" section, it still doesnt run.</p>","549859","","549859","","2011-01-19 19:27:51","2011-01-19 22:36:42","Keyboard input error","<java><android><input>","1","4","","",""
"4739466","1","","","2011-01-19 19:00:49","1","919","<p>I'm using the following code to fly to a specific latitude and longitude using a Google Earth Android intent:</p><pre><code>Intent myIntent = new Intent(); myIntent.setClassName(""com.google.earth"", ""com.google.earth.EarthActivity""); myIntent.setAction(Intent.ACTION_SEARCH); myIntent.putExtra(SearchManager.QUERY, lat + "" "" + lon);</code></pre><p>This works pretty much OK, except that it seems to want to geocode the lat/lon to the nearest address, if one is within a certain range. That is, if the lat/lon is in the middle of Antarctica, the map centers on the given point, but if the coordinates are, say, of the Sphinx, the map centers on an address on Cairo Alex Desert Rd., some distance away.</p><p>Is there a way to make Google Earth for Android just go to the given lat/lon in all cases? </p>","503156","","","","","2013-12-16 11:31:38","Flying to lat/lon with Google Earth Android intent","<android><google-earth>","1","0","2","",""
"4739486","1","4739731","","2011-01-19 19:03:00","2","4044","<p>I'm new to android development and I was wondering whether it's possible to add a ""seconds hand"" to the default analog clock in android?</p><p>I already have a working clock with a dial, hour and minute hands. I've searched around and I came across some posts stating that you need a service running in the background to update the clock every second. This was for a clock widget though and mines is for an app.</p><p>Is there any way it can be done?</p>","581949","","2633423","","2013-10-05 10:52:06","2013-10-05 10:52:06","Android clock seconds hand","<android><android-widget>","4","0","","",""
"4739547","1","4739583","","2011-01-19 19:11:11","1","1662","<p>when setting up the the notepad exercise (http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html) i am having problems getting past step 1 point 4. for build target it says no target available. </p><p>could someone offer any help please?</p><p><img src=""http://i.stack.imgur.com/7sp09.jpg"" alt=""alt text""></p><p><img src=""http://i.stack.imgur.com/cToQ7.jpg"" alt=""alt text""></p>","229616","","1228","","2013-08-13 14:31:51","2013-08-13 14:31:51","android notepad tutorial - no build target available","<android><notepad>","4","2","","",""
"4739658","1","","","2011-01-19 19:22:02","2","881","<p>I would like to develop an Android app that can read DRM-protected ebooks (pdf and epub). </p><p>I know this can be accomplished by using Adobe Reader Mobile 9 SDK but unfortunately it is quite expense to have a license for it ($75,000 per year).</p><p>So I'm looking for other alternatives, are there any?</p>","62483","","","","","2012-07-02 18:48:47","Alternatives to Adobe Reader Mobile 9 SDK to read DRM-protected ebooks","<android><mobile><drm>","2","0","","",""
"4739742","1","","","2011-01-19 19:32:19","0","78","<p>If I had an app that wanted to assess what other apps I had on my phone and make recommendations for new ones, what information can I read off the phone and send back to our server?</p>","581996","","","","","2011-06-07 00:55:58","What information can an Android App tell about other apps on a phone?","<android>","2","1","","",""
"4739763","1","4739811","","2011-01-19 19:34:09","0","682","<p>The problem is that if the list is bigger than the hole, the announcement is over the list. Any ideas? Thanks.</p><p></p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""xmlns:app=""http://schemas.android.com/apk/res/eu.domain.app""    android:id=""@+id/settings""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;Spinner     android:id=""@+id/spinner""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_alignParentTop=""true""    android:layout_marginTop=""4dip""    /&gt;        &lt;ListView            android:id=""@+id/android:list""            android:layout_below=""@id/spinner""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            /&gt;          &lt;com.admob.android.ads.AdView        android:id=""@+id/ad""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        app:backgroundColor=""#000000""        app:primaryTextColor=""#FFFFFF""        app:secondaryTextColor=""#CCCCCC""    /&gt;&lt;/RelativeLayout&gt;</code></pre>","522186","","","","","2011-01-19 19:37:23","RelativeLayout with 3 elements (Spinner, list and Admob)","<android><layout><admob>","1","0","","",""
"4739963","1","4740944","","2011-01-19 19:51:14","1","390","<p>Once you select which device version you will be developing on, what is the different between the tagged versions in git repository?</p><p>Example:<br>android-2.1_r1<br>android-sdk-2.1_r1  </p><p>Is checking out one more correct than the other for debugging/stepping through code? Been using the tags with ""-sdk"" in name, just curious what the difference between the two are.</p>","572002","","","","","2011-01-19 21:25:00","Android SDK Source Tag","<android><git><sdk><repository><source>","1","0","1","",""
"4740016","1","","","2011-01-19 19:55:28","0","127","<p>new in android, i have 4 button on clicking  button1, it gives a new form...box.java</p><pre><code>import android.os.Bundle;import android.content.Intent;import android.widget.Button;import android.view.View;import android.view.View.OnClickListener;public class Box extends CustomWindow {@Override    public void onCreate(Bundle savedInstanceState) {   super.onCreate(savedInstanceState);      Button b1 = (Button) findViewById(R.id.b1);   b1.setOnClickListener(new OnClickListener() {      @Override      public void onClick(View v) {         Intent intent = new Intent();         intent.setClass(Box.this, Group1.class);         startActivity(intent);      }   });   Button b2 = (Button) findViewById(R.id.b2);   b2.setOnClickListener(new OnClickListener() {      @Override      public void onClick(View v) {         Intent intent = new Intent();         intent.setClass(Box.this, Group2.class);         startActivity(intent);      }   });       Button b3 = (Button) findViewById(R.id.b3);   b3.setOnClickListener(new OnClickListener() {      @Override      public void onClick(View v) {         Intent intent = new Intent();         intent.setClass(Box.this, Group3.class);         startActivity(intent);      }   });   Button b4 = (Button) findViewById(R.id.b4);   b4.setOnClickListener(new OnClickListener() {      @Override      public void onClick(View v) {         Intent intent = new Intent();         intent.setClass(Box.this, Group4.class);         startActivity(intent);      }   });}}</code></pre><p>group1.java</p><pre><code>import android.os.Bundle;public class Group1 extends CustomWindow {@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.group1);}}</code></pre><p>Problem: How to make tabhost on group1?</p>","581955","","12855","","2011-01-19 19:59:59","2011-01-19 20:10:29","How to make a tab?","<android><android-layout><android-listview><android-tabhost><android-style-tabhost>","1","1","","",""
"4740088","1","4740182","","2011-01-19 20:02:07","2","258","<p>I need to make a screencast of an app to present to a client, but need it to look better than the ugly red phone or the various other incarnations of the emulator.  Is there a way to swap out that image? </p><p>Also would be great to get rid of the keyboard that displays next to it and make the window borders go way (since I have to capture it full screen on a mac, unfortunately, I can't crop it tight). </p>","226507","","","","","2011-02-09 23:44:56","change image of phone on emulator","<android>","2","0","","",""
"4740132","1","4740566","","2011-01-19 20:05:56","1","1156","<p>I have code to access a SQLite table that works perfectly from my ""main"" activity. I'm trying to make the code more elegant by creating a separate class to handle data inserts, deletes, etc.</p><p>When I move the exact same code from the main activity to a separate class I get the following error:</p><blockquote>  <p>The method  openOrCreateDatabase(String, int,  null) is undefined for the type  BarCode</p></blockquote><p>I notice that by extending my database class with ""Activity"" the error goes away. However, now I am getting <strong>NullPointerException</strong> when I run the code.</p><p>How would be the correct way to abstract database code and still be able to refer to it from an activity in Android?</p><p>Excuse me if I am getting the jargon wrong because I am a newbie to Android and Java.</p><p>Here is the full code:</p><pre><code>package com.example.stockcontrol;import java.util.Locale;import android.app.Activity;import android.content.ContentValues;import android.database.sqlite.SQLiteDatabase;public class BarCode extends Activity { public BarCode() { } public void insertBarCode(String upc) {  SQLiteDatabase db;        db = openOrCreateDatabase(         ""StockControl.db""         , SQLiteDatabase.CREATE_IF_NECESSARY         , null        );        db.setVersion(1);        db.setLocale(Locale.getDefault());        db.setLockingEnabled(true);        ContentValues mUpc = new ContentValues();        mUpc.put(""upc"", ""444"");        mUpc.put(""description"", ""Box o toast"");        mUpc.put(""scan_count"", ""1"");        db.insertOrThrow(""tbl_upc"", null, mUpc); }}</code></pre>","150398","","210916","","2011-04-26 14:16:34","2012-04-05 14:42:21","How to refer to to a SQLite database from an 'independent' Method in Android","<android><sqlite>","3","0","","",""
"4740144","1","4760597","","2011-01-19 20:07:16","0","98","<p>Hey folks. I have a strange problem with my EditView elements in an Android project I am working on.  I make the view clickable in the xml file and put an action listener on it to launch a Uri. No problem there.  What I'm finding though, is that the bottom of the view element disappears when the view is clickable.  Below is a screenshot of what I mean.  I added the bold/blue font to make the items stand out more, but it did  that before adjusting the font as well.</p><p>Since I can't post an image here, I've linked to it below.</p><p><a href=""https://docs.google.com/leaf?id=0BxAyDSR7j2blZWYzYWViYjctM2E0Yi00NWFiLTllYmQtMTA3YWI3YTBhYmEw&amp;hl=en"" rel=""nofollow"">https://docs.google.com/leaf?id=0BxAyDSR7j2blZWYzYWViYjctM2E0Yi00NWFiLTllYmQtMTA3YWI3YTBhYmEw&amp;hl=en</a></p>","245634","","","","","2011-01-21 15:35:29","Android: borders messed up on clickable view elements?","<android><android-layout>","1","2","0","",""
"4740150","1","","","2011-01-19 20:07:47","0","288","<p>i'm designing an android app that stores its data in xml files locally;<br>local data are part of all data stored at a server;<br>i need remote file path to download and view locally;<br>user can list remote files in a listView and check files (eg.. books) to download;<br>my question !!<br>what can the structure of the remote repo be?(SQL!)how can i make the query and recieve result ?(JSON!);<br>any way to sync ( subtract exisiting files from remote )?<br>i know little about web dev;<br>any help will be appreciated</p>","533111","","533111","","2011-01-19 22:53:47","2011-01-19 23:13:55","remote query from java code","<java><android><sql><xml><json>","1","0","","",""
"4740194","1","","","2011-01-19 20:11:53","2","1606","<p>""An error has occurred. See error log for more details.Could not initialize class com.ibm.icu.impl.JavaTimeZone""</p>","581828","","126214","","2011-01-19 20:32:52","2012-09-13 12:40:05","What does ""Could not initialize class com.ibm.icu.impl.JavaTimeZone"" mean?","<android>","2","2","1","",""
"4740197","1","4740235","","2011-01-19 20:12:24","11","7393","<p>I have a layout for a ListActivity. To modify the list I have used menu-options. But to remove a couple of ""clicks"" on the screen I'd like to add two buttons in the button of the screen that is always visible and not affected if the list is scrolled. </p><p>My problem is that I don't know how to add these buttons. I have tried a couple of solutions but the best I managed either the list or the buttons disapears from the layout. Seems that I can't get both buttons and list visible at the same time. </p><p>So my question is how to create a layout where I can have both buttons and the list?</p><p>Thanks in advanceRoland</p>","435267","","","","","2011-08-26 00:08:40","Add buttons to a listactivity","<android><layout><button><listactivity>","1","0","4","",""
"4740288","1","4898350","","2011-01-19 20:23:25","0","827","<p>how to unlock android phone from service(android.app.Service;) when phone is in locked sate</p>","413770","","","","","2011-02-04 13:13:04","how to unlock android phone from service","<android>","1","1","","",""
"4740319","1","4740728","","2011-01-19 20:27:10","9","3125","<p>We have several apps that will be very similar in layout and code.  The only difference is we will be switching out graphical elements, and making changes to a single constants file and strings file.  Of course, theres several problems with this -- the first being namespace.  Having an app with the same namespace will overwrite any other apps.</p><p>What are some suggestions to doing this?Currently our namesapce is:com.company.appnameI figured I could do:com.company.appname.appversion</p><p>I've seen post about ant scripts that helps with this, but I'm wondering if theres more fluid solutions now.</p>","324661","","","","","2013-08-10 11:43:50","Bulk Publishing of Android Apps","<android><android-manifest><android-build>","1","2","7","",""
"4740351","1","4740472","","2011-01-19 20:30:40","0","1732","<p>I have tried to create one tabhost with two tabs. Each tab contains one listview. Here is the code for the java file</p><pre><code>package com.Bussruter;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.net.HttpURLConnection;import java.net.URL;import java.net.URLConnection;import android.app.AlertDialog;import android.app.TabActivity;import android.content.ActivityNotFoundException;import android.content.DialogInterface;import android.content.Intent;import android.content.res.Resources;import android.net.ConnectivityManager;import android.net.Uri;import android.os.Bundle;import android.os.Environment;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TabHost;import android.widget.TabHost.TabContentFactory;import android.widget.Toast;import android.widget.AdapterView.OnItemClickListener;import android.widget.AdapterView.OnItemLongClickListener;import android.widget.TabHost.OnTabChangeListener;public class Bussruter extends TabActivity implements OnTabChangeListener {    /** Alle */    private static final String LIST1_TAB_TAG = ""List1"";    /** Nedlastet */    private static final String LIST2_TAB_TAG = ""List2"";    private StorageHandler sh;    private Resources res;// Resource object to get Drawables    private ListView lvNedlastet;    private ListView lvAlle;    private TabHost th;    /*private int[] created = new int[]{            0,            20100108,            0    };*/    /** Called when the activity is first created. */    @SuppressWarnings({ ""unchecked"", ""rawtypes"" })    @Override    public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.main);      //Checking which pdfs are already downloaded.      sh = new StorageHandler();      this.checkAvaliablePdfs();      th = getTabHost();      res = getResources();      th.setOnTabChangedListener(this);      lvAlle = (ListView) findViewById(R.id.list1);      lvNedlastet = (ListView) findViewById(R.id.list2);      lvAlle.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, new String[]{""1""}));//sh.getListNameAlle()));      lvNedlastet.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_2, new String[]{""1""}));//sh.getListNameNedlastet()));      OnItemClickListener itemCLAlle = this.createClickListenerAlle();      OnItemClickListener itemCLNedlastet = this.createClickListenerNedlastet();      lvAlle.setOnItemClickListener(itemCLAlle);      lvNedlastet.setOnItemClickListener(itemCLNedlastet);      OnItemLongClickListener itemLCL = this.createLongClickListener();      lvAlle.setOnItemLongClickListener(itemLCL);      lvAlle.setLongClickable(true);      lvNedlastet.setOnItemLongClickListener(itemLCL);      lvNedlastet.setLongClickable(true);      th.addTab(th.newTabSpec(LIST2_TAB_TAG)                .setIndicator(LIST2_TAB_TAG,                        res.getDrawable(R.drawable.ic_tab_nedlastet))                .setContent(new TabContentFactory() {                    public View createTabContent(String arg0) {                        return lvNedlastet;                    }                }));      th.addTab(th.newTabSpec(LIST1_TAB_TAG)                .setIndicator(LIST1_TAB_TAG,                        res.getDrawable(R.drawable.ic_tab_alle))                .setContent(new TabContentFactory() {                    public View createTabContent(String arg0) {                        return lvAlle;                    }                }));      th.setCurrentTabByTag(LIST1_TAB_TAG);    }    private OnItemLongClickListener createLongClickListener() {        return         new OnItemLongClickListener() {            public boolean onItemLongClick(AdapterView&lt;?&gt; parent, final View view,                       final int position, long id) {                if(isAvailable(position)){                    try{                        new AlertDialog.Builder(parent.getContext())                        .setMessage(""Vil du slette bussruten?"")                        .setCancelable(false)                        .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {                            public void onClick(DialogInterface dialog, int id) {                                deleteFile(view, position);                                sh.availability[position] = false;                            }                        })                        .setNegativeButton(""No"", new DialogInterface.OnClickListener() {                            public void onClick(DialogInterface dialog, int id) {                                dialog.cancel();                            }                        })                        .show();                    }catch(Exception e){                        toastText(""ERROR: ""+e.getMessage(), Toast.LENGTH_LONG);                    }                    return true;                }else return false;            }        };    }    private OnItemClickListener createClickListenerAlle(){        return             new OnItemClickListener() {               public void onItemClick(AdapterView&lt;?&gt; parent, View view,                       int position, long id){                     boolean temp = sh.availability[position];                   if(temp == true){                       if(Environment.getExternalStorageState().equals(                               Environment.MEDIA_MOUNTED)){                           File file = new File(StorageHandler.sdcardUrl+ StorageHandler.uniqueBussFilename[position]);                           if (file.exists()) {//open the file                               Uri path = Uri.fromFile(file);                               Intent intent = new Intent(Intent.ACTION_VIEW);                               intent.setDataAndType(path, ""application/pdf"");                               intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);                               try {                                   startActivity(intent);                               }                                catch (ActivityNotFoundException e) {                                   toastText(""No Application Available for viewing PDF"", Toast.LENGTH_LONG);                               }                           }else{                               toastText(""The file ""+file.getAbsolutePath()+"" was not found."", Toast.LENGTH_LONG);                           }                       }else{                           toastText(""sdkort er ikke tilgjengelig."", Toast.LENGTH_LONG);                       }                   }else{//Have to download the file.                       connect();                          try {                             String absUrl = StorageHandler.webUrl[position];                            InputStream inputStream = OpenHttpConnection(absUrl);                            File tempFile = new File(StorageHandler.sdcardUrl+StorageHandler.uniqueBussFilename[position]);                            File tempFile2 = new File(StorageHandler.sdcardUrl);                            if(!tempFile.exists()){                                tempFile2.mkdirs();                                tempFile.createNewFile();                            }                            OutputStream output = new FileOutputStream(tempFile);                            int bytesRead;                            byte[] buffer = new byte[8 * 1024];                            while((bytesRead = inputStream.read(buffer)) != -1){                                output.write(buffer,0,bytesRead);                            }                            output.close();                            inputStream.close();                            toastText(""Bussruten er lastet ned."", Toast.LENGTH_LONG);                            sh.availability[position] = true;                        } catch (IOException e) {                            toastText(""ERROR:Kan ikke laste ned bussruten.\nStacktrace:\n""+e.getMessage(), Toast.LENGTH_LONG);                        }                   }               }            };    }    private OnItemClickListener createClickListenerNedlastet(){        return         new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View view,                   int position, long id){                 boolean temp = sh.availability[position];               if(temp == true){                   if(Environment.getExternalStorageState().equals(                           Environment.MEDIA_MOUNTED)){                       File file = new File(StorageHandler.sdcardUrl+ StorageHandler.uniqueBussFilename[position]);                       if (file.exists()) {//open the file                           Uri path = Uri.fromFile(file);                           Intent intent = new Intent(Intent.ACTION_VIEW);                           intent.setDataAndType(path, ""application/pdf"");                           intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);                           try {                               startActivity(intent);                           }                            catch (ActivityNotFoundException e) {                               toastText(""No Application Available for viewing PDF"", Toast.LENGTH_LONG);                           }                       }else{                           toastText(""The file ""+file.getAbsolutePath()+"" was not found."", Toast.LENGTH_LONG);                       }                   }else{                       toastText(""sdkort er ikke tilgjengelig."", Toast.LENGTH_LONG);                   }               }            };        };}    private boolean isConnected(){        if(sh.isEmulator){            return true;        }else{            ConnectivityManager connMan = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);            if (connMan.getActiveNetworkInfo().isConnected()){//getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnected()) {                return true;            }else{                return false;            }        }    }    private void toastText(String t, int l){        final String text = t;        final int length = l;        Toast.makeText(getApplicationContext(), text, length).show();                   }    private void connect(){        if(isConnected()){            sh.isConnected = true;            toastText(""Kobler til..."", Toast.LENGTH_SHORT);        }else{            sh.isConnected = false;            toastText(""Bussruten har ikke blitt lastet ned.\n"" +                    ""Vennligst koble til internet for å laste ned ruten"", Toast.LENGTH_LONG);           }    }    private InputStream OpenHttpConnection(String urlString)     throws IOException    {        InputStream in = null;        int response = -1;        URL url = new URL(urlString);        URLConnection conn = url.openConnection();        if (!(conn instanceof HttpURLConnection))                                 throw new IOException(""Not an HTTP connection"");        try{            HttpURLConnection httpConn = (HttpURLConnection) conn;            httpConn.setAllowUserInteraction(false);            httpConn.setInstanceFollowRedirects(true);            httpConn.setRequestMethod(""GET"");            httpConn.connect();             response = httpConn.getResponseCode();                             if (response == HttpURLConnection.HTTP_OK) {                in = httpConn.getInputStream();                                             }                             }        catch (Exception ex)        {            throw new IOException(""Error connecting"");                    }        return in;         }    /*    private String urlWithSpaces2Percentage20(String url){        String output = """";        for(int i = 0;i&lt;url.length();i++){            char c = url.charAt(i);            if(c == ' '){                output = output + ""%20"";            }else{                output = output + c;            }        }        return output;    }    private int getCreatedDateFromFullName(String name){        return 0;    }*/    private boolean isAvailable(int position){        File f = new File(StorageHandler.sdcardUrl + StorageHandler.uniqueBussFilename[position]);        if(f.exists()){            return true;        }        return false;    }    private void checkAvaliablePdfs(){        for(int i = 0;i&lt;StorageHandler.uniqueBussFilename.length;i++){            File f = new File(StorageHandler.sdcardUrl + StorageHandler.uniqueBussFilename[i]);            if(f.exists()){                sh.availability[i] = true;            }        }    }    private void deleteFile(View view, int index){        try{            File f =  new File(StorageHandler.sdcardUrl + StorageHandler.uniqueBussFilename[index]);            f.delete();        }catch(Exception e){            toastText(""ERROR: ""+e.getMessage(), Toast.LENGTH_LONG);        }    }    /*    private void setTextColor(View view, int id){        if(availability[id]){            view.setPressed(true);        }    }*/    /**     * Implement logic here when a tab is selected     */    @SuppressWarnings({ ""unchecked"", ""rawtypes"" })    public void onTabChanged(String tabName) {        if(tabName.equals(LIST2_TAB_TAG)) {            lvNedlastet.setAdapter(new ArrayAdapter(this,                     android.R.layout.simple_list_item_2,                     sh.getListNameNedlastet()));        }        else if(tabName.equals(LIST1_TAB_TAG)) {            //do something        }    }}</code></pre><p>And here is the code for the main.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""&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;ListView android:id=""@+id/list1"" android:layout_width=""fill_parent""                android:layout_height=""wrap_content"" android:layout_weight=""1""&gt;            &lt;/ListView&gt;            &lt;ListView android:id=""@+id/list2"" android:layout_width=""fill_parent""                android:layout_height=""wrap_content"" android:layout_weight=""1""&gt;            &lt;/ListView&gt;        &lt;/FrameLayout&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>And here is the Error message from the DDMS</p><pre><code>01-19 21:40:13.198: ERROR/AndroidRuntime(16123): Uncaught handler: thread main exiting due to uncaught exception01-19 21:40:13.838: ERROR/AndroidRuntime(16123): java.lang.IllegalStateException: ArrayAdapter requires the resource ID to be a TextView01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:347)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.widget.AbsListView.obtainView(AbsListView.java:1274)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1147)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.widget.ListView.onMeasure(ListView.java:1060)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.view.View.measure(View.java:7964)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.view.View.measure(View.java:7964)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:350)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.view.View.measure(View.java:7964)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.view.View.measure(View.java:7964)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.view.View.measure(View.java:7964)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.view.View.measure(View.java:7964)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.view.View.measure(View.java:7964)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.view.ViewRoot.performTraversals(ViewRoot.java:763)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.os.Handler.dispatchMessage(Handler.java:99)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.os.Looper.loop(Looper.java:123)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.app.ActivityThread.main(ActivityThread.java:4363)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at java.lang.reflect.Method.invokeNative(Native Method)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at java.lang.reflect.Method.invoke(Method.java:521)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at dalvik.system.NativeStart.main(Native Method)01-19 21:40:13.838: ERROR/AndroidRuntime(16123): Caused by: java.lang.ClassCastException: android.widget.TwoLineListItem01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:340)01-19 21:40:13.838: ERROR/AndroidRuntime(16123):     ... 35 more</code></pre><p>In advance. THANKS! :)</p>","582061","","","","","2011-01-19 20:42:54","Problem using tabs that contains listviews (Android)","<android><listview><layout><android-tabhost><tabview>","2","0","","",""
"4740380","1","","","2011-01-19 20:33:42","1","725","<p>I'm developing an android app and I'm facing a weird issue. I'm doing some image processing on a SurfaceView. I'm drawing the processed image using a canvas and the following method:</p><pre><code>canvas.drawBitmap(image, x, y, paint)</code></pre><p>My SurfaceView has a colored background (#3500ffff, kind of very dark green) and once the image is drawn, I can notice that its original colors are not conserved. It has a very slight dark green tint, like if the bitmap alpha was changed. </p><p>Did anyone already encounter this issue? Would you have an idea on how to fix this?</p>","370102","","","","","2011-01-20 01:01:17","Android: image doesn't keep it's original color with use of canvas.drawBitmap","<android><canvas><background><alpha><drawbitmap>","2","2","","",""
"4740530","1","4743207","","2011-01-19 20:46:37","7","6602","<p>I wrote a small clock widget.  Like all clocks, it has to be updated every minute.  So I set up an alarm to do this.  It worked fine.  It was just a little too small.  So I fiddled with an XML attribute and tried again.  It force-closed.  I changed the attribute back to the original and tried again.  It again force-closed.</p><p>The LogCat follows(from package install to the OS killing it):</p><pre><code>01-19 13:38:52.292: DEBUG/PackageManager(57): New package installed in /data/app/com.---.clock-2.apk01-19 13:38:52.571: INFO/ActivityManager(57): Force stopping package com.---.clock uid=1004301-19 13:38:52.571: INFO/Process(57): Sending signal. PID: 593 SIG: 901-19 13:38:52.612: INFO/ActivityManager(57): Force stopping package com.---.clock uid=1004301-19 13:38:53.022: DEBUG/PhotoAppWidgetProvider(282): getPhoto query count=001-19 13:38:53.022: DEBUG/PhotoAppWidgetProvider(282): sending out views=null for id=001-19 13:38:53.131: INFO/ActivityManager(57): Start proc com.---.clock for broadcast com.---.clock/.Clock: pid=613 uid=10043 gids={1015}01-19 13:38:53.713: DEBUG/Clock widget(613): updated01-19 13:38:54.011: INFO/ActivityManager(57): Force stopping package com.---.clock uid=1004301-19 13:38:54.021: INFO/Process(57): Sending signal. PID: 613 SIG: 901-19 13:38:54.301: DEBUG/dalvikvm(121): GC_EXPLICIT freed 13673 objects / 524360 bytes in 177ms01-19 13:38:54.542: DEBUG/dalvikvm(125): GC_EXPLICIT freed 4956 objects / 200960 bytes in 440ms01-19 13:38:54.801: WARN/RecognitionManagerService(57): no available voice recognition services found01-19 13:38:55.032: DEBUG/dalvikvm(57): GC_EXPLICIT freed 4960 objects / 290104 bytes in 201ms01-19 13:38:55.042: INFO/installd(35): unlink /data/dalvik-cache/data@app@com.---.clock-1.apk@classes.dex01-19 13:38:55.131: DEBUG/AndroidRuntime(605): Shutting down VM01-19 13:38:55.151: DEBUG/dalvikvm(605): Debugger has detached; object registry had 1 entries01-19 13:38:55.212: INFO/AndroidRuntime(605): NOTE: attach of thread 'Binder Thread #3' failed01-19 13:38:55.571: DEBUG/PhotoAppWidgetProvider(282): getPhoto query count=001-19 13:38:55.571: DEBUG/PhotoAppWidgetProvider(282): sending out views=null for id=001-19 13:38:55.762: INFO/ActivityManager(57): Start proc com.---.clock for broadcast com.---.clock/.Clock: pid=622 uid=10043 gids={1015}01-19 13:38:56.332: WARN/asset(622): Asset path /data/app/com.---.clock-1.apk is neither a directory nor file (type=1).01-19 13:38:56.373: DEBUG/AndroidRuntime(622): Shutting down VM01-19 13:38:56.373: WARN/dalvikvm(622): threadid=1: thread exiting with uncaught exception (group=0x4001d800)01-19 13:38:56.722: DEBUG/PhotoAppWidgetProvider(282): getPhoto query count=001-19 13:38:56.732: DEBUG/PhotoAppWidgetProvider(282): sending out views=null for id=001-19 13:38:56.841: ERROR/AndroidRuntime(622): FATAL EXCEPTION: main01-19 13:38:56.841: ERROR/AndroidRuntime(622): java.lang.RuntimeException: Unable to instantiate receiver com.---.clock.Clock: java.lang.ClassNotFoundException: com.---.clock.Clock in loader dalvik.system.PathClassLoader[/data/app/com.---.clock-1.apk]01-19 13:38:56.841: ERROR/AndroidRuntime(622):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2789)01-19 13:38:56.841: ERROR/AndroidRuntime(622):     at android.app.ActivityThread.access$3200(ActivityThread.java:125)01-19 13:38:56.841: ERROR/AndroidRuntime(622):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2083)01-19 13:38:56.841: ERROR/AndroidRuntime(622):     at android.os.Handler.dispatchMessage(Handler.java:99)01-19 13:38:56.841: ERROR/AndroidRuntime(622):     at android.os.Looper.loop(Looper.java:123)01-19 13:38:56.841: ERROR/AndroidRuntime(622):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-19 13:38:56.841: ERROR/AndroidRuntime(622):     at java.lang.reflect.Method.invokeNative(Native Method)01-19 13:38:56.841: ERROR/AndroidRuntime(622):     at java.lang.reflect.Method.invoke(Method.java:521)01-19 13:38:56.841: ERROR/AndroidRuntime(622):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-19 13:38:56.841: ERROR/AndroidRuntime(622):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-19 13:38:56.841: ERROR/AndroidRuntime(622):     at dalvik.system.NativeStart.main(Native Method)01-19 13:38:56.841: ERROR/AndroidRuntime(622): Caused by: java.lang.ClassNotFoundException: com.---.clock.Clock in loader dalvik.system.PathClassLoader[/data/app/com.---.clock-1.apk]01-19 13:38:56.841: ERROR/AndroidRuntime(622):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)01-19 13:38:56.841: ERROR/AndroidRuntime(622):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)01-19 13:38:56.841: ERROR/AndroidRuntime(622):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)01-19 13:38:56.841: ERROR/AndroidRuntime(622):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2780)01-19 13:38:56.841: ERROR/AndroidRuntime(622):     ... 10 more01-19 13:38:56.901: WARN/asset(57): Asset path /data/app/com.---.clock-1.apk is neither a directory nor file (type=1).01-19 13:38:56.913: WARN/PackageManager(57): Failure retrieving resources forcom.---.clock01-19 13:38:57.932: DEBUG/PhotoAppWidgetProvider(282): getPhoto query count=001-19 13:38:58.003: DEBUG/PhotoAppWidgetProvider(282): sending out views=null for id=001-19 13:39:05.101: INFO/Process(622): Sending signal. PID: 622 SIG: 901-19 13:39:05.151: INFO/ActivityManager(57): Process com.---.clock (pid 622) has died.01-19 13:39:05.182: WARN/InputManagerService(57): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43ecc69801-19 13:39:05.892: DEBUG/PhotoAppWidgetProvider(282): getPhoto query count=001-19 13:39:05.892: DEBUG/PhotoAppWidgetProvider(282): sending out views=null for id=001-19 13:39:06.011: INFO/ActivityManager(57): Start proc com.---.clock for broadcast com.---.clock/.Clock: pid=630 uid=10043 gids={1015}01-19 13:39:06.413: WARN/asset(630): Asset path /data/app/com.---.clock-1.apk is neither a directory nor file (type=1).01-19 13:39:06.472: DEBUG/AndroidRuntime(630): Shutting down VM01-19 13:39:06.482: WARN/dalvikvm(630): threadid=1: thread exiting with uncaught exception (group=0x4001d800)01-19 13:39:06.901: ERROR/AndroidRuntime(630): FATAL EXCEPTION: main01-19 13:39:06.901: ERROR/AndroidRuntime(630): java.lang.RuntimeException: Unable to instantiate receiver com.---.clock.Clock: java.lang.ClassNotFoundException: com.---.clock.Clock in loader dalvik.system.PathClassLoader[/data/app/com.---.clock-1.apk]01-19 13:39:06.901: ERROR/AndroidRuntime(630):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2789)01-19 13:39:06.901: ERROR/AndroidRuntime(630):     at android.app.ActivityThread.access$3200(ActivityThread.java:125)01-19 13:39:06.901: ERROR/AndroidRuntime(630):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2083)01-19 13:39:06.901: ERROR/AndroidRuntime(630):     at android.os.Handler.dispatchMessage(Handler.java:99)01-19 13:39:06.901: ERROR/AndroidRuntime(630):     at android.os.Looper.loop(Looper.java:123)01-19 13:39:06.901: ERROR/AndroidRuntime(630):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-19 13:39:06.901: ERROR/AndroidRuntime(630):     at java.lang.reflect.Method.invokeNative(Native Method)01-19 13:39:06.901: ERROR/AndroidRuntime(630):     at java.lang.reflect.Method.invoke(Method.java:521)01-19 13:39:06.901: ERROR/AndroidRuntime(630):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-19 13:39:06.901: ERROR/AndroidRuntime(630):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-19 13:39:06.901: ERROR/AndroidRuntime(630):     at dalvik.system.NativeStart.main(Native Method)01-19 13:39:06.901: ERROR/AndroidRuntime(630): Caused by: java.lang.ClassNotFoundException: com.---.clock.Clock in loader dalvik.system.PathClassLoader[/data/app/com.---.clock-1.apk]01-19 13:39:06.901: ERROR/AndroidRuntime(630):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)01-19 13:39:06.901: ERROR/AndroidRuntime(630):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)01-19 13:39:06.901: ERROR/AndroidRuntime(630):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)01-19 13:39:06.901: ERROR/AndroidRuntime(630):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2780)01-19 13:39:06.901: ERROR/AndroidRuntime(630):     ... 10 more01-19 13:39:06.901: DEBUG/PhotoAppWidgetProvider(282): getPhoto query count=001-19 13:39:06.922: DEBUG/PhotoAppWidgetProvider(282): sending out views=null for id=001-19 13:39:07.051: WARN/ActivityManager(57): Process com.---.clock has crashed too many times: killing!01-19 13:39:07.062: INFO/Process(57): Sending signal. PID: 630 SIG: 901-19 13:39:07.151: WARN/ActivityManager(57): Unable to launch app com.---.clock/10043 for broadcast Intent { act=android.appwidget.action.APPWIDGET_UPDATE cmp=com.---.clock/.Clock (has extras) }: process is bad01-19 13:39:07.151: WARN/ActivityManager(57): finishReceiver called but none active</code></pre><p>I have never seen this error before and have no idea what's causing it or how to fix it.  Can someone interpret this for me please?</p>","467090","","","","","2011-01-20 03:35:40","Unable to launch app for broadcast intent","<android><android-widget><widget><logcat><android-logcat>","1","3","1","",""
"4740538","1","4740747","","2011-01-19 20:46:55","5","8794","<p>What I'm trying to do is define a common background for use in a LinearLayout which frequents my application on many of its Activitys.  This particular layout is a header that shows on the top of each activity. </p><p>What I'm trying to do is create a drawable that fills the linearlayout with a gradient and has a horizontal line below the gradient.  </p><p>Does anyone know if this is possible or do I have to do this sort of thing only with nested layouts.</p><p>Thanks,</p><p>My attemptat the drawable xml is </p><pre><code> &lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item&gt;&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""    android:shape=""rectangle""&gt;    &lt;gradient android:startColor=""#AA000000"" android:endColor=""#AA333333""        android:angle=""270"" /&gt;&lt;/shape&gt;&lt;/item&gt;&lt;item&gt;&lt;shape android:shape=""line""&gt;    &lt;stroke android:width=""3dp"" android:color=""#FFFFFFFF""            android:dashWidth=""1dp"" android:dashGap=""2dp"" /&gt;    &lt;size android:height=""5dp"" /&gt;&lt;/shape&gt;&lt;/item&gt;&lt;/selector&gt;</code></pre>","333276","","","","","2011-01-19 21:05:56","Can I use multiple shapes in one Android drawable?","<android><layout><drawable>","1","0","","",""
"4740565","1","4740947","","2011-01-19 20:47:55","4","1688","<p>There are a few Paint constant in Android about which I couldn't find much info. Could anyone help me with a bit of explanation about those flags:</p><ul><li>LINEAR_TEXT_FLAG</li><li>SUBPIXEL_TEXT_FLAG</li><li>FILTER_BITMAP_FLAG</li></ul><p>Is 'subpixel' mode something close to ClearType or is it something altogether different?</p>","348183","","372239","","2014-01-04 15:45:49","2014-01-04 15:45:49","Meaning of some Paint constants in Android","<android><text><constants><paint>","1","0","1","",""
"4740582","1","","","2011-01-19 20:49:13","1","180","<p>I create an android app which connect runners in closed proximity. I used a Tornado ServerWeb (Python) and a No-SQL database.</p><p>My solution:</p><p>Store all the {lon,lat} (regularly updated) of users in a DataLocation.</p><p>When a user want to see users around him, it calls specific function to my server which make a bounding box from his current position. The next step is to return the users of my DataLocation who are in his bounding box.</p><p>Is that a good way? Any advices? Is GeoJSON useful for me? How can I do that in Python?</p>","420574","","","","","2011-01-19 21:14:57","The best way to connect users in closed proximity ? (latitude, longitude)","<python><android><geolocation><bounding-box><geojson>","1","0","","",""
"4740590","1","4741166","","2011-01-19 20:49:41","3","765","<p>My aim is to get the keyboard to open as soon as the app is loaded. Using this code, <code>InputMethodManager inputMgr = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);                      inputMgr.toggleSoftInput(0, 0);</code></p><p>on a button, i can get the keyboard to load when the button is pressed. However, when placed in the override onCreate() section, nothing happens.</p><p>Any ideas?</p><p>Thankyou in advance.</p>","574940","","","","","2011-01-19 21:46:56","Can't get keyboard to load onCreate()","<android><android-softkeyboard>","1","2","1","",""
"4740844","1","4741016","","2011-01-19 21:14:17","-2","4598","<p>Hello i keep getting the error</p><pre><code>01-19 22:29:20.678: ERROR/AndroidRuntime(22463): Uncaught handler: thread main exiting due to uncaught exception01-19 22:29:21.278: ERROR/AndroidRuntime(22463): java.lang.NullPointerException01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:353)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.widget.AbsListView.obtainView(AbsListView.java:1274)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1147)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.widget.ListView.onMeasure(ListView.java:1060)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.view.View.measure(View.java:7964)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.view.View.measure(View.java:7964)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:350)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.view.View.measure(View.java:7964)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.view.View.measure(View.java:7964)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.view.View.measure(View.java:7964)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.view.View.measure(View.java:7964)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.view.View.measure(View.java:7964)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.view.ViewRoot.performTraversals(ViewRoot.java:763)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.os.Handler.dispatchMessage(Handler.java:99)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.os.Looper.loop(Looper.java:123)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at android.app.ActivityThread.main(ActivityThread.java:4363)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at java.lang.reflect.Method.invokeNative(Native Method)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at java.lang.reflect.Method.invoke(Method.java:521)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)01-19 22:29:21.278: ERROR/AndroidRuntime(22463):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>BUT i can't find out where in the code the NullPointerException is beeing thrown.Here is the java code:</p><pre><code>package com.Bussruter;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.net.HttpURLConnection;import java.net.URL;import java.net.URLConnection;import android.app.AlertDialog;import android.app.TabActivity;import android.content.ActivityNotFoundException;import android.content.DialogInterface;import android.content.Intent;import android.content.res.Resources;import android.net.ConnectivityManager;import android.net.Uri;import android.os.Bundle;import android.os.Environment;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TabHost;import android.widget.TabHost.TabContentFactory;import android.widget.Toast;import android.widget.AdapterView.OnItemClickListener;import android.widget.AdapterView.OnItemLongClickListener;import android.widget.TabHost.OnTabChangeListener;public class Bussruter extends TabActivity implements OnTabChangeListener {    /** Alle */    private static final String LIST1_TAB_TAG = ""List1"";    /** Nedlastet */    private static final String LIST2_TAB_TAG = ""List2"";    private StorageHandler sh;    private Resources res;// Resource object to get Drawables    private ListView lvNedlastet;    private ListView lvAlle;    private TabHost th;    /*private int[] created = new int[]{            0,            20100108,            0    };*/    /** Called when the activity is first created. */    @SuppressWarnings({ ""unchecked"", ""rawtypes"" })    @Override    public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.main);      //Checking which pdfs are already downloaded.      sh = new StorageHandler();      this.checkAvaliablePdfs();      th = getTabHost();      res = getResources();      th.setOnTabChangedListener(this);      lvAlle = (ListView) findViewById(R.id.list1);      lvNedlastet = (ListView) findViewById(R.id.list2);      lvAlle.setAdapter(new ArrayAdapter(this,               android.R.layout.simple_list_item_1,              R.id.list1,               new String[]{""1""}));//sh.getListNameAlle()));      lvNedlastet.setAdapter(new ArrayAdapter(this,              android.R.layout.simple_list_item_2,              R.id.list2,               new String[]{""1""}));//sh.getListNameNedlastet()));      OnItemClickListener itemCLAlle = this.createClickListenerAlle();      OnItemClickListener itemCLNedlastet = this.createClickListenerNedlastet();      lvAlle.setOnItemClickListener(itemCLAlle);      lvNedlastet.setOnItemClickListener(itemCLNedlastet);      OnItemLongClickListener itemLCL = this.createLongClickListener();      lvAlle.setOnItemLongClickListener(itemLCL);      lvAlle.setLongClickable(true);      lvNedlastet.setOnItemLongClickListener(itemLCL);      lvNedlastet.setLongClickable(true);      th.addTab(th.newTabSpec(LIST1_TAB_TAG)                .setIndicator(LIST1_TAB_TAG,                        res.getDrawable(R.drawable.ic_tab_alle))                .setContent(new TabContentFactory() {                    public View createTabContent(String arg0) {                        return lvAlle;                    }                }));      th.addTab(th.newTabSpec(LIST2_TAB_TAG)                .setIndicator(LIST2_TAB_TAG,                        res.getDrawable(R.drawable.ic_tab_nedlastet))                .setContent(new TabContentFactory() {                    public View createTabContent(String arg0) {                        return lvNedlastet;                    }                }));      th.setCurrentTabByTag(LIST1_TAB_TAG);    }    private OnItemLongClickListener createLongClickListener() {        return         new OnItemLongClickListener() {            public boolean onItemLongClick(AdapterView&lt;?&gt; parent, final View view,                       final int position, long id) {                if(isAvailable(position)){                    try{                        new AlertDialog.Builder(parent.getContext())                        .setMessage(""Vil du slette bussruten?"")                        .setCancelable(false)                        .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {                            public void onClick(DialogInterface dialog, int id) {                                deleteFile(view, position);                                sh.availability[position] = false;                            }                        })                        .setNegativeButton(""No"", new DialogInterface.OnClickListener() {                            public void onClick(DialogInterface dialog, int id) {                                dialog.cancel();                            }                        })                        .show();                    }catch(Exception e){                        toastText(""ERROR: ""+e.getMessage(), Toast.LENGTH_LONG);                    }                    return true;                }else return false;            }        };    }    private OnItemClickListener createClickListenerAlle(){        return             new OnItemClickListener() {               public void onItemClick(AdapterView&lt;?&gt; parent, View view,                       int position, long id){                     boolean temp = sh.availability[position];                   if(temp == true){                       if(Environment.getExternalStorageState().equals(                               Environment.MEDIA_MOUNTED)){                           File file = new File(StorageHandler.sdcardUrl+ StorageHandler.uniqueBussFilename[position]);                           if (file.exists()) {//open the file                               Uri path = Uri.fromFile(file);                               Intent intent = new Intent(Intent.ACTION_VIEW);                               intent.setDataAndType(path, ""application/pdf"");                               intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);                               try {                                   startActivity(intent);                               }                                catch (ActivityNotFoundException e) {                                   toastText(""No Application Available for viewing PDF"", Toast.LENGTH_LONG);                               }                           }else{                               toastText(""The file ""+file.getAbsolutePath()+"" was not found."", Toast.LENGTH_LONG);                           }                       }else{                           toastText(""sdkort er ikke tilgjengelig."", Toast.LENGTH_LONG);                       }                   }else{//Have to download the file.                       connect();                          try {                             String absUrl = StorageHandler.webUrl[position];                            InputStream inputStream = OpenHttpConnection(absUrl);                            File tempFile = new File(StorageHandler.sdcardUrl+StorageHandler.uniqueBussFilename[position]);                            File tempFile2 = new File(StorageHandler.sdcardUrl);                            if(!tempFile.exists()){                                tempFile2.mkdirs();                                tempFile.createNewFile();                            }                            OutputStream output = new FileOutputStream(tempFile);                            int bytesRead;                            byte[] buffer = new byte[8 * 1024];                            while((bytesRead = inputStream.read(buffer)) != -1){                                output.write(buffer,0,bytesRead);                            }                            output.close();                            inputStream.close();                            toastText(""Bussruten er lastet ned."", Toast.LENGTH_LONG);                            sh.availability[position] = true;                        } catch (IOException e) {                            toastText(""ERROR:Kan ikke laste ned bussruten.\nStacktrace:\n""+e.getMessage(), Toast.LENGTH_LONG);                        }                   }               }            };    }    private OnItemClickListener createClickListenerNedlastet(){        return         new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View view,                   int position, long id){                 boolean temp = sh.availability[position];               if(temp == true){                   if(Environment.getExternalStorageState().equals(                           Environment.MEDIA_MOUNTED)){                       File file = new File(StorageHandler.sdcardUrl+ StorageHandler.uniqueBussFilename[position]);                       if (file.exists()) {//open the file                           Uri path = Uri.fromFile(file);                           Intent intent = new Intent(Intent.ACTION_VIEW);                           intent.setDataAndType(path, ""application/pdf"");                           intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);                           try {                               startActivity(intent);                           }                            catch (ActivityNotFoundException e) {                               toastText(""No Application Available for viewing PDF"", Toast.LENGTH_LONG);                           }                       }else{                           toastText(""The file ""+file.getAbsolutePath()+"" was not found."", Toast.LENGTH_LONG);                       }                   }else{                       toastText(""sdkort er ikke tilgjengelig."", Toast.LENGTH_LONG);                   }               }            };        };}    private boolean isConnected(){        if(sh.isEmulator){            return true;        }else{            ConnectivityManager connMan = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);            if (connMan.getActiveNetworkInfo().isConnected()){//getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnected()) {                return true;            }else{                return false;            }        }    }    private void toastText(String t, int l){        final String text = t;        final int length = l;        Toast.makeText(getApplicationContext(), text, length).show();                   }    private void connect(){        if(isConnected()){            sh.isConnected = true;            toastText(""Kobler til..."", Toast.LENGTH_SHORT);        }else{            sh.isConnected = false;            toastText(""Bussruten har ikke blitt lastet ned.\n"" +                    ""Vennligst koble til internet for å laste ned ruten"", Toast.LENGTH_LONG);           }    }    private InputStream OpenHttpConnection(String urlString)     throws IOException    {        InputStream in = null;        int response = -1;        URL url = new URL(urlString);        URLConnection conn = url.openConnection();        if (!(conn instanceof HttpURLConnection))                                 throw new IOException(""Not an HTTP connection"");        try{            HttpURLConnection httpConn = (HttpURLConnection) conn;            httpConn.setAllowUserInteraction(false);            httpConn.setInstanceFollowRedirects(true);            httpConn.setRequestMethod(""GET"");            httpConn.connect();             response = httpConn.getResponseCode();                             if (response == HttpURLConnection.HTTP_OK) {                in = httpConn.getInputStream();                                             }                             }        catch (Exception ex)        {            throw new IOException(""Error connecting"");                    }        return in;         }    /*    private String urlWithSpaces2Percentage20(String url){        String output = """";        for(int i = 0;i&lt;url.length();i++){            char c = url.charAt(i);            if(c == ' '){                output = output + ""%20"";            }else{                output = output + c;            }        }        return output;    }    private int getCreatedDateFromFullName(String name){        return 0;    }*/    private boolean isAvailable(int position){        File f = new File(StorageHandler.sdcardUrl + StorageHandler.uniqueBussFilename[position]);        if(f.exists()){            return true;        }        return false;    }    private void checkAvaliablePdfs(){        for(int i = 0;i&lt;StorageHandler.uniqueBussFilename.length;i++){            File f = new File(StorageHandler.sdcardUrl + StorageHandler.uniqueBussFilename[i]);            if(f.exists()){                sh.availability[i] = true;            }        }    }    private void deleteFile(View view, int index){        try{            File f =  new File(StorageHandler.sdcardUrl + StorageHandler.uniqueBussFilename[index]);            f.delete();        }catch(Exception e){            toastText(""ERROR: ""+e.getMessage(), Toast.LENGTH_LONG);        }    }    /*    private void setTextColor(View view, int id){        if(availability[id]){            view.setPressed(true);        }    }*/    /**     * Implement logic here when a tab is selected     */    @SuppressWarnings({ ""unchecked"", ""rawtypes"" })    public void onTabChanged(String tabName) {        if(tabName.equals(LIST2_TAB_TAG)) {            lvNedlastet.setAdapter(new ArrayAdapter(this,                     android.R.layout.simple_list_item_2,                     sh.getListNameNedlastet()));        }        else if(tabName.equals(LIST1_TAB_TAG)) {            //do something        }    }}</code></pre><p>And in case you need to look at the main.xml here it 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=""@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;ListView android:id=""@+id/list1"" android:layout_width=""fill_parent""                android:layout_height=""wrap_content"" android:layout_weight=""1""&gt;            &lt;/ListView&gt;            &lt;ListView android:id=""@+id/list2"" android:layout_width=""fill_parent""                android:layout_height=""wrap_content"" android:layout_weight=""1""&gt;            &lt;/ListView&gt;        &lt;/FrameLayout&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre>","582061","","","","","2011-01-19 21:32:27","Help finding the Null, NullPointerException (Android)","<android><listview><nullpointerexception><android-tabhost><tabview>","1","6","","2011-01-20 23:51:50",""
"4740891","1","","","2011-01-19 21:19:09","0","3168","<p>First off, I AM able to programmatically connect to a device via bluetooth if I have manually paired it beforehand. However, I haven't found a (user-friendly) way to connect with unpaired devices (that are discoverable, obviously), even using the unchanged sample Android Bluetooth code.</p><p>I would like to pop up the pairing dialog box that requests the user to input a passkey for the device. What happens with my code, and the sample Android Bluetooth code, is that making a socket with a discoverable bluetooth device</p><pre><code>device.createRfcommSocketToServiceRecord(MY_UUID); </code></pre><p>will add a notification to the notification bar at the top of the screen; however, it is pretty unlikely that the user will even notice a new notification (I know I didn't).</p><p>How would I pop up that pairing dialog box, prompting the user to enter the passkey - or better yet, supply a passkey for a particularly device automatically?</p>","582004","","","","","2011-04-11 20:30:48","Android Bluetooth Development - connecting to an UNPAIRED device","<java><android><bluetooth>","2","1","1","",""
"4740966","1","4750481","","2011-01-19 21:27:00","0","1046","<p>Although Internet browsing works in the emulator, my app who also runs in the emulator, is unable to connect to a server on the internet on port 5222 via TCP. I'm pretty sure that there is no firewall involved on my router or on my pc, as I can telnet to that ip:port from my pc.</p><p>Here is a screenshot of the packettrace taken on the emulator: <a href=""http://i.stack.imgur.com/sIFFM.png"" rel=""nofollow"">http://i.stack.imgur.com/sIFFM.png</a></p><p>A packet-trace on the emulated device showed that every SYN packet to that particular port is answered with RST,ACK and the connection is closed by my app with a ""connection error"".</p><p>Why does the emulator block (?) these ports? How can I change it?</p>","194894","","3052751","","2014-01-08 13:09:31","2014-01-08 13:09:31","Android Emulator (qemu) does not allow certain tcp connections (RST,ACK as answer to SYN)","<android><android-emulator><qemu>","2","0","1","",""
"4740990","1","","","2011-01-19 21:30:06","0","327","<p>I have an Android application does many things. I would like to be able have it spawn a desktop widget (?) that opens the application to do a specific thing when the widget is clicked.</p><p>Can someone give me a road map on how to do this?</p>","575616","","","","","2011-01-19 21:48:35","Spawn Android desktop widget from an application","<android><widget>","2","1","","",""
"4741111","1","4741398","","2011-01-19 21:41:30","0","1057","<p>Does anyone know of any good tutorials that show how to create tabs with listviews as content?Possibly also showing how to update lists on tab focus?</p>","582061","","1228","","2013-08-13 14:31:52","2013-08-13 14:31:52","Tutorials for creating Tabs that have ListViews as Content (Android)","<android><listview><android-tabhost><tabview>","2","1","2","2013-08-13 15:54:06",""
"4741149","1","4741261","","2011-01-19 21:44:16","1","521","<p>My application needs a guaranteed time to complete some IO on an SDcard before the SDcard is unmounted. My solution is to write a linux kernel module that inserts a wrapper around the umount system call that will delay the actual umount and call me back to complete my work. </p><p>My code may have root privileged components.</p><p>Any less obstructive solutions? </p>","582149","","","","","2011-01-19 21:56:59","How to delay umount of SDcard on Android to complete my own file io","<android><android-sdcard>","1","2","","",""
"4741284","1","","","2011-01-19 21:59:10","6","5941","<p>Would like to do the following: <code>take picture</code> and <code>convert the text in image into encoded text</code>. I was just wondering if there are any companies providing OCR API for iPhone and/or Android phones? </p>","419628","","418183","","2011-01-19 22:05:25","2012-11-01 08:50:43","Is there any good OCR API for iPhone and/or Android phones?","<iphone><android><ocr>","2","0","7","2012-11-08 17:53:12",""
"4741465","1","4755932","","2011-01-19 22:20:02","2","1068","<p><strong>EDITED</strong></p><p>Thought I'd follow up a bit more and add the info here (as opposed to adding more comments below).</p><p>After installing Galileo and finding it went well and no android problems, I installed Helios.  It too went well and no Android problems (yet).</p><p>I did add the necessary lines to the eclipse config ini file to increase Memory size and added Garbage Collection. When I did this to Gannymede, it made a significant speed improvement but, I don't see any effect in either Galileo or Helios.  Makes me think that since they are not natively added for these two versions (at least not for 64-bit Cocoa / Mac), they may not be used. Nonetheless, they seem to have no negative affect. If anyone has knowledge to share on this, I'm all ears...</p><p>Thanks</p><hr><p>I'd like to get opinions on updating Eclipse for Android development.</p><p>I currently use Eclipse (Ganymede) 3.4.2. on a Mac (duo core intel)</p><p>I've read many posts regarding this and, while there are differing opinions, probably mostly with regard to the interface. I have read about issues with the Android SDK and ADT with Eclipse versions above 3.4.2. but, thus far, all posts seem to be prior to the Android Dev site recommending the following (they previously recommend not using above 3.4):</p><blockquote>  <ul>  <li>Eclipse 3.4 (Ganymede) or greater</li>  <li>Eclipse JDT plugin (included in most Eclipse IDE packages)</li>  <li><p>If you need to install or update Eclipse, you can download it from  <a href=""http://www.eclipse.org/downloads/"" rel=""nofollow"">http://www.eclipse.org/downloads/</a>.</p>    <p>Several types of Eclipse packages  are available for each platform. For  developing Android applications, we  recommend that you install one of  these packages:    o Eclipse IDE for Java Developers    o Eclipse Classic (versions 3.5.1 and higher)    o Eclipse IDE for Java EE Developers</p></li>  </ul></blockquote><p>Some questions:</p><ol><li>Is there an advantage in switching from 3.4.2 Ganymede to Classic 3.5.1?</li><li>Is it worth the trouble?</li><li>Is anyone having compatibility issues with Android and the ADT? using 3.5.1?</li></ol><p>Thanks - any input/recommendations are appreciated...</p>","382200","","382200","","2011-01-24 22:52:47","2011-01-24 22:52:47","Upgrading Eclipse SDK for Android Development","<android><eclipse>","1","5","","",""
"4741510","1","4777463","","2011-01-19 22:24:38","14","10304","<p>is it possible to use ressources like strings that are defined in library projects in the application-projects? if so, how?because i cant seem to resolve the strings i would like to resolve like this:</p><pre><code>String title = ""sample"";int id = ressources.getIdentifier(title, ""string"", ""com.package"");</code></pre><p>gives me this exception</p><p>WARN/ResourceType(278): No package identifier when getting value for resource number 0x00000000WARN/System.err(278): android.content.res.Resources$NotFoundException: String resource ID #0x0</p><p>the string (""sample"") i am looking for is definitely in this package provided in the strings.xml of the library project. i can even see it in the R.java</p>","97688","","97688","","2011-01-23 13:59:49","2011-11-11 22:22:54","android import ressources from library project","<android><xml><resources><android-library>","4","2","6","",""
"4741559","1","","","2011-01-19 22:30:51","0","735","<p>How could I connect to the desktop dock by code if the phone is already paired (not connected) to the dock? </p>","19601","","12707","","2011-01-19 22:32:07","2011-02-09 20:18:25","How to connect to desktop dock by code","<android><bluetooth><dock>","2","2","","",""
"4741665","1","4741847","","2011-01-19 22:43:24","3","127","<p>I've got an app in the Android Market that I can see on my phone (US T-Mobile Nexus One), but a user wrote in complaining that he can't see my app on the UK T-Mobile Android Market.</p><p>How can I test this?  I've already verified that I've checked ""All locations"" in my Market publisher console.</p>","54829","","","","","2011-01-30 12:29:06","Test whether Android app is available worldwide","<android><google-play>","3","1","","",""
"4741671","1","4914580","","2011-01-19 22:43:49","2","1669","<p>I'm working with an Expandable List, like this:<img src=""http://i.stack.imgur.com/FnHgD.png"" alt=""alt text""></p><p>The Expandable list activity has a method called ""OnGroupExpand"" which allows you to perform some work before the parent expands and it's children are exposed.</p><p>In my case, I want to attach a checkChangeHandler to each child's checkbox so that when it's clicked, I can mark the child as complete. I have the list showing up and the children show when the parent expands, but my check box does nothing.</p><p>Then, I try to add checkbox handlers dynamically in the  ""onGroupExpand"" method. However, when onGroupExpand is triggered <strong>I get an illegal cast exception</strong> when trying to get a reference to each child view.</p><pre><code>public void  onGroupExpand (int groupPosition) {      int numOfChildren = expListAdapter.getChildrenCount(groupPosition);            for(int i = 0; i &lt; numOfChildren; i++)            {                 //Get exception here because getChild() returns Object - but how else can                 //can I attach a check box to each child?                 View v = (View) expListAdapter.getChild(groupPosition, i);                 CheckBox cb = (CheckBox)v.findViewById( R.id.checkComplete );                  cb.setOnCheckedChangeListener(new OnCheckedChangeListener(){                    public void onCheckedChanged(CompoundButton arg0, boolean arg1) {                        Toast.makeText(getBaseContext(), ""Check Changed for "" + groupPosition, 2000);                    }                  });             }</code></pre><p>My primary question is about getting a reference to the Child view so that I can attach a handler dynamically. Please see the code comment where I'm trying to do this.Thanks for your time...</p>","462307","","462307","","2011-02-06 16:24:28","2011-02-06 21:47:57","Working with children in ExpandableListActivity","<android>","1","0","1","",""
"4741757","1","4741851","","2011-01-19 22:54:30","11","11116","<p>I'm building an app that will trigger notifications at specific time-intervals during the users waking hours.</p><p>I have an alarmManager running inside of a service.  The service is explicitly started via button click on the main activity and has the alarmManager executing notifications during specific time invervals.  How would I go about stopping the notifications during certain hours of the day?  I do not want these notification to be fired, for instance, while the user is sleeping.</p><p>My code that is currently firing notifications at user-set intervals is below (imports removed....this is long enough already):</p><pre><code>public class FartSmackinChunks extends Service {    public Notification scheduleNotification;    public AlarmManager alarmScheduleManager;    public PendingIntent alarmScheduleIntent;    private Boolean autoUpdateBoolean = true;    private int intervalsGoneByInt = 0;    private Notification notification;    public static final int NOTIFICATION_ID = 1;    @Override    public void onCreate() {        // TODO: Actions to perform when service is created.        int icon = R.drawable.icon;        String tickerText = ""INTERVAL FIRED"";        long when = System.currentTimeMillis();        scheduleNotification = new Notification(icon, tickerText, when);        alarmScheduleManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE);        String ALARM_ACTION;        ALARM_ACTION = ScheduleAlarmReceiver.ACTION_REFRESH_SCHEDULE_ALARM;        Intent intentToFire = new Intent(ALARM_ACTION);        alarmScheduleIntent = PendingIntent.getBroadcast(this, 0, intentToFire,        0);    }    @Override    public int onStartCommand(Intent intent, int flags, int startId) {        SharedPreferences mySharedPreferences =        PreferenceManager.getDefaultSharedPreferences(getApplicationContext());        boolean autoUpdateBoolean =        mySharedPreferences.getBoolean(""storedAutoUpdateBoolean"", false);        String updateFreq =        mySharedPreferences.getString(""storedInitialAverageTimeInterval"", ""00:00:00"");        SimpleDateFormat dfInterval = new SimpleDateFormat(""hh:mm:ss"");        Date intervalTimeAsDateObject = null;        long updateFreqMilliLong;        try {            intervalTimeAsDateObject = dfInterval.parse(updateFreq);        } catch (ParseException e) {            e.printStackTrace();        }        updateFreqMilliLong = intervalTimeAsDateObject.getTime() - 18000000;        if (autoUpdateBoolean) {            int alarmType = AlarmManager.ELAPSED_REALTIME_WAKEUP;            long timetoRefresh = SystemClock.elapsedRealtime() +            updateFreqMilliLong;            alarmScheduleManager.setInexactRepeating(alarmType,            timetoRefresh, updateFreqMilliLong, alarmScheduleIntent);            notifications();        } else alarmScheduleManager.cancel(alarmScheduleIntent);        return Service.START_NOT_STICKY;    };    private void notifications() {        **notification stuff in here***    }    @Override    public IBinder onBind(Intent intent) {        // TODO: Replace with service binding implementation.        return null;    }    @Override    public void onDestroy() {        this.alarmScheduleManager.cancel(alarmScheduleIntent);    }}</code></pre><p>.....and my broadcast receiver implementation here:</p><pre><code>import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;public class ScheduleAlarmReceiver extends BroadcastReceiver {    public static final String ACTION_REFRESH_SCHEDULE_ALARM    = ""com.application.ACTION_REFRESH_SCHEDULE_ALARM"";    @Override    public void onReceive(Context context, Intent intent) {        Intent startIntent = new Intent(context, SmokerReducerService.class);        context.startService(startIntent);    }}</code></pre><p>I'm having a little difficulty wrapping my brain around how this should be implemented.  </p><p>I was thinking to rework this code so that the alarmManager is fired at waketime and stopped at sleepTime, all while inside the service is a Timer that fires the notification method at specific intervals?  Is there a better way to go about doing this?</p><p>Any input would be appreciated.  I've been trying to work this out in my head for days now.</p><p>Thanks</p><p><strong>EDIT: @anyone who comes across this intending to use a Timer for daily notifications:</strong></p><p>A timer which runs inside of a service will be paused by the runtime when the device is put to sleep (ie...the user puts the phone in standby).  Therefor, using a Timer to fire notifications at specific time intervals won't work correctly within a service because when Android pauses the service, it also pauses the timer, which throws off the interval.</p><p>The correct way to do this is to use AlarmManager with an array of pending intents to set alarms at specific times during the day.  This ensures that even if the phone is put in standby, the notifications (or whatever you want to happen at that time) will still be executed.</p>","239932","","281545","","2013-03-16 18:09:34","2013-03-16 18:09:34","Use alarmManager and service to perform schedule notification only during specific time period","<android><alarmmanager>","1","2","5","",""
"4741815","1","","","2011-01-19 23:02:16","5","627","<p>I read some example in internet/book about the App Widget, a normal example to update the widget is in onUpdate(Context context, AppWidgetManager appWidgetManager,int[] appWidgetIds) method of AppWidgetProvider like this:</p><pre><code>final int N = appWidgetIds.length;for (int i=0; i&lt;N; i++) { int appWidgetId = appWidgetIds[i]; RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.mywidget_layout); updateViews.setTextViewText(R.id.mytext, ""updated text""); appWidgetManager.updateAppWidget(appWidgetId, updateViews);    }</code></pre><p>It update each Widgets in a loop.</p><p>But now, I have to implement an App Widget, it is updated in BroadcastReceiver, onReceive(Context context, Intent intent) method since there are no int[] appWidgetIds passed in. So I implemented the code like this:</p><pre><code>RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.mywidget_layout);updateViews.setTextViewText(R.id.mytext, ""updated text"");ComponentName myComponentName = new ComponentName(context, AndroidBatteryWidgetProvider.class);AppWidgetManager manager = AppWidgetManager.getInstance(context);manager.updateAppWidget(myComponentName, updateViews);</code></pre><p>It didn't update widget one-by-one, but actually all widgets were updated at once. Even though it worked as I want, but I got confused as to why there is no need to update all widgets one-by-one as before.</p><p>What's the difference between two method?</p><p>Can I send another broadcast from BroadcastReceiver.onReceive() to trigger AppWidgetProvider.onUpdate()? And how to?</p>","573528","","1979347","","2013-06-28 19:10:53","2013-06-28 19:10:53","What the difference to update Android App Widget between two approach?","<android><widget><broadcastreceiver><appwidget>","1","0","1","",""
"4741970","1","","","2011-01-19 23:23:40","0","194","<p>Currently trying to pull information from an SQLite3 database and display it in ListView</p><p>This current code:</p><pre><code>protected String doInBackground(final String... args) {             List&lt;String&gt; names = Foundation.this.application.getDataHelper().selectAll();             List&lt;String&gt; calculations = Foundation.this.application.getDataHelper().selectCalculation();             StringBuilder sb = new StringBuilder();             for (String name : names) {                sb.append(name + "" - "" + calculations + ""\n"");             }             return sb.toString();          }</code></pre><p>How do I display it in list view so it looks like this:</p><p>name - calculationname - calculationetc.</p><p>Any help would be greatly appreciated!</p>","576820","","","","","2011-01-19 23:23:40","Android - Output via ListView","<android><sql><listview>","0","2","","",""
"4742035","1","4742043","","2011-01-19 23:37:01","1","1883","<p>Is there a way to view an application database on an Android device? The only solution I've found requires a developer device and I don't have one. I know I can root it and get the same result, but I'd rather not do that.</p>","543677","","","","","2011-03-02 23:51:59","Viewing an Android application database","<android><database>","3","0","","",""
"4742057","1","4742694","","2011-01-19 23:41:22","0","255","<p>I have 2 BroadcastReceivers in my android application. They are in the same package.If in the onReceive() method, they both read/write a static class variable (in a separate Util class).  Does android create 1 copy of that static class variable or 2 (1 for each receiver)?</p><p>And what do I need to do to make sure they are accessing the static class variable not corrupting the data?</p>","286802","","","","","2011-01-20 01:42:08","2 BroadcastReceivers and 1 static variable","<android>","2","1","","",""
"4742248","1","","","2011-01-20 00:17:40","0","410","<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>I was a Java developer for 3 years, now I want to retire my Java skills for some time and go to some other languages(I already develop in more than 8 languages) that can be used for Android development and their tools/IDEs.</p><p><em>PS: I need tools/languages that I can build APKs that I can distribute at the Market using my account there</em></p>","126353","","89806","","2011-01-20 08:32:24","2011-01-20 08:32:24","Development Languages For Android","<java><android><mobile>","2","2","1","2011-01-20 00:53:36",""
"4742321","1","6629075","","2011-01-20 00:32:32","1","1114","<p>Trying to call from an android client, using the signpost oauth libs.   I generated new APIv2 keys, but didn't seem to make a difference.  The error I'm getting looks like:</p><pre><code>{""error"":{""text"":""Signature was invalid"",""id"":""INVALID_SIGNATURE"",""description"":""Invalid signature. Expected signature base string: GET&amp;http%3A%2F%2Fapi.yelp.com %2Fv2%2Fsearch&amp;category_filter%3Drestaurants%2520food%26limit%3D10%26ll %3D37.422005%252C-122.084095%26oauth_consumer_key %3DPbSjw9p08To_XXXXXXXXZg%26oauth_nonce %3D-81097XXXXXXXX560239%26oauth_signature_method%3DHMAC- SHA1%26oauth_timestamp%3D129XXXX091%26oauth_token %3DARfbDXXXXXXXXlBHARTgygLkcMw9h8eW%26oauth_version%3D1.0%26offset %3D0%26radius_filter%3D300%26sort%3D0""}} </code></pre><p>I double checked, and all my token and secret values exactly match what's in the manage API screen.  Code currently looks like this: </p><pre><code>if (location != null) {         String lat = Double.toString(location.getLatitude());         String lng = Double.toString(location.getLongitude());         String category = ""restaurants+food"";         String radius = ""300"";         String limit = ""10"";         String offset = ""0"";         String sort = ""0"";         try {                 String query = String.format(""http://api.yelp.com/v2/search?ll=%s, %s&amp;category_filter=%s&amp;radius_filter=%s&amp;limit=%s&amp;offset=%s&amp;sort=%s"",                                 URLEncoder.encode(lat, ENCODING_SCHEME),                                 URLEncoder.encode(lng, ENCODING_SCHEME),                                 category,                                 URLEncoder.encode(radius, ENCODING_SCHEME),                                 URLEncoder.encode(limit, ENCODING_SCHEME),                                 URLEncoder.encode(offset, ENCODING_SCHEME),                                 URLEncoder.encode(sort, ENCODING_SCHEME));                 OAuthConsumer consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);                 consumer.setTokenWithSecret(TOKEN, TOKEN_SECRET);                 consumer.setMessageSigner(new HmacSha1MessageSigner());                 consumer.setSendEmptyTokens(true);                 consumer.setSigningStrategy(new QueryStringSigningStrategy());                 String signedQuery = consumer.sign(query);                 Log.i(getClass().getName(), signedQuery);                 HttpGet request = new HttpGet(signedQuery);                 HttpClient httpClient = new DefaultHttpClient();                 HttpResponse response = (HttpResponse) httpClient.execute(request);                 HttpEntity entity = response.getEntity();                 String jsonResult = EntityUtils.toString(entity);                 Log.i(getClass().getName(), jsonResult); </code></pre>","106418","","","","","2011-07-08 18:52:44","Yelp v2 API from Android using SignPost oauth libs says Signature Invalid","<java><android><web-services><oauth><signpost>","1","1","","",""
"4742331","1","4798740","","2011-01-20 00:34:01","0","711","<p>How do you wrap two textures over a plane? I think I did it, but the texture is filling the whole object not just the sliver I want it to. </p><p>Any help is appreciated~Aedon</p><pre><code>InputStream is = context.getResources().openRawResource(R.drawable.woodtexture1);InputStream is2 = context.getResources().openRawResource(R.drawable.bandtest);Bitmap bitmap = null;Bitmap b2 = null;try {        //BitmapFactory is an Android graphics utility for images        bitmap = BitmapFactory.decodeStream(is);        b2 = BitmapFactory.decodeStream(is2);} finally {//Always clear and closetry {    is.close();    is2.close();    is = null;    is = null;} catch (IOException e) {}}    //Generate one texture pointer...    gl.glGenTextures(1, textures, 0);    //...and bind it to our array    gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);    //Create Nearest Filtered Texture    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);    //Different possible texture parameters, e.g. GL10.GL_CLAMP_TO_EDGE    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);    //Use the Android GLUtils to specify a two-dimensional texture image from our bitmap    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);    //Generate one texture pointer...    gl.glGenTextures(1, textures, 0);    //...and bind it to our array    gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);    //Create Nearest Filtered Texture    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);    //Different possible texture parameters, e.g. GL10.GL_CLAMP_TO_EDGE    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_ONE);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_ONE);    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, b2, 0);</code></pre>","480691","","480691","","2011-01-20 16:01:40","2011-01-25 20:59:25","Wrap two texture over a plane?","<android><opengl-es><mapping><textures>","1","1","","",""
"4742366","1","4742386","","2011-01-20 00:40:20","0","850","<p>I am working on a few demos getting Flash applications running Android. I was able to download the AIR SDK and can run a simple Flash application that displayed ""Hello, world!"" on my Android device.</p><p>Then, to complicate the application, I created an empty text field and converted it to a movie clip and named it ""text_mc"". Then in the frame I set the AS to</p><pre><code>_root.displayText();stop();</code></pre><p>Then I went to the Scene where execution begins and did:</p><pre><code>#include ""Demo.as""</code></pre><p>Then I created Demo.as in the same folder as demo.fla.</p><pre><code>var title = ""Hello, world!"";function displayTitle(){    text_mc.header_txt.text = title;}</code></pre><p>I try and build and receive the following error:</p><pre><code>Scene 1, Layer 'Layer 1', Frame 1, Line 1 1093: Syntax error.</code></pre><p>That line is <code>#include ""Demo.as""</code>. I pulled up some old flash applications I had worked on a while back and that's exactly how it was imported before. I tried adding a semicolon to the end, but it didn't change anything. What am I missing? How do I include an ActionScript file to execute it's functions?</p>","450780","","","","","2012-11-13 22:29:12","ActionScript #include ""Demo.as"" Syntax Error","<android><flash><actionscript-3><actionscript><air>","2","0","","",""
"4742394","1","4743085","","2011-01-20 00:44:57","-3","712","<p>Can anybody grab Calendar.apk and CalendarProvider.apk from their phone and upload it here: <a href=""http://code.google.com/p/android/issues/detail?id=1389"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=1389</a></p><p>I don't know if it is possible.</p><p>The alternative would be to build from source which requires Linux or Mac <a href=""http://source.android.com/source/download.html"" rel=""nofollow"">http://source.android.com/source/download.html</a></p><p>The link to the source code repository for the Calendar app <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Calendar.git;a=summary"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/packages/apps/Calendar.git;a=summary</a></p><p>Basically,, I am just trying to get the Calendar on my emulator.</p><p>I would do this myself, but I do not have a Linux or Mac machine.</p><p>Of course, if anybody knew of a link to an already built copy on Google or some other website then that would work also.</p>","463304","","463304","","2011-01-20 02:41:57","2011-01-20 03:09:24","Please either make or find a copy of Android's Calendar.apk","<android><build><download>","1","2","","2011-01-20 07:03:42",""
"4742403","1","4742423","","2011-01-20 00:47:21","5","2872","<p>I am beginning to develop a few Android applications and would like to know if I should get the <a href=""http://developer.htc.com/adp.html"">Android Developer Phone</a>. What if I get a normal Android phone? Does the Android Dev Phone provide any benefits other than custom Android builds. Plus I also read somewhere that the Dev Phone ""does not enforce signed system images"", what would that mean and is this limitation a showstopper?</p><p>Thanks for your time with this question.</p>","225499","","","","","2011-01-20 05:44:28","Do I need an Android Developer Phone to develop applications for the Android platform?","<android>","3","2","1","",""
"4742464","1","4744565","","2011-01-20 00:59:32","4","1368","<p>Is there any API in android which normalize phone numbers? e.g. when i look up phone number , some times there is 2223334444 some times, it is +2223334444</p><p>Thank you.</p>","286802","","","","","2013-06-03 08:47:19","Any API in android to normalize phone number","<android>","3","0","","",""
"4742587","1","4742859","","2011-01-20 01:20:42","0","328","<p>So I have a Cursor that is getting a result from a query to the application database. I know that there is at least one correct entry in the database since I was able to retrieve the string from the row previously. </p><p>I then changed some of the logic to accommodate the result and am suddenly getting null returned when calling c.getString(0). The relevant code is posted below. </p><p>I'm new to Android and Java, so I might be missing some subtlety that's causing the problem.</p><pre><code>   Cursor c = context.getContentResolver().query(tempJobName.build(),            null, null, null, null);   for (c.moveToFirst(); c.isAfterLast() == false; c.moveToNext())   {       Log.w(TAG, c.getString(0));       if (c.getString(0).equalsIgnoreCase(jobName))       {           existed = true;           break;       }    }</code></pre>","543677","","543677","","2011-01-20 01:37:19","2011-01-20 02:14:14","Help with the Android Cursor","<android><cursor>","1","4","","",""
"4742589","1","5970217","","2011-01-20 01:20:49","15","5721","<p>The bug I'm seeing is on the calls to reset() and release() never returning thus leaving my application in an indefinitely stopping state. It doesn't matter if I call stop() before reset() or release() the hang can always be reproduced.</p><p>Anyone experienced any similar issues with the MediaPlayer locking up?  Any tips? I'm working on a multi-threaded application.</p><p>The DDMS reports the following when looking at the threads that are holding:</p><blockquote>  <p>CLASS | METHOD | FILE | LINE | NATIVE</p>    <p>android.media.MediaPlayer _release    MediaPlayer.java    -2  true<br>  android.media.MediaPlayer release MediaPlayer.java    1049    false</p></blockquote>","398248","","","","","2012-10-26 05:42:49","Android MediaPlayer bug when using reset() and release() calls","<android><media-player>","3","0","4","",""
"4742611","1","","","2011-01-20 01:24:52","0","735","<p>I'm displaying some sql data in a list via a ListAdapter. Everything works fine except when I try to set a click listener to each item in the list. Nothing happens when I click any of the items; no error messages, it just silently fails.</p><pre><code>public class Notes extends ListActivity implements OnClickListener {    private static final String TAG = ""Notes"";    private NotesData notes;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        notes = new NotesData(this);        try {            Cursor cursor = getNotes();            showNotes(cursor); /* set the cursor to the listadapter */            ListView ls = (ListView) findViewById(android.R.id.list);            ls.setOnItemClickListener(new OnItemClickListener() {                public void onItemClick(AdapterView&lt;?&gt; parent,View v,                    int position,long id) {                    Toast.makeText(getApplicationContext(),""clicked"",                        Toast.LENGTH_SHORT).show();                }            });        } finally {            notes.close();        }    }</code></pre><p>main.xml, containing 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:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;Buttonandroid:id=""@+id/new_note_button""android:layout_height=""wrap_content""android:layout_width=""fill_parent""android:text=""@string/new_note""/&gt;&lt;ListViewandroid:id=""@android:id/list""android:layout_width=""wrap_content""android:layout_height=""wrap_content"" /&gt;&lt;TextView  android:id=""@+id/empty""  android:layout_height=""wrap_content""  android:layout_width=""wrap_content""  android:text=""@string/empty""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Is there something I'm missing?</p>","275552","","","","","2011-05-31 11:35:17","android onItemClick silently fails","<android>","4","8","","",""
"4742660","1","4742677","","2011-01-20 01:35:19","13","28275","<p>I having a problem in my switch/case statement. The error says : ""Case expressions must be constant expressions"". I understand the error and I can resolve it using If but can someone tells me why the case expression must be constant in a switch/case. A code example of my error :</p><pre><code>public boolean onOptionsItemSelected(MenuItem item) {    int idDirectory = ((MenuItem) findViewById(R.id.createDirectory)).getItemId();    int idSuppression = ((MenuItem) findViewById(R.id.recycleTrash)).getItemId();    int idSeeTrash = ((MenuItem) findViewById(R.id.seeTrash)).getItemId();    switch (item.getItemId()) {    case idDirectory:        createDirectory(currentDirectory);        break;    case idSuppression:        recycleTrash();        break;    case idSeeTrash:        seeTrash();        break;    }    return super.onOptionsItemSelected(item);}</code></pre><p>Thx for your explanation !!</p>","314862","","","","","2013-02-25 07:20:16","A Switch Java problem : case expressions must be constant expressions","<java><android><switch-statement>","3","4","8","",""
"4742740","1","4743271","","2011-01-20 01:49:35","5","4402","<p>I saw many examples about filtering Accelermeter's values, to cancel out the gravity (High-pass filter).</p><p>But most of them were 1st order one, which is said to be simple, but laggy and not the best one (though I know nothing about the filters or DSP).</p><p>Somebody in here said that there exists the better solution used in DSP to sense the motion. Regretfully I can't even imagine what it would be, as I am completely outsider to the field.</p><p>I hope somebody could tell at least the type of filters that can be used when dealing with the sensor. Of course, even brief introduction to the specific algorithm will be very pleased :)</p><p>Thanks in advance.</p>","582352","","582352","","2011-01-20 02:15:15","2011-01-20 04:32:13","Android Accelerometer filtering?","<android><filtering><signal-processing><sensor>","3","0","8","",""
"4742829","1","","","2011-01-20 02:06:57","0","308","<p>I'm totally new to Java and Android, so I think I'm probably missing something obvious.I'm writing an app where I sample the orientation sensor and write the result to a file on the SDCard as well as display it in a log on the screen.Everything works fine while the screen is on. Since I want to also operate while the screen goes dark, I added code to acquire a PARTIAL_WAKE_LOCK.From what I can tell, when the screen goes dark the sensors are still being sampled (making me think the wake lock worked), but none of the results are written to the SDCard. I think this is what is happening, because when I reawaken the screen by pressing the menu key, the log on the screen has all the transitions displayed that took place while the screen was off. But, when I look at the file created on the SD card, the only transitions recorded in the file are the ones that occurred while the screen was on.As for how I'm writing the file I have tried (I think I'm saying this right...) a FileWriter wrapped in BufferedWriter, and a FileWriter wrapped in a FileOutputStream.At first, the orientation sensor wasn't working even though I had the wake lock until I learned a work around where I added a BroadcastReceiver for Intent.ACTION_SCREEN_OFF and when I get it, I unregister the orientation listener, then re-register it.Do I need to ""unregister"" the FileWriter and ""re-register"" it or something?The weird part is that the output file contains all orientation changes before the Intent.ACTION_SCREEN_OFF is received, and all of them after Intent.ACTION_SCREEN_ON is received when I power the screen back up, but nothing in between.</p><p>I'm writing for Android 1.6 (I have a G1)My project is set to use SDK 4</p>","582363","","","","","2011-01-20 02:32:22","Not able to write to SDCard while screen is off even though I have PARTIAL_WAKE_LOCK","<android><android-wake-lock>","1","1","","",""
"4742868","1","","","2011-01-20 02:15:26","2","9612","<p>I'm afraid to already have the unfortunate answer to this question but just in case... I'm using a SurfaceView to do some image processing with bitmaps (lights and colors modifications) and I would need to import the modified bitmap (i.e. the content of the SurfaceView) in a new bitmap so that I can save it as an image file. </p><p>I've been looking around and it seems that it's possible to get a bitmap from View.getDrawingCache() but it doesn't work with SurfaceView. All I get is an empty bitmap.</p><p>Is there any solution to this?</p><p>Thanks</p>","370102","","","","","2011-01-20 02:24:42","Android: creating a Bitmap with SurfaceView content","<android><image-processing><bitmap><save><surfaceview>","1","0","3","",""
"4742897","1","4743154","","2011-01-20 02:22:39","1","413","<p>I am developing a game with a few <code>Animation</code>s running in infinite loops (live background - think of the home screen of Angry Birds). However, very quickly the app consumes 90% or more of my CPU (Nexus One / Froyo). These are very simple translation animations applied to <code>ImageView</code>s. Game development is novel to me, and I was wondering if there were best practices to avoid such CPU overload. Is the <code>Animation</code> object known to be expensive? Would direct bitmap drawing on the canvas be better suited?</p><p>Thanks in advance,</p><p>Michael</p>","318683","","","","","2011-01-20 03:25:36","Animations and CPU - best practice?","<android><performance><animation>","1","1","","",""
"4742898","1","4742955","","2011-01-20 02:23:18","3","11976","<p>I need to post data using the codes below, to php file that will save it in a text file.i just don't know how to create the php file to receive the data below and save it in a text file.as simple as possible.</p><p>Anyone can help, id really appreciated.</p><pre><code>try {      // Add your data      List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);      nameValuePairs.add(new BasicNameValuePair(""stringData"", ""12345""));      nameValuePairs.add(new BasicNameValuePair(""stringData"", ""AndDev is Cool!""));      httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));      // Execute HTTP Post Request      HttpResponse response = httpclient.execute(httppost);      String responseText = EntityUtils.toString(response.getEntity());     tv.setText(responseText);             } catch (ClientProtocolException e) {      // TODO Auto-generated catch block  } catch (IOException e) {      // TODO Auto-generated catch block  }  </code></pre>","582370","","471800","","2011-01-20 02:37:56","2011-01-20 03:43:12","Write Post data to file with PHP","<php><android><http><text><post>","2","0","1","",""
"4742938","1","4743148","","2011-01-20 02:30:52","3","4708","<ul><li>I have two Android projects in my Eclipse workspace (one is a library project used by the other)</li><li>Compiling the first (library) project works fine</li><li>The second one always hangs (at 98% complete)</li></ul><p>I know there are similar issues covered in articles and blogs, but none of these guides seem to work.</p><p>So far, I have:</p><ul><li>Cleaned projects</li><li>Created clean workspaces</li><li>Even had to do a clean install of Ubuntu (so all Eclipse, Java, Android SDK are clean)</li></ul><p>Please help! I am at the end of my ropes with this problem!</p><p>I am running Ubuntu 10.04, Eclipse 3.5.2 (everything is 32-bit). This setup had been working for a month or so, and just broke the other day.)</p>","478044","","","","","2013-09-17 14:51:10","Eclipse Android SDK - 'Building Workspace' deadlock","<android><eclipse>","3","4","2","",""
"4743031","1","4743063","","2011-01-20 02:57:00","3","798","<p>If I issue a toast when my App's activity is not in the foreground then the toast will still show up on the screen. How can I prevent my toast from showing up when my app is running in the background. i.e with none of its activities currently the activity being shown. </p><p>I am thinking that I must somehow detect that my activities are not the activity currently being shown and when true not issue any toasts; but how would I detect this condition?</p><p>Thanks</p>","467569","","","","","2013-10-15 17:45:27","Want to hide Android toast when app in background","<android><toast>","2","0","","",""
"4743057","1","","","2011-01-20 03:02:05","2","1546","<p>I have built app that display asp pages using WebView but some of the page want the authentication (Username ,Password )  to login I want my application to auto login to this page using Username and Password from my Application </p><p>This is  my code Please Help</p><hr><pre><code>public class eadvantage extends Activity {    /** Called when the activity is first created. */</code></pre><p>WebView mWebView;         @Override        public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.eadvantage);</p><pre><code>     HttpClient httpclient = new DefaultHttpClient();     HttpPost httppost = new HttpPost(""http://www.ucsi.edu.my/advantage/new/main.asp"");    try {        // Add your data        List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);        nameValuePairs.add(new BasicNameValuePair(""txtUserID"", ""12345));        nameValuePairs.add(new BasicNameValuePair(""txtPassword"", ""12345""));        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));        // Execute HTTP Post Request        HttpResponse response = httpclient.execute(httppost);        mWebView = (WebView) findViewById(R.id.webview);        mWebView.getSettings().setJavaScriptEnabled(true);        mWebView.loadUrl(""http://www.ucsi.edu.my/advantage/new/main.asp"");        mWebView.setWebViewClient(new WebViewClient());</code></pre>","582394","","50776","","2011-11-15 22:58:51","2012-03-28 07:16:50","Android WebView login on Android","<android><asp.net><login><passwords>","1","0","2","",""
"4743058","1","","","2011-01-20 03:02:17","7","3951","<p>What's the meaning of attribute 'msgid' in strings.xml ?</p><p>How to get its value?</p>","493162","","","","","2011-01-21 23:41:40","What's the meaning of attribute 'msgid' in strings.xml?","<android>","1","2","1","",""
"4743082","1","4743132","","2011-01-20 03:08:58","0","523","<p>I am attempting to create a toast pop-up when the icon at the bottom of the layout (the screen icon) <a href=""http://i.stack.imgur.com/C8WgN.png"" rel=""nofollow"">http://i.stack.imgur.com/C8WgN.png</a></p><p>I want the information entered to be put into the toast notification like a shipping address</p><p>First Last</p><p>Street</p><p>City State Zip</p><p>is there a way to do this where the toast calls on the Id's for the EditText views?</p><p>The .xml with the layout:</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_height=""fill_parent""             android:layout_width=""fill_parent""&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:stretchColumns=""2"" android:orientation=""vertical""&gt; &lt;TableRow&gt;     &lt;TextView         android:text=""First Name""         android:padding=""3dip"" android:layout_column=""0""/&gt;     &lt;TextView         android:text=""Last Name"" android:padding=""3dip""/&gt; &lt;/TableRow&gt; &lt;TableRow&gt;   &lt;EditText             android:layout_height=""wrap_content""             android:id=""@+id/EditText01""             android:inputType=""textPersonName""                  android:width=""150dip""/&gt;  &lt;EditText android:singleLine=""true""             android:inputType=""textPersonName""             android:isScrollContainer=""false""             android:layout_height=""wrap_content""             android:id=""@+id/EditText02""             android:lines=""1"" android:width=""150dip""&gt;&lt;/EditText&gt;  &lt;/TableRow&gt;  &lt;View     android:background=""#FF909090"" android:layout_height=""2px""/&gt;  &lt;TableRow&gt;     &lt;TextView         android:text=""Street Address""         android:padding=""3dip"" android:layout_column=""0""/&gt;  &lt;/TableRow&gt;  &lt;TableLayout&gt;    &lt;TableRow android:layout_width=""fill_parent""&gt;    &lt;TextView               android:text=""Line 1""               android:padding=""3dip""                             android:layout_column=""0""/&gt;    &lt;EditText    android:layout_height=""wrap_content""    android:id=""@+id/EditText03""                             android:inputType=""textPostalAddress""                             android:width=""255dip""/&gt;   &lt;/TableRow&gt;   &lt;TableRow android:layout_width=""fill_parent""&gt;      &lt;TextView     android:text=""Line 2""    android:padding=""3dip"" android:layout_column=""0""/&gt;   &lt;EditText    android:layout_height=""wrap_content""    android:id=""@+id/EditText04""                             android:inputType=""textPostalAddress""/&gt;  &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;TableLayout&gt;&lt;TableRow&gt;&lt;TextView android:text=""City"" android:padding=""3dip""  android:layout_column=""0"" /&gt;&lt;EditText  android:layout_height=""wrap_content"" android:id=""@+id/EditText05""  android:inputType=""text""  android:layout_width=""120px""/&gt;&lt;/TableRow&gt;&lt;TableLayout&gt;  &lt;TableRow&gt;    &lt;TextView        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:padding=""3dip""        android:text=""@string/state"" /&gt;    &lt;Spinner         android:layout_height=""wrap_content""        android:prompt=""@string/state""        android:id=""@+id/Spinner01""         android:layout_width=""wrap_content""/&gt;    &lt;TextView     android:layout_height=""wrap_content""     android:text=""Zipcode"" /&gt;    &lt;EditText      android:layout_height=""wrap_content""      android:inputType=""phone"" android:width=""80px""/&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;/TableLayout&gt;&lt;View     android:background=""#FF909090"" android:layout_height=""2px""/&gt; &lt;TableRow&gt;  &lt;TextView   android:layout_width=""120px""   android:layout_height=""wrap_content""   android:text=""Telephone Number""    android:padding=""3dip""/&gt; &lt;/TableRow&gt; &lt;TableLayout&gt;  &lt;TableRow&gt;   &lt;EditText    android:layout_height=""wrap_content""    android:inputType=""phone""    android:layout_width=""120dip"" /&gt;  &lt;Button android:id=""@+id/Button01""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""           android:padding=""3dip""           android:background=""@drawable/ic_monitor_grey""                   android:clickable=""true"" /&gt;  &lt;/TableRow&gt;  &lt;/TableLayout&gt;  &lt;/TableLayout&gt;  &lt;/ScrollView&gt;</code></pre><p>With my .java file being </p><pre><code>public class Basic extends Activity {public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.basic);    Spinner spinner = (Spinner) findViewById(R.id.Spinner01);    ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(            this, R.array.state_array, android.R.layout.simple_spinner_item);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spinner.setAdapter(adapter);   }}</code></pre>","581112","","581112","","2011-01-20 03:14:48","2011-01-20 05:38:55","Create a toast based on items inputted","<android><views><toast>","1","0","","",""
"4743116","1","4744499","","2011-01-20 03:17:00","65","80259","<p>How I can get screen width and height for use this value in</p><pre><code>@Override protected void onMeasure(int widthSpecId, int heightSpecId) {   Log.e(TAG, ""onMeasure"" + widthSpecId);   setMeasuredDimension(SCREEN_WIDTH, SCREEN_HEIGHT -       game.findViewById(R.id.flag).getHeight());}</code></pre>","278221","","403455","","2012-09-10 03:39:04","2014-03-25 06:47:21","Get Screen width and height","<android>","5","2","24","",""
"4743186","1","4744564","","2011-01-20 03:32:26","3","1844","<p>I just started doing my first Android app which happens to be an RSS Reader. I did a bit of googling about this but haven't seen a clear reference though. What I want to do is cache my xml file (the feed file) to the sdcard so when the phone is offline, the user can still view the feed by automatically telling the application to look for it when no network is detected. What I have now is the mechanism to cache the image but I wonder how to use this for other files since it was specified only for images that converts it to Bitmap using the HashMap().</p>","579385","","1046161","","2013-11-07 03:56:56","2013-11-07 03:56:56","Android: Cache XML File from RSS Feed","<android><xml><caching><rss><feeds>","1","3","","",""
"4743209","1","4743851","","2011-01-20 03:35:53","0","667","<p>I have an app that queries the MediaStore and shows all the images in the gallery. Simple. It works well on my Nexus S, Droid X, and all flavors of the emulator. It gives wrong results on my Friends Evo (2.2) however. He sees only two images (out of 100 in his gallery). Here is the code:</p><pre><code>    // Where images are stored    Uri uri = MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI;    // The columns we want    String[] projection = { MediaStore.Images.ImageColumns._ID, MediaStore.Images.Thumbnails.IMAGE_ID, MediaStore.Images.Thumbnails.KIND };    // Select only mini's    String selection = MediaStore.Images.Thumbnails.KIND + ""="" + MediaStore.Images.Thumbnails.MINI_KIND;    mCursor = this.managedQuery(uri, projection, selection, null, null);    mCursor.moveToFirst();    return mCursor;</code></pre><p><strong>Fairly simple and common. Here is the ImageAdapter:</strong></p><pre><code> View vi=convertView; ViewHolder holder; if(convertView==null){        vi = inflater.inflate(R.layout.image_item, null);        holder=new ViewHolder();        holder.text=(TextView)vi.findViewById(R.id.text);;        holder.image=(ImageView)vi.findViewById(R.id.image);        vi.setTag(holder);    }    else {        holder=(ViewHolder)vi.getTag();    }mCursor.requery();mCursor.moveToPosition(position);// Build the URIint id = mCursor.getInt(mCursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns._ID));Uri uri = Uri.withAppendedPath(MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, """" + id);    holder.image.setTag(uri);    holder.image.setImageURI(uri);</code></pre><p>..again, straightforward. This is code I have cobbled together from dozens of examples, all basically the same. What is it about the EVO that could cause this not to work.</p><p>If I remove the query restriction:</p><pre><code>// Select only mini'sString selection = MediaStore.Images.Thumbnails.KIND + ""="" + MediaStore.Images.Thumbnails.MINI_KIND;</code></pre><p>...then it returns almost double the ""images"" than there are in the Gallery, but most do not have Thumbnail images.</p><p>Any ideas?</p>","232240","","","","","2011-01-20 05:46:21","MediaStore query works on most phones, but not EVO","<android><image><media>","1","2","1","",""
"4743377","1","4743465","","2011-01-20 04:14:52","0","222","<p>I am unsure as to how to approach this.I have taken some guidelines given by another person on here and have now gotten to the point of it crashing when I push the button (the monitor)<a href=""http://i.stack.imgur.com/C8WgN.png"" rel=""nofollow"">http://i.stack.imgur.com/C8WgN.png</a></p><p>I want to be able to post a toast notification when the button is pushed, and then have it go away after a few secondsAlso, is there a way to do it to where it will still create a toast notification although some of the info (like line2) is empty?</p><p>basic.java:</p><pre><code>public class Basic extends Activity {public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.basic);    Spinner spinner = (Spinner) findViewById(R.id.Spinner01);    ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(            this, R.array.state_array, android.R.layout.simple_spinner_item);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spinner.setAdapter(adapter);final Button display = (Button) findViewById(R.id.Button01);display.setOnClickListener(new OnClickListener() {public void onClick(View v) { EditText firstField = (EditText) findViewById(R.id.First);    EditText lastField = (EditText) findViewById(R.id.Last);    EditText line1Field = (EditText) findViewById(R.id.Line1);    EditText line2Field = (EditText) findViewById(R.id.Line2);    EditText cityField = (EditText) findViewById(R.id.City);    EditText stateField = (EditText) findViewById(R.id.Spinner01);    EditText zipField = (EditText) findViewById(R.id.Zip);    //EditText phoneField = (EditText) findViewById(R.id.Telephone);    final Editable firstName = firstField.getText();    final Editable lastName = lastField.getText();    final Editable lineOne = line1Field.getText();    final Editable lineTwo = line2Field.getText();    final Editable city = cityField.getText();    final Editable state = stateField.getText();    final Editable zip = zipField.getText();    //final Editable phoneNumber = phoneField.getText();     Toast toDisplay = Toast.makeText(null, firstName, 10);     toDisplay.show();     }     }); }    }</code></pre><p>I would like the layout of the toast to be multi-lined, and looking like a postal address</p><p>First Last<br>Street Line 1<br>Line 2<br>City, State Zip</p>","581112","","244296","","2011-01-20 04:19:36","2011-01-20 04:34:22","Calling final Editables to use in toast","<android><onclick><toast><android-edittext>","1","0","","",""
"4743416","1","4864288","","2011-01-20 04:23:17","8","5857","<p>I need to play videos from Youtube as MP4.</p><p>My system (an Android Phone) does not support Flash.</p><p>It can play MP4 videos.</p><p>So I'm thinking of creating a web page that plays videos from Youtube.</p><p>I need to get MP4 videos to play in my page.</p><p>What approaches are there?</p>","450431","","38403","","2011-02-09 07:09:35","2011-02-28 09:54:50","How to play MP4 videos from Youtube?","<javascript><android><youtube>","4","1","","",""
"4743510","1","","","2011-01-20 04:42:34","0","1828","<p>I cant seem to get a simple TCP connection going between a java server application and Android (I have tried both the emulator and the Android Dev Phone 2). I am getting this error on the Emulator ""The application Data Receive (process com.mdog.datareceive) has stopped unexpectedly. Please try again."" </p><p>Forgive me but I am very new to android. So I don't know how to debug it... but I am not trying anything too complex. Eventually I want to try and ""consume"" the bytes I am receiving in the application. and have the TCP run in the background... but for now simply getting the phone and computer to communicate would be great.</p><p>If you can help me that would be awesome.</p><p>Code for Android side:  </p><pre><code>public class Receive extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TextView tv = new TextView(this);        Socket connectionSocket = null;        byte[] inputHolderByteArray = new byte[5*1024];        /* Connect to Server */        try {            connectionSocket = new Socket(""192.168.0.104"", 11313);        } catch (UnknownHostException e) {            e.printStackTrace();        } catch (IOException e) {            e.printStackTrace();        }        /* Send an s to server to start transmission */        try {            PrintWriter out = new PrintWriter(connectionSocket.getOutputStream(), true);            out.print('s');            out.flush();        } catch (IOException e1) {            e1.printStackTrace();        }        /* read server transmission */        try {            connectionSocket.getInputStream().read(inputHolderByteArray);        } catch (IOException e) {            e.printStackTrace();        }        tv.setText(""done"");        setContentView(tv);    }}</code></pre>","577017","","405015","","2011-01-20 04:45:45","2011-01-20 19:22:25","Android TCP - program crashes","<java><android><tcp><client><client-server>","2","2","","",""
"4743938","1","4744193","","2011-01-20 05:58:27","0","347","<p>My web service response comes in this format: <code>19/2/2011</code>. I want to compare this web service date to my own calendar date. </p><p>Is there any answer and how to highlight that date?</p>","565024","","399317","","2012-12-03 09:58:56","2012-12-03 09:58:56","How to compare web service date to calendar date in Android?","<android><web-services><calendar>","2","0","1","",""
"4743958","1","4744155","","2011-01-20 06:02:10","3","6775","<p>I am creating some buttons and add them to a linear layout which is defined as</p><pre><code>&lt;LinearLayout        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:orientation=""horizontal""        android:id=""@+id/mylayout""&gt;    &lt;/LinearLayout&gt;</code></pre><p>The buttons are created with</p><pre><code>for (int i = 0; i &lt; 3; i++)    {        Button btn = new Button(activity);        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(                LinearLayout.LayoutParams.WRAP_CONTENT,                LinearLayout.LayoutParams.WRAP_CONTENT);        lp.setMargins(1, 1, 1, 1);        btn.setText(""Button"");        btn.setPadding(0, 0, 0, 0);        mylayout.addView(pv, lp);    }</code></pre><p>These buttons always have a margin (about 3px) which I'd like to remove. Is there anything I am missing? If I use a custom view which I created there is no space between them.</p><p>Should I set </p><p>lp.setMargins(-3, -3, -3, -3);</p><p>which removes the margin? Is there a drawback with this?</p>","292233","","","","","2011-09-20 21:21:57","Margin of buttons in linear layout","<android><gui>","2","1","1","",""
"4744127","1","4744748","","2011-01-20 06:31:14","0","568","<p>Hii</p><p>I want to know the mechanism how the screen changes automatically from horizontally to vertically or vice-versa in android when we change the position of phone. Example in terms of coding would be highly appreciable.</p><p>Regards</p><p>Piyush</p>","510617","","","","","2011-01-20 08:07:57","How screen changes from horizontally to vertically or Vice-versa automatically in Android","<android>","3","0","","",""
"4744135","1","6738901","","2011-01-20 06:32:43","0","1251","<p>The goal:</p><p>Remote control of an Android device.  I'm trying to make an alternate input device for physically disabled individuals who can't use a touchscreen or the tiny slide-out keyboard on an Android phone or tablet.  I need to be able to control the entire Android device - send keystrokes like KEYCODE_DPAD_DOWN, etc.  A joystick or other input device would be used, and ideally the command would be sent to the device via Bluetooth.</p><p>Here's where I am now:</p><p>I can send these keystrokes through Monkeyrunner to control an active device (Thanks for the help, Roman R.!).  Problem is, that requires a computer to be connected to the device and configured to program it.  I'd like to eliminate the computer from the system altogether, and allow an individual to have complete (remote) control over their Android device.  Perhaps through an app or service that would run in the background, handle the Bluetooth exchange and produce the corresponding Key Events.</p><p>My research thus far:</p><p>It is possible to send KeyEvents, but this only seems to allow interaction with your own app - entering text into an EditText box, for example. (<a href=""http://developer.android.com/resources/articles/creating-input-method.html"" rel=""nofollow"">link</a>)</p><p>It is also possible (as far as I understand) to trap a physical key event on the device and perform some action in response to that event.  </p><p>Finally, it looks like Google knows exactly what I'm trying to do but has disallowed it for security reasons.  (<a href=""http://www.anddev.org/novice-tutorials-f8/throwing-simulating-keystrokes-programatically-t717-15.html"" rel=""nofollow"">link</a> - at the bottom of the page someone links to <a href=""http://groups.google.com/group/android-developers/msg/001710cd8adf3a41"" rel=""nofollow"">this</a> blog, where it is stated that this is not allowed.)</p><p>I understand there could be security concerns for implementing something like this, but the whole goal of this project is to give the user complete (remote) control over the Android system.  Obviously it would be necessary to explicitly require the user to authorize this control.  This sort of control is already available, they call it <a href=""http://developer.android.com/guide/topics/admin/device-admin.html"" rel=""nofollow"">Device Administration</a>.  This allows an app to control very intimate parts of the system, and correctly requires explicit authorization to do so.  This remote control system would be no different.</p><p>In my case it would be used to assist my sister, who is physically disabled.  You might use it to create a flight control system or some other gamepad-like controller.  There are a lot of reasons to implement this sort of interface.</p><p>Finally, Google is constantly updating Android, and the blog entry above that states this cannot be done is over two years old.  A lot has changed since then...</p><p>Does anyone have any idea how to do this?  If it can't be done yet, do you know how to make an official request for a new feature to be added to the Android system that might allow it in a later release?</p><p>Thanks!</p>","500069","","","","","2011-07-18 20:26:53","Remote control of Android device - mimic physical keystrokes to any installed app?","<android><bluetooth><disability>","1","0","","",""
"4744139","1","","","2011-01-20 06:33:18","0","564","<p>The current edit text control is not capable of displaying/Rendering Hindi text correcltly , hence I need to develop an edit text from scratch, i have done this in winCE(overridding CEdit), so i have that cpp code, i am new to android can some body please tell me how can i create the edit text(override) in android, i have installed the android SDK's for windows XP and using eclipse as an editor, if requires i have no problems to move to Ubuntu as the development environment.</p>","582552","","","","","2011-01-20 07:05:34","how to create edit text control","<android>","1","0","","",""
"4744165","1","4744686","","2011-01-20 06:37:32","2","135","<p>I have Samsung Galaxy version  Android 2.2 I want to know that I can update with 2.3 or Upper version like 3.0 Or not?????Pls Reply me  </p>","545951","","","","","2011-01-20 08:08:36","Android Version UPdated","<android>","2","4","1","2011-01-20 08:09:13",""
"4744169","1","4745075","","2011-01-20 06:38:08","1","2056","<p>In an iPhone Application, I just write one line to get the complete path for a specific file ( as below ).</p><pre><code>NSString *strPath=[[NSBundle mainBundle] pathForResource:@""myjavascript"" ofType:@""js""];</code></pre><p>My question is How to get the complete path for a specific file which is located under <strong>Assets folder in Android</strong>.</p><p>Sample Image. </p><p><img src=""http://i.stack.imgur.com/sHPPx.png"" alt=""alt text""></p>","140765","","","","","2011-01-20 08:54:18","Android - How to determine the Absolute path for specific file from Assets?","<javascript><android><android-assets>","1","2","","",""
"4744182","1","","","2011-01-20 06:39:22","0","763","<p>I have a WebView loading a swf using loadUrl(). My app saves files from the web locally and then uses flash to show them.  Keep running into a 2148 error for the crossdomain.xml.</p><p>Anyone get around this and access files from the SD Card or application cache somewhere to show in a Flash component embedded into a WebView?</p>","573716","","","","","2011-01-20 18:58:35","How to get around Security Sandbox issues with Flash in an Android WebView","<android><flash><webview><crossdomain.xml>","1","0","0","",""
"4744187","1","","","2011-01-20 06:40:26","22","29145","<p>I have written following code to add new contact in android phone book, it is working but when i open contact menu, i cannot see the new contact added. Can anyone help me to find out what's wrong here? </p><pre><code>import android.app.Activity;import android.os.Bundle;import android.content.ContentResolver;import android.content.ContentValues;import android.provider.ContactsContract;import android.widget.TextView;import android.widget.Toast;public class AddContacts extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        try        {            ContentResolver cr = this.getContentResolver();            ContentValues cv = new ContentValues();            cv.put(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME, ""New Name"");            cv.put(ContactsContract.CommonDataKinds.Phone.NUMBER, ""1234567890"");            cv.put(ContactsContract.CommonDataKinds.Phone.TYPE, ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE);            cr.insert(ContactsContract.RawContacts.CONTENT_URI, cv);            Toast.makeText(this, ""Contact added"", Toast.LENGTH_LONG).show();        }        catch(Exception e)        {            TextView tv = new TextView(this);            tv.setText(e.toString());            setContentView(tv);        }    }}</code></pre>","574114","","","","","2013-09-04 05:34:08","How to add new contacts in android","<android>","2","9","26","",""
"4744210","1","","","2011-01-20 06:44:40","0","1612","<p>I am facing problem in developing phone contacts but it produce error.I am using code</p><pre><code>Intent i = new Intent(); i.setAction(Intent.ACTION_DELETE);i.setData(ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, Long.parseLong(Integer.toString(id))));startActivity(i);</code></pre><p>Please guide me.Thanks in advance.</p><p>error message:</p><pre><code>Android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.DELETE dat=content://com.android.contacts/contacts/5 } </code></pre>","555688","","546999","","2011-01-20 07:07:22","2011-01-20 10:19:40","How to delete phone contact?","<android>","1","3","0","",""
"4744373","1","4744497","","2011-01-20 07:08:07","1","1714","<p>Tell me if there is a common language for developing applications for the platform Android, Windows Mobile, iOS?I mean, that is iOS Objective-C/J, for Android - Java, C++, Windows Mobile - C++ etc.I'd even like to write in JavaScript (like JSCocoa for iOS), but I can't find a translator for other platforms. Are there any common solution implementation?</p>","458167","","226958","","2011-01-20 10:24:14","2012-08-21 11:00:44","Unified language for developing apps for Android, WinMobile, iOS","<javascript><android><ios><windows-mobile>","4","0","5","",""
"4744424","1","4744596","","2011-01-20 07:16:53","0","222","<p>I am using JFreeChart ( <a href=""http://www.jfree.org/jfreechart/"" rel=""nofollow"">http://www.jfree.org/jfreechart/</a> ) as a charting library. But for Android I use DroidCharts ( <a href=""http://code.google.com/p/droidcharts/"" rel=""nofollow"">http://code.google.com/p/droidcharts/</a>) which is basically JFreechart for Android. I have created a chart on android. Initially it is clear, then I can add some values to plot and it plots on the chart. </p><p>When I rotate my android orientation from portrait to landscape, the screen is blank once again due to the android lifecycle (it goes on to destroy and onCreate is called once again). </p><p>I need to know how can I save my plot points using ""onSaveInstanceState"" to create once again on ""onRestoreInstanceState"" when the orientation is changed. ? Any code snippet would be helpful . Thanks </p>","435597","","","","","2011-01-20 07:46:03","Android DroidCharts SaveInstanceState Issue?","<android><charts><parcelable><savestate><android-lifecycle>","1","0","","",""
"4744589","1","","","2011-01-20 07:45:07","0","368","<p>I had originally asked the question here:<br><a href=""http://www.experts-exchange.com/Programming/Languages/Java/Android/Q_26754261.html"" rel=""nofollow"">http://www.experts-exchange.com/Programming/Languages/Java/Android/Q_26754261.html</a><br>But I guess this might be a better place to ask the question.</p><p>I have made an Android application that calls some native code. When I first run the application on an Android 2.2 device (by pressing the icon) it works fine but if I press the back button and then relaunches the application by pressing its icon again, the application crashes (info from eclipse):</p><pre><code> 01-19 13:21:51.989: INFO/DEBUG(30): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***    01-19 13:21:51.989: INFO/DEBUG(30): Build fingerprint: 'generic/sdk/generic:2.3/GRH55/79397:eng/test-keys'    01-19 13:21:51.989: INFO/DEBUG(30): pid: 354, tid: 381  &gt;&gt;&gt; Test.Application &lt;&lt;&lt;    01-19 13:21:51.989: INFO/DEBUG(30): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000005a</code></pre><p>I have checked the native code and don't see any bugs. The code also works the first time I run it. It has something to do with that not all resources are freed when pressing the back button. I though I had found a simple solution to the problem by inserting System.exit(0) in onDestroy() but this only works when the application is in landscape mode.</p><p>In landscape mode the life cycle is like this:</p><pre><code>    01-15 22:38:29.913: INFO(18062): onCreate    01-15 22:38:30.143: INFO(18062): onResumePressed back button    01-15 22:38:34.093: INFO(18062): onPause    01-15 22:38:34.343: INFO(18062): OnDestroy</code></pre><p>In portrait mode the life cycle is like this:</p><pre><code>    01-15 22:41:00.343: INFO(18167): onCreate    01-15 22:41:00.863: INFO(18167): onResume    01-15 22:41:00.913: INFO(18167): onPause    01-15 22:41:00.913: INFO(18167): OnDestroy    01-15 22:41:01.423: INFO(18167): onCreate    01-15 22:41:01.693: INFO(18167): onResumePressed back button    01-15 22:41:05.663: INFO(18167): onPause    01-15 22:41:05.963: INFO(18167): OnDestroy</code></pre><p>So in portrait mode things happen twice - so if I insert System.exit(0) in onDestroy the application will not launch when the device is upright/in portrait mode.</p><p>I guess the best solution would be to find the real cause to why the native code is crashing but so far I have not found the cause. Maybe it has something to do with low memory. I have tried running Debug.getNativeHeapFreeSize() and the amount of free memory is very low at times but the error message says ""fault address"".</p><p>After the application has crashed I press its icon and run the application again without problems. So the application only successfully launches half of the times you press its icon.</p><p>Do you have any idea what is wrong or perhaps a workaround? I have searched for an answer on this site and found some information about the double life cycle problem and how to get a JNI stack trace. I will look some more at it and see if I can find the cause. I could also make an ugly workaround that ensures System.exit(0) is not called the first time onDestroy is called if the device is in portrait mode but if the application then is installed on a device that does not have this double life cycle problem the application will not shut down properly when in portrait mode.</p><p>/Kim</p>","582610","","582610","","2011-01-20 11:33:35","2011-01-20 21:47:12","Android application crashes when relaunching","<c++><android><debugging><jni><portrait>","1","1","","",""
"4744646","1","4744963","","2011-01-20 07:53:02","3","74","<p>I start my Android app, which in turns initializes some state on the first screen. The app has a many screens, and after randomly navigating through some screens, I minimize the app using the ""Home key"". Now after running some other apps from the phone, the OS decides that it needs to free up my app and hence kills it.</p><p>Now when I again click on the app icon, the OS remembers the history and tries to go back to the screen from where I minimized the app. But, the problem is since the OS purged my app sometime back, all my states are lost and the screen may not have any relevance.</p><p>How do I tackle this? How do I ensure that the OS calls the launcher screen, if it has been purged before and not the Activity in the history?</p>","177890","","","","","2011-01-20 12:08:11","Application getting purged by Android","<android><android-layout><android-manifest>","2","0","","",""
"4744819","1","","","2011-01-20 08:19:42","2","520","<p>I need to write a wifi scanner running on Android. It works fine except that I could not find a way to get <code>AccessPoint</code> band (<code>a/b/g/n</code>) out of that ScanResult provided by Android wifi manager. </p><p>Is there any way to get this info? Or do I need to go to lower level? (maybe impossible).</p><p>Any help would be highly appreciated.</p>","582646","","881286","","2013-08-18 01:49:06","2013-08-18 01:49:06","How to get wifi band info. in Android?","<android><wifi>","0","0","","",""
"4744849","1","4744918","","2011-01-20 08:25:06","1","2594","<p>I have searched the forums, but none of the solutions proposed curedmy problem.I cannot compile my project.I get this error, followed by :</p><pre><code>Description Resource Path Location TypeProject 'videothumb' is missing required source folder: 'gen' videothumb Build pathBuild Path ProblemThe project cannot be built until build path errors are resolved videothumb Unknown    Java ProblemUnable to resolve target 'android-5' until the SDK is loaded. MojoGBAMulti Unknown    Android Target ProblemUnable to resolve target 'android-5' until the SDK is loaded. MojoGBAMulti UnknownAndroid Target ProblemR cannot be resolved image.java /ImageThumbnailsActivity/src/image/Thumbnailsline27    Java ProblemR cannot be resolved image.java /ImageThumbnailsActivity/src/image/Thumbnailsline36Java ProblemR cannot be resolved MediaPlayerDemo.java /Media/src/media/media line49 Java ProblemR cannot be resolved MediaPlayerDemo.java /Media/src/media/media line50 Java ProblemR cannot be resolved MediaPlayerDemo.java /Media/src/media/media line52 Java ProblemR cannot be resolved MediaPlayerDemo.java /Media/src/media/media line56 Java ProblemR cannot be resolved MediaPlayerDemo_Audio.java /Media/src/media/media line80    Java ProblemR cannot be resolved MediaPlayerDemo_Video.java /Media/src/media/media line106    Java ProblemR cannot be resolved MediaPlayerDemo_Video.java /Media/src/media/media line107    Java ProblemR cannot be resolved MediaPlayerDemo_Video.java /Media/src/media/media line112    Java ProblemR cannot be resolved MediaPlayerDemo_Video.java /Media/src/media/media line114    Java ProblemR cannot be resolved MediaPlayerDemo_Video.java /Media/src/media/media line116    Java ProblemR cannot be resolved MediaPlayerDemo_Video.java /Media/src/media/media line118 Java ProblemR cannot be resolved MediaPlayerDemo_Video.java /Media/src/media/media line120 Java ProblemR cannot be resolved videothumb.java /Media/src/media/media    line 26    Java ProblemR cannot be resolved videothumb.java /Media/src/media/media    line 41    Java Problem</code></pre><p>Something is definitively going wrong here.</p><p>Can you help me? I am stuck...</p><p>new for android application....</p><p><img src=""http://i.stack.imgur.com/DHH8H.png"" alt=""alt text""><img src=""http://i.stack.imgur.com/nUKcT.png"" alt=""alt text""><img src=""http://i.stack.imgur.com/UAlbY.png"" alt=""alt text""><img src=""http://i.stack.imgur.com/XQz7O.png"" alt=""alt text""><img src=""http://i.stack.imgur.com/lP96I.png"" alt=""alt text""><img src=""http://i.stack.imgur.com/eTkBz.png"" alt=""alt text""><img src=""http://i.stack.imgur.com/4YHJA.png"" alt=""alt text""></p>","486554","","486554","","2011-01-20 09:15:59","2011-04-12 11:57:38","error messages i do not understand during a build of android project","<android><build><path>","1","1","","",""
"4744894","1","","","2011-01-20 08:32:37","3","736","<p>How can i know if the keyboard is open or not?</p>","508197","","","","","2012-09-13 17:29:34","android keyboard open issue","<android>","2","0","","",""
"4744912","1","4745063","","2011-01-20 08:34:46","2","1229","<p>I'm a novice Android developer. I used the code given at Google's Android developer site and developed the <a href=""http://developer.android.com/resources/tutorials/views/hello-gallery.html"" rel=""nofollow"">gallery widget</a>.</p><p>Now I wanna tweak it. When the image is clicked currently it shows the index instead I wanna show the preview in the space available below the gallery. </p><p>As per my understanding I need to change the code somewhere here:</p><pre><code>g.setOnItemClickListener(new OnItemClickListener() {    public void onItemClick(AdapterView parent,             View v, int position, long id) {        Toast.makeText(HelloGallery.this, """" + position,            Toast.LENGTH_SHORT).show();</code></pre><p>Instead of a Toast I wanna use some function that would bring up the preview. Can someone help me please.</p><p>Thanks in advance.</p>","348301","","418183","","2011-01-20 09:18:15","2011-01-20 09:18:15","Preview Image when clicked- Android","<java><android><gallery>","1","0","1","",""
"4745026","1","4745036","","2011-01-20 08:47:55","0","1670","<p>I have the following code:</p><pre><code>public boolean onCreateOptionsMenu(Menu menu){   menu.add(0, AUSRECHNEN_ID, Menu.NONE,""Umrechnen"");   return super.onCreateOptionsMenu(menu);   setContentView(R.layout.main);}</code></pre><p>I get an ""unreachable code"" warning right next to the <code>setContentView()</code> method.</p><p>What am I doing wrong?</p>","582674","","21234","","2011-01-20 08:52:47","2011-01-20 08:52:47","Unreachable Code when using setContentView()","<android>","1","1","","",""
"4745034","1","","","2011-01-20 08:49:19","0","1088","<p>I am using <code>twitter4j</code> API for an Android app. I have given the Consumer key and the Consumer secret.</p><p>What can be the reason for this error? Is there any example code for android for twitter4j?</p><blockquote>  <p>Logcat Error:</p></blockquote><pre><code>01-20 09:23:26.719: ERROR/!!! Error--&gt;(565): 401:Authentication credentials were missing or incorrect.01-20 09:23:26.719: WARN/System.err(565): 401:Authentication credentials were missing or incorrect.01-20 09:23:26.719: WARN/System.err(565): TwitterException{exceptionCode=[fde06384-e892de6e], statusCode=401, retryAfter=0, rateLimitStatus=null, version=2.1.10}01-20 09:23:26.719: WARN/System.err(565):     at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:310)01-20 09:23:26.738: WARN/System.err(565):     at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:72)01-20 09:23:26.738: WARN/System.err(565):     at twitter4j.internal.http.HttpClientWrapper.get(HttpClientWrapper.java:94)01-20 09:23:26.748: WARN/System.err(565):     at twitter4j.Twitter.verifyCredentials(Twitter.java:1394)01-20 09:23:26.748: WARN/System.err(565):     at twitter4j.Twitter.getId(Twitter.java:212)01-20 09:23:26.748: WARN/System.err(565):     at twitter4j.AsyncTwitter.getId(AsyncTwitter.java:128)01-20 09:23:26.748: WARN/System.err(565):     at com.cabot.android.twittertest.MainTwitter.OAuthLogin(MainTwitter.java:121)01-20 09:23:26.748: WARN/System.err(565):     at com.cabot.android.twittertest.MainTwitter.onClick(MainTwitter.java:89)01-20 09:23:26.766: WARN/System.err(565):     at android.view.View.performClick(View.java:2485)01-20 09:23:26.766: WARN/System.err(565):     at android.view.View$PerformClick.run(View.java:9080)01-20 09:23:26.766: WARN/System.err(565):     at android.os.Handler.handleCallback(Handler.java:587)01-20 09:23:26.766: WARN/System.err(565):     at android.os.Handler.dispatchMessage(Handler.java:92)01-20 09:23:26.766: WARN/System.err(565):     at android.os.Looper.loop(Looper.java:123)01-20 09:23:26.766: WARN/System.err(565):     at android.app.ActivityThread.main(ActivityThread.java:3647)01-20 09:23:26.781: WARN/System.err(565):     at java.lang.reflect.Method.invokeNative(Native Method)01-20 09:23:26.781: WARN/System.err(565):     at java.lang.reflect.Method.invoke(Method.java:507)01-20 09:23:26.781: WARN/System.err(565):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)01-20 09:23:26.781: WARN/System.err(565):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)01-20 09:23:26.781: WARN/System.err(565):     at dalvik.system.NativeStart.main(Native Method)01-20 09:23:29.487: DEBUG/dalvikvm(60): GC_CONCURRENT freed 937K, 46% free 4276K/7879K, external 1865K/3065K, paused 9ms+8ms</code></pre><p>Code: </p><pre><code>void OAuthLogin() {    try {        AsyncTwitter ATObj=new AsyncTwitter(username,password, this);         Twitter twitter=new Twitter();        twitter.setOAuthConsumer(TWITTER_CONSUMER_KEY, TWITTER_SECRET_KEY);        RequestToken twitterRequestToken= twitter.getOAuthRequestToken();        String token = twitterRequestToken.getToken();        String tokenSecret = twitterRequestToken.getTokenSecret();        AFobj.getBasicAuthorizationInstance (username,password);        int UserId=ATObj.getId();        ResponseList&lt;UserList&gt; AllUserList=twitter.getAllUserLists(UserId);         String URI=UserId+"""";        Toast Display1=Toast.makeText(getBaseContext(), URI, Toast.LENGTH_LONG);        Display1.show();        String test=""TEST01"";        Toast Display=Toast.makeText(getBaseContext(), test, Toast.LENGTH_LONG);        Display.show();        } catch (Exception ex) {        Toast.makeText(this, ex.getMessage(), Toast.LENGTH_LONG).show();        Log.e(""  !!! Error--&gt;"", ex.getMessage());        ex.printStackTrace();      }</code></pre><p>Thanks in advance. :)</p>","573700","","573700","","2011-01-21 13:21:13","2011-01-21 13:21:13","401 Authentication credential missing or incorrect using Twitter4j","<android><twitter4j>","1","5","","",""
"4745199","1","4745422","","2011-01-20 09:08:25","0","1249","<p>I suppose the title is a bit confusing but here is what I'm trying to do:</p><p>I have a class called <code>ManageClass</code> which lists the entries of a database. I have written another private class within <code>ManageClass</code> which extends <code>AsyncTask</code> so that I can display a progress dialog while I'm getting the data from the database. Now when I click on an item I create a new Intent which takes me to my <code>ViewItem</code> class. I've added a button there so that the user can delete that particular entry that he/she is looking at. All of the above work fine.</p><p>Now I want after deleting that entry to kill the activity and go back to the previous one (the one displaying the list) but I want to refresh the listings. </p><p>My problem is that I cant use <code>onResume()</code> cause it will also be called when the activity is resumed after the <code>AsyncTask</code> finishes. </p><p>Could anyone help me with that? I'm really stuck... all ideas are welcome!!!</p>","582665","","561309","","2012-02-21 14:26:58","2012-02-21 14:26:58","Android restart activity (with AsyncTask) on completion of another activity","<android><activity><android-asynctask><kill><onresume>","2","0","","",""
"4745210","1","","","2011-01-20 09:09:47","0","518","<p>I'm collecting crash logs from clients via code that runs with the <code>Thread.setDefaultUncaughtExceptionHandler</code> callback. </p><p>Before I wasn't attaching a device ID with my uploads, but now I am, and I'm seeing some very strange reports. Essentially, over the span of 1-2 minutes, I see 50 or so <code>OutOfMemoryError</code> crash logs all uploaded by the same client, sometimes with two or more logs reported in the same second. </p><p>I assume that threads spawned by a parent thread with a <code>setDefaultUncaughtExceptionHandler</code> are also using the handler, so once the first <code>OutOfMemoryError</code> happens a cascading effect takes places that touches all application threads at once. Maybe many of these threads are able to upload a crash log before the whole app goes down. However, I would have expected this exception to cause the app to terminate much sooner.</p><p>Here's a concrete example -- I see this stack ~10 times in the span of 45sec and sometimes repeatedly within the same second, and I would have expected the first such exception to fully take down the app, not drag it out: </p><pre><code>java.lang.RuntimeException: An error occured while executing doInBackground()    at android.os.AsyncTask$3.done(AsyncTask.java:200)    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)    at java.util.concurrent.FutureTask.setException(FutureTask.java:124)    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)    at java.util.concurrent.FutureTask.run(FutureTask.java:137)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)    at java.lang.Thread.run(Thread.java:1096)Caused by: java.lang.OutOfMemoryError    at java.lang.AbstractStringBuilder.(AbstractStringBuilder.java:83)    at java.lang.StringBuilder.(StringBuilder.java:68)    at com.appspot.myapp.util.RestClient.convertStreamToString(RestClient.java:306)    at com.appspot.myapp.util.RestClient.executeRequest(RestClient.java:288)    at com.appspot.myapp.util.RestClient.Execute(RestClient.java:185)    at com.appspot.myapp.GridViewActivity$LoadProfilesTask.doInBackground(GridViewActivity.java:1135)    at com.appspot.myapp.GridViewActivity$LoadProfilesTask.doInBackground(GridViewActivity.java:1)    at android.os.AsyncTask$2.call(AsyncTask.java:185)    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)</code></pre><p>Can someone explain what happens when Android encounters an <code>OutOfMemoryError</code> and why I'm seeing this behavior? It's as if the app continues to limp along and is treating these errors as nonfatal...?</p><p>Thanks!</p>","61072","","561309","","2012-02-21 14:28:59","2012-02-21 14:28:59","Android OutOfMemoryErrors don't appear to immediately terminate activity - why?","<android><exception-handling><out-of-memory>","2","0","","",""
"4745212","1","4746689","","2011-01-20 09:10:03","3","799","<p>Is it a way to test GPS in emulator?</p><p>I know how to send a single coordinate, I saw also possibility to load GPX- oder KML-files (haven't try it really), but what I mean, it would be nice to have some component, which would send coordinates periodically emulating normal human motion :)</p><p>Maybe there are possibilities to do it programmatically?</p><p>Thank you very much for any advice or link.</p><p>Mur</p>","408780","","","","","2011-01-20 11:44:57","Test GPS in Android","<android><android-emulator><gps>","2","0","2","",""
"4745225","1","4747336","","2011-01-20 09:11:33","0","759","<p>I was using Android API, to send some data using http POST method:</p><pre><code>        HttpClient httpclient = new DefaultHttpClient();        HttpPost httppost = new HttpPost(""http://myapp.com/"");        try {            List parameters = prepareHttpParameters();            HttpEntity entity = new UrlEncodedFormEntity(parameters);            httppost.setEntity(entity);            ResponseHandler responseHandler = new BasicResponseHandler();            response = httpclient.execute(httppost, responseHandler);            Toast.makeText(this, response, Toast.LENGTH_LONG).show();        } catch (IOException e) {            // TODO: manage ClientProtocolException and IOException            Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();        }</code></pre><p>and my parameters are prepared here:</p><pre><code>List parameters = new ArrayList(2);parameters.add(new BasicNameValuePair(""usr"", ""foo"" ));parameters.add(new BasicNameValuePair(""pwd"", ""bar"" ));return parameters;</code></pre><p>But it seems to be wrong because I do not get any expected response.</p><p>I have tested the same request with same parameters using Curl and I get expected response.</p><p>Am I wrong with my code?</p><p>Thank you very much</p>","576931","","561309","","2012-02-21 14:14:58","2012-02-21 14:14:58","How can I post in Android?","<java><android><http-post>","1","2","","",""
"4745230","1","","","2011-01-20 09:11:54","0","607","<p>I have added a frame by frame animation for a button background. When the button is pressed, the animation is started, and when it's finished, another activity is started. The animation is simulating drawing a circle on the button, and the first frame is transparent.</p><p>The problem is that when I'm coming back to the first activity, the button will have the last animation frame as the background (the whole circle). I tried to set a transparent frame as the last frame from the list. But in this case, the circle will disappear before the next activity is launched.</p><p>Is there an easy way to have the last frame before launching the next activity, and then, when the user get back to the first activity, to have the animation at the first frame?</p>","460611","","561309","","2012-02-21 14:14:13","2012-02-21 14:14:13","Frame by frame button animation","<android>","1","0","","",""
"4745247","1","","","2011-01-20 09:13:43","6","374","<p>How can i obtain PreApproval key for PayPal subscription? How the Preapprovals are working in Android?</p>","523058","","","","","2011-12-06 18:19:14","Preapproval key in Android","<android><paypal-subscriptions>","1","1","1","",""
"4745282","1","4746601","","2011-01-20 09:18:09","1","560","<p>I get this message all the time on my error log:</p><pre><code>Could not create the view: Could not initialize class com.ibm.icu.impl.JavaTimeZone.</code></pre><p>This situation its bad: each time when I try to open a class I get this message.  </p><p>What should I do to solve this problem?</p>","581828","","561309","","2012-02-21 13:25:32","2012-09-16 17:17:02","""Eclipse"" trouble message error appear constantly","<android><eclipse>","3","0","","",""
"4745366","1","4745403","","2011-01-20 09:28:21","9","27181","<p>If I run my project this error will come build path problem how to solve this error. </p><p>error:</p><ol><li>Description Resource Path LocationType Project 'videothumb' is missingrequired source      folder: 'gen'videothumb Build path Build PathProblem</li><li>The project cannot be built untilbuild path errors are resolvedvideothumb Unknown      Java Problem</li></ol><p>Can any one help me?</p><p><img src=""http://i.stack.imgur.com/mTD7p.png"" alt=""alt text""></p>","486554","","486554","","2011-01-20 10:48:54","2013-07-26 04:24:09","How to resolve build path errors?","<android><buildpath>","5","3","1","",""
"4745465","1","","","2011-01-20 09:38:43","1","631","<p>I have a spinner control, I wish it can be used like a html ""select"" control.For example, image a country select control (in html), populated with a countries code array and countries name array.I wish this behavior because, countries code will not change, but countries name could does. If I want to display this name in english, spanish, french, etc, but countries codes never change.So my question is How can I make this with an spinner in Android?Or if you think that this is not ""correct"", Can you suggest me some solution?</p><p>Thank you very much.</p>","576931","","","","","2011-01-20 09:43:08","How to make a spinner like html style in Android?","<android><spinner>","0","2","","",""
"4745486","1","","","2011-01-20 09:40:33","0","1114","<p>I've been attempting to install and set up the Java JDK 1.6 and Eclipse (helios) on Windows 7.</p><p>I have downloaded the 32 bit of each, as the 64 bit Eclipse version didn't want to work.  </p><p>So, having done that and amended the eclipse.ini file to pick up the right java.exe, I'm getting exit code 13 when running Eclipse.  Have I made an error in the eclipse.ini some place?  </p><p>Thanks!</p><p>-startupplugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar--launcher.libraryplugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1.R36x_v20100810-productorg.eclipse.epp.package.java.product--launcher.defaultActionopenFile--launcher.XXMaxPermSize256M-showsplashorg.eclipse.platform--launcher.XXMaxPermSize256m-vmC:\Program Files (x86)\Java\jdk1.6.0_23\jre\bin\java.exe--launcher.defaultActionopenFile-vmargs-Dosgi.requiredJavaVersion=1.5-Xms40m-Xmx384m</p>","505934","","505934","","2011-01-20 09:55:46","2013-06-18 23:14:00","Setting up Eclipse and Java JDK","<java><android><eclipse><jre><jdk1.6>","3","2","","",""
"4745489","1","4745867","","2011-01-20 09:40:45","0","386","<p>i want to communicate with emulator and pc.i am using emulator as a client and pc as server.i am sending data from emulator to pc properly but i am unable to get the response of the server i.e pc.can u plz help me in this issue</p>","555653","","","","","2011-01-20 10:19:46","getting response from server","<android><sockets>","1","1","","",""
"4745492","1","4745546","","2011-01-20 09:41:01","1","2001","<p>How do you scale and rotate images on a Canvas on Android?</p>","244540","","22610","","2013-06-20 17:21:56","2013-06-20 17:38:46","Scaling and rotating images on a Canvas on Android","<android>","3","0","","",""
"4745515","1","4745575","","2011-01-20 09:42:48","0","214","<p>Hi i have doubt about about gc. suppose that if am using 5 static button with some images as their background,if am finish the application then the memory associated with the button would release or not ? </p>","487219","","991737","","2012-01-10 19:13:50","2012-01-10 19:13:50","Android Memory issue","<android><memory><memory-management>","3","1","","",""
"4745542","1","4745588","","2011-01-20 09:44:25","1","2893","<p>I would like to embed a videoview in a webview. I would like to play an mp4 video on that video view. Please guide me with some pointers so that i can implement this.<hr> <strong>Update</strong><br>I have only html4 browser</p>","449378","","449378","","2011-01-20 09:50:07","2011-01-20 10:24:18","How to embed a videoview in Webview?","<android><webview><videoview>","1","1","","",""
"4745547","1","","","2011-01-20 09:44:57","1","3784","<p>i am trying to draw some lines via code on top of a background image to make a sort of graph-like thing, but i can't seem to find a method to do this, can anyone help?</p><p>*edit here is what i have so far, but i get a force close on the line Canvas canvas</p><p>*edit2 sorry for ignorance on my part, i am new to this, i've not used logcat before.  i opened logcat and it appears that it might be a ""immutable bitmap passed to canvas constructor"".  after some googling, i think this is getting to be beyond the scope of what i am capable of, i didn't realize drawing was this involved.  thanks for the help anyways all.</p><pre><code>package com.surreall;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas; import android.graphics.Color;import android.graphics.Paint;import android.os.Bundle;public class drawline extends Activity {/** Called when the activity is first created. */// load picture and create a canvas to draw onto@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);  // set drawing colourBitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.felt2);Canvas canvas = new Canvas(bitmap);//Paint p = new Paint();//p.setColor(Color.RED);// draw a line onto the canvas//canvas.drawLine(0, 0, 50, 50, p);}}</code></pre>","486086","","486086","","2011-01-20 12:21:55","2011-01-20 12:21:55","trying to draw some simple lines in android","<android><draw>","1","2","1","",""
"4745550","1","4747260","","2011-01-20 09:45:16","1","1001","<p>I am trying to make a secure connection to a OCS server through https in android.</p><p>I found the EasySSLFactory and EasyX509TrustManager classes to make android trust the certificate but I don't know how to initialize only one time the EasySSLFactory and EasyX509TrustManager objects.</p><p>I have the following code to accept a certificate and make a single connection:</p><pre><code>    SchemeRegistry schemeRegistry = new SchemeRegistry();    schemeRegistry.register(new Scheme(""https"", new EasySSLSocketFactory(),            443));    HttpParams params = new BasicHttpParams();    params.setParameter(ConnManagerPNames.MAX_TOTAL_CONNECTIONS, 3);    params.setParameter(ConnManagerPNames.MAX_CONNECTIONS_PER_ROUTE,            new ConnPerRouteBean(1));    params.setParameter(HttpProtocolParams.USE_EXPECT_CONTINUE, false);    HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);    HttpProtocolParams.setContentCharset(params, ""utf8"");    int timeoutConnection = 1000;    HttpConnectionParams.setConnectionTimeout(params, timeoutConnection);    int timeoutSocket = 1000;    HttpConnectionParams.setSoTimeout(params, timeoutSocket);    clientConnectionManager = new ThreadSafeClientConnManager(params,            schemeRegistry);    HttpClient client = new DefaultHttpClient(clientConnectionManager,            params);</code></pre><p>In order to make a new connection in an new method, I have to do write those lines too... Is there a way that I can put them in the class constructor and then do connections in that class without writing that before the connection..</p><p>Thank you</p>","449310","","","","","2011-03-07 23:09:30","android: how to accept CA certificate","<android><ssl-certificate><ca>","1","0","1","",""
"4745639","1","","","2011-01-20 09:54:15","0","2409","<p>I have a seekbar in android app to capture the values that ranges from 10-90. What is the java code for capuring the values.</p><p>please helpThanks.</p>","582760","","","","","2013-04-12 06:32:37","android seekbar widget","<android><seekbar>","2","0","1","",""
"4745652","1","4748416","","2011-01-20 09:55:05","18","8515","<p>When working on Android, does ORMLite only save shallow level objects? I have a data structure with nested Objects, both of which are newly created, and I would like to be able to save both of them with one call to dao.create()</p><p>For exmaple, I have the following Parent Class. </p><pre><code>@DatabaseTablepublic class Parent {  @DatabaseField(generatedId=true)  public int id;  @DatabaseField  public String name;  @DatabaseField  public Child child;}</code></pre><p>and the following Child Class.</p><pre><code>@DatabaseTablepublic class Child {  @DatabaseField(generatedId=true)  public int id;  @DatabaseField  public String name;}</code></pre><p>I want to be able to do the following.</p><pre><code>Parent parent = new Parent();parent.name = ""ParentName"";Child child = new Child();child.name = ""ChildName"";parent.child = child;//  .. get helper and create dao object...dao.create(parent);</code></pre><p>When doing this, the parent object is persisted but not the child object and the auto-generated <code>child_id</code> column in the parent table is set to 0. Is this normal behavior? Is there a way to have nested objects persisted and propagate the primary key up?</p>","210130","","179850","","2011-10-15 18:44:51","2013-12-18 20:57:55","Saving nested foreign objects with ORMLite on Android","<android><ormlite>","4","1","9","",""
"4745661","1","4746711","","2011-01-20 09:56:11","0","609","<p>I want compile an email with HTML content which users can see before send it.</p><p>I use an </p><pre><code>Intent email = new Intent(Intent.ACTION_VIEW); </code></pre><p>But I cannot see an HTML interpreted, see the image below:<img src=""http://i.stack.imgur.com/upxxY.png"" alt=""alt text""></p><p><img src=""http://i.stack.imgur.com/upxxY.png"" alt=""alt text""></p><p>There is a way to show an HTML interpreted email content?</p><p>Thanks a lot</p>","554892","","554892","","2011-01-20 10:02:37","2011-01-22 05:39:20","Email View doesn't show interpreted HTML","<android>","1","0","","",""
"4745670","1","4826571","","2011-01-20 09:56:56","4","9671","<p>i'm tring to use the gps on the android emulator, i've the following code:</p><pre><code>public class NL extends Activity { private LocationManager locmgr = null; @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.nl);        locmgr = (LocationManager) getSystemService(Context.LOCATION_SERVICE);        Criteria crit = new Criteria();        crit.setAccuracy(Criteria.ACCURACY_FINE);        String provider = locmgr.getBestProvider(crit, true);        Location loc = locmgr.getLastKnownLocation(provider);        Toast msg = Toast.makeText(this, ""Lon: "" + Double.toString(loc.getLongitude()) + "" Lat: "" + Double.toString(loc.getLatitude()), Toast.LENGTH_SHORT);        msg.show();    }}</code></pre><p>i've added the following line at the manifest:</p><pre><code>&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;</code></pre><p>and i've set the gps location with the DDMS method and either with the geo fix method, but when i run the code, i get a NullPointerExeption at the Toast line, probably cause loc is null.</p><p>I don't understand where the error is... can you help me please?</p><hr><p>UPDATE!</p><p>Thanks for your help, now i use the following code and i don't get any error, but it doesn't run the code inside onChangeLocation... it doesn't run the Toast and don't return any message in the log!</p><pre><code> public class NL extends Activity {        private LocationManager locmgr = null;        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.nl);            locmgr = (LocationManager) getSystemService(Context.LOCATION_SERVICE);         // Define a listener that responds to location updates            LocationListener locationListener = new LocationListener() {                public void onLocationChanged(Location loc) {                  // Called when a new location is found by the network location provider.                    Log.i(""NOTIFICATION"",""onLocationChenged Triggered"");                    Toast msg = Toast.makeText(NetworkLocator.this, ""Lon: "" + Double.toString(loc.getLongitude()) + "" Lat: "" + Double.toString(loc.getLatitude()), Toast.LENGTH_SHORT);                    msg.show();                }                public void onStatusChanged(String provider, int status, Bundle extras) {}                public void onProviderEnabled(String provider) {}                public void onProviderDisabled(String provider) {}              };            // Register the listener with the Location Manager to receive location updates            locmgr.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);        }    }</code></pre><p>Thanks!</p>","561438","","561438","","2011-01-20 14:09:20","2011-01-28 09:19:31","Android - Unable to get the gps location on the emulator","<java><android><android-emulator><gps>","4","8","1","",""
"4745706","1","4745766","","2011-01-20 10:00:51","0","1215","<p>This is a simple program i created to test BOOT_COMPLETED event of Android but it's not working! am i doing something wrong here?</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.enea.training.bootdemo""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;uses-permission android:name=""android.permission.RECEIVE_BOOT_COMPLETED"" /&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;receiver android:name="".BootDemoReceiver""&gt;            &lt;Intent-filter&gt;                &lt;action android:name =""android.intent.action.BOOT_COMPLETED""&gt;&lt;/action&gt;            &lt;/Intent-filter&gt;        &lt;/receiver&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;/manifest&gt; </code></pre><p>java:</p><pre><code>public class BootDemoReceiver extends BroadcastReceiver {    static final String TAG = ""BootDemoReceiver"";     @Override     public void onReceive(final Context context, final Intent bootintent) {         Log.v(TAG, ""Come on"");     }}</code></pre>","192901","","546999","","2011-01-20 10:02:31","2012-02-13 16:07:28","Android BOOT_COMPLETED not working!","<android><htc-hero>","1","1","","",""
"4745708","1","4771597","","2011-01-20 10:01:27","0","284","<p>Is there a way I can get a reference to the Views that onFling has not yet revealed? I'm extending Gallery, and in my onFling method, of course I can get the current View (the one that is showing already). But I haven't found a way to get the views that are about to be flung by. I need to change properties like backgroundColor (it's a Gallery of TextViews).</p>","561772","","561772","","2011-10-06 20:13:49","2011-10-06 20:13:49","Override Views that OnFling hasn't Shown Yet","<android><android-layout><textview><gallery><onfling>","1","0","","",""
"4745808","1","","","2011-01-20 10:14:08","0","203","<p>HiI need to make an application for android that will display current weather and weather forcast for any city. I know google has an api for that.While searching in the web I found some website that has exactly what i am looking for.They provide the code. BUT they dont have any step by step tutorial. What I am looking for is a tutorial which explains in details so that i can understand the basics.Can anybody plz suggest me such tutorial?? would be a great help for me.</p><p>cheers</p>","574308","","","","","2011-01-20 10:44:49","read from XML or api into android","<android>","1","0","","",""
"4745810","1","4745917","","2011-01-20 10:14:22","5","8904","<p>I want to open a ProgressDialog when I click on the List Item that opens the data of the clicked Item form the Web Service. The ProgressDialog needs to be appeared till the WebContent of the clicked Item gets opened.</p><p>I know the code of using the Progress Dialog but I don't know how to dismiss it particularly.</p><p>I have heard that Handler is to be used for dismissing the Progress Dialog but I didn't found any worth example for using the Handler ultimately. </p><p>Can anybody please tell me how can I use the Handler to dismiss the Progress Dialog?</p><p>Thanks,david</p>","422859","","","","","2011-01-21 16:10:02","ProgressDialog dismissal in android","<android><handler><progressdialog>","2","0","2","",""
"4745812","1","4746209","","2011-01-20 10:14:29","0","528","<p>friends,i am using following xml actually i want to draw image along with textbox and then etc controls above and then prefrences below thats why used relativelayout at root level</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""&gt;        &lt;PreferenceCategory                android:title=""First Category""&gt;                &lt;ListPreference                        android:title=""List Preference""                        android:summary=""This preference allows to select an item in a array""                        android:key=""listPref""                        android:defaultValue=""digiGreen""                        android:entries=""@array/justforme_title_array""                        android:entryValues=""@array/sub_justforme_array"" /&gt;        &lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;&lt;/RelativeLayout&gt;</code></pre><p>and java code</p><pre><code>public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);        setContentView(R.layout.justforme);}</code></pre><p>it is giving me following error</p><pre><code>01-20 15:07:54.412: ERROR/AndroidRuntime(648): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.abc/com.abc.JustForMe}: android.view.InflateException: Binary XML file line #3: Error inflating class PreferenceScreen</code></pre><p>any help would be appreciated.</p>","249991","","","","","2011-01-20 10:57:01","PrefrenceScreen basic implementation problem?","<android>","2","0","","",""
"4745899","1","","","2011-01-20 10:23:16","5","9174","<p>I am trying to access <code>CallManager</code> class object from <code>com.android.internal.telephony</code> package. </p><p>Here is my code:</p><pre><code>ClassLoader classLoader = TestActivity.class.getClassLoader();final ClassLoader classLoader = this.getClass().getClassLoader();try {    final Class&lt;?&gt; classCallManager =        classLoader.loadClass(""com.android.internal.telephony.CallManager"");    Log.i(""TestActivity"", classCallManager);} catch (final ClassNotFoundException e) {    Log.e(""TestActivity"", e);}</code></pre><p>Unfortunately, this is throwing a <code>ClassNotFoundException</code>. The same approach allows me to access <code>PhoneFactory</code>, but apparently I'm not allowed to access <code>CallManager</code>.</p><p>If I could reach the class, then I'd want to proceed using the class as follows:</p><pre><code>Method method_getInstance;method_getInstance = classCallManager.getDeclaredMethod(""getInstance"");method_getInstance.setAccessible(true);Object callManagerInstance = method_getInstance.invoke(null);</code></pre><p>Can anyone help me on this?</p><p>Thanks in advance,<br>Harsha C</p>","572679","","154306","","2011-01-20 14:45:48","2012-07-19 07:00:09","how to access com.android.internal.telephony.CallManager?","<java><android><telephony>","7","1","3","",""
"4745988","1","6131725","","2011-01-20 10:32:09","24","36171","<p>Is there a way in Android to detect if the software (a.k.a. ""soft"") keyboard is visible on screen?</p><p>Thank you.</p>","358306","","265807","","2012-05-01 02:08:45","2014-02-21 21:59:09","How do I Detect if Software Keyboard is Visible on Android Device?","<android><keyboard>","6","1","9","",""
"4746058","1","4746136","","2011-01-20 10:38:24","38","11099","<p>I would like to reference a string from another string in my strings.xml file, like below (specifically note the end of the ""message_text"" string content):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string name=""button_text""&gt;Add item&lt;/string&gt;    &lt;string name=""message_text""&gt;You don't have any items yet! Add one by pressing the \'@string/button_text\' button.&lt;/string&gt;&lt;/resources&gt;</code></pre><p>I've tried the above syntax but then the text prints out the ""@string/button_text"" as clear text. Not what I want. I would like the message text to print ""You don't have any items yet! Add one by pressing the 'Add item' button.""</p><p>Is there any known way to achieve what I want? </p><p><strong>RATIONALE:</strong><br/>My application has a list of items, but when that list is empty I show a ""@android:id/empty"" TextView instead. The text in that TextView is to inform the user how to add a new item. I would like to make my layout fool-proof to changes (yes, I'm the fool in question :-)</p>","569885","","569885","","2011-01-24 10:11:59","2013-12-24 10:49:02","Reference one string from another string in strings.xml?","<android><xml><string>","4","0","0","",""
"4746063","1","","","2011-01-20 10:39:15","1","1305","<p>how to strore data in shared preferences in table format </p>","582788","","582788","","2011-01-20 10:45:08","2012-06-01 08:32:52","shared preferences in android","<android>","4","0","1","",""
"4746075","1","4757419","","2011-01-20 10:40:06","10","6928","<p>I have the following code to take a video as a raw resource, start the video and loop it but I need the video to loop seamlessly as of now when it comes to an end of the clip and starts the clip again the transition between causes a flicker for a split second, which I really can't have for my app. </p><pre><code>public class Example extends Activity {    VideoView vv;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        vv = (VideoView)findViewById(R.id.VideoView01);        //Video Loop        vv.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {            public void onCompletion(MediaPlayer mp) {                vv.start(); //need to make transition seamless.            }        });        Uri uri = Uri.parse(""android.resource://com.example/""                + R.raw.video);        vv.setVideoURI(uri);        vv.requestFocus();            vv.start();    }}</code></pre><p>The clip is only 22 seconds long but was created to be seamless so it is possible to work without the delay.</p>","400406","","","","","2011-12-08 13:21:33","Seamless video Loop with VideoView","<java><android><videoview>","4","0","1","",""
"4746293","1","","","2011-01-20 11:02:08","13","9542","<p>I have textview which I need to linkify. Here's what I am doing..</p><pre><code>TextView text = (TextView) view.findViewById(R.id.name);text.setText(""Android...Update from Android"");Pattern pattern = Pattern.compile(""Android"");String scheme = ""www.android.com"";Linkify.addLinks(text, pattern, scheme);</code></pre><p>The text-view is displayed correctly with the text ""Android...Update from Android"", but I am facing two problems.</p><p>1) My text string has two instances of the string ""Android"". So, both the text are linkified. I want only the first occurrence to be linkified. How should I go about it?</p><p>2) When I click the linkfy text, it opens the browser, but the URL is weird. The url it tries to open is ""www.comandroid"". I don't know whats going wrong here. The text ""android"" in the URL is being replaced. Am I doing something wrong when Linknifying the text.</p><p>Any help will be highly appreciated.</p>","548903","","905093","","2011-10-12 23:56:27","2012-11-20 05:48:53","Android: Linkify TextView","<android><linkify>","6","2","2","",""
"4746340","1","4746578","","2011-01-20 11:08:17","0","1252","<p>I have an EditTextPreference. After the user has edited the preference and pressed ok I then want to check the value for formatting errors before committing. </p><pre><code>public class Preferences_Default extends PreferenceActivity implements OnSharedPreferenceChangeListener  {     @Override     protected void onCreate(Bundle savedInstanceState) {             super.onCreate(savedInstanceState);             addPreferencesFromResource(R.layout.prefs_default);    }  } @Override     protected void onResume() {         super.onResume();         // Set up a listener whenever a key changes                     getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);     }    @Override    protected void onPause() {        super.onPause();        // Unregister the listener whenever a key changesgetPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);        }    @Override    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {        //This just calls a function to update the Pref Summary        Preference pref = findPreference(key);        initSummary(pref);    }</code></pre><p>Where would I put the call to the function that checks the value and what is the code to re-commit the preference value if altered.</p>","548552","","469983","","2011-03-29 11:09:22","2011-03-29 11:09:22","Check and Format preference string value before committing back to preferences","<android><preferences>","1","0","","",""
"4746570","1","","","2011-01-20 11:32:37","0","771","<p>In my application I'm trying to launch the Video with resolution set to minimum.I'm using the EXTRA_VIDEO_QUALITY intent for that.Here is the relevant code:</p><pre><code>int NEW_VIDEO = 1;Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE); intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0);intent.putExtra(MediaStore.EXTRA_SIZE_LIMIT, 600000);startActivityForResult(intent, NEW_VIDEO); </code></pre><p>However, when the video camera starts it is set to the resolution that was previously defined in the device and ignores the EXTRA_VIDEO_QUALITY intent.</p><p>Does anybody encountered this issue before?</p><p>Thanks,Yair</p>","566108","","","","","2011-01-20 11:50:57","HTC Aria 2.2 ignores EXTRA_VIDEO_QUALITY intent","<android><video><video-capture>","1","0","","",""
"4746641","1","4746732","","2011-01-20 11:40:20","3","560","<p>I have created an android application but I don't want unauthorized persons to access and use my application. How can I make my application a password protected?</p>","516160","","476747","","2011-01-20 11:43:11","2011-01-20 11:48:51","Password Protected App","<java><android><password-protection>","1","0","","",""
"4746661","1","","","2011-01-20 11:42:03","21","13143","<p>I`m trying to select images from gallery, but i only found the way to select a single image.</p><pre><code>Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);photoPickerIntent.setType(""image/*"");startActivityForResult(photoPickerIntent, 1);</code></pre><p>Is there a way to select multiple images?</p>","582881","","568613","","2011-04-14 09:19:40","2013-02-28 13:10:22","Select multiple images from Photo Gallery on Android using Intents","<java><android><image><gallery>","4","2","7","",""
"4746676","1","4746863","","2011-01-20 11:43:20","0","1619","<p>How can i get App Inventor XMl code for Eclipse IDE</p>","565024","","","","","2011-09-02 20:48:11","How to get app inventor xml code in my eclipse IDE","<android><app-inventor>","3","1","1","",""
"4746736","1","4746828","","2011-01-20 11:49:03","0","158","<p>I am new to Android. I want to know how to pass value to the custom dialog box from the activity.</p><p>Suppose I want to  pass  a text in the activity to the edittext box in the customized dialog box,then what should I do?</p>","366916","","561309","","2012-02-21 14:44:20","2012-02-21 14:44:20","Android-Customized Dialog","<android>","1","2","","",""
"4746770","1","","","2011-01-20 11:51:49","0","5362","<p>Where and how to install a generic Android 2.2 OS in Samsung Galaxy S?</p>","582905","","584192","","2011-11-19 20:24:15","2013-08-12 18:02:18","How To Install Generic Android OS In Samsung Galaxy S?","<android>","2","2","","",""
"4746838","1","4747074","","2011-01-20 11:59:46","0","471","<p>how can we show the image slowly-slowly and change the place of image from bottom to top in android ??? i knw through Transformation but how please give me sample code..</p>","432559","","","","","2011-01-20 13:26:57","how can we show the image slowly-slowly and change the place of image from bottom to top in android?","<android>","3","0","","",""
"4746843","1","","","2011-01-20 12:00:33","0","89","<p>I am interested in finding an iPhone or Android project that I can contribute to. Is there any organized way of finding one?</p>","582915","","","","","2011-01-20 12:00:33","Collaborative iPhone or Android project","<iphone><android><project>","0","2","","",""
"4746934","1","","","2011-01-20 12:09:57","0","164","<p>HiI have added a new button in android virtual keyboard and gave name Done. Now i want to perform some action by pressing Done button. How to do this can any body help?</p><p>Thanks &amp; Regards.</p>","489762","","","","","2011-04-03 17:07:23","android keyboard","<android>","1","0","","",""
"4746949","1","4747277","","2011-01-20 12:11:57","3","1096","<p>i have added the admob test in my app as the pdf instructions were directing and everything works nice(in emulator and in my device).In order to stop the test mode and upload my new apk at the market i have to erase the test code from my .java file,right?i have tried it and i uploaded my .apk file in my device (from mass storage)but i cant see any admob...what is my wrong ?</p><p>TEST CODE:</p><pre><code> AdManager.setTestDevices( new String[] {                    AdManager.TEST_EMULATOR,""xxxxxxxxxxxxxxxxxxxxxxxxx"",});             AdView adView=(AdView)findViewById(R.id.ad);             adView.requestFreshAd();</code></pre><p>i checked my LogCAT view:</p><pre><code>01-20 14:13:38.938: INFO/AdMobSDK(19582): No fill.  Server replied that no ads are available (373ms)</code></pre>","519526","","79125","","2011-06-17 17:15:39","2011-06-17 17:15:39","admob says ""Server replied that no ads are available""","<android><admob>","4","0","","",""
"4746965","1","4747553","","2011-01-20 12:13:48","0","901","<p>I want to start a Google Maps activity from a button click.</p><p>It works great:</p><pre><code>Intent mapIntent = new Intent(Intent.ACTION_VIEW, url);          mapIntent.setData(url);          startActivity(mapIntent);</code></pre><p>... but I really want to hide the intent chooser between <strong>Browser</strong> and <strong>Maps</strong>. I want to make the button open directly Google Maps.</p><p>I tried adding <strong>geo:0,0?q=</strong> as a prefix to the URL, and this works. But, for reasons I am not able to explain, I can't use this notation or my app would not work.</p><p>In other words: Can I invoke directly the Google Maps class from its package to start it as an Intent?</p><p>Thank you.</p>","252711","","","","","2011-01-20 13:15:38","Starting Google Maps as default activity","<android><android-intent><maps>","1","0","","",""
"4746998","1","","","2011-01-20 12:16:58","0","865","<p>Trying to implement ksoap2 on android app with Eclipse (3.6).</p><p>This is the part of the source code:</p><p>SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);</p><p>SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);envelope.dotNet=true;envelope.setOutputSoapObject(request);</p><p>HttpTransport androidHttpTransport = new HttpTransport(URL);androidHttpTransport.call(SOAP_ACTION, envelope);</p><p>When hitting the ""androidHttpTransport.call(SOAP_ACTION, envelope);"" line, I get error saying:</p><p>The source attachment does not contain source for the file HttpTransport.class</p><p>In the log I get this error:</p><p>VFY: dead code 0x0005-0005 in Lorg/ksoap2/transport/ServiceConnectionMidp; .setRequestProperty (Ljava/lang/String;Ljava/lang/String;)V</p><p>What the hell is the problem?</p>","582933","","","","","2013-05-27 15:38:52","KSOAP2 error does not contain source for the file HttpTransport.class","<java><android><web-services><android-ksoap2>","1","2","","",""
"4747100","1","4747340","","2011-01-20 12:27:55","1","861","<p>I have this strange crash I can't figure out.</p><p>The first time I launch the app I check if /data/Message.xml exists. If not I create one.I then navigate to a page where I parse that xml file and it crashes because it doesn't exist (so it didn't create one). I looked in the data directory and indeed, it didn't create one.</p><p>Then I launch the app again and it executes the same code, while this time it DOES create the xml file.</p><p>I don't know why it isn't working the 1st time, the app doesn't change anything untill it crashes on the first time and the conditions are the same when it launches for the 2nd time.</p><p>Is it an Android thing?</p><hr><p><em>More detailed information:</em></p><p>I check if the file is available:</p><pre><code>File file = new File(Environment.getDataDirectory() + ""/data/com.name.app/files/Message.xml"");</code></pre><p>if (file.exists() == false) {   createFirstXML();  }</p><p>createFirstXML():</p><pre><code>public void createFirstXML() {</code></pre><p>File newxmlfile = new File(Environment.getDataDirectory() + ""/data/com.name.app/files/Message.xml"");  try {   newxmlfile.createNewFile();  } catch (IOException e) {   e.printStackTrace();  }  FileOutputStream fileos = null;  try {   fileos = new FileOutputStream(newxmlfile);  } catch (FileNotFoundException e) {   e.printStackTrace();  }  XmlSerializer serializer = android.util.Xml.newSerializer();  try {   serializer.setOutput(fileos, ""UTF-8"");   serializer.startDocument(null, Boolean.valueOf(true));   serializer.setFeature(""http://xmlpull.org/v1/doc/features.html#indent-output"", true);</p><p>serializer.startTag(null, ""Message"");</p><p>serializer.startTag(null, ""Service"");   serializer.text(""App"");   serializer.endTag(null, ""Service"");</p><p>serializer.endTag(null, ""Message"");</p><p>serializer.endDocument();   serializer.flush();   fileos.close();  } catch (Exception e) {   e.printStackTrace();  } }</p><p>The log:</p><pre><code>java.io.IOException: No such file or directory bla blajava.io.FileNotFoundException: /data/data/com.name.app/files/Message.xml (No such file or directory) bla blajava.lang.IllegalArgumentException bla blajava.io.FileNotFoundException: /data/data/com.name.app/files/Message.xml (No such file or directory) bla blajava.io.FileNotFoundException: /data/data/com.name.app/files/Message.xml (No such file or directory) bla bla</code></pre><p>The second time I launch my app it also can't find Message.xml (because it executes createFirstXML();) but it doesn't give the exceptions???</p><p>I really don't get it..</p>","517460","","517460","","2012-03-29 15:33:30","2012-03-29 15:33:30","App crashes on first launch and not the 2nd time, while it executes the same code","<android><file><exception>","1","2","0","",""
"4747182","1","","","2011-01-20 12:36:08","1","579","<p>I create android project with command:</p><pre><code>android create project --target android-3 --path name --package com.name --activity name</code></pre><p>build and install with commands:</p><pre><code>ant debugadb install -r bin/name-debug.apk</code></pre><p>its takes 11 sec. In Eclipse create project from source of this project clean and run takes 2-3 seconds.</p><p>How to build and run faster in command line?</p>","582954","","35060","","2011-01-20 12:38:35","2011-01-20 12:38:35","Android built-in command line","<android><ant><javac>","0","1","","",""
"4747189","1","","","2011-01-20 12:37:09","2","472","<p>Save data: <code>localstorage.setItem ('name', 'value');</code>When forced to close the app or reboot the device, all of the storage data are lost.</p><p>Please help me to fix the problem.</p>","473438","","584518","","2013-04-11 15:02:59","2013-04-11 15:02:59","Storage data is lost when closing an app or rebooting device","<android><sqlite><storage><phonegap><local-storage>","1","2","1","",""
"4747232","1","","","2011-01-20 12:41:35","2","469","<p>I'm using <code>HtmlCleaner</code> to scrape a <code>ISO-8859-1</code> encoded web site in Android.</p><p>I've implemented this in an external <code>jar</code> file that I import into my Android app.</p><p>When I run the unit tests in Eclipse it handles Norwegian letters (<code>æ,ø,å</code>) correct (I can verify that in the debugger), but in the Android app these characters look like inverted question marks.</p><p>If I attach the debugger to my Android app I can see that these letters are not correct in the exact same places they were good when running unit test from Eclipse, so it's not a display/render/view issue in the Android app.</p><p>When I copy the text from the debuggers I get these results:</p><p><strong>Java Process (Unit Test)</strong>:   &laquo;Blårek&raquo;, &laquo;Benny&raquo;</p><p><strong>Android Process (In emulator)</strong>:  &laquo;Bl?rek&raquo;, &laquo;Benny&raquo;</p><p>I would expect these Strings to be equal, but notice how the ""å"" is replaed by the inverted question marks in Android.   </p><p>I have tried running <code>htmlCleaner.getProperties().setRecognizeUnicodeChars(true)</code> without any luck. Also, I found no way of forcing UTF-8 or ISO-8859-1 encoding in html cleaner, but I' not sure if that would have made a difference.</p><p>Here is the code i run:</p><pre><code>HtmlCleaner htmlCleaner = new HtmlCleaner();// connect to url and get root TagNode from HtmlCleanerInputSteram is = new URL( url ).openConnection().getInputStream();TagNode rootNode = htmlCleaner.clean( is );// navigate through some TagNodes, getting the ContentNode ContentNode cn = rootNode... // This String contains the incorrectly decoded characters on Android. // Good in Oracle JVM though..String value = cn.toString().trim();</code></pre><p>Does anyone knows what could cause the decoding behavoir to be different on Android? I guess the main difference between the two environments is that the Android app uses Android's java.io stack while my unit tests use Sun/Oracle's stack.</p><p>Thanks,<br>Geir</p>","561451","","881286","","2013-08-18 01:48:28","2013-08-18 05:38:42","Non-english characters are decoded incorrectly on Android with HtlmCleaner","<java><android><encoding><html-parsing>","1","0","1","",""
"4747311","1","4747587","","2011-01-20 12:50:16","6","12140","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4674940/android-how-do-i-keep-a-button-displayed-as-pressed-until-the-action-created-by"">Android. How do I keep a button displayed as PRESSED until the action created by that button is finished?</a>  </p></blockquote><p>I have one button and i want when i pressed it to stay as pressed (with the green color at froyo)..Any help??</p><pre><code> mycodes_Button = (Button) findViewById(R.id.mycodes); ... if (saved_Button.isPressed()) {    saved_Button.setFocusable(true); }</code></pre><p>Something like this?</p>","579981","","24054","","2011-01-20 12:52:33","2012-02-29 12:28:00","How can i keep one button as pressed after click on it?","<android><button><pressed>","3","3","1","2013-01-15 17:00:52",""
"4747350","1","4747509","","2011-01-20 12:53:46","0","217","<p>If i am in an activity i call a service b using the following code:</p><pre><code>String start = ""start"";    Intent i = new Intent(QScheduleActivity.this, UploadService.class);    i.putExtra(""start"", start);    startService(i)</code></pre><p>Once i am inside this service, how do i recall the service from within the service if i need to?</p><p>Inside the else i am trying to recall the service like this:</p><pre><code>        Calendar cal = Calendar.getInstance();        cal.add(Calendar.MINUTE, 30);        String start = ""start"";        Intent i = new Intent(UploadService.this, UploadService.class);        i.putExtra(""start"", start);        PendingIntent sender = PendingIntent.getBroadcast(this, 192837, i, PendingIntent.FLAG_UPDATE_CURRENT);        AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);        am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender); </code></pre>","569654","","569654","","2011-01-20 13:06:48","2011-01-20 13:10:04","Android Recall Service","<android>","2","2","","",""
"4747395","1","5383664","","2011-01-20 12:57:58","2","4152","<p>Hey,I just added a Widget to my Android App but when I now move my App to SD the Widget disappears and is not listet any more. Is there any trick so that I can still use a Widget oder twi I have to write a second ""Widget App"" ?</p>","570168","","","","","2011-03-21 21:00:21","Android Widget from SD Card","<android><android-widget><app2sd>","2","0","","",""
"4747417","1","6131759","","2011-01-20 13:00:08","1","4742","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3568919/android-how-can-i-tell-if-the-soft-keyboard-is-showing-or-not"">Android: how can i tell if the soft keyboard is showing or not?</a>  </p></blockquote><p>how to detect whether the soft keyboard is shown in the screen or not in android?</p>","262523","","13793","","2012-05-01 01:24:23","2012-05-01 01:24:23","Android - how to detect soft keyboard shown in the screen","<android><android-softkeyboard>","1","3","","2011-09-10 01:19:35",""
"4747481","1","","","2011-01-20 13:06:45","0","548","<p>I""m sure this is something that is simple, but I'm not figuring it out. I'm trying to make a simple repeating alarm and it never gets triggered.  What I have is:</p><pre><code>private void setupAlarms(){    AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);    Intent intent = new Intent(this, RepeatingAlarm.class);    PendingIntent pendingIntent = PendingIntent.getBroadcast(HelloAndroid.this, 0, intent, 0);    GregorianCalendar fifteenSeconds = (GregorianCalendar)Calendar.getInstance();    fifteenSeconds.add(Calendar.MINUTE, 0);    fifteenSeconds.set(Calendar.SECOND, 15);    alarmManager.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,            SystemClock.elapsedRealtime(), fifteenSeconds.getTimeInMillis(), pendingIntent);}</code></pre><p>This is called from the main onCreate call.</p><p>My alarm receiver:</p><pre><code>public class RepeatingAlarm extends BroadcastReceiver{    @Override    public void onReceive(Context context, Intent intent)    {        Toast.makeText(context, R.string.hello, Toast.LENGTH_SHORT).show();    }}</code></pre><p>In my manifest, I have added:</p><pre><code>&lt;receiver android:name="".RepeatingAlarm"" android:process="":remote"" /&gt;</code></pre><p>Any help, much appreciated</p>","573927","","","","","2011-01-20 13:42:45","Android alarm not being triggered","<android><alarm>","1","6","","",""
"4747496","1","4847320","","2011-01-20 13:08:23","1","638","<p>here is my scenario: I need to distribute optional content packages for an Android application in a secure/protected way, i.e. prevent download of the content from outside the application. The content consists of zipped SQLite database creation files with sizes up to 4 Megabytes. The packages will be updated 4 times a year. I have currently about 1000 active installations. This means at peak times traffic for downloading the content package updates could yield in about 4 GB per day. The installation base of the app grows  by rougly 100 users per day.</p><p>Based on the scenario I wonder how to solve the following issues:</p><p>1) What would be the best way to distribute the content? HTTPS transport? What would be a recommended way to do authentication (e.g. passwords, certificates)? Should I use password protected Zip files instead?</p><p>2) Which infrastructure should be used for content delivery that fits the following criteria: </p><ul><li>support of the protection mechanism from 1) out of the box</li><li>easy to setup and maintain</li><li>scalable and download nodes in Europe and the US</li><li>relatively inexpensive (not more than 30$ per month). Ideally pay-as-you-go bandwidth.</li></ul><p>I was considering CDNs like SoftLayer, Amazon CloudFront, etc. Any recommendations?</p><p>Thanks for your help,</p><p>Philipp</p>","400334","","","","","2011-01-31 03:16:13","Secure/protected content distribution for Android app","<android><content><cdn><protected><delivery>","1","4","","",""
"4747647","1","4748006","","2011-01-20 13:24:17","0","547","<p>I'm trying to push a database to the emulator. I created the database with a script on my desktop computer, it looks the same as the database created by my SQLiteOpenHelper subclass:</p><pre><code>CREATE TABLE android_metadata (locale TEXT);insert into android_metadata values('en_US');CREATE TABLE notes (_id integer primary key autoincrement,                    key text,                    content text not null,                    modifydate text,                    createdate text,                    syncnum integer,                    version integer,                    minversion integer,                    sharekey text,                    publishkey text,                    deleted integer not null default 0,                    pinned integer not null default 0,                    unread integer not null default 0);CREATE TABLE tags (_id integer primary key autoincrement,                   name text not null,                    pos integer not null,                   noteid integer not null,                   foreign key(noteid) references notes (_id));</code></pre><p>But for some reason the app tries to recreate the database even though it already exists. It fails when it tries to create a table that already exists in the database. Maybe someone here knows why?</p>","3414","","","","","2011-01-20 14:00:09","Why is SQLiteOpenHelper recreating my existing database?","<android><database>","1","1","","",""
"4747651","1","4748033","","2011-01-20 13:24:37","2","5398","<p>I created a list with textview &amp; edittext using holder... it looks like</p><pre><code>     Textview    Edittext---------------------------------     Textview    Edittext---------------------------------     Textview    Edittext---------------------------------</code></pre><p>but I cant get the data from each every Edittext...can any one assist me.. how to achieve it... assist with sample code...</p>","569553","","1280410","","2012-05-03 16:37:03","2012-06-30 20:01:53","getting data from edittext placed in listview","<android>","4","3","0","",""
"4747746","1","","","2011-01-20 13:34:45","5","470","<p>I have an application on the Android Market that was published over a year ago using the market legacy copy protection (which is still active but depreciated over the new licensing model).  I have read many accounts that if I turn off the legacy copy protection, current customers will no longer be able to access the application.  Since the legacy copy protection was officially depreciated, sales of my application have decreased dramatically, is it possible that because legacy copy protection is on, that newer devices no longer ""see"" my application?  More importently, how do I turn off legacy copy protection w/o alienating existing customers?</p>","236975","","423823","","2011-01-20 14:14:56","2011-01-20 15:04:39","Android market legacy copy protection","<android><google-play>","1","0","2","",""
"4747885","1","4748510","","2011-01-20 13:47:39","0","2025","<p>Iam using all the below links on Mobile browser but they ar given ""not found Error 404"".</p><pre><code>http://market.android.com/details?id=&lt;appMarketUidString&gt;market://details?id=&lt;appMarketUidString&gt;http://market.android.com/search?q=pname:&lt;package name&gt;http://market.android.com/search?q=pub:""&lt;Developer name&gt;""</code></pre><p>how to resolve this.</p>","486216","","","","","2011-01-20 14:48:10","Market link giving Error 404","<android><google-play>","1","2","1","",""
"4747971","1","4748109","","2011-01-20 13:56:31","0","319","<p>I know this is part of the multitasking functionality of android but I can't find the solution to my problem. </p><p>I have a media player object in my app that play an audio clip which is looped over and over and is supposed to only stop when the app is closed, it is running alongside a VideoView which is playing a video with no sound (reason: I need the video to loop seamlessly and only seems to do this without the sound attached to the video). I need the sound to stop when the video stops (i.e. when the app is closed. I know the VideoView has the method isPlaying() so I guess it could have something to do with that but everything I have tried so far failed.</p><p>Will I need to use a thread? Is there any way to send out a message from the VideoView saying it is no longer playing? then I could call the stop() method on the MediaPlayer object.</p>","400406","","","","","2011-01-20 14:40:58","MediaPlayer carries on playing after app is closed","<java><android><media-player>","1","0","","",""
"4748104","1","4748162","","2011-01-20 14:08:55","1","2419","<p>I currently need to send files from a folder, i want the service i am running to check in the folder every half an hour....how am i able to know if the folder is clear?</p>","569654","","","","","2014-01-31 10:34:24","How to check if a folder is empty","<android>","3","1","1","",""
"4748161","1","4776853","","2011-01-20 14:14:06","1","1745","<p>Can anyone help me achieve the following,  </p><p>Given a Uri to a contact already obtained via an 'ACTION_PICK' during a previous activity, I want to launch an ACTION_DIAL intent to call the contact.</p><p>Not sure how to go about this though, do I first need to query to find the primary number associated with the contact or is there a simpler approach?  I was hoping I could just launch ACTION_DIAL with the Uri of the contact and it would figure out what to do itself but that doesn't work.</p><p>Your advice as always is appreciated.</p><p>PS This code is for Froyo onwards, so using ContactsContract not the older stuff.</p><p>Thanks,</p>","333276","","","","","2013-03-13 09:54:48","How to launch dialer with primary contact number?","<android><android-contacts>","3","0","","",""
"4748227","1","4748284","","2011-01-20 14:21:03","0","2244","<p>friends,</p><p>any one guide me if there is any event of useful way exits in android to know if my android application is running in low memory?</p><p>actually , i am caching many objects so i want to know a central place or area where i could release them if memory is low.</p><p>any help would be appreciated.</p>","249991","","","","","2014-02-12 18:00:09","Is there any event or way exists in android to check if memory is low?","<android>","3","1","","",""
"4748236","1","4748999","","2011-01-20 14:21:44","1","3244","<p>Does anyone know how the content in the tabs are updated when they are beeing switched to?In other words, when i change a tab, i want content, in the tab i'm changing to refresh or recreate.</p><p>I have this code as the TabActivity:</p><pre><code>package com.example.HelloTabWidget;import android.app.TabActivity;import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.widget.TabHost;import android.widget.TabHost.OnTabChangeListener;public class Bussruter extends TabActivity implements OnTabChangeListener { 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     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, NedlastetBussruter.class);     // Initialize a TabSpec for each tab and add it to the TabHost     spec = tabHost.newTabSpec(""Nedlastet bussruter"").setIndicator(""Nedlastet bussruter"",                       res.getDrawable(R.drawable.ic_tab_nedlastet))                   .setContent(intent);     tabHost.addTab(spec);      // Do the same for the other tabs     intent = new Intent().setClass(this, AlleBussruter.class);     spec = tabHost.newTabSpec(""Alle bussruter"").setIndicator(""Alle bussruter"",                       res.getDrawable(R.drawable.ic_tab_alle))                   .setContent(intent)                   ;     tabHost.addTab(spec);     tabHost.setCurrentTab(2);     tabHost.setOnTabChangedListener(this); } @Override public void onTabChanged(String tabId) {  TabHost th = getTabHost();  th.getCurrentTabView().destroyDrawingCache();//i know this is wrong :S  th.getCurrentTabView().buildDrawingCache();//and this is also wrong.... }}</code></pre><p>Now lets say that i am changing to the tab, ""NedlastetBussruter"" which has the code:</p><pre><code>package com.example.HelloTabWidget;import java.io.File;import java.util.ArrayList;import android.app.AlertDialog;import android.app.ListActivity;import android.content.ActivityNotFoundException;import android.content.DialogInterface;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.os.Environment;import android.view.View;import android.widget.AdapterView;import android.widget.AdapterView.OnItemClickListener;import android.widget.AdapterView.OnItemLongClickListener;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.Toast;public class NedlastetBussruter extends ListActivity { public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        String[] listName = this.getListNameNedlastet();        setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, listName));        ListView lv = getListView();        lv.setTextFilterEnabled(true);        if(!listName[0].equals(""Ingen bussruter er lastet ned."")){         lv.setOnItemClickListener(this.createClickListenerNedlastet());         lv.setOnItemLongClickListener(this.createLongClickListener());         lv.setClickable(true);         lv.setLongClickable(true);        }else{         lv.setClickable(false);         lv.setLongClickable(false);        }        /*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();          }        });*/        /*TextView textview = new TextView(this);        textview.setText(""This is the Artists tab"");        setContentView(textview);*/    } private OnItemLongClickListener createLongClickListener() {  return   new OnItemLongClickListener() {   public boolean onItemLongClick(AdapterView&lt;?&gt; parent, final View view,        final int position, long id) {    if(isAvailable(position)){     try{      new AlertDialog.Builder(parent.getContext())      .setMessage(""Vil du slette bussruten?"")         .setCancelable(false)         .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {          public void onClick(DialogInterface dialog, int id) {           deleteFile(view, position);                 StorageHandler.availability[position] = false;             }         })         .setNegativeButton(""No"", new DialogInterface.OnClickListener() {          public void onClick(DialogInterface dialog, int id) {           dialog.cancel();             }         })         .show();     }catch(Exception e){      toastText(""ERROR: ""+e.getMessage(), Toast.LENGTH_LONG);     }     return true;    }else return false;   }  }; } private OnItemClickListener createClickListenerNedlastet(){  return   new OnItemClickListener() {   public void onItemClick(AdapterView&lt;?&gt; parent, View view,       int position, long id){        boolean temp = StorageHandler.availability[position];      if(temp == true){       if(Environment.getExternalStorageState().equals(         Environment.MEDIA_MOUNTED)){        File file = new File(StorageHandler.sdcardUrl+ StorageHandler.uniqueBussFilename[position]);                 if (file.exists()) {//open the file                     Uri path = Uri.fromFile(file);                     Intent intent = new Intent(Intent.ACTION_VIEW);                     intent.setDataAndType(path, ""application/pdf"");                     intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);                     try {                      startActivity(intent);                     }                      catch (ActivityNotFoundException e) {                      toastText(""No Application Available for viewing PDF"", Toast.LENGTH_LONG);                     }                 }else{                  toastText(""The file ""+file.getAbsolutePath()+"" was not found."", Toast.LENGTH_LONG);                 }       }else{        toastText(""sdkort er ikke tilgjengelig."", Toast.LENGTH_LONG);       }      }   };  }; } private void toastText(String t, int l){  final String text = t;  final int length = l;  Toast.makeText(getApplicationContext(), text, length).show();     } private void deleteFile(View view, int index){  try{   File f =  new File(StorageHandler.sdcardUrl + StorageHandler.uniqueBussFilename[index]);   f.delete();  }catch(Exception e){   toastText(""ERROR: ""+e.getMessage(), Toast.LENGTH_LONG);  } } private boolean isAvailable(int position){  File f = new File(StorageHandler.sdcardUrl + StorageHandler.uniqueBussFilename[position]);  if(f.exists()){   return true;  }  return false; } private String[] getListNameNedlastet() {  this.checkAvaliablePdfs();  ArrayList&lt;String&gt; al = new ArrayList&lt;String&gt;();  for(int i = 0;i&lt;StorageHandler.uniqueId.length-1;i++){    if(StorageHandler.availability[i]){    //String br = bussRuter[i]; //used for debugging...    al.add(StorageHandler.uniqueId[i] + "" - "" + StorageHandler.bussRuter[i]);   }  }  String[] output = new String[al.size()];  if(output.length == 0){   output = new String[]{""Ingen bussruter er lastet ned.""};  }else{   for(int i=0;i &lt; al.size();i++){     output[i] = al.get(i);   }  }  return output; } private void checkAvaliablePdfs(){  for(int i = 0;i&lt;StorageHandler.uniqueBussFilename.length;i++){   File f = new File(StorageHandler.sdcardUrl + StorageHandler.uniqueBussFilename[i]);   if(f.exists()){    StorageHandler.availability[i] = true;   }  } }}</code></pre><p>How can i make the ""nedlastet bussruter"" tab recreate the content each time it is beeing switched to? is there an easy command available?</p>","582061","","","","","2012-03-11 21:56:26","How do you update the content on tabChange (Android)","<android><content><android-tabhost><tabactivity><tabview>","1","0","","",""
"4748256","1","","","2011-01-20 14:23:30","0","268","<p>I have some strange  behavior issues on texture-mapping with OpenGL ES 1.1</p><p>1)This is the right picture (Samsung Galaxy S):</p><p><img src=""http://i.stack.imgur.com/j00Zy.png"" alt=""alt text""></p><p>2)This an wrong picture (HTC Magic):<img src=""http://i.stack.imgur.com/P8NCW.png"" alt=""alt text""></p><p>3)This is another wrong picture (Ideos):</p><p><img src=""http://i.stack.imgur.com/aOAza.png"" alt=""alt text""></p><p>I am very disappointed for that, could someone help me?I have mapped a texture in a  Sphere using OpenGL ES 1.1, the OpenGL need version is write in the AndroidManifest.xml file.</p><p>In the 2th case I can read a lot of this message:</p><p><strong>E/libEGL  ( 2372): called unimplemented OpenGL ES API</strong></p><p>I configured the checkError flag in OpenGLViewRender, but I cannot see the OpenGL call which cause this message.</p><p>Thanks a lot in advance.</p><p>pedr0</p>","554892","","","","","2011-01-21 01:10:05","openGLES different behavior on different devices","<android>","1","0","","",""
"4748276","1","","","2011-01-20 14:25:58","0","334","<p>im working under Windows 7 32 bit, with Eclipse3.6.1+latest Android SDKwhen i run the project in Eclipse it start the emulator and shows 3 cmd windows like this:<a href=""http://img409.imageshack.us/img409/3182/tempb.png"" rel=""nofollow"">http://img409.imageshack.us/img409/3182/tempb.png</a> and the last windows shows this error:</p><pre><code>E/ddms: shutting down due to uncaught exceptionE/ddms: java.lang.IllegalArgumentException: Bad version: standalone at com.android.sdkstats.SdkStatsService.normalizeVersion(SdkStatsService.java:467) at com.android.sdkstats.SdkStatsService.doPing(SdkStatsService.java:195) at com.android.sdkstats.SdkStatsService.ping(SdkStatsService.java:130)</code></pre><p>whats interesting about it is when it finished to run all three cmd windows for 1-2 sec it shows the emulator then i actually need to press the turn on button and wait until the device boot up and open the program (wich takes about 2 min)</p><p>i have two questions:1. why is this error shown and it still works after all2. why cant it jsut boot on my applications right away without turning on the device and wait 2 minutes until i could open it.</p><ul><li>im a noobie so sorry if i made you laught :P</li></ul>","583084","","","","","2011-01-20 14:29:38","Problem when running app in android emulator","<android><ddms>","1","0","","",""
"4748283","1","","","2011-01-20 14:27:10","6","7377","<p>I want to use Flickr API for downloading the images on Android Phone, can any one give or tell, me about the working sample of Flickr API on Andorid.</p><p>I have add the flickr.jar as the external library, and i have the ""Key""and ""Secret"" but i do not know how to download the images.</p><p>Thanks in Advance.</p>","321373","","","","","2014-01-29 06:15:45","Flickr API on Android?","<android><flickr>","3","0","4","",""
"4748336","1","4748688","","2011-01-20 14:32:09","2","4659","<p>Is there a way to force an android view to redraw it's background?I have set a drawable shape with a gradient as background which works fine but after changing the view's height you can see those ugly gradient steps.</p><p>What can I do?I tried <code>view.invalidate()</code> and <code>view.refreshDrawableState()</code> without any visible difference.</p><p>Thank you!</p><p>//EDIT:Here are some more details and my code:<i>After your answers I think the banding is a result of my probably bad code. Here is what I'm doing:</p><ol><li>Scaling a view</li><li>setting its new width and height because the scaled view does not accept user input in other areas then the ""old"" one (see <a href=""http://stackoverflow.com/questions/4727117/android-weird-at-least-for-me-behaviour-of-control-after-scaling-doesnt-acce"">android weird (at least for me) behaviour of control after scaling / doesn't accept input in it's whole area</a> )</li><li><strong>trying to set the background again</strong> (which contains a gradient and a rectangle with rounded corners)</i></li></ol><p>Here is my code:</p><pre><code>public void onAnimationEnd(Animation animation){    MyView view = (MyView) ((ExtendedScaleAnimation) animation).getView();    view.getLayoutParams().width = toWidth;    view.getLayoutParams().height = toHeight;    view.clearAnimation();    view.requestLayout();    view.refreshBackground(); // background will be changed}</code></pre><p>On the device you can see that the background drawable is changed but there is a flickering which seems to me like the backround change is applied before the animation is over. Programatically it should be over! Or am I wrong?</p><p>Thank you again!</p>","578502","","578502","","2011-01-20 16:05:18","2011-01-20 16:05:18","How to force android view to redraw it's background-drawable? / probably an animation is blocking it to work properly","<android><view><background><drawable><redraw>","1","4","","",""
"4748382","1","4748409","","2011-01-20 14:36:58","2","217","<p>Currently i have an application where an activity calls a service which sends a file to a server. This is working fine..However, i was wondering does anybody know what happens if the internet connection is interrupted. Will the service run again when the connection comes back...Or is there something i need to implement to do this? If so how and what etc? thanks</p>","569654","","","","","2011-01-20 14:50:29","File Upload interruption","<android>","1","0","","",""
"4748397","1","","","2011-01-20 14:37:53","0","1334","<p>In my app i'm trying to create a Contact by calling the standard Create/Edit contact Activity. </p><p>I've found how to make it work but not exactly the way I like.</p><p>For now I manage to call the standard create contact activity with the following intent extra:</p><pre><code>Intent i = new Intent(ContactsContract.Intents.SHOW_OR_CREATE_CONTACT, Uri.parse(String.format(""tel: %s"", data.getPhone())));i.addCategory(Intent.CATEGORY_DEFAULT);i.putExtra(ContactsContract.Intents.EXTRA_FORCE_CREATE, true);i.putExtra(ContactsContract.Intents.Insert.NAME, data.getName());i.putExtra(ContactsContract.Intents.Insert.PHONE_TYPE, ContactsContract.CommonDataKinds.StructuredPostal.TYPE_WORK);i.putExtra(ContactsContract.Intents.Insert.PHONE, org.getPhone());i.putExtra(ContactsContract.Intents.Insert.POSTAL_TYPE, ContactsContract.CommonDataKinds.StructuredPostal.TYPE_WORK);i.putExtra(ContactsContract.Intents.Insert.POSTAL, org.getAddress() + "" "" + org.getZipCode());i.putExtra(ContactsContract.Intents.Insert.EMAIL_TYPE, ContactsContract.CommonDataKinds.StructuredPostal.TYPE_WORK);i.putExtra(ContactsContract.Intents.Insert.EMAIL, org.getEmail());startActivity(i);</code></pre><p>All the data is filled properly except the address field as you can see in the following picture: <a href=""http://img689.imageshack.us/img689/1073/capturevvm.png"" rel=""nofollow"">http://img689.imageshack.us/img689/1073/capturevvm.png</a></p><p>I'd like to specify each part of the address in the separate field. Is there a way to do it with an Intent?</p><p>I tried this, but it did not work.</p><pre><code>i.putExtra(ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE, ContactsContract.CommonDataKinds.StructuredPostal.TYPE_WORK);i.putExtra(ContactsContract.CommonDataKinds.StructuredPostal.STREET, ""toto"");i.putExtra(ContactsContract.CommonDataKinds.StructuredPostal.CITY, ""paris"");</code></pre><p>Any idea?</p>","384483","","","","","2012-07-25 11:46:17","Create a pre filled contact with the standard Activity","<android>","2","0","1","",""
"4748435","1","4749369","","2011-01-20 14:41:22","1","1127","<p>I'm looking for a way to scroll a webview that a specific part of the contained text is shown.</p><p>Scrolling programmatically needs always an integer value of how far to scroll. Is there any possibility of retrieving the y-position of a specific text in that webview?</p>","564256","","","","","2011-01-20 15:58:45","scrolling vertically to a specific text part in a webview","<android><webview><vertical-scrolling>","2","0","","",""
"4748444","1","4748582","","2011-01-20 14:42:15","0","1234","<p>I am developing the Web application in Android 2.2 and i want to deploy it on the LG P500 device. I am using Windows XP as an operating system. But i am facing the problem of installing the drivers on my system, it gives the error ""Hardware not found the desired USB drivers"". So give me any suggestion on this.       Also told me that it is possible on windows system or it required Linux System?</p><p>Thanks in advance....    </p>","387466","","","","","2011-01-20 14:53:58","Android Application Deployment on LG P500 Device","<android>","1","1","","",""
"4748497","1","4750097","","2011-01-20 14:47:03","0","857","<p>I am developing an android application,I want to parse two node from url like,chennai12i want to parse city name and corresponding id and display in spinner,when i choose particular city in spinner,display corresponding id in alert box,How will do,please guide me</p><p>Thanks </p>","500595","","","","","2011-09-29 10:33:11","how to display xml parse value in spinner using android?","<android>","1","0","1","",""
"4748503","1","4748807","","2011-01-20 14:47:23","0","101","<p>I'm beginner in Java Android developing. I'm using Eclipse SDK 3.6.1 version. I'm trying to do this thing: in first class (layout - main.xml) is button ""hello"", it calls new class (layout - second.xml), in this class are button ""hello2"", it calss new class. I can't do this cause when I push  first button ""hello"" I getting this messages ""The aplication (xxxx) has stopped unexpectedly. Please try again"". How to resolve this problem. I think problem is in 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=""net.kodinis_raktas""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".veiksmas""        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="".second"" &gt;    &lt;intent-filter&gt;   &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;/intent-filter&gt;                         &lt;/activity&gt;&lt;activity android:name="".lock""&gt;&lt;/activity&gt;     &lt;intent-filter&gt;    &lt;/intent-filter&gt;   &lt;/application&gt;       &lt;uses-permission android:name=""android.permission.SEND_SMS""&gt;    &lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.RECEIVE_SMS""&gt;    &lt;/uses-permission&gt;    &lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;/manifest&gt; </code></pre>","572853","","21234","","2011-01-20 15:06:05","2011-01-20 20:56:47","How to call correctly run few class (intents)?","<android><android-manifest>","2","0","","",""
"4748573","1","","","2011-01-20 14:53:27","1","3647","<p>Does anyone know how well the iFrame HTML tag is supported on Android?  Some of my preliminary research indicates that it is supported, but scrolling can be hit or miss and should be avoided.  Is there documentation on this anywhere or am I going to have to get ahold of devices to test on?</p>","476457","","","","","2013-07-02 03:02:38","Android iFrame Browser Support","<android><html><browser><iframe>","2","1","","",""
"4748611","1","4754657","","2011-01-20 14:57:41","2","4190","<p>I want to give my app a nice touch by allowing users to slide the page left or right instead of just using next/previous buttons (similar to the home screen).</p><p>What is the best way to do that? I assume I would have to override one of the <code>Activity.on...</code> methods and that I would also have to put my page's main <code>View</code> in a <code>ViewGroup</code> that allows me to shift pages left and right.</p>","463304","","463304","","2012-06-19 12:43:35","2012-06-19 12:43:35","Android: Next/Previous fling that sticks to the finger similar to Home Screen","<android><drag><slide>","5","0","","",""
"4748653","1","","","2011-01-20 15:01:18","0","326","<p>I want my AppWidgetProvider (which is a direct subclass of BroadcastReceiver) to be notified when the user reads a previously unread sms or when he opens the list of missed calls. So far I gound out that it seems to be impossible to get a Intent delivered to the BroadcastReceiver as the actions that open the (sms/phone) activities are not broadcast actions. </p><p>Is there another way to let a BroadcastReceiver know when an unread sms is read or the missed calls list is opened?</p>","583113","","546999","","2011-01-20 15:03:24","2011-01-20 15:07:20","Android: notification when the user opens SMS app or phone app/missed calls list","<android><broadcastreceiver><appwidget>","1","0","","",""
"4748771","1","4748885","","2011-01-20 15:10:19","0","2360","<p>I am working android application.when i run that application below error occred.please help me......</p><pre><code>01-20 20:39:02.955: WARN/dalvikvm(5690): VFY: arbitrarily rejecting large method (regs=93 count=23019)01-20 20:39:02.955: WARN/dalvikvm(5690): VFY:  rejected Lez/com/Action_module_screen;.da ()V01-20 20:39:02.955: WARN/dalvikvm(5690): Verifier rejected class Lez/com/Action_module_screen;01-20 20:39:02.955: INFO/System.out(5690): verify Errorez.com.Action_module_screen</code></pre>","533787","","244296","","2011-01-20 15:15:48","2011-01-20 16:26:27","how to solve android verify error?","<android>","4","2","","",""
"4748888","1","4749086","","2011-01-20 15:19:45","5","12351","<p>i have made a simple hello web view example and i want to make it in full screen like i do not want that two top most black bars.anybody have any idea how to do that?</p><p>thanks a lot. </p>","397901","","","","","2011-01-21 11:38:32","webview with full screen in android","<android><webview>","2","3","5","",""
"4748898","1","","","2011-01-20 15:20:22","0","358","<p>I'm implementing a Search dialog in my application, I already configured the Intent filter to my Activity, and that is already being called with the Intent, but the same Activity, is my main Activity and I need to handle the intent on the Activity that was already running, when the event occurs a new instance of my Activity is being created and the onCreate called again.</p><p>This is my code.</p><pre><code>public class MainActivity extends Activity {    private int ht;    private ImageView img;    private Bitmap bmp;    private int width = 612, height = 792;    public void onCreate(Bundle savedInstance) {        super.onCreate(savedInstance);        requestWindowFeature(Window.FEATURE_NO_TITLE);        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,                WindowManager.LayoutParams.FLAG_FULLSCREEN);        setContentView(R.layout.main);        img = (ImageView) findViewById(R.id.image01);        img.setMinimumHeight(height);        img.setMinimumWidth(width);        draw();        refreshImage();        handleIntent(getIntent());    }    protected void onNewIntent(Intent intent) {        setIntent(intent);        handleIntent(intent);    }    private void search(String text) {    //Do the search    }    private void handleIntent(Intent intent) {        if (Intent.ACTION_SEARCH.equals(intent.getAction())) {            String query = intent.getStringExtra(SearchManager.QUERY);            search(query);        }    }}</code></pre><p>And the Filter:</p><pre><code>        &lt;activity android:name=""MainrActivity""            android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&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;</code></pre><p>The searchable.xml</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""    android:hint=""Search text..."" &gt;&lt;/searchable&gt; </code></pre><p>What to do to handle this intents on the opened Activity?</p>","558433","","","","","2011-09-23 11:24:46","Use the SearchDialog intent to open an active Activity","<java><android><search>","1","0","","",""
"4748964","1","4770996","","2011-01-20 15:26:47","23","26725","<p>I have implemented AsyncTask in my one of activity:</p><pre><code> performBackgroundTask asyncTask = new performBackgroundTask(); asyncTask.execute();</code></pre><p>Now, i need to implement the ""Cancel"" button functionality, so i have to stop the execution of the running task. I don't know how do i stop the running task(background task). </p><p>So Please suggest me, how do i cancel the AsyncTask forcefully ? </p><h2>Update:</h2><p>I found about the <code>Cancel()</code> method of the same, but i found that calling <strong><code>cancel(boolean mayInterruptIfRunning)</code></strong> doesn't necessarily stop the execution of the background process. All that seems to happen is that the AsyncTask will execute onCancelled(), and won't run onPostExecute() when it completes.</p>","379693","","379693","","2011-01-20 15:32:01","2013-11-26 22:26:49","Android - Cancel AsyncTask Forcefully","<android><android-asynctask>","6","0","15","",""
"4749403","1","4749659","","2011-01-20 16:00:49","1","631","<p>i want to implement sms text counter like feature as in android default messaging application . So that after each 161 character counter should be incaremented by one and on deleting of character it should decrease .Has any one do this before.......any help will be appreciated...Thanks in advance... </p>","307585","","","","","2011-01-20 16:27:40","sms text counter in android","<android><sms>","2","0","1","",""
"4749424","1","","","2011-01-20 16:02:13","0","321","<p>""How can I use large static C or C++ arrays in Java?""</p><p>I'm working with Android NDK and JNI to get some native C (or C++) code working in Java. This is fine, my JNI-generated interface and my C (or C++) implementation are working.</p><p>However, my app needs a very large array. In C/C++, and originally Objective-C, this is sure to be contiguous whereas this is explicitly not the case in Java. Even if Java arrays were like C or C++ arrays, I can't pass it by reference from Java to my C implementation. I can't copy the Java array to a C or C++ array in my implementation because this doubles the memory cost. And I can't create it from scratch each time my C or C++ implementation is called.</p><p>I'd therefore like to keep this array out of a Java header and in a C or C++ header, and have it ready in C or C++ world at all times from the moment the app loads. This is a critical component of the app.</p><p>What can I do?</p><p>Thanking you kindly in advance.</p><p>//////////////////////////////////</p><p>Using <code>Get&lt;PrimitiveType&gt;ArrayElements</code> from JNI is a long way towards a solution, the only worry is memory allocation. It's likely that the array is copied after all.</p><p>But it is running in the Android emulator and the results are impressive: A calculation that takes 13 seconds in Java on the emulator takes 0.7 seconds on the emulator when carried out in C.</p><p>Because the Android emulator is fairly slow this is likely to be an authentic figure, the only way to be sure is to test it on the device.</p>","283311","","283311","","2011-01-21 10:15:46","2013-07-31 21:22:33","Including C/C++ headers with implementations in Java for an Android app","<android><arrays><jni><android-ndk>","1","2","1","",""
"4749435","1","","","2011-01-20 16:03:15","0","865","<p>Can a (jailbroken OR not borken) smart phone app access your private info, contacts, sms and sends back to collector?</p>","577436","","","","","2011-01-23 10:57:06","android/iphone app can steal ur contacts and sms?","<iphone><android><contacts><privacy>","2","1","1","2011-01-20 17:30:16",""
"4749505","1","4753287","","2011-01-20 16:08:45","3","3650","<p>I am trying to write a calendar app and I plan to have a grid (week view) which will probably be a <code>TableLayout</code> and directly on top of that I will have to absolutely position events on the grid.</p><p>But <code>AbsoluteLayout</code> is deprecated. What should I use instead?</p><p>Events may overlap and I think it would be really silly to try and use a non absolute layout to achieve what I want.</p><p>Maybe I should use <code>RelativeLayout</code> with a margin left and margin top on each of the child nodes. Seems odd to do it that way and might not be as efficient. Is this the best way or is there an alternative?</p>","463304","","","","","2012-04-23 20:08:08","Android: Alternative to AbsoluteLayout (I really do need absolute positioning)","<android><layout><css-position>","3","0","1","",""
"4749559","1","","","2011-01-20 16:12:49","1","2064","<p>I am working on a web page that will allow the end-user to upload <a href=""http://en.wikipedia.org/wiki/APK_%28file_format%29"" rel=""nofollow"">.apk files</a>.I need a library/component to check that the files uploaded are valid .apk files.I am looking for something more that the ability to just view the contents.</p><p>Thanks in advance...</p>","5471","","319618","","2011-01-20 16:14:44","2013-06-14 18:39:37","need to check if file is a valid APK","<android><validation><apk>","1","0","","",""
"4749593","1","4924464","","2011-01-20 16:15:30","4","2156","<p>I was wondering if I can start an Intent for viewing a directory with a File browser (if there's one installed on the device) so I can open a folder like this:</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);Uri uri = Uri.parse(""file:///sdcard/MyFolder"");intent.setDataAndType(uri, ""MIME TYPE FOR FOLDERS"");startActivity(intent);</code></pre>","483362","","","","","2013-12-19 18:33:28","MIME type for directories in Android","<android><mime-types><android-intent>","4","2","1","",""
"4749618","1","4750101","","2011-01-20 16:17:21","0","787","<p>I understand how to lock the application into landscape mode using <code>android:screenOrientation= ""lanscape""</code> but how can I lock it to use both landscape and sensor orientations, which allows me to switch between the landscape views and skip out the portrait views. I found somewhere there is an option for sensorLandscape orientation mode but don't know how to set this in the manifest.</p>","400406","","","","","2011-01-20 16:57:19","Lock application orientation to landscape and sensor only","<java><android><manifest>","1","0","","",""
"4749735","1","","","2011-01-20 16:27:49","1","5933","<p>I would like to programmatically find the IP addresses of computers which are connected via WiFi to an Android device or emulator.  How do I do this?</p>","583259","","643977","","2012-04-23 05:50:48","2013-07-23 06:06:33","get Ip address of computers in WIFI network on Android Emulator","<android><emulator>","4","0","","",""
"4749803","1","","","2011-01-20 16:33:35","0","335","<p>I'm no expert when it comes to opengles but I have been using it for a lot of my applications. I created a new app to refresh myself on opengles and I got a square to draw. Now I applied texture mapping and it was mapping incorrectly. I checked the UV coords thoroughly over and over again and it seemed right. After hours of confusion I finally decided to change the .png to something random again that I downloaded from the web. Viola! It was mapping correctly. When I switched back to the old .png it mapped incorrectly again. Can someone tell me why this is happening? </p>","507007","","","","","2011-05-06 04:44:56","Android texture mapping weird problem","<java><android><opengl-es><texture-mapping><uv-mapping>","1","2","","",""
"4749820","1","4755170","","2011-01-20 16:34:54","0","507","<p>I am trying to dynamically add buttons to table rows, but need to alter the style of the buttons based on screen orientation.  I have the following ""game_answer_button.xml"" layout file in both ""layout"" and ""layout-land"" folders.</p><p><strong>res/layout:</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;Button xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""wrap_content""    android:layout_width=""fill_parent""    /&gt;</code></pre><p><strong>res/layout-land:</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;Button xmlns:android=""http://schemas.android.com/apk/res/android""    style=""@android:style/Widget.Button.Small""    /&gt;</code></pre><p>The button layout is being inflated in my activity as follows:</p><pre><code>LayoutInflater inflater = getLayoutInflater();Button button = (Button)inflater.inflate(R.layout.game_answer_button, null);button.setText(image.getDescription());</code></pre><p>However, it seems the default (portrait) layout is selected every time.  If the contents of the default layout are replaced with the landscape layout, then the landscape layout is finally rendered.  It doesn't seem to be correctly selecting the landscape layout resource via LayoutInflater.</p><p>Any ideas on this?</p>","583242","","","","","2011-01-21 03:44:57","Landscape resource not picked up via LayoutInflater","<android>","2","0","","",""
"4749891","1","","","2011-01-20 16:39:53","2","1524","<p>How can I programmatically delete data or format the entire SD Card?</p>","583267","","577167","","2012-11-27 20:19:23","2012-11-27 20:19:23","How can I programmatically format all data on an SD Card?","<android><sd-card>","3","1","4","",""
"4749893","1","4749970","","2011-01-20 16:39:57","3","5034","<p>I have been using the <code>pt</code> unit in XML files. Now I need to set the width of an element at runtime. How can I set the width by points so that it is the same unit I have been using everywhere else. I assume I will need to multiply by resolution and dpi. A code sample would be best.</p>","463304","","","","","2011-01-20 16:45:58","Android: Convert points to pixels","<android><resolution><pixels><points>","2","0","1","",""
"4749996","1","","","2011-01-20 16:48:00","1","654","<p>I've read many posts on stackoverflow and doc on the Android API in order to be able to catch links from SMS or mail. For example, if I receive a SMS containing a link like myapp://hello, I want to to be clickable and to open my application once clicked.</p><p>I found how to do it using an intent filter on the activity I want to activate. Here is my code:</p><pre><code>   &lt;intent-filter&gt;&lt;action android:name=""android.intent.action.VIEW""&gt;&lt;/action&gt;&lt;category android:name=""android.intent.category.DEFAULT""&gt;&lt;/category&gt;&lt;category android:name=""android.intent.category.BROWSABLE""&gt;&lt;/category&gt;&lt;data android:scheme=""myapp""&gt;&lt;/data&gt;</code></pre><p></p><p>I tried it first with android:scheme=""http"" and it worked well (when I clicked a link from a SMS, Android asked the user which app to use: browser or myapp).However when I want to do so with myapp instead of http, it doesn't work...indeed the link myapp://hello is not clickable...so it's impossible to launch myapp clicking on it...</p><p>Do you have any idea ? Do I have to activate something, somewhere to tell Android to parse this kind of addresses ?</p><p>Thanks</p>","575481","","","","","2011-01-21 04:19:35","Intent filter to catch links from SMS doesn't work","<android><hyperlink><sms><intentfilter>","0","2","1","",""
"4750019","1","","","2011-01-20 16:49:33","0","541","<p>I'm trying to create a fairly simple application with a tabbed layout. At the moment, I have three tabs - two are blank textview activities, while the third attempts to do something a little more complex: scrape some data (a JSON array) from a website, and display it as a list.</p><p>The app starts fine, and the blank tabs can be used without issue. When switching to the final tab, however, the app crashes and an exception is thrown:</p><pre><code>java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.tabapp/com.tabapp.Tab3}: java.lang.NullPointerException</code></pre><p>To try and narrow down what's happening (beyond Java's adorable ""raaaargh something doesn't exist!""), I included Log.d commands all over the place. The very first line in onCreate() in the faulty activity is a Log.d, and that message never appears when the app runs. So, the crash occurs when the activity is called, but the first line isn't being executed, so presumably the problem isn't in the activity itself.</p><p>I've checked the <a href=""http://pastebin.com/2bNtkJD8"" rel=""nofollow"">manifest</a>, and all of the activities are (to the best of my limited knowledge) defined properly.</p><p>I'm very new to Android development and Stack Overflow; apologies if I've missed any important info.</p>","583293","","","","","2011-01-21 11:07:03","Crash when starting activity (via tabhost) - exception thrown before first line","<android>","1","3","","",""
"4750326","1","","","2011-01-20 17:18:00","5","1038","<p>I can't seem to create a modeless popupwindow in Android. I can create a popupwindow just fine, and it will receive events. However, what I need is for it to receive its events, and if the user clicks outside the popup window, the activity receives events as per normal.</p><p>I don't really want to use a dialog, and I'm looking for a look where a control pops up, and the user can choose to click on that or choose to click on something else in the activity.</p><p>I've been reading about FLAG_NOT_TOUCH_MODAL, but I can't seem to get this wot work with a popupwindow.</p><p>Any ideas?</p>","583342","","","","","2013-01-25 11:42:55","Android Modeless Popupwindow","<android><popupwindow><modeless>","1","2","","",""
"4750381","1","4751887","","2011-01-20 17:22:50","0","940","<p>I have an <code>AutoCompleteTextView</code> in my app that connects to a remote site to fetch suggestions. While suggestions are fetched I show a list of one item saying ""searching, please wait"". After the request completes, I update the suggestion list adapter and call <code>notifyDataSetChanged</code>.</p><p>Then the list contents changes to new suggestions (as expected), but somehow the list remains 1 cell in height, so that only the top suggestion is visible. How to force the view to re-calculate the dropdown height?</p>","6533","","","","","2011-01-20 19:55:18","How to force AutoCompleteTextView to update height of drop-down?","<android><autocompletetextview>","1","0","","",""
"4750452","1","","","2011-01-20 17:29:12","0","467","<p>My project is where, i have to wait, for a background operation to get completed. Till then, a progress dialog is shown. Now, after the operation is done, the results are stored in a List and a list should be created.</p><p>Everything seems to be working fine ( the progress dialog and all), but in wait(), my code (seen in stack overflow) is</p><pre><code>    Runnable runnable = new Runnable() {    public void run() {      // wait(); This call wouldn't work      synchronized (this) {        wait();  // This call will work      }    }};</code></pre><p>and after the background operation is completed, it is </p><pre><code>public void handleMessage(android.os.Message msg) {          super.handleMessage(msg);             System.out.println(""Doneee!!! Yup yes "");          pd.dismiss();         synchronized (runnable) {        runnable.notifyAll(); // this call will work       }    }</code></pre><p>But the problem is, the wait is getting hanged up. I mean, when i tried to debug also, the wait() doesn't return. It's in waiting state only. So can you please help me out to do it!</p><p>Thanks a lot in advance!</p><p>RegardsNithin</p>","583344","","","","","2012-04-06 17:22:04","Wait gives me an error in Android","<android><wait>","2","2","","",""
"4750498","1","4750548","","2011-01-20 17:33:53","3","1653","<p>This is an example of using outer class</p><pre><code>public class MyActivity extends Activity implements OnClickListener {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.mylayout);        findViewById(R.id.myid).setOnClickListener(this));    }    public void onClick(View v){...}}</code></pre><p>This is an example of anonymous classes</p><pre><code>public class MyActivity extends Activity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.mylayout);        findViewById(R.id.myid).setOnClickListener(new OnClickListener() {            public void onClick(View v){...}        }));    }}</code></pre>","463304","","","","","2011-01-20 17:39:36","Android Events: When implementing interfaces is it better to use the outer class or anonymous classes","<android><events><class><interface>","1","0","1","",""
"4750524","1","4750682","","2011-01-20 17:36:55","1","377","<p>Let's say I have a killer mobile app named X. I have lots of users and some users want a desktop version of X. How do I associate my mobile users profile with their new website profile? I don't want to have a username/password on the mobile device, because all of my users are on mobile and have a unique mobile device id already.I was thinking about generating a short UUID in the cloud, send it to the device and when the user signs up for the website they just input their UUID and email.Is that the best way to do it? Is there a better way?</p>","341390","","","","","2011-01-20 17:53:41","What's the best way to tie a mobile app user to their online profile?","<iphone><android><authentication><mobile><uuid>","3","2","","",""
"4750640","1","4751250","","2011-01-20 17:48:45","0","661","<p>I'll be publishing an Android application to the market for the first time .I have already posted all these questions on the Android Market help website but no one answered , hence posting the question here though I know this is a developer forum , since I dont know of anyother option of getting answers to this question.</p><p>I have the following queries:</p><p>1> I want to publish the application in my organisation's name , so do I need to visit the <a href=""http://market.android.com/publish"" rel=""nofollow"">http://market.android.com/publish</a> &amp; create a mail Id in my company's name ?</p><p>2> Do I need to provide an authorisation letter in my organisation's name , if I am publishing the application in my organisation's name ?</p><p>3> Is there any separate licence for a developer publishing an Android application &amp; an organisation publishing an application?</p><p>4> Is there any renewal policy of the licence?</p><p>5> I want to use the application from an enterprise perpective , so want to know is there any rule for the same.</p><p>I went through the developer site of android , but didn't find any information about publishing an Android application in Android market in the name of the organisation. Everything mentioned there seems for an individual developer perspective.</p><p>Kindly provide me your inputs. Sorry if I posted it at wrong place.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2011-01-20 20:23:32","Question regarding publishing Android application into Android market","<android>","1","0","","",""
"4750714","1","","","2011-01-20 17:57:29","0","1237","<p>I have to receive an SMS on port in my android application. Does anyone have an example code for receiving SMS message using sendOrderedBroadcast. I want to use sendOrderedBroadcast because my messages should not be stored in native message inbox. So, i have to use sendOrderedBroadcast. Does anyone have an example code for how to do this?</p><p>-chinnadurai</p>","543133","","","","","2011-01-20 17:57:29","sendOrderedBroadcast example code for receiving SMS in Android","<android>","0","2","","",""
"4750772","1","4751237","","2011-01-20 18:05:13","0","3482","<p>I am using this tutorial / code to learn the camera functions: <a href=""http://develnetwork.blogspot.com/2010/11/how-to-take-full-size-picture-in.html"" rel=""nofollow"">cam tutorial.</a></p><p>The app is crashing after the camera Intent takes the picture and returns to <code>onActivityResult</code>.  But I am checking the make sure data is not null:</p><pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {System.out.println(""***** inside onActivityResult"");  if (requestCode == TAKE_PICTURE) {    if (data != null) {    System.out.println(""***** inside data !=null if"");      imageid = data.getData().getLastPathSegment(); //returns full pic id      System.out.println(""***** imageid:"" + imageid);[...]</code></pre><p>I get inside the <code>data != null</code> if statement and it crashes when I <code>imageid = data.getData().getLastPathSegment();</code>.</p><p>Logcat:</p><blockquote>  <p>01-20 12:45:02.678: ERROR/AndroidRuntime(1626): FATAL EXCEPTION: main  01-20 12:45:02.678: ERROR/AndroidRuntime(1626): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { act=inline-data (has extras) }} to activity {org.kimile/org.kimile.Camera}: java.lang.NullPointerException  01-20 12:45:02.678: ERROR/AndroidRuntime(1626):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3515)  01-20 12:45:02.678: ERROR/AndroidRuntime(1626):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3557)  01-20 12:45:02.678: ERROR/AndroidRuntime(1626):     at android.app.ActivityThread.access$2800(ActivityThread.java:125)  01-20 12:45:02.678: ERROR/AndroidRuntime(1626):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2063)</p></blockquote><p>I can't figure out why its throwing the null exception even know I am checking to make sure its not null.</p>","570509","","","","","2014-04-20 02:30:59","Null pointer exception using camera intent when getData called","<android><null><camera><android-intent>","3","1","1","",""
"4750814","1","4752347","","2011-01-20 18:09:51","17","12531","<p>I am trying to create a button that is always on the screen.</p><ol><li>The button should be clickable andanything directly under the buttonshould not be activated on a press.    </li><li>The activity or home screen runningbehind the button should still work,meaning the user should still beable to interact with the homescreen or application. </li><li>The soft keybuttons should still work: home,back, menu, etc</li></ol><p>The following code does #1 and #2 but the soft key buttons no longer work:</p><pre><code>WindowManager.LayoutParams params = new WindowManager.LayoutParams(        WindowManager.LayoutParams.WRAP_CONTENT,        WindowManager.LayoutParams.WRAP_CONTENT,        WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,        WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL |        WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,        PixelFormat.TRANSLUCENT);</code></pre><p>Changing it to this disables the overlay from clicks but #2 and #3 work:</p><pre><code>WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,</code></pre><p>Finally in this example the overlay and what is directly behind it gets clicked:</p><pre><code>WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,</code></pre><p>How can I change this so that the overlay is clickable, whats directly under it is not clickable, and everything outside of the overlay works including the home buttons?</p><p>An example application that performs all of this is Super Manager.</p><p>UPDATE: I've found that the following allows the home button to be used, but still not the other buttons:</p><pre><code>        WindowManager.LayoutParams.TYPE_SYSTEM_ALERT |             WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,        WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL |            WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH</code></pre><p>,</p>","242904","","242904","","2011-01-20 20:29:11","2013-07-29 18:05:34","Creating a system overlay where the home buttons still work?","<android>","2","2","15","",""
"4750828","1","4752721","","2011-01-20 18:11:09","0","3942","<p>I want to: rotate my cube on a x,y,z center point. And the second way: i want to rotate my cube on my cube's center points. How i can do this?</p>","472537","","472537","","2011-01-20 18:39:48","2011-01-20 21:20:30","Android OpenGL ES rotate a cube on x, y, z points, and the cube's center","<android><opengl-es>","1","0","","",""
"4750855","1","4751115","","2011-01-20 18:14:19","0","352","<p>I have an app supporting from hdpi to ldpi. It works fine, without any problem for accessing resources.In this app, I have a ListView, and I decided to add an image in each view of the list. So I prepared three png images, one for each resolution, and placed them in their respective resource directories.</p><p>All is fine with a hdpi 2.2 emulator, but it crashes with a NullPointerException in 2.2 mdpi and ldpi at the bindView method line where I put the drawable in the iImageView:<code>mImageView.setImageDrawable(getBaseContext().getResources().getDrawable(R.drawable.hello)</code>I've tried to replace <code>getBaseContext()</code> by <code>getApplicationContext()</code> or even removing it without success.</p><p>I guess that the app doesn't look in the -mdpi folder. However, I don't understand why the hdpi version works fine. Note that there is nothing in the bare drawable directory.Furthermore, the app knows how to look in these folders since it does it in a previous activity used to launch the one with the ListView.</p><p>Any Idea ?</p>","377088","","377088","","2011-01-20 19:00:23","2011-01-20 20:14:03","Problem with some mdpi and ldpi ressources with android","<android><listview><resources><hdpi><mdpi>","2","0","","",""
"4750939","1","5110476","","2011-01-20 18:23:17","31","16810","<p>It seems that an android animation is not truly finished when the <code>onAnimationEnd</code> event is fired although <code>animation.hasEnded</code> is set to true.</p><p>I want my view to change it's background drawable on the end of it's <code>ScaleAnimation</code> which it does, but you can clearly see that it is changed some miliseconds before it finishes. The problem is, that it flickers because the new background appears (=is) scaled for a short time until the animation really finishes.</p><p>Is there a way to get either the real end of the animation or just prevent the new background from beeing scaled this short period of time?</p><p>Thank you!</p><hr><p>//EDIT: I'm using an AnimationListener to get the following call:</p><pre><code>    @Overridepublic void onAnimationEnd(Animation animation){    View view = (MyView) ((ExtendedScaleAnimation) animation).getView();    view.clearAnimation();    view.requestLayout();    view.refreshBackground(); // &lt;-- this is where the background gets changed}</code></pre>","578502","","39709","","2011-09-10 21:16:46","2014-02-20 21:43:20","android animation is not finished in onAnimationEnd","<android><animation><background><drawable>","5","6","21","",""
"4751141","1","","","2011-01-20 06:45:56","1","855","<p>I think, next pattern is common in UI:</p><ul><li>input (or edit) some form</li><li>view this form</li></ul><p>It's user-friendly, when this two forms look similar.</p><p>In iPhone, they often use standard forms with rounded borders, like that:</p><p><img src=""http://i.stack.imgur.com/l4cbt.png"" alt=""enter image description here""></p><p>Form looks similar in view and edit mode. And it's good for user...</p><p>How to implement such pattern in Android?</p>","438843","korovyansk","128662","","2011-07-28 15:34:44","2011-07-28 15:34:44","UI for input form in Android","<forms><android><input>","0","2","","",""
"4751148","1","4751235","","2011-01-20 18:44:03","0","8214","<p>I'm trying to make an android app that will connect to a device that I have that I suspect uses bluetooth frequencies. However, it seems that all the constructors in the <code>android.bluetooth</code> package are private. Does anyone have any experience they can share with me? </p><p>As a note, yes I've already looked at the API. I think I know what to use, but, again, I can't call any of the constructors of any of the classes.</p>","453435","","","","","2011-01-20 18:53:50","Connect to bluetooth device with Android/Java","<android><bluetooth>","1","0","","",""
"4751301","1","","","2011-01-20 19:00:34","0","500","<p>My app is running properly on some Android devices but on some devices it's giving an out of memory error.</p><p>Here is the LogCat log:</p><p><a href=""http://logcat.miui-dev.com/147001"" rel=""nofollow"">http://logcat.miui-dev.com/147001</a></p><p>What this Activity does is load Bitmaps, and display those Bitmaps through <code>onDraw()</code>.</p><p>What would cause this error?</p><p>what am doing ?</p><p>Am just maping all images in a method image </p><p>_bitmapCache.put(R.drawable.gb2, BitmapFactory.decodeResource(                getResources(), R.drawable.gb2));</p><p>and when a constructor is called i call that method , while using image i just use</p><p>canvas.drawBitmap(_bitmapCache.get(R.drawable.level1c1), 0, 0, null);</p><p>to craw the image</p>","182699","","182699","","2011-01-22 06:46:48","2011-01-22 06:46:48","Strange ""Out of Memory"" Error","<android>","2","2","","",""
"4751338","1","4756858","","2011-01-20 19:03:34","1","94","<p>My application contains 2 parts: a network part and GUI. It works kinda like a browser - user requests some information from server, server sends back some data representing some view, then GUI displays it.</p><p>Right now I've implemented network part as a service, which constructs and keeps all the views by itself. When an activity is created, network part sets it's content view to the last received view.</p><p>That's pretty simple, no need to recreate all the view hierarchy and saving all the states.</p><p>But there is problem - I can create Views within service context, I can keep them between activity launches, can unbind and rebind views when an activity is destroyed and created? but some views require Activity context (e.g. Spinner, that creates popup dialog).</p><p>So, is there any way to change context of a View after creation?</p><p>I'm very new in android programming, so there may be some better way to do this (again, the task is - keep view hierarchy and all the states when activity beeing destroyed and recreated, when a screen rotating occurs, for example).</p>","467290","","","","","2011-01-21 08:43:33","Android, keeping view","<android><view><context><orientation-changes>","1","0","","",""
"4751443","1","4751489","","2011-01-20 19:14:10","0","145","<p>I have a listactivity with the following 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:layout_width=""fill_parent"" android:layout_height=""fill_parent""    xmlns:myapp=""http://schemas.android.com/apk/res/se.javalia.myDrinks""    &gt;    &lt;Button android:id=""@+id/saveButton""         android:text=""test test""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content"" /&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/main_no_items"" /&gt; &lt;/LinearLayout&gt;</code></pre><p>Now, I'd like to add a button above the list that stays in place when the list is scrolled. Is it possible at all? </p><p>Thanks in advanceRoland</p>","435267","","435267","","2011-01-20 20:09:43","2011-01-20 20:09:43","Layout with list","<android><layout><button><listactivity>","4","0","","",""
"4751547","1","4751602","","2011-01-20 19:24:49","1","133","<p>My previous question was closed since it was to general. I will try to be more specific.</p><p>Based on the books I have which langauge should I learn, seeing my goal is to develop for iPhone &amp; Android. This will be my first programming language as well.</p><ol><li>The C programming language</li><li>Accelerated C++</li><li>An introduction to programming and object oriented design using Java (version 5.0) (Alot bigger than the two first books on C and C++ - which isn't a plus in my book).</li></ol><p>Thanks.</p>","583413","","","","","2011-01-20 19:34:11","Which langauge to learn based on the books I have. (for iPhone & Android)","<java><iphone><c++><android><c>","3","2","2","2011-01-20 19:53:32",""
"4751609","1","5039557","","2011-01-20 19:30:25","2","26772","<p>I am trying to save some data from my app in a simple text file on the internal private storage area (app user preferences). I have read through many questions on here (StackOverflow) and tried the solutions suggested with no success. The simplest solution, it seems, would be the one suggested here:<br /><br />  <a href=""http://developer.android.com/guide/topics/data/data-storage.html#filesInternal"" rel=""nofollow"">http://developer.android.com/guide/topics/data/data-storage.html#filesInternal</a> <br /><br />but I cannot get this to work on my test device. I have also tried to create the file using the methods available in the java.io.File with the appropriate methods. I have also tried to create the file on the SDCard with the same result, fail. I have tried many solutions listed in other answers, following the code and instructions suggested exactly and find the same result. I am beginning to feel that I am missing some important bit of code, or a setting flag somewhere, I have set the permission in the manifest file:<br /><br />  </p><pre><code>  &lt;uses-permission         android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;</code></pre><p><br />  </p><p>To be clear, I am trying to write to the device's internal, private storage. It is a small file containing a name, phone number, and a couple of type <code>int</code> flags. What ever method I use, I either find that the file did not create (or change if I place the file manually on the SDCard), or I get a NullPointerException when I try to reference the file or file location:<br /></p><pre><code>private              File   fILE = new File(""Mydata"", main.FILENAME);</code></pre><p>or<br /></p><pre><code>private              File   fILE  = getDir(""Mydata"", 0);</code></pre><p><br />I am running the code on a HTC Hero, updated with the latest service release from Sprint. Any help would be GREATLY appreciated, Thanks in advance!</p><p>-Steve</p><p>Update (2/2/11): Using a EVO (API 8) I still get a NullPointerException. The code generating the exception is below, any thoughts on why my app can't access the internal storage? I have this problem on three different physical devices using two API levels (API 7 and 8).</p><pre><code>    File newfile = new File(this.getFilesDir() + ""/data/files/"", ""sample.txt"");</code></pre><p>UPDATE 2: 2/4/11 - I have found that I cannot see the file structure on the physical device (data directory) under any circumstance. Any one have any thoughts on this? The device is properly configured and can run app from eclipse or adb.</p><p>UPDATE 3: (2/9/11) - I think I may have found what the problem is here, but I am not sure about how to deal with it. I have figured out that the permissions on the /data/ directory on the physical devices are: <code>drwxrwx--x</code>. I am not sure why it is this way, maybe something to with Sprint? I have found this set this way on an HTC Hero, Samsung Epic (Galaxy S), and HTC EVO all on Sprint. The issue appears to be that DDMS and my app do not have r/w access to the directory. I need to figure out 2 things here, why it is like this and how to over come this issue in the wild. Again, any help here would be AWESOME!!</p><p>UPDATE 4: I think last February was a total blonde moment for me (see UPDATE 3). The test devices that I have are not ROOTed and hence no access (DUH!). After all the updates that he SGS and the EVO 4G have gone through, the result is still the same. I am still working this problem and will try and get back here with an update soon (hopefully less than a year next time).</p>","549510","","549510","","2012-02-07 04:54:38","2013-06-28 06:34:44","Writing to the internal private storage in Android (UPDATED 2/6/12)","<android><file-permissions>","4","5","2","",""
"4751791","1","","","2011-01-20 19:45:27","0","2539","<p>I am using the public api of class DownloadManager, I am able to download files to sdcard, so-called external storage. However, when I tried to download a file to other places, like /cache partition, it throw a security exception which says ""Destination must be on external storage"".</p><p>Does anyone know how to bypass this limitation and write downloaded file to /cache partition ?</p><p>Thanks a lot.</p>","455544","","","","","2011-01-21 19:25:56","DownloadManager: download a file to cache partition","<android><download-manager>","1","0","","",""
"4751804","1","4751991","","2011-01-20 19:46:47","1","2526","<p>I am fairly new to android and am writing an app that will solve physics problems. The math is going well thanks to some help from these forums, but when I try to start my activity from a list it comes up with a nullpointerexception in the onCreate Method of the new activity. This doesn't seem to make much sense though, because all thats there is a submit button that executes the math from some EditText views. Here is my code.</p><pre><code>package android.physicsengine;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import java.lang.Math;public class ProjectileMotion extends Activity { private EditText acceleration; private EditText finalVelocity; private EditText initialVelocity; private EditText time; private EditText deltay; private EditText velocity; private EditText deltax; private Button submitButton; @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.projectile_motion_layout);  submitButton.setOnClickListener(new OnClickListener() {    @Override   public void onClick(View v) {    acceleration = (EditText)findViewById(R.id.acceleration);    double a = Doublify(acceleration);    finalVelocity = (EditText)findViewById(R.id.finalVelocity);    double vf = Doublify(finalVelocity);    initialVelocity = (EditText)findViewById(R.id.intitialVelocity);    double vi = Doublify(initialVelocity);    time = (EditText)findViewById(R.id.time);    double t = Doublify(time);    deltay = (EditText)findViewById(R.id.deltay);    double y = Doublify(deltay);    velocity = (EditText)findViewById(R.id.velocity);    double vx = Doublify(velocity);    deltax = (EditText)findViewById(R.id.deltax);    double x = Doublify(deltax);    //Y Axis    if(time.getText()==null &amp;&amp; deltay.getText()==null){     time.setText(Double.toString((vf-vi)/a));     deltay.setText(Double.toString(((vf-vi)/a)+(a*Math.pow(((vf-vi)/a),2))));    }    if(acceleration.getText()==null &amp;&amp; deltay.getText()==null){     acceleration.setText(Double.toString((vf-vi)/t));     deltay.setText(Double.toString((vi*t+.5*((vf-vi)/t))*Math.pow(t,2)));    }    if(acceleration.getText()==null &amp;&amp; time.getText()==null){     acceleration.setText(Double.toString(((Math.pow(vf,2)-Math.pow(vi,2)))/2*y));     time.setText(Double.toString(2*y*(vf-vi)/(Math.pow(vf,2)-vi)));    }    if(initialVelocity.getText()==null &amp;&amp; deltay.getText()==null){     initialVelocity.setText(Double.toString(vf-a*t));     deltay.setText(Double.toString((vf-a*t)*t+.5*a*Math.pow(t,2)));    }    if(initialVelocity.getText()==null &amp;&amp; time.getText()==null){     initialVelocity.setText(Double.toString(Math.sqrt(Math.pow(vf,2)-2*a*y)));     time.setText(Double.toString((vf-Math.sqrt(Math.pow(vf,2)-2*a*y))/2));    }    if(initialVelocity.getText()==null &amp;&amp; acceleration.getText()==null){     initialVelocity.setText(Double.toString(vf-2*(vf-y/t)));     acceleration.setText(Double.toString((2/t)*(vf-y/t)));    }    if(finalVelocity.getText()==null &amp;&amp; deltay.getText()==null){     finalVelocity.setText(Double.toString(vi+a*t));     deltay.setText(Double.toString(vi*t+.5*a*Math.pow(t,2)));    }    if(finalVelocity.getText()==null &amp;&amp; time.getText()==null){     finalVelocity.setText(Double.toString(Math.sqrt(Math.pow(vi,2)+2*a*y)));     time.setText(Double.toString(((Math.sqrt(Math.pow(vi,2)+2*a*y)-vi))/a));    }    if(finalVelocity.getText()==null &amp;&amp; acceleration.getText()==null){     acceleration.setText(Double.toString(2*(y-vi*t)/Math.pow(t,2)));     finalVelocity.setText(Double.toString(vi+(2*(y-vi*t)/t)));    }    if(finalVelocity.getText()==null &amp;&amp; initialVelocity.getText()==null){     initialVelocity.setText(Double.toString((y-.5*a*Math.pow(t,2))/t));     finalVelocity.setText(Double.toString((y-.5*a*Math.pow(t,2))/t)+a*t);    }   }     }); } private double Doublify(EditText editText){  if(editText.getText()!= null){   return Double.parseDouble(editText.getText().toString());  }  return 0; }}</code></pre><p>and the XML</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:orientation=""vertical""&gt;   &lt;TableRow&gt;    &lt;TextView android:text=""Projectile Motion Engine""        android:textSize=""25dip""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_span=""4""        android:layout_gravity=""center"" /&gt;       &lt;/TableRow&gt;   &lt;TableRow&gt;    &lt;TextView android:text=""X axis""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_span=""2""        android:textStyle=""bold""/&gt;      &lt;TextView android:text=""Y axis""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_span=""2""        android:textStyle=""bold""/&gt;     &lt;/TableRow&gt;   &lt;TableRow&gt;    &lt;TextView android:text=""accel(m/s^2)=""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;EditText android:id=""@+id/acceleration""        android:text=""9.8""        android:inputType=""numberDecimal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;TextView android:text=""deltax(m)=""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;EditText android:id=""@+id/deltax""        android:inputType=""numberDecimal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;   &lt;/TableRow&gt;   &lt;TableRow&gt;    &lt;TextView android:text=""init v(m/s)=""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;EditText android:id=""@+id/intitialVelocity""        android:inputType=""numberDecimal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;TextView android:text=""v =""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;EditText android:id=""@+id/velocity""        android:inputType=""numberDecimal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;   &lt;/TableRow&gt;   &lt;TableRow&gt;    &lt;TextView android:text=""final v(m/s)=""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;EditText android:id=""@+id/finalVelocity""        android:inputType=""numberDecimal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;TextView android:text=""time(s)=""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;EditText android:id=""@+id/time""        android:inputType=""numberDecimal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;   &lt;/TableRow&gt;   &lt;TableRow&gt;    &lt;TextView android:text=""deltay(m)=""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;EditText android:id=""@+id/deltay""        android:inputType=""numberDecimal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;  &lt;Button android:id=""@+id/submitButton""    android:layout_width=""fill_parent""      android:layout_height=""wrap_content""       android:layout_span=""2""      android:text=""Launch"" /&gt;   &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre>","583082","","390989","","2011-01-20 19:48:40","2011-01-20 20:05:27","NullPointerException in Android Program in onCreate()","<java><android><nullpointerexception><oncreate>","3","2","","",""
"4751919","1","","","2011-01-20 19:58:54","1","428","<p>I have a layout animation similar to the one in this example: <a href=""http://developer.android.com/resources/samples/ApiDemos/res/layout/layout_animation_4.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/res/layout/layout_animation_4.html</a>(corresponding code: <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/LayoutAnimation4.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/LayoutAnimation4.html</a>)I would like to add a short sound when each icon fades in.Can I do that? How?</p>","341390","","","","","2011-01-20 19:58:54","Can I add sound to an Android layout animation?","<android><animation><audio><layout-animation>","0","0","","",""
"4751934","1","","","2011-01-20 20:00:29","0","620","<p>I'm writing an android socket client application that employs a socket connection and I'm having a lot of trouble deciding the best way persist the socket data across different activities.</p><p>What I'd like to do is have the initial activity of my client android application send a log-in command through the socket and read the initial configuration of my data out of the socket and into an Object that then becomes available to all of the activities in my application.</p><p>After the Object has been initialized it should be updated on a regular basis by sending a command through the socket and reading the socket response into the Object.</p><p>The different activities of my application display subsets of the data contained in this Object and occasionally send a command through the socket.</p><p>My thinking was to create an android Service that would employ a background thread to poll the socket on a regular basis and store the data in an Object but I think my main problem is how do I persist this data Object without storing it in a SQLite database? It needs to be updated on a regular basis and be accessible by several different activities.</p>","354271","","","","","2011-01-20 20:00:29","Android Application Design Pattern for Socket Data","<android><sockets><activity><switching>","0","2","1","",""
"4751963","1","4752125","","2011-01-20 20:03:27","4","1848","<p>Simply trying to extend View and do some custom work, but Eclipse will complain when I attempt to override the setFrame method. Claiming there isn't a method in the parent class to override: </p><blockquote>  <p>The method setFrame(int, int, int, int) of type Test must override or implement a supertype method</p></blockquote><p>Here is the signature of the method from android SDK source.</p><pre><code>protected boolean setFrame(int left, int top, int right, int bottom)</code></pre><p>As you can see it's not private or package level, or even specified as final... just protected. Which should mean I am totally able to override it in a subclass. Right? Below is the bare minimum of what I'm trying to do in Eclipse. Perhaps it is just an Eclipse error, but I'm not too familiar with using Ant to check against that.</p><p><b>Edit: To those answering that setFrame is not defined in the View class, I can assure you it is. How else do you think I got the method signature? It is even called during layout(). Or am I seriously just crazy?</b></p><p>git HEAD: <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob_plain;f=core/java/android/view/View.java;hb=HEAD"" rel=""nofollow"">View.java</a><br>Cupcake (1.5r4): <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/view/View.java;h=0a84aa01d04eaf34c896987fb8bf55fe57438ff5;hb=46e23fe762d2143d60589ab6d39c4b47c2c754d1"" rel=""nofollow"">View.java</a></p><p>You can even see the method <b>being overriden</b> in the <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob_plain;f=core/java/android/widget/ImageView.java;hb=HEAD"" rel=""nofollow"">ImageView</a> and <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob_plain;f=core/java/android/widget/TextView.java;hb=HEAD"" rel=""nofollow"">TextView</a> classes...this is why I am seriously confused as to why I cannot override it myself from View directly...</p><pre><code>public class Test extends View {    public Test(Context context) {        super(context);    }    public Test(Context context, AttributeSet attrs) {        super(context, attrs);    }    public Test(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);    }    @Override    protected boolean setFrame(int left, int top, int right, int bottom) {        return super.setFrame(left, top, right, bottom);    }}</code></pre>","572002","","572002","","2011-01-20 21:02:01","2011-10-09 19:29:03","Android: Why Can't I Override setFrame From View?","<java><android><inheritance><extension-methods><override>","2","0","1","",""
"4752110","1","4752214","","2011-01-20 20:18:36","2","471","<p>I'm just wondering if it's the Launchers' responsibility to render the wallpaper/live wallpapers? or if's always drawn below it? so that if i make a transparent launcher i can assume that the wallpaper is there?</p>","96664","","918414","","2012-06-30 02:30:08","2012-06-30 02:30:08","Is the launcher is responsible for drawing the wallpaper on Android?","<android><wallpaper><launcher>","2","0","","",""
"4752197","1","","","2011-01-20 20:27:46","2","1274","<p>I am using scrollBy() on a RelativeLayout to try to scroll over to buttons to the right of the visible screen, but I only see blank screen. Buttons on the screen border get clipped, and remain clipped after scrolling (in any direction).</p><p>I have tried nearly every combination of WRAP CONTENT and FILL PARENT on the relativelayout params. </p><p>I also tried using a LinearLayout in the setContentview(), it didn't work.</p><p>I need the view to scroll horizontally, and the app is set to be always in landscape mode.</p><p>Does the layout have to be redrawn or refreshed in some manner to enable the missing buttons to appear?</p><p>Do I need to use some other view type for this kind of functionality?</p><p>Thanks for any input.</p><p>-nathan</p><p>Here is all the code from top, to end of onCreate():</p><pre><code>package golfcaddy.tools;import android.app.Activity;import android.content.Intent;import android.content.SharedPreferences;import android.os.Bundle;import android.util.Log;import android.view.Menu;import android.view.MotionEvent;import android.view.View;import android.view.View.OnClickListener;import android.view.ViewGroup.LayoutParams;import android.widget.Button;import android.widget.LinearLayout;import android.widget.RelativeLayout;import android.widget.TextView;import android.widget.Toast;public class GolfScoreRel extends Activity implements OnClickListener {    // Settings file, preferences    public static final String PREFS_NAME = ""golfscore"";    public static final String PREFS_SCORES = ""scores"";    public static final String PREFS_BACKGROUND_IMAGE = ""backimage"";    SharedPreferences mSettings;    private int currentX = 0;    private int currentY = 0;    int numHoles = 0;    int numplayers = 0;      RelativeLayout r1;      LinearLayout lin;      public int mLastScoreEntered;      //manages unique ID's for all view inside Relative layouts      int viewCount = 1;     // int holeScoresFront[] = new int[9];     // int holeScoresFrontb[] = new int[9];      Button mLastClicked;      Button exitButton;      TextView pTotal1;      TextView pTotal2;    @Override    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);       // lin = new LinearLayout(this);       // lin.setOrientation(LinearLayout.VERTICAL);        /*    not used yet....        GolfPlayer p1 = new GolfPlayer(""P 1"");        GolfPlayer p2 = new GolfPlayer(""P 2"");        GolfPlayer p3 = new GolfPlayer(""P 3"");        GolfPlayer p4 = new GolfPlayer(""P 4"");        */        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,                  LayoutParams.WRAP_CONTENT);        r1 = new RelativeLayout(this); // this layout will be set for contentview         r1.setLayoutParams(params);        numplayers = 4;   //standard golf group        numHoles = 18;  //standard golf round        r1.addView(createCard(numplayers,numHoles));        setContentView(r1);    }  //end oncreate</code></pre><p>here's my r1.scrollBy() code I borrowed from someplace:</p><pre><code>Override public boolean onTouchEvent(MotionEvent event) {  switch (event.getAction()) {      case MotionEvent.ACTION_DOWN: {          currentX = (int) event.getRawX();          currentY = (int) event.getRawY();          break;      }      case MotionEvent.ACTION_MOVE: {          int x2 = (int) event.getRawX();          int y2 = (int) event.getRawY();          r1.scrollBy(currentX - x2 , currentY - y2);          currentX = x2;          currentY = y2;          break;      }         case MotionEvent.ACTION_UP: {          break;      }  }    return true; }</code></pre><p>Screen Shots notes:  We should be seeing 8 more buttons to the right.<br>              Last shot shows a 5 player card with DEBUG button clipped.</p><p>Dang,as a new user, I'm not allowed to post images. try viewing them here:  <a href=""http://groups.yahoo.com/group/nateandroiddev/photos/album/776905892/pic/list?mode=tn&amp;order=ordinal&amp;start=1&amp;dir=asc"" rel=""nofollow"">http://groups.yahoo.com/group/nateandroiddev/photos/album/776905892/pic/list?mode=tn&amp;order=ordinal&amp;start=1&amp;dir=asc</a></p>","582162","","582162","","2011-01-21 00:25:53","2011-01-21 00:25:53","RelativeLayout is dynamically created,I am using .scrollBy(), views off screen can't be seen or clicked","<android><relativelayout>","1","0","","",""
"4752199","1","4753576","","2011-01-20 20:27:56","5","3645","<p>I'm designing a service that will comprise a cloud-based database (with a UI for us to manage the data), and then a mobile app for end-users that displays the data to people who want it (primarily read-only). The end-users will be anonymous.</p><p>The cloud database / app server needs to provide:</p><ul><li><p>A solid, scalable, cloud-based database</p></li><li><p>A nice easy API, REST, and ideally an Android SDK</p></li><li><p>A UI on the web to manage data (including creating forms across tables)</p></li><li><p>Sensible pricing, but not free</p></li></ul><p>My options include Google App Engine, Microsoft Azure, hosted Couchdb, Salesforce's forthcoming database.com, and Amazon SimpleDB. But my third requirement, web-based forms for internal data management, are proving the biggest hurdle.</p><p>Database.com (or more specifically the force.com product) make it VERY easy to create online forms to run reports, and add and edit data. But Salesforce are a pain in the backside to deal with, and the database.com pricing looks expensive.</p><p>People are suggesting I code up a UI myself for the data editing &amp; management, and yes I could, but it's a lot of work (especially as I don't know Azure, Python etc), and I'd much rather put that effort into the app, which is what my customers will use. I'm new to Android this year, so have my hands full learning the one platform.</p><p>One option is for me to use force.com to manage the data, but then replicate it somewhere else, where the API calls come in, best of both worlds perhaps.</p><p>Which option suits my needs best? I'm sure I'm far from alone in looking for a nice back-end service to sit behind mobile apps.</p>","477415","","","","","2013-08-30 08:32:03","Which cloud database back end should I use for my Android app?","<android><google-app-engine><salesforce><sql-azure><amazon-simpledb>","5","0","7","",""
"4752209","1","4752241","","2011-01-20 20:28:33","0","365","<p>Hello is it possible to add a tab pane inside another one?</p>","234898","","1069068","","2013-03-19 14:35:11","2013-03-19 14:35:11","android tab pane inside tab pane?","<android>","1","0","","",""
"4752277","1","4752681","","2011-01-20 20:34:50","2","1965","<p>I am trying to figure out the best way to monitor the accelerometer sensor with a polling rate of less than .25 milliseconds. I have implemented a UI option for the user to switch to a constant monitoring state and made it clear of the battery drain ramifications. Would a remote service be the best way over a daemon thread because of the way Android handles cleaning up memory and threads? The point is to make the accelerometer monitored as close to constantly as possible, battery drain be damned. And this monitoring needs to be long running, maybe even more than 24 hours straight, again I realize the power consumption consequences. Any suggested reading or code snippets will be appreciated.</p><p>Just a newbe looking for advice from the wisdom of the Android community. Thanks in advance,</p><p>-Steve</p><p>CLARIFICATION: I am trying to detect the instant there is a change in acceleration. My code discriminates by axis, but getting real time data from the accelerometer is my goal.</p>","549510","","549510","","2011-01-20 21:29:49","2011-01-20 21:29:49","Constantly monitor a sensor in Android","<android><multithreading><daemon>","2","5","3","",""
"4752290","1","4752354","","2011-01-20 20:37:06","2","1676","<p>To stackoverflow community,I created this method to turn some EditText fields in doubles. I added the if statement specifically for the purpose of avoiding parse error because I know that several of my EditText fields will be left blank. However, they still keep coming at runtime. Does anybody know the correct way to avoid parsing fields that are blank? Thank you very much.</p><pre><code>private double Doublify(EditText editText){  if(!(editText.getText().equals(null))){   return Double.parseDouble(editText.getText().toString());  }  return 0; }</code></pre>","583082","","225239","","2011-01-20 20:38:01","2011-01-20 21:07:33","Avoiding a Parsing Error from an EditText in Android","<java><android><parsing>","4","0","1","",""
"4752383","1","","","2011-01-20 20:46:16","0","873","<p>This is a basic problem of an inexperienced programmer. I am making a game in android application. Obviously it requires a lot of touch events. This function seems to grow very big with if/else statements. I want some guidelines on how to write an onTouchEvent method. Can someone point me to any example that has a onTouchEvent method and how is it structured well ?</p>","583571","","","","","2011-02-18 07:16:59","OnTouchEvent guidelines for a game","<android>","1","0","1","",""
"4752417","1","4753417","","2011-01-20 20:49:11","1","249","<p>I have a video player implemented in an activity. I am forcing it into landscape at this stage by doing setting up the manifest like this</p><pre><code>&lt;activity android:name="".activity.VideoPlayerActivity""              android:launchMode=""singleTask""              android:configChanges=""orientation""              android:screenOrientation=""landscape""/&gt;</code></pre><p>and overriding onConfigurationChanged with an empty implementation so that the activity is not restarted.</p><p>This all works great but at least on the emulator it seems to affect other activities forcing them into landscape even though they share nothing in terms of code. I have no seen this happen on any phone yet but obviously I have a limited amount of phones and I would really not like this to happen to users.</p><p>So has anybody seen this problem before? Is it just the emulator? Is there maybe a better way to do it?</p><p>Or considering tablets and so on coming along should I stop to force landscape mode anyway and just keep track of the position in the video and restart at the right position upon orientation change? </p>","136445","","","","","2011-01-20 22:31:40","Screen orientation getting stuck on emulator","<java><android><android-emulator><android-manifest>","2","0","","",""
"4752478","1","5653851","","2011-01-20 20:55:23","0","2975","<p>I am looking for the best, if any, programmatic way of connecting two or more Android phones to each other through the use of either Bluetooth or preferably, Wi-Fi.  Apparently Android devices still do not have ad-hoc Wi-Fi capabilities and I am trying to create a peer based program without the use of any central server.</p><p>I want to accomplish this without the use of modification to the phones (no rooting).  It is even fine to have a phone act as an access point with no Internet access to its clients if that is possible, I just need a mobile network.</p>","292023","","292023","","2011-01-20 21:20:07","2011-04-13 18:32:28","Android ad-hoc / access point connection capabilities","<android><networking><mobile><phone><adhoc>","2","0","","",""
"4752480","1","","","2011-01-20 20:55:30","1","172","<p>Before I just modified the Vertex Array to implement ""scrolling"" of a tiled map but since android uses buffers I cannot use that method anymore. I am using gluOrtho2D for my projection and was wondering what would be the best method to achieve ""scrolling"". Do I use gluOrtho2D, gluLookAt, or glTranslatef? Is there another option that I do not know of?</p>","507007","","44729","","2011-01-20 23:21:37","2011-01-20 23:21:37","Android opengles scrolling solution","<java><android><opengl-es>","0","2","0","",""
"4752776","1","4752822","","2011-01-20 21:25:29","0","202","<p>I'm trying to use SafeViewFlipper (<a href=""http://pastie.org/1086467"" rel=""nofollow"">http://pastie.org/1086467</a>) <a href=""http://stackoverflow.com/questions/4674796/crash-when-rotating-activity-using-viewflipper"">Crash when rotating Activity using ViewFlipper</a></p><p>but I don't know how to do it..</p><p>When I try this the application crashes (ClassCastException)</p><pre><code>SafeViewFlipper controlsFlipper;controlsFlipper = (SafeViewFlipper) findViewById(R.id.controlsFlipper);</code></pre><p>in the layout.xml..</p><pre><code>&lt;ViewFlipper android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:id=""@+id/controlsFlipper""&gt;</code></pre>","564468","","","","","2011-01-20 21:30:06","How can I use SafeViewFlipper?","<android><android-layout>","1","0","","",""
"4752838","1","","","2011-01-20 21:30:53","1","836","<p>I'm following <a href=""http://android.amberfog.com/?p=422"" rel=""nofollow"">http://android.amberfog.com/?p=422</a> to start an activity by a secret code using below code:</p><pre><code> &lt;action android:name=""android.provider.Telephony.SECRET_CODE"" /&gt; &lt;data android:scheme=""android_secret_code"" android:host=""4636"" /&gt;</code></pre><p>What I would like to do is to have an option in the application itself, where the user can change the secret code to something they wish.</p><p>So as a default, user presses <em>#</em>#4636#<em>#</em> to get into application, and when user changes to some other code, say 5555, for the next launch it uses 5555 to launch application.</p><p>Are there anyways to do this?</p><p>I first thought about getting this code from strings.xml, but then I realized that I can't change the resources in strings.xml in runtime. </p><p>I, then, thought about putting this value into sqllite database or to shared preference, but I am not sure if I can pull this value back to manifest.</p><p>Are there any good ideas to do this?</p><p>I could also not use secret_code, but when user calls certain number (say 33334) then the application launch. Then user can change this number in the application. If this is possible, I can cope with this way too.</p><p>I know the above is possible in Shady_SMS but not sure how this application handled this.</p>","583633","","1288","","2013-02-09 16:16:35","2013-09-19 09:16:15","Dynamic Manifest File for ""android_secret_code""","<android><dynamic><manifest>","1","1","1","",""
"4753013","1","5089350","","2011-01-20 21:48:30","4","8529","<p>If I have a large bitmap file that would normally generate an ""Out of memory"" exception, how can I load it as tiles? e.g. I have a 10,000x10,000 image, I want to split it up into a 10x10 grid of 1,000x1,000 pixel tiles.</p><p>I've seen the function <code>Bitmap.createBitmap(sourceBitmap, x, y, width, height)</code> but it requires my large image as the source input.</p><p>How can I get a tile from my input image, without fully loading the input image?</p>","986","","","","","2012-06-25 10:07:42","How to load tiles from a large bitmap in Android?","<java><android><memory-management><bitmap>","3","2","3","",""
"4753158","1","","","2011-01-20 22:03:08","16","10506","<p>My question is how to add a shadow to text when TextView is selected or View that TextView is in gets selected. For example I have a CheckedTextView which changes background according to type of selection. I also made a text selector which changes color on differents states. Now I would like to add a shadow when for example View gets selected. So it changes background color, text color and creates a shadow. This is my text selector:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item     android:state_focused=""true""     android:state_pressed=""false""           android:color=""@android:color/white""    style=""@style/DarkShadow""/&gt;&lt;item     android:state_focused=""true""     android:state_pressed=""true""                android:color=""@android:color/white""    style=""@style/DarkShadow""/&gt;&lt;item     android:state_focused=""false""     android:state_pressed=""true""     android:color=""@android:color/white""    style=""@style/DarkShadow""/&gt;&lt;item     android:color=""@color/primary_text_light_disable_only""/&gt;</code></pre><p></p><p>and style:</p><pre><code>&lt;style name=""DarkShadow""&gt;       &lt;item name=""android:shadowColor""&gt;#BB000000&lt;/item&gt;    &lt;item name=""android:shadowRadius""&gt;2.75&lt;/item&gt;&lt;/style&gt;</code></pre><p>Now text gets properly highlighted but no shadows appear. Does anyone know how to solve this?</p>","524384","","","","","2014-02-05 13:55:10","How to add shadow to TextView on selection/focus","<android>","3","1","9","",""
"4753252","1","4787994","","2011-01-20 22:13:01","3","11363","<p>My app allows a user to save an image to their SD card. But I'm not sure how to make it appear in the gallery until you unmount and remount the SD card. I have googled for a couple of days with this problem but am not sure how to make it appear automatically. I found <a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg24164.html"" rel=""nofollow"">this</a> link but I'm not sure how to use the class. This is what i use to save the file. At the bottom of the try catch block is where I want to scan the sd card for new media. </p><pre><code>    FileOutputStream outStream = null;    File file = new File(dirPath, fileName);    try {        outStream = new FileOutputStream(file);        bm.compress(Bitmap.CompressFormat.JPEG, 100, outStream);        outStream.flush();        outStream.close();    } catch {         ...    }</code></pre><p>If anyone could point me in the right direction, I would appreciate.</p>","469194","","","","","2014-04-15 08:28:36","Scan Android SD card for new files","<android><media><sd-card><android-mediascanner>","6","2","2","",""
"4753423","1","4753668","","2011-01-20 22:31:13","0","581","<p>I'd like to add a web-based application to the Android market. Is this possible? Tools like JQueryMobile and JTouch are great, but it's easy to miss user acquisition opportunities if you don't get into the marketplace.</p><p>You see examples of this from Google - ""Tasks"", ""Latitude"" for example. But I haven't found a resource explaining how to do this.</p>","391146","","","","","2011-01-21 13:53:01","Is it possible to add a web application to the Android marketplace?","<android><google-play>","2","0","","",""
"4753516","1","4754139","","2011-01-20 22:43:59","6","4319","<p>I'm using PreferenceActivity. How do I remove a preference? I cannot seem to get this to work:</p><pre><code>Preference p = findPreference(""grok"");boolean worked = getPreferenceScreen().removePreference(p);// worked == false.</code></pre><p>So the preference is found, but the removePreference() call fails. What's the right way to do this? I'm using a preference.xml file for the keys like so:</p><pre><code>&lt;PreferenceScreen    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;PreferenceCategory        android:title=""foo""&gt;        &lt;CheckBoxPreference            android:key=""grok"" /&gt;            ...</code></pre><p>Thanks</p>","291701","","291701","","2011-01-20 23:09:19","2014-04-17 12:48:54","How to remove a preference from PreferenceActivity?","<android>","2","0","3","",""
"4753646","1","4753815","","2011-01-20 23:00:36","1","619","<p>Let me sum up the situation for you:</p><ul><li>I have a button (btnChooseEp), and when you press it an AlertDialog appears.</li><li>When something is picked in the AlertDialog, three if statements must be evaluated.</li><li>While they are being evaluated, a ProgressDialog appears. It indicates that the app is ""busy"".</li><li>After the evaluation of these statements, the ProgressDialog must disappear.</li></ul><p>My problem is described beneath the code.</p><p>The entire code block is shown here:</p><pre><code>ProgressDialog getTracklistProgressDialog = null;</code></pre><p>...</p><pre><code>    Button btnChooseEp = (Button)findViewById(R.id.btnChooseEp);    btnChooseEp.setOnClickListener(new OnClickListener()    {                   public void onClick(View v)        {                           final AlertDialog.Builder builder = new AlertDialog.Builder(GA.this);            builder.setTitle(getText(R.string.chooseEpisode));            builder.setItems(episodes, new DialogInterface.OnClickListener()            {                public void onClick(DialogInterface dialog, final int pos)                {                                           getTracklistProgressDialog = ProgressDialog.show(GA.this, ""Please wait..."",                            ""Retrieving tracklist..."", true);                    new Thread()                    {                        public void run()                        {                            try                            {                                                       String str1, epURL;                                if(pos &lt; 9)                                {                                    str1 = getResources().getString(R.string.epNo1);                                            epURL = String.format(str1, pos+1);                                    setTracklist(epURL, tracklist);                                                 }                                else if(pos &lt; 100)                                {                                    str1 = getResources().getString(R.string.epNo2);                                    epURL = String.format(str1, pos+1);                                    setTracklist(epURL, tracklist);                                }                                else if(pos &gt;= 100)                                {                                    str1 = getResources().getString(R.string.epNo3);                                    epURL = String.format(str1, pos+1);                                    setTracklist(epURL, tracklist);                                }                            }                            catch(Exception e)                            {}                            // Remove progress dialog                            getTracklistProgressDialog.dismiss();                                                       }                    }.start();                                          }            });            AlertDialog alertDialog = builder.create();            alertDialog.show();        }    });</code></pre><p>Not sure if needed, but here is the code for the function setTracklist:</p><pre><code>public void setTracklist(String string, TextView tv){    try    {        tv.setText(getStringFromUrl(string));    }    catch(Exception e)    {        e.printStackTrace();    } }</code></pre><p>And the code for the function getStringFromUrl can be seen here: <a href=""http://pastebin.com/xYt3FwaS"" rel=""nofollow"">http://pastebin.com/xYt3FwaS</a></p><p><strong>Now, the problem:</strong>Back when I didn't implement the ProgressDialog thing (which I have from here, btw: <a href=""http://www.anddev.org/tinytut_-_displaying_a_simple_progressdialog-t250.html"" rel=""nofollow"">http://www.anddev.org/tinytut_-_displaying_a_simple_progressdialog-t250.html</a>), it worked fine - the setTracklist function retrieves a string from a text file on the internet, and sets the text to a TextView. Now, when I have added the ProgressDialog code, and put the original code into the try statement, only a very little part of the text file is added to the TextView - approximately 22-24 characters, not more. The ""busy"" ProgressDialog shows up just fine. It worked perfectly before; it was more than capable of loading more than 1300 characters into the TextView.I don't know if it has anything to do with the thread - I have Googled a lot and found no answer.</p><p>So, how do I get it to load in all data instead of just a small part?</p><p>(By the way, I would love to be able to set the line ""setTracklist(epURL, tracklist);"" beneath all of the if statements, but then it says it can't resolve ""epURL"". Seems stupid to write the same line 3 times!)</p><p><strong>Updated 25/1 with current code:</strong></p><pre><code>final Handler uiHandler = new Handler();final Button btnChooseEp = (Button)findViewById(R.id.btnChooseEp);btnChooseEp.setEnabled(false);btnChooseEp.setOnClickListener(new OnClickListener(){                   public void onClick(View v)        {                           builder.setTitle(getText(R.string.chooseEpisode));            builder.setItems(episodes2, new DialogInterface.OnClickListener()            {                public void onClick(DialogInterface dialog, final int pos)                {                                           replay.setVisibility(View.VISIBLE);                    replayWeb.setVisibility(View.VISIBLE);                    getTracklistProgressDialog = ProgressDialog.show(GA.this, ""Please wait..."",                            ""Retrieving tracklist..."", true);                    new Thread()                    {                        public void run()                        {                            try                            {                                                       String str1, epURL;                                if(pos &lt; 9)                                {                                    str1 = getResources().getString(R.string.gaEpNo1);                                          epURL = String.format(str1, pos+1);                                    setTracklist2(epURL, tracklist);                                                    }                                else if(pos &lt; 100)                                {                                    str1 = getResources().getString(R.string.gaEpNo2);                                    epURL = String.format(str1, pos+1);                                    setTracklist2(epURL, tracklist);                                }                                else if(pos &gt;= 100)                                {                                    str1 = getResources().getString(R.string.gaEpNo3);                                    epURL = String.format(str1, pos+1);                                    setTracklist2(epURL, tracklist);                                }                            }                            catch(Exception e)                            {}                            // Remove progress dialog                            uiHandler.post(new Runnable()                            {                                 public void run()                                {                                     getTracklistProgressDialog.dismiss();                                                                       }                            }                            );                                                      }                    }.start();                                          }            });            AlertDialog alertDialog = builder.create();            alertDialog.show();        }    });public void setTracklist2(final String string, final TextView tv){    try    {        uiHandler.post(                new Runnable()                {                    public void run()                    {                        try                        {                            tv.setText(getStringFromUrl(string));                        }                        catch (UnsupportedEncodingException e)                        {                            e.printStackTrace();                        }                    }                });    }    catch(Exception e)    {        e.printStackTrace();    } }</code></pre><p>Notes: ""replay"" and ""replayWeb"" are just two TextView's. ""btnChooseEp"" is enabled when another button is pressed.</p>","554002","","554002","","2011-01-24 23:54:59","2011-01-25 00:06:55","""Busy"" progress dialog causes strange code processing","<android><alertdialog><progressdialog>","1","0","","",""
"4753693","1","","","2011-01-20 23:07:09","6","33119","<p>On <a href=""http://developer.android.com/sdk/win-usb.html"">http://developer.android.com/sdk/win-usb.html</a> android Developers lists the instructions for installing their USB drivers for Windows Vista and Windows XP.  But <strong>Windows' current OS in Windows 7</strong> -  where are are the instructions for that?   (FWIW I'm using Windows 7 64 bit.  MY Eclipse and Java tools are 32 bit)</p><p>BTW, I'm aware that there is lots of 3rd party advice and comment and debate about this all over the web but is there anything official from Android/Google?</p><p>I have 2 XP systems which work fine with my Droid Incredible after editing android_winusb.inf .</p><p>Thanks in advance.</p>","424690","","","","","2013-12-10 22:24:30","Android USB Driver for Windows 7?","<android>","6","0","1","",""
"4753799","1","","","2011-01-20 23:20:02","0","1970","<p>I need to get data from an XML file in Android.  On the iPhone environment, my code is:</p><pre><code>NSURL *thisURL = [[NSURL alloc] initWithString:@""http://www.xxx.com/file.xml""];NSArray *myArray = [[NSArray alloc] initWithContentsOfURL:providerURL];</code></pre><p>myArray is now an array of dictionary items initialized with contents from file.xml.</p><p>Is there any way to do this in Android?  Can someone point me to doc or sample code?</p><p>I'm new to the Android environment and just need some direction.</p><p>Thanks,</p><p>Kevin</p>","463889","","","","","2011-01-21 14:48:18","Android - Getting data from XML file on the web","<android><xml><arrays>","2","0","","",""
"4753896","1","","","2011-01-20 23:31:43","1","5428","<p>I have an SQLite database that I have generated using the SQLite JDBC connector found <a href=""http://www.zentus.com/sqlitejdbc/"" rel=""nofollow"">here</a>.</p><p>I have then copied this database to my Android phone's SD card, and attempted to open it, using an SQLiteOpenHelper. I get the following exceptions:</p><pre><code>ERROR/SQLiteOpenHelper(7373): android.database.sqlite.SQLiteException: attempt to write a readonly database: BEGIN EXCLUSIVE;ERROR/AndroidRuntime(7373): Caused by: android.database.sqlite.SQLiteException: Can't upgrade read-only database from version 0 to 1: /mnt/sdcard/4Trak/4Trak.db</code></pre><p>This doesn't make any sense to me. Why is it a read-only database? I was able to write to it to generate it in the first place, and again when I realised I would need an android_metadata table, and added it using an SQLite browser. </p>","504055","","932225","","2012-06-20 07:59:45","2012-06-20 07:59:45","Externally generated SQLite database considered read-only by Android's SQLiteOpenHelper","<android><sqlite>","2","0","2","",""
"4753971","1","4754113","","2011-01-20 23:44:44","1","567","<p>Hi Stackoverflow members!</p><p>I have a option menu when the activity looses focus the selected option menu item(s) retain state but when my activity is destroyed all the options are reset.</p><p>How can I save the state of the selected preference after resuming from a destroyed state? Having problem visualizing how to implement [Shared Preferences][1] for the code.</p><p>(Only needed for the boolean values but I have included the static menu items)    </p><p>Any expert comments are greatly appreciated.</p>","583739","","583739","","2011-01-25 22:05:02","2011-01-25 22:05:02","Saving Option Menu InstateState Android","<android><menu><save><option><instant>","1","0","","",""
"4754089","1","4763122","","2011-01-21 00:01:10","1","2070","<p>I implemented my <code>SimpleExpandableListAdapter</code>, and I'm trying to customize the section titles. To do this I pass to the <a href=""http://developer.android.com/reference/android/widget/SimpleExpandableListAdapter.html#SimpleExpandableListAdapter%28android.content.Context,%20java.util.List%3C?%20extends%20java.util.Map%3Cjava.lang.String,%20?%3E%3E,%20int,%20java.lang.String%5b%5d,%20int%5b%5d,%20java.util.List%3C?%20extends%20java.util.List%3C?%20extends%20java.util.Map%3Cjava.lang.String,%20?%3E%3E%3E,%20int,%20java.lang.String%5b%5d,%20int%5b%5d%29"" rel=""nofollow"">constructor</a> the id of a custom <code>TextView</code> for the <em>groupTo</em> parameter:</p><pre><code>    setListAdapter( new SimpleExpandableListAdapter(this,                                                    groupsData,                                                     android.R.layout.simple_expandable_list_item_1,                                                    new String[]{SECTION},                                                     new int[]{R.id.list_group_title},                                                     innerData,                                                    0,                                                     null,                                                     new int[]{}){ /*my code here*/ });&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/list_group_title""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:textSize=""20dip"" /&gt;</code></pre><p>Problem is, nothing is showing up! The whole thing is blank, as if the view wasn't there.Any idea on why, or any link I could read up to solve this? Thanks!</p>","525843","","525843","","2011-01-21 15:37:40","2011-01-21 19:49:59","SimpleExpandableListAdapter sections titles","<android><expandablelistview>","1","0","3","",""
"4754145","1","4754162","","2011-01-21 00:10:50","0","293","<p>I'm trying to create a class with static variables, but I'm not sure how to set the variables before runtime. This is what I'm attempting to do...</p><pre><code>public class Defaults {public static String[] abc = new String[2];public static void functionToExecuteBeforeRuntime{    abc[0] = ""a"";    abc[1] = ""b"";    abc[2] = ""c"";}</code></pre><p>}</p><p>It's supposed to set <code>abc</code> using <code>functionToExecuteBeforeRuntime</code> before runtime so other classes can access it with <code>Defaults.abc</code>,however it is never executed. How can I achieve this? Any help appreciated</p><p>-oh i'm not sure if this makes a difference but I don't think with andriod I can use the <code>public static main()</code> guy</p>","559475","","","","","2011-01-21 00:40:51","Set variable/execute function before runtime in java(android)?","<java><android>","2","0","","",""
"4754264","1","4754280","","2011-01-21 00:35:01","1","1443","<p>I wrote a package in eclipse (Java/Android package, that is). Now I want to make another package which is a slight variation on the original. My plan is to copy and paste each .java file into the new package and change the <em>import package.somename</em> to the name of the new package, and develop from there. Is there a better way to do this?</p>","485498","","","","","2011-01-21 01:24:08","Duplicate a package in Eclipse","<java><android><eclipse>","4","0","1","",""
"4754303","1","","","2011-01-21 00:43:43","1","863","<p>Hi Im implementing a custom control and setting the the onTouchEvent on control. I want it to work just like a Click although I need to do some stuff when control is pressed and released. Also I need to handle the cancelation of the click such as down &amp; drag outside the boundaries of the control. Everything is working fine except for the cancalation of the control's click. The reason I need this custom stuff is b/c I need to do some custom UI stuff on click of the control that I cannot do on regular click. </p><pre><code>public boolean onInterceptTouchEvent(MotionEvent event) {            switch(event.getAction())             {                case MotionEvent.ACTION_DOWN:                case MotionEvent.ACTION_CANCEL:                case MotionEvent.ACTION_UP:                case MotionEvent.ACTION_OUTSIDE:                {                    return true;                }            }             // otherwise let the event slip through to children            return false;        }     public boolean onTouchEvent(MotionEvent event) {                _click = MotionEvent.obtain(event);                 if (_click.getAction() == MotionEvent.ACTION_DOWN &amp;&amp; _click.getEdgeFlags() != 0) {// assuming user canceled the click -- does not work here                         return false;                     }                if (_click.getAction() == MotionEvent.ACTION_DOWN)                {                  // subscribe my child controls to do a highlight                        return true;                }                else if ((_click.getAction() == MotionEvent.ACTION_CANCEL) || (_click.getAction() ==   MotionEvent.ACTION_UP))                {                    // release of the control, do an actual click                               return true;                }                   return false;        } </code></pre>","538428","","","","","2011-01-21 00:43:43","onTouchEvent event implementing custom onClick canceling of it does not work","<android><onclick><ontouchevent>","0","1","","",""
"4754399","1","11086422","","2011-01-21 00:59:18","2","1372","<p>I am an android developer and I am developing now an android application that can download and read epub files with drm.</p><p>I am now struggling to understand how this drm works and I got messages from the RMSDK such as ""No device provider implementation"" ...</p><p>Has anybody came through this? Can anybody explain to me how to work with the DRM on an android system?</p><p>Thank in advance</p>","438244","","","","","2012-06-18 15:50:00","android DRM problem","<android><drm>","1","1","","",""
"4754412","1","4754476","","2011-01-21 01:02:29","10","8866","<p>I guess I just havent found a good explanation here.  So can anyone please tell me what android:stretchColumns actually does.  I have it in my table and have tried several different values but cannot seem to figure out what it is doing?</p><p>Sorry for the dumb question!</p>","528130","","","","","2011-03-17 07:19:58","android:stretchColumns","<android><table>","1","0","3","",""
"4754505","1","","","2011-01-21 01:17:40","5","604","<p>I made an app that use the sharedPreferences and i storage some info there, when i uninstall the app and install again the info storage there always appear, i don´t know why. I don´t programming anything to keep them there.</p><p>I just upgrade my Galaxy S to 2.2.1 and i did a back up of all my apps including that i made, i don´t know sure if Android does not erase correctly the app.</p><p>I did uninstall others apps like facebook one and apparently erase all files fine.</p><p>I need suggestion of what can i do, please.</p>","462413","","","","","2011-09-16 15:59:19","My info doesn´t erase after uninstall the app","<android>","2","1","3","",""
"4754595","1","","","2011-01-21 01:36:10","0","497","<p>When I call </p><pre><code>getListView().getChildAt(aPosition).invalidate();</code></pre><p>in the on item touched method the only one that seems to get invalidated is the very first child in the list view. Am I using the wrong method?</p>","180825","","","","","2011-09-28 07:22:25","How to invalidate a touched list item in a list view","<android>","0","2","","",""
"4754630","1","","","2011-01-21 01:43:37","0","1852","<p>I would like to have a button and when you click the button it displays a phrase at random.I've done a little research and (I have a limited knowledge of java) i believe i would have to use an array and it display a random string of text.can someone tell me what code i'd have to use?</p>","583844","","432209","","2011-01-21 01:46:38","2011-01-23 23:50:45","Display Random Text on button click","<android><button><textview>","1","4","","",""
"4754655","1","4758075","","2011-01-21 01:47:51","0","370","<p>How can I send the image from my phone back to a Domino Server.I am using the xmlhttprequest object and posting the Base64 image data into a RichText Field on my Form. I have confirmed that it is not truncating the data. I cannot figure out what to do with the data to display it as an image.</p><p>I have tried the  tag and putting the Base64 text as the img src. This just shows the std broken image icon in my browser.</p><p>Please help.. I am on day 7 of trying to get this to work.Thanks!</p>","472335","","472335","","2011-04-07 15:13:14","2011-04-07 15:13:14","How to send photo from Android Phone to Domino Server","<android><ajax><android-camera><lotus-domino>","1","2","","",""
"4754802","1","","","2011-01-21 02:19:39","6","927","<p>I am using a PreferenceActivity for user to define certain settings for the application.</p><p>I am also using the OnPreferenceChangeListener interface to get notifications of changed preferences, and within that callback, I can do validation of the user's input, and I can make decisions on updating on rejecting user's input.</p><p>When I detect a validation error, I would like to keep the preference editing dialog box active on the screen, so that I can use the .getTextEdit().setError() method to set an error message to inform the user.   However, I wasn't able to manage to keep the dialog box active on the screen, since it seems like disappearing right before the  OnPreferenceChangeListener callback gets executed.</p><p>Any ideas?</p>","287597","","","","","2012-09-28 10:33:27","PreferenceActivity validating user input and showing error messages","<android><verification><android-preferences>","1","1","1","",""
"4754985","1","4755479","","2011-01-21 03:02:46","3","5606","<p>I am attempting to split an image into pieces, lets say for example 16 chunks (4x4).</p><p>I have found so many examples with java, but Android does not have BufferedImage and what not... I think.</p><p>I have a decent IDEA on how to, but I don't really know where to start.</p><p>Should I use a bitmap or a drawable?</p><p>Is there a method to split or will I have to make a custom method?</p><p>Should I use a GridView to hold the split images?</p><p>I don't want to com across as newbish and wanting to have someone do this for me, I want the satisfaction of doing it myself, but I don't have to much of an idea where to start since I am new to graphics in Java and Android.</p><p>Hopefully most of my questions are answerable and maybe even have examples available that I can't find for some reason.</p>","558961","","709619","","2011-09-30 00:54:16","2013-05-08 06:24:50","Android - Split Drawable","<android><image><gridview><grid><split>","2","2","6","",""
"4755168","1","4755853","","2011-01-21 03:43:51","1","2071","<p>Does the android support Unicode natively?But in String.xml we have to edit it with UTF-8 ??Any way to check the string's encoding? unicode or utf-8 ?....</p>","206630","","","","","2012-04-30 05:54:26","Does the android support Unicode natively?","<android>","3","1","","",""
"4755185","1","4755189","","2011-01-21 03:49:39","1","721","<p>My activity looks like this</p><pre><code>| header           ||------------------||  ViewGroup       ||  that fills      ||  the screen      ||                  ||     centered     ||      button      ||                  ||------------------|| footer           |</code></pre><p>The View Group that fills the screen is a child of a RelativeLayout that RelativeLayout fills the screen with fill_parent and layout_below header and layout_above footer. The ViewGroup under that RelativeLayout is set to the same width and height of the RelativeLayout at runtime.</p><p>The reason it is set the same height at runtime is because this view group can be dragged over to the left with a finger (similar to the Android home screen) If I drag it to the left it is fine. But if I drag it to the right my fill_parent dimensions get messed up.</p><pre><code>| header           ||------------------||     '  ViewGroup |     ' |     '  that fills|     '|     '  the screen|     '|     '            |     '|     '  centered  | &lt;-- button not centered. It is only centered on the visible area, not the whole thing|     '   button   |     '|     '            |     '|     '            |     '|------------------|| footer           |</code></pre><p>The way I am doing the positioning is by setting the left margin of the ViewGroup which will shift it right (or setting it negative to shift it left)</p><h3>Why I can't use <code>HorizontalScrollView</code>.</h3><p>Here is a top view of the android</p><pre><code>     ' previous ' current  '   next   ' # Three panes that can be dragged to switch between                |          | # The android screen bounderies</code></pre><p>I am planning for the user to be able to go next/previous by dragging the screen right and left. If the user drags the screen a little and he/she does it slowly</p><pre><code>        ' previous ' current  '   next   '                 |          |</code></pre><p>Then the screens should animate back in place</p><pre><code>     ' previous ' current  '   next   '                 |          |</code></pre><p>If the user does it quickly</p><pre><code>              ' previous ' current  '   next   '                 |          |</code></pre><p>Then the screens should animate the rest of the way</p><pre><code>                ' previous ' current  '   next   '                 |          |</code></pre><p>Previous should become the new current and we should have a new previous</p><pre><code>     ' previous ' current  '   next   '                 |          |</code></pre><p>I used a scrollview I would be doing something like this</p><pre><code>     ' previous ' current  '   next   '      |          |</code></pre><p>Now there is no room for a new previous unless I jump the scrolling</p><pre><code>     ' previous ' current  '   next   '                 |          |</code></pre><p>which sounds even worse to me.</p><p>So my options are</p><ul><li><code>AbsoluteLayout</code> (deprecated / don't use it)</li><li><code>RelativeLayout.LayoutParams.setMargins</code> (See below. This is what I am doing now)</li><li>Write my own <code>LayoutManager</code> (Sounds easier than it is)</li><li>Draw the pixels to the screen instead of using <code>View</code>s (DirectDraw or OpenGL)</li><li><code>HorizontalScrollView</code></li></ul>","463304","","463304","","2013-01-15 18:21:12","2013-01-15 18:21:12","Android: Is there a way to get fill_parent to not shrink to fit the parent's parent?","<android><layout><dimensions>","1","0","","",""
"4755209","1","4755246","","2011-01-21 03:54:09","0","1689","<p>I have a option menu. When the activity loses focus, the selected option menu item(s) retain state, but when my activity is destroyed, all the options are reset.</p><p>How can I save the state of the selected preference after resuming from a destroyed state? Having problem visualizing how to implement <a href=""http://developer.android.com/guide/topics/data/data-storage.html#pref"" rel=""nofollow"">Shared Preferences</a> for the code.</p><p>(Only needed for the boolean values but I have included the static menu items.)</p><pre><code>public final static int MENU_SOMETHING_MODE_ON = 1;public final static int MENU_SOMETHING_MODE_OFF = 2;public final static int MENU_FULLSCREEN_ON = 3;public final static int MENU_FULLSCREEN_OFF = 4;public final static int MENU_SOUND_ON = 5;public final static int MENU_SOUND_OFF = 6;public final static int MENU_FASTER = 7;public final static int MENU_SLOWER = 8;public final static int MENU_SOMETHING = 9;public final static int MENU_EXTRAS = 10;private static boolean soundOn = true;private static boolean mFaster = true;private boolean fullscreen = true;@Overridepublic boolean onCreateOptionsMenu(Menu menu){    super.onCreateOptionsMenu(menu);    menu.add(0, MENU_SOMETHING, 0, R.string.menu_new_something);    menu.add(0, MENU_SOMETHING_MODE_ON, 0,             R.string.menu_something_on);    menu.add(0, MENU_SOMETHING_MODE_OFF, 0,             R.string.menu_something_off);    menu.add(0, MENU_FULLSCREEN_ON, 0, R.string.menu_fullscreen_on);    menu.add(0, MENU_FULLSCREEN_OFF, 0, R.string.menu_fullscreen_off);    menu.add(0, MENU_SOUND_ON, 0, R.string.menu_sound_on);    menu.add(0, MENU_SOUND_OFF, 0, R.string.menu_sound_off);    menu.add(0, MENU_FASTER, 0, R.string.menu_faster);    menu.add(0, MENU_SLOWER, 0, R.string.menu_slower);    menu.add(0, MENU_EXTRAS, 0, R.string.menu_extras);    return true;}@Overridepublic boolean onPrepareOptionsMenu(Menu menu){    super.onPrepareOptionsMenu(menu);    menu.findItem(MENU_SOUND_ON).setVisible(!getSoundOn());    menu.findItem(MENU_SOUND_OFF).setVisible(getSoundOn());    menu.findItem(MENU_SOMETHING_ON).setVisible(        getMode() == SOMETHING_NORMAL);    menu.findItem(MENU_SOMETHING_OFF).setVisible(        getMode() != SOMETHING_NORMAL);    menu.findItem(MENU_FULLSCREEN_ON).setVisible(!fullscreen);    menu.findItem(MENU_FULLSCREEN_OFF).setVisible(fullscreen);    menu.findItem(MENU_FASTER).setVisible(getFaster());    menu.findItem(MENU_SLOWER).setVisible(!getFaster());    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item){    switch (item.getItemId()) {    case MENU_SOMETHING:     AlertDialog.Builder alt_bld = new AlertDialog.Builder(this);        alt_bld.setMessage(""Are you sure?"")     .setCancelable(false)     .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {             public void onClick(DialogInterface dialog, int id) {                 //  Action for 'YES' Button                 something.new();             }      })     .setNegativeButton(""No"", new DialogInterface.OnClickListener() {             public void onClick(DialogInterface dialog, int id) {                 //  Action for 'NO' Button                 dialog.cancel();             }      });      AlertDialog alert = alt_bld.create();      // Title for AlertDialog      alert.setTitle(""Something"");      // Icon for AlertDialog      alert.setIcon(R.drawable.dialog);      alert.show();      return true;    case MENU_SOMETHING_ON:      setMode(THIS_SOMETHING);      return true;    case MENU_SOMETHING_OFF:      setMode(THIS_NORMAL);      return true;    case MENU_FULLSCREEN_ON:      fullscreen = true;      setFullscreen();      return true;    case MENU_FULLSCREEN_OFF:      fullscreen = false;      setFullscreen();      return true;    case MENU_SOUND_ON:      setSoundOn(true);      return true;    case MENU_SOUND_OFF:      setSoundOn(false);      return true;    case MENU_FASTER:      setFaster(false);      return true;    case MENU_SLOWER:      setSlower(true);      return true;    case MENU_EXTRAS:      startExtras();      return true;    }    return false;}private void setFullscreen(){    if (fullscreen) {      getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);      getWindow().clearFlags(          WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);    } else {      getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);      getWindow().addFlags(          WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);    }    mView.requestLayout();}public synchronized static void setMode(int newMode){    Mode = newMode;}public synchronized static int getMode(){    return Mode;}public synchronized static boolean getSoundOn(){    return soundOn;}public synchronized static void setSoundOn(boolean so){    soundOn = so;}public synchronized static boolean getFaster(){    return Faster;}public synchronized static void setFaster(boolean dont){    Faster = dont;}</code></pre>","583922","","13531","","2011-01-26 00:00:31","2011-01-26 00:00:31","Saving Option Menu Shared Preferences","<android><shared><sharedpreferences>","1","0","","",""
"4755421","1","","","2011-01-21 04:36:16","0","2752","<p>i am trying to transferring a file with bluetooth between two device but not able to figure out any one can help me to build the code.</p><p>thank you</p>","583947","","","","","2011-01-21 05:05:29","what is the code to transfer a file using bluetooth in android?","<android><bluetooth><file-transfer>","1","0","","",""
"4755487","1","4755545","","2011-01-21 04:48:42","1","9807","<p>I am making an Android app that uses many buttons.</p><p>My main.xml layout has three buttons.</p><p>I know how to use buttons to go from one activity to another, But i dont know how to have multiple buttons on one activity, with each launhing a different activity than the other.</p><p>EXAMPLE</p><p><strong>Main.xml</strong></p><p>Button1Button2</p><p><strong>Main2.xml</strong></p><p>Launched by button1</p><p><strong>About.xml</strong></p><p>Launched by Button2</p><p>How do i make the main.java file do this??</p>","583952","","","","","2013-03-20 05:18:58","How to have multiple buttons in one activity","<android>","4","0","4","",""
"4755532","1","","","2011-01-21 04:57:03","0","1095","<p>It looks like a rather common thing.I am trying to display a list of EditText controls, likeLabel1 EditText1Label2 EditText2…so that user can edit text “in-place”, and this list has to be shown in Dialog (AlertDialog?).I am using ArrayAdapter to fill the list. The problem is that I can not find the right EditText for its label to get the user-modified values.BTW, It’s hard to believe how many passes the system makes filling the list with getView(). It is also being called when I click on one of EditText.Maybe my approach is wrong and there is a different way to do this?</p>","583972","","457982","","2011-01-21 05:07:54","2011-01-21 05:22:25","Array of EditText controls","<android><listview><dialog><edittext><android-arrayadapter>","1","0","","",""
"4755574","1","4755598","","2011-01-21 05:05:23","3","6243","<p>How can I create a QR code to my app in the Android Market?</p>","479180","","","","","2012-12-17 21:29:25","Create QR code to app in market","<android>","7","0","","2012-12-18 15:29:49",""
"4755604","1","","","2011-01-21 05:09:39","0","835","<p>I am trying to initiate a call by passing '#' character with numbers. But when i pass that uri an exception is occured as shown below</p><p>01-21 10:36:21.247: WARN/System.err(383): java.lang.IllegalArgumentException: Illegal character in fragment at index 104: </p><p>My code is</p><pre><code>      public String getHttpConnectionToServer(String uri, String proxyIP,               Integer port, String debugMode) {         HttpGet httppost = new HttpGet(uri);    HttpResponse response = client.execute(httppost);    HttpEntity entity = response.getEntity();    InputStream is = entity.getContent();    BufferedReader reader = new BufferedReader(new InputStreamReader(        is, ""iso-8859-1""), 8);    StringBuilder sb = new StringBuilder();}Exception is thrown at this line of code : HttpGet httppost = new HttpGet(uri);</code></pre><p>How can i resolve that?? Please HElp</p>","548218","","619361","","2012-07-18 17:42:01","2012-07-18 17:42:01","IllegalArgumentException while initiating a call passing # character","<android>","1","2","","",""
"4755621","1","4755680","","2011-01-21 05:12:27","3","7274","<p>In my current android application, I would like to get the geocordinates based on an entered city name, street name or zip code. How can I accomplish this?</p><p>Best Regards,Rony</p>","264953","","","","","2013-06-01 10:49:32","Get latitude and longitude based on city, zip or streetname","<java><android><android-emulator><android-widget>","4","0","5","",""
"4755655","1","","","2011-01-21 05:18:22","3","859","<p>So I've got the following custom view in my status:</p><p><img src=""http://i.stack.imgur.com/QEOyK.png"" alt=""alt text""></p><p>How do I make the buttons (1, 2, 3, 4) clickable with onClick functions?</p><p>Plus how do I make the icon in the notification bar go away since this is an on going thing?</p><p>Thanks</p>","149166","","","","","2013-05-15 06:12:56","Add onClick to button inside custom status bar view","<android><button><notifications><onclick><statusbar>","1","0","0","",""
"4755708","1","4755770","","2011-01-21 05:26:03","4","8485","<p>I want to use foursquare API in my android application. In my app I want to fetch nearby place.</p><p>Could you please show me how to start?</p>","437833","","492620","","2013-01-22 21:50:40","2013-01-22 21:50:40","how to use foursquare API in android application?","<android><api><foursquare>","3","0","2","",""
"4755729","1","4776749","","2011-01-21 05:32:43","2","1534","<p>I have an application where clicking on an item in a list shows webview with javascript injected.I need to save the webview object so that when the user presses the same item again the existing webview is shown instead of reloading it and injecting the javascript again.I am able to save the webview object in Arraylist of webview inside the application class.</p><p>I check whether the item already exists in the Arraylist and if it do exists take the corresponding object and set the object as the content of the activity as shown below. </p><pre><code>     temp_WebView=new WebView(this);                     temp_WebView=(WebView)application.getWebview(j);     ViewGroup parent = (ViewGroup) application.getWebview(j).getParent();     parent.removeView(application.getWebview(j));       setContentView(temp_WebView);This works fine but when clicking on any of the select box inside the webview where a dialog is populated it gets crashed  with the following error,WARN/WindowManager(60): Attempted to add application window with unknown token HistoryRecord{4506d1e8 tabviewapp.com/.Webresults}.  Aborting. DEBUG/AndroidRuntime(500): Shutting down VM WARN/dalvikvm(500): threadid=1: thread exiting with uncaught exception (group=0x4001d800)     ERROR/AndroidRuntime(500): FATAL EXCEPTION: main     ERROR/AndroidRuntime(500): android.view.WindowManager$BadTokenException: Unable to  add window -- token android.os.BinderProxy@45034510 is not valid; is your activity running? ERROR/AndroidRuntime(500): at android.view.ViewRoot.setView(ViewRoot.java:505) ERROR/AndroidRuntime(500): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177) ERROR/AndroidRuntime(500):  at      android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) ERROR/AndroidRuntime(500):     at android.view.Window$LocalWindowManager.addView(Window.java:424) ERROR/AndroidRuntime(500):     at android.app.Dialog.show(Dialog.java:241) ERROR/AndroidRuntime(500):     at android.webkit.WebView$InvokeListBox.run(WebView.java:7095) ERROR/AndroidRuntime(500):     at android.os.Handler.handleCallback(Handler.java:587) ERROR/AndroidRuntime(500):     at android.os.Handler.dispatchMessage(Handler.java:92) ERROR/AndroidRuntime(500):     at android.os.Looper.loop(Looper.java:123) ERROR/AndroidRuntime(500):     at android.app.ActivityThread.main(ActivityThread.java:4627) ERROR/AndroidRuntime(500):     at java.lang.reflect.Method.invokeNative(Native Method) ERROR/AndroidRuntime(500):     at java.lang.reflect.Method.invoke(Method.java:521) ERROR/AndroidRuntime(500):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) ERROR/AndroidRuntime(500):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) ERROR/AndroidRuntime(500):     at dalvik.system.NativeStart.main(Native Method) WARN/ActivityManager(60):   Force finishing activity tabviewapp.com/.Webresults</code></pre><p>I think the problem is with the context of the webview but not able to figure out how to set the context for the existing object or pass context to dialog generated inside the webview.</p><p>Thanks in advance.</p>","475744","","475744","","2011-01-21 08:12:13","2011-01-23 22:02:36","Webview crashes on select box or any Dialog","<android><dialog><webview>","1","0","","",""
"4755740","1","","","2011-01-21 05:34:30","0","2055","<p>Can I use flash in my android native app?The application is not an internet app, so it does not use HTML/javascript.</p>","296257","","","","","2011-01-21 08:31:38","Flash in android app","<android><flash>","3","0","","",""
"4755757","1","5141247","","2011-01-21 05:38:42","1","1741","<p>i am getting the audio files information in sdcard using</p><pre><code>cr = getContentResolver();crsrSdcard_ringtone = cr.query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, null, null,     null, MediaStore.Audio.Media._ID);</code></pre><p>now i want to play particular file from the list can i do it with passing it like</p><pre><code>MediaPlayer mediaPlay = new MediaPlayer();    mediaPlay.setDataSource(this,Uri.withAppendedPath(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, ""/""+id));mediaPlay.prepare();mediaPlay.start();</code></pre><p>please suggest a solution to get the file being played.</p>","548208","","548208","","2011-01-21 06:21:39","2011-02-28 11:15:03","android list audio on sd card and play it","<android><media-player><sd-card>","1","1","","",""
"4755761","1","","","2011-01-21 05:38:55","0","272","<p>Anyone of you have any idea that is there any different on writting to database to sdcard in android 1.5 and 2.1? I faced a problem here. </p><p>I have a android apad which firmware is 1.5. I have write a program to write to database at sdcard. However no database was created in this firmware 1.5.</p><p>Then I proceed on to test on emulator. Using platform 1.5, <strong>no</strong> database created, but when using plathform 2.1, there <strong>is</strong> database created with the information inside.</p><p>I have given the permisson to write to sdcard and database. by using the following permission:</p><p><code>&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""/&gt;&lt;uses-permission android:name=""android.permission.ACCESS_CHECKIN_PROPERTIES""/&gt;</code></p><p>The method to create database to sdcard is:</p><p><code>testInputDB = this.openOrCreateDatabase(""/sdcard/database/testInputDB.db"", MODE_PRIVATE, null);<br>                /* Create a Table in the Database. */<br>                testInputDB.execSQL(""CREATE TABLE IF NOT EXISTS ""<br>                        + TableName<br>                        + "" (Field1 VARCHAR, Field2 VARCHAR);"");</code></p>","575319","","575319","","2011-01-21 05:55:09","2011-01-21 05:55:09","Write to database in sdcard platform 1.5 and 2.1 (PROBLEM)","<java><android>","0","2","","",""
"4755800","1","","","2011-01-21 05:48:47","0","825","<p>I use the following method to store the phone number and email-id to the contacts application.</p><pre><code>/**     * Phone number.     */    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, phone_Num)            .withValue(ContactsContract.CommonDataKinds.Phone.TYPE, ContactsContract.CommonDataKinds.Phone.TYPE_WORK)            .build());    /**     * Business Email     */    ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)            .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)            .withValue(ContactsContract.Data.MIMETYPE,                    ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE)            .withValue(ContactsContract.CommonDataKinds.Email.DATA, web)            .withValue(ContactsContract.CommonDataKinds.Email.TYPE, ContactsContract.CommonDataKinds.Email.TYPE_WORK)            .build());</code></pre><p>I also would like to save the photo to the contacts. How can I accomplish this similar to what I did above?</p><p>Best Regards,Rony</p>","264953","","","","","2011-11-08 15:36:09","How to save photo to contacts application in android","<android><android-emulator><android-widget>","1","1","","",""
"4755831","1","","","2011-01-21 05:54:43","-1","592","<p>how to debug multithreaded application for Android..</p><p>I am new to this android platformI want to debug a native multithreaded application on android. Please let me know the procedure.</p>","584020","","503969","","2011-01-21 06:00:23","2011-03-23 18:25:24","How to debug multithreaded application for Android","<android>","2","2","","",""
"4755862","1","","","2011-01-21 06:00:45","-1","856","<p>I have read <a href=""http://stackoverflow.com/questions/1083527/how-to-block-calls-in-android"">How to block calls in android</a>, but IDE doesn't know how to resolve com.android.internal.telephony.ITelephony. The internal API has gone?How I can access setting->call setting->auto reject call?</p>","554861","","","","","2011-01-21 06:17:52","How I block incoming call?","<android><call-control>","1","1","","",""
"4755871","1","","","2011-01-21 06:02:22","41","80778","<p>I want imagebutton with two states i) normal ii) touch(or click).</p><p>I have set <strong>normal</strong> image in the <strong>imagebutton</strong> background and I am trying to <em>change</em> <strong>image(pressed)</strong> from <em>onclick</em> method, but it doesn't change.</p><p><strong>I want that if I pressed image button then image should change from normal to pressed until I press other button but it doesn't happen</strong>.</p><p>Can anyone suggest to me how can I do this with <strong>selector or at run time</strong>? </p><p>Here is my imagebuttonpanel 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:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:orientation=""horizontal""  android:gravity=""bottom""  android:id=""@+id/buttonpanel""&gt;  &lt;ImageButton android:id=""@+id/buttonhome""               android:layout_width=""80dp""               android:layout_height=""36dp""               android:focusable=""true""                android:background=""@drawable/homeselector""&gt;               &lt;/ImageButton&gt;  &lt;ImageButton android:id=""@+id/buttonsearch""               android:layout_height=""36dp""               android:layout_width=""80dp""               android:background=""@drawable/searchselector""               android:focusable=""true""&gt;               &lt;/ImageButton&gt;&gt;  &lt;ImageButton android:id=""@+id/buttonreg""               android:layout_height=""36dp""               android:layout_width=""80dp""               android:background=""@drawable/registerselector""               android:focusable=""true""&gt;               &lt;/ImageButton&gt;&gt;  &lt;ImageButton android:id=""@+id/buttonlogin""               android:layout_height=""36dp""               android:layout_width=""80dp""               android:background=""@drawable/loginselector""               android:focusable=""true""&gt;               &lt;/ImageButton&gt;&lt;/LinearLayout&gt;</code></pre><p>and my selector xml is</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;!--&lt;item android:state_pressed=""true"" android:drawable=""@drawable/homehover""         /&gt; &lt;item android:state_focused=""true"" android:drawable=""@drawable/homehover""         /&gt; &lt;item android:drawable=""@drawable/home"" /&gt; &lt;item android:state_window_focused=""true""         android:drawable=""@drawable/homehover"" /&gt; --&gt;    &lt;item android:state_enabled=""false"" android:drawable=""@drawable/homehover"" /&gt;    &lt;item android:state_pressed=""true"" android:state_enabled=""true""        android:drawable=""@drawable/homehover"" /&gt;    &lt;item android:state_focused=""true"" android:state_enabled=""true""        android:drawable=""@drawable/homehover"" /&gt;    &lt;item android:state_enabled=""true"" android:drawable=""@drawable/home"" /&gt;&lt;/selector&gt; </code></pre><p>And I have also tried to change image resource on ontouch and onclick event, but it does not help. </p>","411359","","1820446","","2013-06-03 16:51:20","2013-06-03 16:51:20","How to set image button backgroundimage for different state?","<android><android-layout>","8","1","10","",""
"4755906","1","4756030","","2011-01-21 06:06:49","0","111","<p>I have an edit text.. I need to restrict the edit text with numbers. So i gave </p><pre><code>     EditText phoneNumber     phoneNumber.setKeyListener(DialerKeyListener.getInstance());</code></pre><p>But in some phones..when i click the edit text 2 characters are shown in the dialler 'p' and </p>","548218","","","","","2011-01-21 06:44:39","Show Dialler : Problems","<android>","2","0","","",""
"4755911","1","4756126","","2011-01-21 06:07:17","1","1761","<p>Me working in windows, so for Git I downloaded and installed <code>msysGit-fullinstall-1.7.3.1</code> from <a href=""http://code.google.com/p/msysgit/downloads/list"" rel=""nofollow"">msysgit</a>.<br>And run as specified there<br>Then i tried to get Gallery application from <a href=""https://android.git.kernel.org/?p=platform/packages/apps/Gallery.git;a=summary"" rel=""nofollow"">Android open source project</a>, as specified there in my git console I given  </p><pre><code>git clone git://android.git.kernel.org/platform/packages/apps/Gallery.git </code></pre><p>it shows the following error <code>No such file or directory</code>    </p><p><img src=""http://i.stack.imgur.com/38EEr.jpg"" alt=""alt text""></p><p>What did i miss here.<br> <strong>I don't know is this the correct way to get code from <code>Android open source</code> in windows. If any other way please help me.</strong><br>Thank you  </p>","477754","","","","","2011-01-21 06:43:37","How to get code from git in windows","<android><git><source-code><window>","2","0","","",""
"4755917","1","","","2011-01-21 06:08:10","1","214","<p>Can someone please tell me where to look out for in the code to check if GPS is enabled or disabled?</p><p>My browser crashes if I build android without GPS (customised one). This happens when I try to open a webpage that tries to acquire location, like in Google homepage.</p><p>Thanks in advance.</p>","523460","","741249","","2012-05-03 12:09:29","2012-05-03 12:10:43","browser crashes if I build android without GPS","<android><crash><gps>","1","1","1","",""
"4755918","1","","","2011-01-21 06:08:13","0","270","<p>Can anyone recommend how to troubleshoot debugger issues, i.e., why the debugger doesn't always stop at breakpoints or why it seems to randomly disconnect.  I often have to stop the emulator and try to start the debugger and emulator again.  Sometimes the debugger doesn't seem to re-attach, too. </p>","267702","","229044","","2012-07-12 15:20:48","2012-07-12 15:20:48","how to troubleshoot Android debugger problems?","<android><debugging>","2","1","","",""
"4755923","1","","","2011-01-21 06:09:55","1","3448","<p>I want to know following things is possible on Android or not.</p><ol><li>Pick a photo and detects faces and show rectangle, and detect smile of each face and show smile percentage of each. </li><li>Pick a photo from photo library and show faces. if you click faces, it search all photo library and show list of possible same person. </li></ol>","446366","","2971","","2011-01-28 12:04:45","2011-02-02 08:09:45","How to detect Face and Smile & Face matching in Android?","<android><face-recognition>","2","0","2","",""
"4755978","1","4757659","","2011-01-21 06:19:02","0","560","<p>I am trying to host a USB Stick to my Android Device using ""USB 2.0 Type A to Mini USB 5-Pin Type B Female / Male Adapter"". I have two requirements:</p><ol><li>To Trigger USB stick from my android device.</li><li>To recieve Data from USB after triggering it.</li></ol><p>But Android does not support USB Host. Can anybody tell me what to do in this regard.</p><p>Thanks and regards,Rahul Jaiswal</p>","315140","","","","","2011-01-21 10:24:36","How to Resolve USB Host Issue in Android?","<android><usb><android-ndk>","1","0","","",""
"4755984","1","5614271","","2011-01-21 06:20:17","1","512","<p>I have a simple approach question about Android design.</p><p>I envision a scenario where I provide a service and an activity. Both the service and the activity need to read/write to the same data. The basic idea is a live playlist: the service that is playing the list ""pops"" a song from the list when it's done playing, but the the app can also edit the list by adding or deleting songs.</p><p>I considered using a ContentProvider for the actual playlist, thinking it would be simple, but all ContentProvider examples I can find on the internet seem morbidly overcomplicated or involve solely SQLite. </p><p>Another approach would be to keep a simple file in my resources, and access that from both the service and the app.</p><p>Which approach seems to be better here? If I should indeed use a ContentProvider, can someone please direct me to the simplest possible implementation, preferably not involving SQLite? From my prior looks, ContentProvider seems overcomplicated for my simple purpose.</p><p>Thanks for any opinions!-Chase</p>","48998","","","","","2011-04-10 19:49:08","Content Provider or resource, activity and service cooperation","<android><service><android-contentprovider>","1","0","","",""
"4756081","1","4756184","","2011-01-21 06:37:12","1","884","<p>I want to use the Progress Dailog in my application. I am facing one issue in doing it, after some RnD I came to know that it is not quite possible to create the progress Dialog I have the Activity Group Class for the TabHost in the application.</p><p>I have exactly the same scenario, I have the TabHost in my application and an ActivityGroup Class that has the TabHost Classes. So, when I try to create the Progress Dialog for the Class that is in the Activity Group Class I cannot create it. But if I try to create the Progress Dialog for the Class that is not in the Activity Group I can create it with no issues.</p><p>Is there any solutions now?</p>","422859","","1288","","2011-05-03 12:18:44","2011-05-03 12:18:44","ProgressDialog in TabHost application ofandroid","<android><android-tabhost><progressdialog>","1","0","","",""
"4756169","1","4756870","","2011-01-21 06:49:22","0","848","<p>I have a very simple piece of code that is used to schedule my next sync operation.  It is running inside the SyncAdapter that extends AbstractThreadedSyncAdapter -- thus uses its context.  The PendingIntent it started for the BroadcastReceiver ""MyService"" which only manages the SyncAdapter.</p><p>I am just trying to schedule it to recur in 24 hours.</p><pre><code>private void scheduleNextSync(Long timeFromNow) {    Intent intentSync = new Intent(getContext(), MyService.class);    intentSync.setAction(Intent.ACTION_SYNC);    intentSync.addCategory(""android.provider.CONTACTS_STRUCTURE"");    intentSync.putExtra(MySyncAdapter.EXTRA_SYNC_TYPE, """");    intentSync.putExtra(MySyncAdapter.EXTRA_RESOLVE_METAID, false);    int flags = 0;    int request = REQUEST_SYNC_ALL;    PendingIntent piSync = PendingIntent.getBroadcast(getContext(), request, intentSync, flags);    //    Log.i(TAG, ""schedulePendingSync: "" + piSync.toString());    AlarmManager alarm = (AlarmManager) getContext().getSystemService(Activity.ALARM_SERVICE);    alarm.set(request, SystemClock.elapsedRealtime() + timeFromNow, piSync);}</code></pre><p>Log output:</p><pre><code>01-20 22:42:18.864 W/dalvikvm(14447): threadid=8: thread exiting with uncaught exception (group=0x40020950)01-20 22:42:18.919 E/AndroidRuntime(14447): FATAL EXCEPTION: Thread-901-20 22:42:18.919 E/AndroidRuntime(14447): java.lang.NullPointerException01-20 22:42:18.919 E/AndroidRuntime(14447):     at android.os.Parcel.readException(Parcel.java:1253)01-20 22:42:18.919 E/AndroidRuntime(14447):     at android.os.Parcel.readException(Parcel.java:1235)01-20 22:42:18.919 E/AndroidRuntime(14447):     at android.app.IAlarmManager$Stub$Proxy.set(IAlarmManager.java:174)01-20 22:42:18.919 E/AndroidRuntime(14447):     at android.app.AlarmManager.set(AlarmManager.java:139)01-20 22:42:18.919 E/AndroidRuntime(14447):     at com.mysyncadpter.android.MySyncAdapter.scheduleNextSync(MySyncAdapter.java:145)01-20 22:42:18.919 E/AndroidRuntime(14447):     at com.mysyncadpter.android.MySyncAdapter.access$2(MySyncAdapter.java:131)01-20 22:42:18.919 E/AndroidRuntime(14447):     at com.mysyncadpter.android.MySyncAdapter$1.run(MySyncAdapter.java:123)01-20 22:42:18.919 E/AndroidRuntime(14447):     at java.lang.Thread.run(Thread.java:1096)</code></pre>","157804","","21234","","2011-01-21 08:12:32","2011-01-21 08:45:06","Why does this Android alarm with a pending intent crash?","<android><alarmmanager><android-pendingintent><android-syncadapter>","1","0","1","",""
"4756209","1","","","2011-01-21 06:56:20","1","781","<p>In my app i make the app fullscreen. Means android title bar and notification bar is hidden here. But when i click on the spinner the hidden notification bar gets visible for fraction of seconds. It is not happening with all the spinners in my app. But where i use a array,generated by a loop execution in the spinner adapter, it is only happening in that case. I have come to know that it is a known bug in android. I also use the following style in spinner to resolve it.</p><p>In my app i make the app fullscreen. Means android title bar and notification bar is hidden here. But when i click on the spinner the hidden notification bar gets visible for fraction of seconds. It is not happening with all the spinners in my app. But where i use a array,generated by a loop execution in the spinner adapter, it is only happening in that case. I have come to know that it is a known bug in android. I also use the following style in spinner to resolve it. </p><p>     true     true     @null  </p><p>But still i cant solve this problem.. If anyone has any solution please let me know. </p>","444277","","1292730","","2012-05-01 14:46:34","2012-05-01 14:46:34","android spinner is showing hidden notification bar","<android><spinner><android-notification-bar>","2","0","","",""
"4756249","1","4758040","","2011-01-21 07:02:42","1","306","<p>Does anyone know of any Eclipse plugins that perform a static analysis in order to detect multithreading bugs?I am looking for it to work in Java with an Android phone as the target. I am looking for a free plugin. </p>","467569","","467569","","2011-01-21 18:20:01","2011-01-25 16:57:44","Are there any multithreading static analysis eclipse plugins?","<android><multithreading>","2","3","1","",""
"4756304","1","4756798","","2011-01-21 07:12:40","1","272","<p>I have tried to test my app on both emulator and actual device. Both have the same screen resolution. However, when the app is tested, I found that the display of the app page height is not the same between emulator and actual device. The actual device has the shorter display length of the page. However, both returns the same viewport height $(window).height. May I know why is this happening? How can I fixed it?</p>","324850","","71724","","2011-01-21 07:34:47","2011-01-21 08:33:27","Android screen height btw emulator and actual device","<android><android-emulator><android-layout>","1","0","","",""
"4756321","1","6065617","","2011-01-21 07:15:25","4","14802","<p>I need to implement <strong>Carousel view in Android</strong>.</p><p>I searched in the net but didn't find any sample code for implementing.</p><p>Kindly send me any sample code / Url which will be helpful in developing the same.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2011-05-19 22:38:20","Carousel view in Android","<android>","1","4","9","2012-03-15 06:04:48",""
"4756352","1","4756383","","2011-01-21 07:20:01","0","1236","<p>I am having 2 tables:</p><p><strong>Table1</strong>: ID,Type,form_date</p><p><strong>Table2</strong>: ID, Type, form_date</p><p>Now, i want to fetch uniq date list (type wise) from both the tables andstores into the third table. How do i do such?</p><p>Date example:</p><p>Table-1:</p><pre><code>Type    form_date1       20/12/20101       25/04/20102       05/11/2010</code></pre><p>Table-2:</p><pre><code>Type form_date1    20/12/20102    25/04/20102    05/11/2010</code></pre><p>I want to have output as below:</p><p><strong><code>Table-3 or Output</code></strong></p><pre><code>Type form_date1    20/12/20101    25/04/20102    25/04/20102    05/11/2010</code></pre><p>Please suggest me a possible solution.Thanx</p><h2>Update:</h2><p>Thanx a lot <strong><code>dan04</code></strong>.From @dan04 answer, i am having success to store Type, form_date from both the tables.</p><p>But when i try to execute below query to get only form_date values then it is giving me an error:</p><pre><code>SELECT form_date FROM Table1UNION SELECT form_date FROM Table2</code></pre><p>please suggest me how do i have only form_date from both the tables?</p>","379693","","379693","","2011-01-21 10:31:46","2011-01-21 10:31:46","SQLite date sorting problem","<android><database><sqlite>","1","1","1","",""
"4756382","1","7883299","","2011-01-21 07:25:28","8","22065","<p>I want to develop application for Android tablet size device. But i am unable to create a tablet size emulator. emulator size should be 1024x600 (WSVGA) but there is no option to make tablet size emulator in default skin size in sdk2.2 as well as sdk 2.3.<strong>Then How to create tablet size emulator?</strong> However i have tried to make tablet size emulator manually putting the screen size 600x1024 in screen resolution. But this emulator is not working. Please any body help.</p><p>Thanks &amp; Regards</p>","489762","","","","","2012-07-20 13:52:44","android tablet emulator","<android>","3","0","5","",""
"4756447","1","4756699","","2011-01-21 07:37:14","7","10927","<p>Can we set a background image to tabs like this?</p><p><img src=""http://i.stack.imgur.com/Z2ZkU.png"" alt=""alt text""></p>","227943","","128421","","2012-01-02 20:50:39","2012-01-02 20:50:39","Can we set a background image to tabs?","<android><background><tabs>","3","0","2","",""
"4756451","1","4756516","","2011-01-21 07:37:36","29","84518","<p>I have a simple ""Hello Android"" application on my computer (<a href=""http://en.wikipedia.org/wiki/Eclipse_%28software%29"">Eclipse</a> environment), and I have built an <a href=""http://en.wikipedia.org/wiki/APK_%28file_format%29"">APK</a> file. How do I transfer the APK file to my Android phone for testing?</p><p>My phone is <a href=""http://en.wikipedia.org/wiki/Huawei_U8800"">Ideos</a> running Android 2.2 (Froyo). My laptop has Windows&nbsp;Vista. I have the latest Android SDK installed.</p>","26143","","63550","","2012-07-08 19:38:46","2014-02-17 16:05:36","How to install an APK file on an Android phone?","<android>","8","0","10","",""
"4756500","1","4759696","","2011-01-21 07:43:11","0","409","<p>I want to write a ListAdapter to serve data from a database that look like this:</p><pre><code>CREATE TABLE notes (_id integer primary key,                     content text);CREATE TABLE tags (_id integer primary key,                   name text,                   pos integer                   noteid integer,                   foreign key(noteid) references notes(_id));</code></pre><p>I use this database to store notes and their associated tags. One requirement of the ListAdapter is that it must be able to update the ListView contents if the underlying data changes. I can query all the notes in the database with this query:</p><pre><code>select notes._id as id, notes.content, tags.pos, tags.name   from notes left join tags on id = tags.noteid  order by id, tags.pos;</code></pre><p>Which will give me results looking like this (null values shown for clarity):</p><pre><code>0|foo bar baz|0|x1|hello world|null|null2|one more nn|0|yy2|one more nn|1|y</code></pre><p>As you can see, a note with more than one tag will be located on more than one row in the result. This means that I can't look at the cursor size to determine the number of notes, I need to traverse the entire Cursor to get a count. I don't want to do that.</p><p>The solution I have come up with so far is to use two cursors: one with the query mentioned above and one with a query containing the number of rows in the notes table (<code>select count(*) from notes</code>). In the constructor I call <code>intializeCursors()</code>:</p><pre><code>private void initializeCursors() {    notesCursor.moveToFirst();    countCursor.moveToFirst();    count = countCursor.getInt(0);}</code></pre><p>I have implemented  getItem() like this:</p><pre><code>public Note getItem(int position) {    // notes is a List of notes that we have already read.    if (position &lt; notes.size()) {         return notes.get(position);    }    int cursorPosition = notes.size();    while (cursorPosition &lt;= position) {        // Creates a note by reading the correct number of rows.        Note note = NotesDb.noteFrom(notesCursor);         notes.add(note);        ++cursorPosition;    }    return notes.get(position);}</code></pre><p>The adapter assumes that the cursors are being managed by some activity that has called <code>startManagingCursor()</code> on them.</p><p>So far so good, I guess. The problem is now how to handle the cursor being requeried. Since I have two cursors I need to register listeners for both of them and when I have received <code>onChange()</code> for both of them I can <code>initializeCursors()</code> and notify any listeners registered to my <code>ListAdapter</code> of a change in the its data.</p><p>This is the best I have so far. I want to check the sanity of this approach with this group. :-) Is this way to complicated? Perhaps I have missed some part of the API that solves this nicely for me?</p><p>Thanks in advance!</p>","3414","","","","","2011-01-21 14:06:17","ListAdapter design advice","<android><design><listadapter>","1","0","","",""
"4756513","1","4756597","","2011-01-21 07:45:39","1","274","<p>I am developing an Android App.</p><p>I have a few Android Devices and in my Emulator the App looked just how i wanted it. I tested it out on my MyTouch and looked perfect as well. But when i test the App out on my LG Ally the buttons are significantly smaller!</p><p>Is there a way to fix this?</p><p>The App is called PostSecret on the Android Market. You can download it and see what the buttons do on your phone if you want...</p><p>I cant post any images yet because of my rank on this site :( But the logo has a black background with a silver border and <em>PS</em> written inside of the logo</p>","583952","","","","","2011-01-21 12:06:57","Buttons in my App are different sizes on different phones","<android>","2","0","","",""
"4756589","1","4766717","","2011-01-21 07:56:55","1","1187","<p>I've made a IM client that uses the asmack .jar library to communicate with google IM service server.</p><p>Now I am trying to export my application from eclipse and use the proguard tool to obfuscate my classes.The problem is that after exporting the project and running it, I can't log on to google because I get errors from the asmack lib...<br>one of the errors: <code>01-21 09:52:19.602: WARN/System.err(24297): java.lang.UnsupportedOperationException: java.lang.NoSuchMethodException: values</code>I also get NoSuchClassException and some names of packages from asmack.</p><p>What settings do I have to make to get this work?Thank you!</p>","449310","","","","","2011-03-05 09:06:00","android: proguard obfuscating imported jars","<java><android><obfuscation><proguard>","1","0","","",""
"4756606","1","4756980","","2011-01-21 07:59:49","4","16745","<p>This is working fine on emulator but not on the devices because I have hard coded the height to 365. Can anyone help me in this regard?</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;TabHost android:id=""@+id/tab_host""    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"" &gt;        &lt;RelativeLayout android:id=""@+id/first_tab""            android:orientation=""vertical"" android:layout_width=""fill_parent""            android:layout_height=""365px"" &gt;               &lt;WebView  xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/webview""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""/&gt;&lt;ImageViewandroid:id=""@+id/widget31""android:layout_width=""fill_parent""android:layout_height=""49px""android:layout_x=""0px""android:layout_y=""0px""android:background=""#39000000""android:layout_alignParentBottom=""true""&gt;&lt;/ImageView&gt;&lt;ImageButtonandroid:id=""@+id/btnFB""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:src=""@drawable/fb""android:background=""#00000000""android:layout_alignRight=""@+id/widget31""android:layout_alignParentBottom=""true""&gt;&lt;/ImageButton&gt;&lt;TextView      android:id=""@+id/myTextView1""      android:layout_height=""wrap_content""      android:layout_width=""wrap_content""      android:text=""Share""   android:textColor=""#111111""   android:textSize=""14pt""   android:paddingBottom=""5px""   android:layout_alignLeft=""@+id/widget31""   android:layout_alignParentBottom=""true""    /&gt; &lt;ImageButtonandroid:id=""@+id/btnTwitter""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:src=""@drawable/twitter""android:visibility=""invisible""android:background=""#00000000""android:layout_alignRight=""@+id/widget31""android:layout_alignParentBottom=""true""&gt;&lt;/ImageButton&gt;            &lt;!-- Replace TextView with your layout content for this tab --&gt;        &lt;/RelativeLayout&gt;        &lt;LinearLayout android:id=""@+id/second_tab""            android:orientation=""vertical"" android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" &gt;            &lt;ScrollView       android:id=""@+id/ScrollView01""    android:layout_height=""365px""     android:layout_width=""fill_parent""&gt;   &lt;WebView  xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/webviewForRSS""android:layout_width=""fill_parent""android:layout_height=""365px""android:background=""#98012E""/&gt; &lt;/ScrollView&gt;            &lt;!-- Replace TextView with your layout content for this tab --&gt;        &lt;/LinearLayout&gt;        &lt;LinearLayout android:id=""@+id/edit_item_text_tab""            android:orientation=""vertical"" android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" /&gt;    &lt;/FrameLayout&gt;&lt;/TabHost&gt;&lt;/RelativeLayout&gt;</code></pre><p>Thanks.</p>","419894","","","","","2011-01-21 08:56:58","how to set height of relative layout dynamically in android","<android><layout><css-position>","2","0","1","",""
"4756757","1","4756931","","2011-01-21 08:24:50","3","961","<p>I want to create a slider that slides from bottom to top when I click a button. For example, I have a button named Login.  If I click the Login button,  the slider must slide from bottom to top. </p>","555221","","224988","","2011-01-21 09:07:26","2011-01-21 09:07:26","Help with Android Slider?","<android><slider>","1","0","","",""
"4756813","1","4757240","","2011-01-21 08:36:14","1","4049","<p>I am having webservice made with PHP. I am posting parameter and fetching data from the server. It works fine for the small amount of data.</p><p>I have one test service which return 10 xml records its working well. The same webservice with all the 160 xml records is not fetching data.</p><p>I pasted my code below.. <strong>Is there any limitation in terms of amount of data or do I need to pass any other parameters ?</strong></p><pre><code>public void LoadNews(String Url, List&lt;NameValuePair&gt; nvp) {    InputStream ins = null;    HttpClient httpclient = new DefaultHttpClient();    HttpPost httppost = new HttpPost(Url);    httppost.setHeader(""Content-Type"", ""application/x-www-form-urlencoded"");    try {        // Add your data        List&lt;NameValuePair&gt; nameValuePairs = nvp;        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));        // Execute HTTP Post Request        HttpResponse response = httpclient.execute(httppost);        ins = response.getEntity().getContent();        BufferedInputStream bis = new BufferedInputStream(ins);        ByteArrayBuffer baf = new ByteArrayBuffer(1024);        int current = 0;        while ((current = bis.read()) != -1) {            baf.append((byte) current);        }        String response = ""&lt;?xml version=\""1.0\"" encoding=\""UTF-8\""?&gt;""                + new String(baf.toByteArray());    } catch (ClientProtocolException e) {        Log.e(CommonFunctions.LOGTAG, ""ClientProtocolException"");    } catch (IOException e) {        Log.e(CommonFunctions.LOGTAG, ""IOException"");    }</code></pre><p>I tested same webservice with Firefox + Poster Addon its working fine with.. XML gives CDATA in response.</p>","206809","","","","","2013-02-27 04:24:15","HTTP POST + ANDROID Not Getting response !","<android><post>","1","5","3","",""
"4756835","1","","","2011-01-21 08:40:01","9","13554","<p>I want to launch home screen of Android with my application. The main target is to show all of apps to user when he/she presses a specialized key. Actually, the way is not important. Any idea to do this?</p>","511853","","","","","2013-12-02 13:00:01","How to Launch Home Screen Programmatically in Android","<java><android><homescreen>","7","0","6","",""
"4756862","1","4756877","","2011-01-21 08:43:55","11","36074","<p>When a thread is alive , how can i stop the thread .. I have given like</p><pre><code>if(thread.isAlive()){    thread.stop();}</code></pre><p>but the method stop is depricated and is throwing an exception</p><pre><code>01-21 14:12:40.188: ERROR/global(535):     Deprecated Thread methods are not supported.01-21 14:12:40.188: ERROR/global(535):    java.lang.UnsupportedOperationException01-21 14:12:40.188: ERROR/global(535):     at java.lang.VMThread.stop(VMThread.java:85)01-21 14:12:40.188: ERROR/global(535):     at java.lang.Thread.stop(Thread.java:1379)01-21 14:12:40.188: ERROR/global(535):     at java.lang.Thread.stop(Thread.java:1344)</code></pre><p>How can we solve this?? Please Help</p>","548218","","180538","","2011-04-05 12:54:03","2014-02-18 06:08:24","How to stop a thread?","<android><multithreading>","5","1","1","",""
"4756899","1","4757308","","2011-01-21 08:48:12","1","2362","<p>I'm trying to implement a custom textview that uses my own custom font.</p><p>is there a way to set the typeface before doing a Super.onDraw()?</p><p>So as to replace the usual font to the custom font that I want to use.</p><p>Something like:</p><pre><code>protected void onDraw(Canvas canvas){    Typeface font1 = Typeface.createFromAsset(context.getAssets(), ""fonts/myfonts.ttf"");    this.setTypeface(font1);    this.setTextSize(18);    super.onDraw(canvas);}</code></pre><p>I know the above code won't work.</p><p>Or do I have no choice but to use drawText() to do so?</p>","584187","","584187","","2011-01-21 08:59:12","2011-03-06 21:07:40","custom textview using custom font","<android><android-widget><ondraw><drawtext><typeface>","2","0","1","",""
"4756959","1","","","2011-01-21 08:55:22","0","319","<p>I am creating a calendar using tablelayout as my display to the screen. However when I need to update the display with either new month or year being selected by the user, it only adds up to the previouse stored data into the table. </p><p>HERE is my code:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //setContentView(R.layout.main);    table = new TableLayout(this);    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(                     ViewGroup.LayoutParams.FILL_PARENT,                     ViewGroup.LayoutParams.FILL_PARENT);     table.setLayoutParams(lp);    table.setStretchAllColumns(true);     rowLp2 = new TableLayout.LayoutParams(                     ViewGroup.LayoutParams.FILL_PARENT,                     ViewGroup.LayoutParams.FILL_PARENT,                     1.0f);    cellLp2 = new TableRow.LayoutParams(                     ViewGroup.LayoutParams.FILL_PARENT,                     ViewGroup.LayoutParams.FILL_PARENT,                     1.0f);   // cellLp3 = new TableRow.LayoutParams(arg0, arg1)setYYMMDD(calendar.get(Calendar.YEAR),calendar.get(Calendar.MONTH),calendar.get(Calendar.DAY_OF_WEEK));    leadGap = new GregorianCalendar(yy, mm, 1).get(Calendar.DAY_OF_WEEK) - 1;  //calling methods    header();    weeks();    //setLeadGap(2011, 2);    days(dom[mm]);    setContentView(table);}private void days(int noDays){    TableRow row = new TableRow(this);    int d=1;    nRow = (leadGap &gt; 3) ? nRow+1 : nRow;    //textMonth.setText(Integer.toString(nRow));    for (int r = 0; r &lt;nRow ; ++r)     {             row = new TableRow(this);        if (r==0)            {   int l = 0;                for (int f = 1; f&lt;7; ++f)                {                    if( l &lt;leadGap)                    {                            TextView v = new TextView(this);                            v.setText("""");                            row.addView(v, cellLp2);                            l++;                    }                    if (l == leadGap)                    {                        Button v = new Button(this);                        v.setText(Integer.toString(d));                        row.addView(v, cellLp2);                        d++;                    }                    row.setBackgroundColor(Color.rgb(55, 254, 55));                }            }            else            {                for (int f = 0; f &lt; 7; ++f)                     {                          if (d &lt;= noDays)                        {                            //Button btn = new Button(this);                              //btn.setText(Integer.toString(d));                                     //row.addView(btn, cellLp2);                            Button v = new Button(this);                            v.setText(Integer.toString(d));                            row.addView(v, cellLp2);                            row.setBackgroundColor(Color.rgb(55, 254, 55));                            d++;                        }                        else                        {                            TextView btn = new TextView(this);                              btn.setText("""");                                     row.addView(btn, cellLp2);                        }                }            }        table.addView(row, rowLp2);     } }private void header(){    headertbl= new TableLayout(this);    btnMonthPos = new Button(this);    btnMonthPos.setOnClickListener(new View.OnClickListener()     {                    public void onClick(View v)         {               if (iMonth &gt; 10)            {                iMonth = 0;            }            else            {                iMonth += 1;            }            setLeadGap(iYear, iMonth);            days(dom[iMonth]);            textMonth.setText(months[iMonth]);               //recompute();        }    });   textMonth = new TextView(this);btnMonthNeg = new Button(this);    btnMonthNeg.setOnClickListener(new View.OnClickListener()     {                    public void onClick(View v)         {               if (iMonth &lt; 1)            {                iMonth = 11;            }            else            {                iMonth -= 1;            }            textMonth.setText(months[iMonth]);                  }            });   btnYearPos = new Button(this);    btnYearPos.setOnClickListener(new View.OnClickListener()     {                    public void onClick(View v)         {               iYear += 1;            textYear.setText(Integer.toString(iYear));              leadGap = new GregorianCalendar(yy, mm, 1).get(Calendar.DAY_OF_WEEK) - 1;            //sunBtn.setText(Integer.toString(leadGap));        }            });textYear = new TextView(this);btnYearNeg = new Button(this);    btnYearNeg.setOnClickListener(new View.OnClickListener()         {                        public void onClick(View v)             {                   iYear -= 1;                textYear.setText(Integer.toString(iYear));                      }                }); //setting values during loadingbtnMonthPos.setText(""++"");textMonth.setText(months[mm]);btnMonthNeg.setText(""--"");btnYearPos.setText(""++"");textYear.setText(Integer.toString(calendar.get(Calendar.YEAR)));btnYearNeg.setText(""--"");TableRow headerRow = new TableRow(this);headerRow.addView(btnMonthPos, cellLp2);headerRow.addView(textMonth, cellLp2);headerRow.addView(btnMonthNeg, cellLp2);headerRow.addView(btnYearPos, cellLp2);headerRow.addView(textYear, cellLp2);headerRow.addView(btnYearNeg, cellLp2);headertbl.addView(headerRow, rowLp2); table.addView(headertbl);}private void weeks(){    String[] weekName = {""Sun"",""Mon"",""Tue"",""Wed"",""Thu"",""Fri"",""Sat""};    tblWeek = new TableLayout(this);    TableRow rowWeek = new TableRow(this);    for (int i = 0; i&lt;1; i++)    {        rowWeek = new TableRow(this);        for (int j=0; j&lt;weekName.length;j++)        {            TextView day = new TextView(this);            day.setText("" ""+weekName[j]);            day.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));            rowWeek.addView(day, cellLp2);        }        rowWeek.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));        tblWeek.addView(rowWeek, rowLp2);    }     table.addView(tblWeek);}}</code></pre>","584186","","21234","","2011-01-21 08:57:48","2011-01-21 09:11:41","Display is ADDING UP with TABLELAYOUT","<android><view><tablelayout><tablerow>","1","0","","",""
"4756982","1","","","2011-01-21 08:57:44","3","4210","<p>I am developing an Image manipulation software in android.i want to change the brightness of an particular image.how it can be done in code? </p>","409344","","","","","2011-04-10 19:12:34","How to change brightness of an image in android?","<android><brightness>","2","4","1","",""
"4757042","1","","","2011-01-21 09:07:15","1","391","<p>I would like to ask what kind of support is provided for ""Microsoft Mail for exchange"" on android 2.2 devices and onwards.</p><p>Question:</p><ol><li><p>Can developers setup an exchange account programmatically?</p></li><li><p>Are there API's to access an exchange server?</p></li><li><p>It is included on the <a href=""http://developer.android.com/guide/topics/admin/device-admin.html"" rel=""nofollow"">Device Administration API</a> as one of the examples that benefits Device Admin but it didn't include emails on the example. Where can we find examples and resources about this one?</p></li><li><p>Does this also support for other IMAP or POP3 accounts?</p></li></ol><p>Thanks</p>","496042","","19750","","2011-06-22 03:31:51","2011-06-22 03:31:51","Mail for Exchange confirmation android 2.2 device","<android><device-admin>","0","0","","",""
"4757049","1","4757734","","2011-01-21 09:07:34","0","855","<p>I'm beginner in Java Android developing. I'm using Eclipse SDK 3.6.1 version. I'm trying to do call new intents, but my app is allways unexpectedly stopped. Do am I correctly call new intents?First class:</p><pre><code>package net.sample;</code></pre><p>import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.Toast;import android.content.Intent;import android.app.PendingIntent;</p><p>public class first extends Activity {</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button SignIn = (Button) findViewById(R.id.SignIn);    SignIn.setOnClickListener(new OnClickListener() {      @Override      public void onClick(View v) {          EditText pw = (EditText) findViewById(R.id.editPasswd);            if(pw.getText().toString().equals(""123"")) {                                      Intent intent = new Intent(first.this, second.class);                 startActivity(intent);                      }      else {        Toast.makeText(getBaseContext(), ""Wrong PIN"" ,                  Toast.LENGTH_LONG).show();    }         }});}}</code></pre><p>Second class:</p><p>package net.sample;</p><p>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.Toast;</p><p>public class second extends Activity {</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.loginas);   Button Button01 = (Button) findViewById(R.id.Button01);Button01.setOnClickListener(new OnClickListener() {   public void onClick(View v) {      if(v.getId() == R.id.Button01) {           Intent intent = new Intent(second.this, third.class);          startActivity(intent);   }}});}</code></pre><p>}Third class:</p><pre><code>package net.sample;</code></pre><p>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.Toast;</p><p>public class third extends Activity {</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.lock);}}</code></pre><p>When I put correct pin code the app show messages ""the application () has stopped unexpectedly. Please try again"". First I want to know that my code is correct.</p>","572853","","15541","","2011-01-21 09:32:04","2011-02-25 09:22:11","How to call correctly few class (intents) using a button?","<android><class><button><android-intent><oncreate>","1","0","","",""
"4757110","1","4818491","","2011-01-21 09:15:31","0","651","<p>I have a dialog in my preferences activity defined as follows (the layout is defined in xml):</p><pre><code>public class DialogPreference extends android.preference.DialogPreference {    public DialogPreference(Context context, AttributeSet attrs) {        super(context, attrs);    }    public DialogPreference(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);    }    public void onClick (DialogInterface dialog, int which) {        if (DialogInterface.BUTTON_POSITIVE == which) {            if (getKey() ==                 getContext().getResources().getText(R.string.blabla)) {                // FIXME ??? - how ?                Log.v(TAG, ""DialogPreference: onClick"");            }        }    }}</code></pre><p>In the dialog there are several widgets, namely a <code>RadioGroup</code> and several <code>RadioButton</code>s. I currently am not able to find a way to access these widgets in the <code>onClick</code> method.</p><p><em>What is the way to access those widgets?</em></p>","19868","","","","","2011-01-27 15:46:25","access widgets state in a DialogPreference","<java><android><activity><android-preferences><preferenceactivity>","2","0","","",""
"4757228","1","4757506","","2011-01-21 09:30:00","2","1157","<p>If I download a project from <code>git clone git://android.git.kernel.org/</code> to what Android API version will it be compatable ?</p><p>I have cloned a project.<br>Then created a project in <code>Eclipse</code> in that name with its <code>res</code>, <code>src</code> and <code>manifest.xml</code>, but still its shows error with some variables declaration missing , some functions arguments changed/not correct etc. </p><p>Any idea?<br>I'm using <code>sdk_r08</code>, and <code>android 2.3</code> project working well.<br>Is the project from <code>android.git.kernel.org</code> need any dependent files? If so what do I need to get those files?  </p><p>Is there any extra arguments that I can set in <code>git clone</code> to get the project in a specific version?  </p><p>Thank you.</p>","477754","","1108213","","2012-02-16 09:29:42","2012-02-16 09:29:42","Project from android.git.kernel.org","<android><git><android-source>","2","0","","",""
"4757263","1","4757413","","2011-01-21 09:35:46","3","10257","<p>I am using query method, but I don't no how to pass more than one selection argument in query method. </p><p>My query method should return result as same as this sql statement :</p><p><code><pre>SELECT _id FROM CONATCT_TAGS WHERE TAG1='tagname' OR                                   TAG2='tagname' OR                                    TAG3='tagname' OR                                    TAG4='tagname' OR                                   TAG5='tagname';</pre></code></p>","550966","","","","","2012-07-17 15:49:00","How to pass two or more selection argument in ""query"" method","<android>","2","0","1","",""
"4757315","1","4781012","","2011-01-21 09:42:09","3","2419","<p>I am running Froyo on my HTC Wildfire. I have 17 MB storage free in my phone. The .apk I'm trying to install on the phone is 2.7MB but I get this wierd <strong>Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE</strong>. I'm using Eclipse and have enabled debugging on my device. I was able to install binaries with the size of 11 MB with the same free storage space a few minutes ago.</p>","421372","","","","","2012-10-11 01:21:12","Insufficient storage problem in HTC Wildfire","<android><debugging><device>","5","0","","",""
"4757317","1","","","2011-01-21 09:42:17","0","3998","<p>This is how my timepicker looks at the moment.I want it to only display the minutes and the minutes only to maximum 30.It works fine but when u enter the time with the keyboard it sets the time to 0 but i want it to go to the maximum.so if a user enters 50 it should go to 30, how can i do this?and how can i hide the hour of the timepicker cause it's not needed here.</p><pre><code>protected void onCreate(Bundle savedInstanceState) {    System.out.println(""Powernap"");    super.onCreate(savedInstanceState);    setContentView(R.layout.powernap);    TimePicker pn = (TimePicker) findViewById(R.id.tp_powernap);    pn.setOnTimeChangedListener(StartTimeChangedListener);    pn.setIs24HourView(true);}    private TimePicker.OnTimeChangedListener StartTimeChangedListener =        new TimePicker.OnTimeChangedListener() {        public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {            updateDisplay(view, hourOfDay, minute);                  }    };    private TimePicker.OnTimeChangedListener NullTimeChangedListener =        new TimePicker.OnTimeChangedListener() {        public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {        }    };    private void updateDisplay(TimePicker timePicker, int hourOfDay, int minute) {         // do calculation of next time         int nextMinute = 0;        int nextHour = 0;        if (minute &gt; 30){            System.out.println(""Minute+30"");            nextMinute = 30;            // set minute            timePicker.setCurrentMinute(nextMinute);        }        else {                      System.out.println(""minute 0"");            nextMinute = 0;        }        if (hourOfDay != 0){            System.out.println(""hour&gt;0"");            nextHour = 24;        }        // remove ontimechangedlistener to prevent stackoverflow/infinite loop        timePicker.setOnTimeChangedListener(NullTimeChangedListener);        // set minute        timePicker.setCurrentMinute(timePicker.getCurrentMinute()+nextMinute);        //set hour        timePicker.setCurrentHour(nextHour);        // hook up ontimechangedlistener again        timePicker.setOnTimeChangedListener(StartTimeChangedListener);    }</code></pre>","565246","","","","","2011-02-01 07:37:13","TimePicker only show minutes and setmaximum minutes if the user enter a time with the keyboard","<android><timepicker>","2","0","3","",""
"4757418","1","4758715","","2011-01-21 09:56:37","20","5839","<p>This pattern is similar to the pattern <em>Main Servlet</em> (the Front Controller) that is used for developing web applications.</p><p>The main idea of this pattern: we have one Activity that manages multiple views and this activity is responsible for representing current content. Not all views need functional of activity (e.g. life-cycle methods) so the main question is: <strong>if I can go without activity why do I have to use it?</strong></p><hr><p>I have found the following disadvantages of using this pattern:</p><ol><li><p>Official source doesn't recommend to <a href=""http://developer.android.com/guide/practices/design/seamlessness.html#multiple-activities"">Overload a Single Activity Screen</a>but they don't explain why.</p></li><li><p>We cannot use <code>TabActivity</code>, <code>ListActivity</code>, <code>MapActivity</code>. But there are some tricks to go without them.</p></li><li>If different screens have different menu it's a problem to make that without activities.</li><li>It is necessary to keep history by ourselves. But it's not so difficult to develop.</li></ol><p>I have found the following advantages of using this pattern:</p><ol><li>It's faster to change the content of current activity than to start another activity</li><li>We are free to manage history as we want</li><li>If we have only one activity-context it's simpler to find and solve problems with memory leaks</li></ol><p>What do you think about this pattern ? Could you provide any other advantages/disadvantages ?</p>","584208","","2390083","","2013-10-28 10:48:15","2013-10-28 10:48:15","Pattern ""One activity, multiple views"": Advantages and disadvantages","<android>","2","0","10","",""
"4757558","1","7139409","","2011-01-21 10:12:55","7","3928","<p>How do I remove this ""shadowBox"" effect around the dialog box that fades the background?</p><p>I know I can create like totally custom view but let's say I want to keep it simple. I have xml layout for dialog with only textView and 2 buttons and I want to stop the fade only for this one dialog.</p>","475861","","","","","2011-08-21 16:07:35","Android: dialog box without shadow around it","<android><alertdialog>","3","0","1","",""
"4757632","1","4757715","","2011-01-21 10:20:56","1","6690","<p>I am trying to make it so my app never goes into portrait mode but is able to switch between the 2 landscape screen views. I know this can be done easily in Gingerbread (2.3) but I am having trouble doing it manually for the other versions of android, my code is as follows:</p><pre><code>Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();        int orientation = display.getRotation();        if (orientation == 1) {            /* The device is rotated to the left. */            Log.v(""Left"", ""Rotated Left"");        } else if (orientation == 3) {            /* The device is rotated to the right. */        Log.v(""Right"", ""Rotated Right"");        } else {         }</code></pre><p>My problem is how do I flip the x and y-axis of the screen view depending on the rotation detected? How do I get hold of them in order to reverse them?</p>","400406","","","","","2011-01-21 10:50:00","Screen rotation using Display.getRotation()","<java><android><rotation>","1","0","1","",""
"4757757","1","","","2011-01-21 10:34:41","0","301","<p>When I start my app via IntelliJ it erases the old version on the phone and deploy the new one.</p><p>Well no... it erases it one time, then it keep running the old code over and over, then it decides to publish a new version once, to restart keeping it as the new old code.</p><p>How do I fix this please?</p><p><strong>EDIT</strong></p><p>IDEA Version: 10.0.1 Community Edition</p>","429059","","1288","","2011-05-27 14:18:48","2011-05-27 14:18:48","Android and IntelliJ run problem","<android><intellij-idea><intellij-plugin>","0","5","1","",""
"4757794","1","4757877","","2011-01-21 10:38:42","12","1719","<p>What naming conventions do you use for resource files and IDs and what benefits do they bring?</p><p>It's very easy for example to end up with a view ID like ""activity_settings_location_text_label"" but quickly becomes unmanageable and messy. I've not seen any guidance from Google on this, did I miss it?</p><p>Resources can be ""grouped"" using hierarchical naming, but what structure works best for each resource type? String, color, dimens, layouts, includes, etc</p><p>My naming is currently fairly ad-hoc, and it's clear I need better structure (particularly so I can find IDs more easily using the IDE's code-completion).</p>","477415","","","","","2011-01-21 11:08:59","What is the clearest way to name resources in Android?","<android><android-layout>","4","1","3","",""
"4757801","1","4779420","","2011-01-21 10:39:12","1","1199","<p>In my application i have one black and white image, now to want to change the black and white image into colored image like where ever i click on that image only that portion become colored</p><p>Thanks</p>","437833","","","","","2011-01-24 06:55:32","how to change color of image in onTouch?","<android>","2","1","","",""
"4757898","1","4757940","","2011-01-21 10:50:00","1","595","<p>I'm using a SlidingDrawer and it works quite well in my application but... is it possible to have one that doesn't open or close entirely when the handle is touched?I'll try to explain better: dragging the handle up and down, my SlidingDrawer opens and closes correctly following up my finger but, when I stop touching, the view completes showing or hiding its content by itself (depending on its previous state).Is it possible to have a SlidingDrawer that behaves exactly as described but, once the touch is released, stop open or close preserving the height shown so far?Thanks! </p>","520032","","","","","2011-01-21 10:53:57","lazy SlidingDrawer","<android><close><open><slidingdrawer>","1","0","","",""
"4758001","1","4758272","","2011-01-21 11:01:42","0","793","<p>I'm using a TabActivity with a custom image title. While calling</p><pre><code>requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.my_custom_title);if (resId &gt; 0){    ImageView im = (ImageView) findViewById(R.id.title_bar);    im.setImageResource(resId);}</code></pre><p>'im' is null. Based on other questions I saw that not calling setContentView can cause this, but I'm not using any layout file. Is there something I'm missing?</p><p>this is my_custom_title.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_height=""wrap_content""                 android:layout_width=""wrap_content""                 android:orientation=""vertical""&gt;    &lt;ImageView  android:src=""@drawable/launch""                android:layout_width=""wrap_content""                android:layout_alignParentLeft=""true""                android:layout_centerVertical=""true""                android:id=""@+id/title_bar""                android:layout_height=""wrap_content""                android:layout_alignParentTop=""true"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Thanks,<br>Rajath</p>","313042","","313042","","2011-01-21 11:12:29","2011-01-21 11:28:28","FindViewById returns null when using custom title in Android","<android><tabactivity>","1","2","0","",""
"4758029","1","4758798","","2011-01-21 11:04:39","0","1631","<p>I am creating application which apk file now becomes 55 MB in size and cant install it on emulator and device both. </p><p>-how can i increase emulator size? </p><p>-what will be problem to upload on android market.</p><p>Thank You.  Vikram</p>","395627","","","","","2013-02-20 12:31:38","Unable to upload file: No space left on device error in android","<android>","3","1","0","",""
"4758071","1","","","2011-01-21 11:08:35","6","1360","<p>I am trying to understand how a traceview works. I have tried to analyze a method using the traceview but have a query about it. </p><p>I have attached the snapshot of the .trace. It indicates that the majority time is taken by (toplevel) marked in blue. however no further info is available on the same. (when this method is executed or what function it performs.)</p><p><img src=""http://i.stack.imgur.com/T2pPy.jpg"" alt=""traceViewSnapshot""></p><p>Can anyone please explain to me why its consuming so much time?</p><p>Thanks in advance!</p>","366053","","366053","","2011-01-22 10:59:04","2012-04-14 18:44:51","Understanding Traceview","<android>","2","1","0","",""
"4758099","1","4758282","","2011-01-21 11:11:39","1","8332","<p>I am trying to download the Android NDK and then extract the files to a certain directory. How can I rename the NDK directory? Do I need to rename the directory?</p><p>How can I check and rename the directory?</p><p>Also, can I use the NDK in Eclipse? If so, how?</p>","486554","","321731","","2014-04-08 18:24:11","2014-04-08 18:24:11","how to install ndk(linux)?","<android><install><android-ndk>","1","0","2","",""
"4758107","1","","","2011-01-21 11:12:34","5","7727","<p>Hi i need to create an autocompletetextview in which suggestion should be a combination of Contact name and organization name ,am using 2.1 os. i can display the contact name ,but orgnization name not, how can i do this. </p><pre><code>public class myactivity extends Activity {    /** Called when the activity is first created. */    public static EditText ed;    private String id;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        AutoCompleteTextView act=(AutoCompleteTextView)findViewById(R.id.AutoCompleteTextView01);        ed=(EditText)findViewById(R.id.EditText01);        ContentResolver content = getContentResolver();        Cursor cursor = content.query(ContactsContract.Contacts.CONTENT_URI,PEOPLE_PROJECTION, null, null, null);        ContactListAdapter adapter = new ContactListAdapter(this, cursor);        act.setThreshold(0);        act.setAdapter(adapter);}    public static final String[] PEOPLE_PROJECTION = new String[] {          ContactsContract.Contacts._ID,        Contacts.DISPLAY_NAME,        ContactsContract.Contacts.HAS_PHONE_NUMBER    };}class ContactListAdapter extends CursorAdapter implements Filterable {      private ContentResolver mCR;    public ContactListAdapter(Context context, Cursor c) {          super(context, c);          mCR = context.getContentResolver();      }    @Override    public void bindView(View view, Context context, Cursor cursor) {             ((TextView) view).setText(cursor.getString(1));    }    @Override    public View newView(Context context, Cursor cursor, ViewGroup parent) {         final LayoutInflater inflater = LayoutInflater.from(context);            final TextView view = (TextView) inflater.inflate( android.R.layout.simple_dropdown_item_1line, parent, false);            view.setText(cursor.getString(1));            return view;    }      @Override    public String convertToString(Cursor cursor) {          return cursor.getString(1);    }    public Cursor runQueryOnBackgroundThread(CharSequence constraint) {        if (getFilterQueryProvider() != null) {            return getFilterQueryProvider().runQuery(constraint);        }        StringBuilder buffer = null;        String[] args = null;        if (constraint != null) {            buffer = new StringBuilder();            buffer.append(""UPPER("");            buffer.append(Contacts.DISPLAY_NAME);            buffer.append("") GLOB ?"");            args = new String[] { constraint.toString().toUpperCase() + ""*"" };        }        return mCR.query(ContactsContract.Contacts.CONTENT_URI,myactivity.PEOPLE_PROJECTION ,    buffer == null ? null : buffer.toString(), args,                Contacts.DISPLAY_NAME);    }}</code></pre>","487219","","487219","","2011-01-28 06:15:50","2014-03-25 16:55:21","Android Autocomplete textview and Cursoradapter","<android>","1","2","3","",""
"4758177","1","","","2011-01-21 11:19:24","0","1323","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4068559/removing-address-bar-from-browser-to-view-on-android"">Removing address bar from browser (to view on Android)</a>  </p></blockquote><p>I'm trying to run a web-based application in Android, and I want to hide the webpage address bar while running the application. Is that possible? How do I do it?</p>","438864","","309308","","2011-01-21 11:21:28","2011-04-18 15:42:32","How to hide the address bar of a webpage in android?","<javascript><android><html>","0","5","1","2012-01-29 02:57:26",""
"4758186","1","4758260","","2011-01-21 11:19:59","0","2369","<p><img src=""http://i.stack.imgur.com/CdZH6.png"" alt=""alt text""></p><p>I get data from a web service as JSON data. The displayed data is shown in the image: it's basically a class called Questionnaire which has two properties which are QuestionnaireId and QuestionnaireName. So the web service method I call returns a collections of this class Questionnaire. </p><p>I am trying to parse this data to an HashTable which I am not able to. Kindly help me get this data parsed into a <code>Hashtable&lt;QuestionnaireId,QuestionnaireName&gt;</code>. </p>","581157","","28169","","2011-01-21 11:22:13","2011-01-21 11:41:43","Android parse JSON data into a HashTable?","<android>","4","0","1","",""
"4758278","1","4766322","","2011-01-21 11:29:08","0","7604","<p>I am trying to redraw an image on the canvas on an <code>onTouch</code> event. I am able to draw the image on the canvas, but I want the image to redraw at a particular <code>x,y</code>.</p><pre><code>protected void onDraw(Canvas canvas){     mBitmap1   = BitmapFactory.decodeResource(getResources(), R.drawable.ab); mBitmap2   = BitmapFactory.decodeResource(getResources(), R.drawable.ab); this.canvas=canvas;     Paint p = new Paint();    p.setColor(Color.parseColor(""#FFFFFF""));    canvas.drawLine(x1, y1, x2 , y2, p);    canvas.drawBitmap(mBitmap1, 70, 60, null);    canvas.drawBitmap(mBitmap1, 185, 60, null);}    @Override    public boolean onTouch(View v, MotionEvent event) {        final int x=(int)event.getX();        Log.i(""***********xPos"",""=""+x);        final int y=(int)event.getY();        Log.i(""***********yPos"",""=""+y);        if(event.getAction()==MotionEvent.ACTION_UP)        {        }        if(event.getAction()==MotionEvent.ACTION_DOWN)        {            canvas.drawBitmap(mBitmap1,50+x,60,null );            this.postInvalidate();        }        if(event.getAction()==MotionEvent.ACTION_MOVE)        {        }        return false;    }</code></pre>","411359","","451951","","2012-05-16 11:35:11","2012-05-16 11:35:11","Redraw image on canvas on touch event?","<android><android-layout>","2","0","0","",""
"4758378","1","4758391","","2011-01-21 11:42:29","0","1000","<p>I've a little problem in my ""timer"" development. I've an activity that shows a timer and when the user press start it schedules an alarm with AlarmManager service. In the broadcast receiver I want to check if the activity Timer is running and visible in order to avoid unneeded notification.So the broadcast receiver should set notification only if the activity isn't in foreground.Any suggestion?</p><p>Thx,SL3</p>","259072","","","","","2011-01-21 11:45:11","Is activity running","<android><broadcastreceiver>","1","0","","",""
"4758462","1","4758570","","2011-01-21 11:52:02","5","18286","<p>I need to finish all the activities running in an Android application when an exit button is clicked.  How can I do that?</p><p>What I want:</p><ol><li>An option menu on screen with an EXIT option.</li><li>When I click the Exit menu, the application should close.</li></ol>","548218","","445131","","2013-02-27 14:54:19","2013-11-10 01:05:14","Android, Finish all activities","<android>","7","0","2","",""
"4758515","1","4758546","","2011-01-21 11:57:34","1","3653","<p>I have an android APP, with a lot of activities.</p><p>In the login activiti of my app, i start a notification icon in the status bar, and it is fixed there until my app stops. Ok, it works. </p><p>But now i need one more thing, i need to changue the icon dynamically, programatically, with a service of my app. How can i do it? </p><p>How can i access to the notification icon of my app and then change the icon?</p><p>I would appreciate code examples to illustrate how to achieve this.</p>","479886","","571593","","2011-02-24 17:00:51","2013-12-08 19:45:38","It is possible to change the Icon of the status bar (notification icon) dynamically?","<android><notifications><statusbar>","2","0","","",""
"4758538","1","4758779","","2011-01-21 11:59:43","4","1144","<p>I have 5-10 lines of address information that I want to insert in a layout in my Android app.I rather not use seperate textviews, but want to have <strong>one</strong> where I can insert line breaks manually.</p><p>I do this by adding \n and it seems to work, BUT.. This also adds padding or a space, I'm not sure which one.</p><p>Example:</p><p>This XML</p><pre><code>&lt;string name=""contact_address""&gt;    Street address\n    City\n    Country&lt;/string&gt;</code></pre><p>Gives this output:</p><pre><code>Street address City Country</code></pre><p>Anyone know what could be wrong, or do I have to give up and make 5-10 seperate textviews?</p>","396749","","","","","2011-01-21 12:27:49","Line break in Android adds padding","<android><newline><textview>","1","2","","",""
"4758588","1","4758756","","2011-01-21 12:05:15","0","305","<p>Is there an API that deals with voice packets during a call in Android? How can I access voice packets?  </p><p>Thanks,<br>Sriram </p>","350685","","","","","2011-01-21 12:25:06","API to handle voice packets in Android","<android><speech>","1","0","","",""
"4758694","1","","","2011-01-21 12:18:12","0","328","<p>I'm just starting out in app development and have a board game concept that I would like to visualize before coding it. </p><p>Which free ware would you recommend that I use and then afterwards maybe even port assets and other resources to my Eclipse Android IDE?</p><p>The key thing for me right now is to have a tool I can use to make and see the game :-O</p><p>If it happens to generate simple java code,that'd be great ;-)  </p><p>If it's a plugin editor for eclipse that'd be superb :-)</p><p>And lastly has anyone ever used Java Ascii Versatile Editor for this purpose? </p><p>BTW there's a fantastic eclipse free hand drawing resource called Sketch currently in development.</p>","469100","","","","","2011-01-21 12:27:20","Android Non-code drawing tool for initial game visualization","<android>","2","0","","",""
"4758827","1","4759225","","2011-01-21 12:32:36","1","1038","<p>How to programmatically rotate dialog box? </p><p>I have an activity that is set to portrait mode with:</p><pre><code>&lt;activityandroid:screenOrientation=""portrait""&gt;&lt;/activity&gt;</code></pre><p>Is there a way to pop up a Dialog depending on device orientation? On iPhone it's possible to both detect device orientation and manually rotate any object to that orientation.</p>","475861","","","","","2011-01-21 13:21:28","Android: programmatically rotate dialog","<android><rotation><device>","1","0","","",""
"4758904","1","4849897","","2011-01-21 12:41:35","2","5896","<p>I have a large png that I would like to use as a background on different layouts, but offset it so that I can have different parts showing (much like you can in CSS), preferable in the xml.</p><p>My main layout for the activity contains the following xml:</p><pre><code>&lt;LinearLayoutandroid:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background=""@layout/bg1""&gt;</code></pre><p>Layout bg1 consists of the following xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;bitmapxmlns:android=""http://schemas.android.com/apk/res/android""android:src=""@drawable/big_image""android:layout_marginTop=""50sp""android:paddingTop=""50sp""android:gravity=""top|left"" /&gt;</code></pre><p>The gravity property works as expected but margins and paddings are ignored, presumably because I'm working on a bitmap object rather than a layout. What I want to do is set these to a minus amount so that only part of the picture is shown. I've tried using a shape but that only wraps the content whereas I need to fill the entire background.</p><p>Any suggestions would be gratefully received. Thanks.</p>","584304","","","","","2011-02-11 17:20:54","Android layouts - offsetting a background image in xml","<android><layout><background><offset>","2","1","","",""
"4758912","1","4759095","","2011-01-21 12:42:40","0","172","<p>Hi <br>I need an approach for how to restrict the size of downloaded application. <br>I dont want to download a application whose size is greater than 100kb .are there  any apis in Android which allow us to write an application that will restrict the downloaded application size? can anyone help me in solving this issue?</p><p>Thanks in Advance,</p>","429501","","","","","2011-01-21 13:05:12","How to restrict the maximum size of downloaded application in android","<android>","1","0","","",""
"4758952","1","4759006","","2011-01-21 12:48:15","0","972","<p>I want to create Dialer for my HTC desire(Android 2.1). i think Android 2.1 does not include SIP Api..so, how can i include SIP API to create SIP Dialer for Android 2.1?</p><p>Thanks...</p>","472882","","","","","2011-10-13 05:42:29","SIP(session initiation protocol) in Android 2.1","<android><sip>","1","0","","",""
"4759055","1","","","2011-01-21 12:58:54","3","534","<p>How could I get current rotation of image on Android 1.6?As for android 2.0 I use ExifInterface , but it isn't available at android 1.6 I want realize smth like this on android 1.6  </p><pre><code>ExifInterface exif = new ExifInterface(path);             int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 1);             if (orientation != -1) {                     // recognize a subset of orientation tag values.                     switch (orientation) {                     case ExifInterface.ORIENTATION_ROTATE_90:                         degree = 90;                         break;                     case ExifInterface.ORIENTATION_ROTATE_180:                         degree = 180;                         break;                     case ExifInterface.ORIENTATION_ROTATE_270:                         degree = 270;                         break;                     default:                         degree = 0;                         break;                     }                 }</code></pre>","583208","","","","","2011-01-21 12:58:54","How could I get current rotation of image on Android 1.6?","<android><image><rotation>","0","1","","",""
"4759057","1","","","2011-01-21 12:59:07","2","731","<p>I am getting an image inforamtion as string from a database and by using that string I create a bitmap image. </p><p>Now my question is how am I sending this image and matter also via mail. This image is not stored on the sdcard or anywhere else.</p>","479027","","479027","","2011-01-21 13:05:44","2012-11-08 08:57:17","How to send an image from a database via mail","<android><email><attachment>","1","0","2","",""
"4759215","1","","","2011-01-21 13:20:13","0","746","<p>I am sure this has something to do with needing an escape character or something - but I cannot figure it out.  When I try to draw +5 to my canvas the + sign never shows up - I noly see the 5.</p><p>Anyone know of a way to draw special characters like this to the canvas?</p><p>Thanks!</p><p>Here is me code that compiles but does not show the ""+"":</p><pre><code>    private void doDraw(Canvas canvas) {       //other misc canvas.draw(...) calls       canvas.drawText(""+5"", xPos, yPos, bonusScorePaint);}</code></pre><p>Apparently</p><pre><code>canvas.drawText(""\+5"", xPos, yPos, bonusScorePaint);</code></pre><p>is not a valid escape sequence so this doesn't compile.</p>","580702","","580702","","2011-01-21 14:38:03","2013-04-07 10:45:51","Canvas.drawText(""+5"") Doesn't show ""+"" symbol at all in Android?","<android><canvas><escaping><character><drawtext>","4","2","","2013-02-04 11:42:15",""
"4759233","1","4759276","","2011-01-21 13:22:02","0","1202","<p>hi now i am using android sdk in eclipse and then i download android ndk then uncompressed the ndk file....... how to call android ndk to eclipse?</p>","486554","","","","","2011-01-21 13:26:13","how to call android ndk directory in eclipse?","<android><sdk><android-ndk>","2","1","","2012-08-17 16:40:39",""
"4759256","1","","","2011-01-21 13:23:47","1","595","<p>I wanted to load a custom KML file on the map. I chose the simple way:</p><pre><code>Intent mapIntent = new Intent(Intent.ACTION_VIEW, url);</code></pre><p>And it works well, but obviously I can't control various features like custom icons for overlay items, or the popup ""Loading myKml.kml..."" that shows everytime I start it, etc.</p><p>First question:<strong>Aren't there any parameters to setup when I start a Google Maps Intent, to tweak my map? I can't find anything on the documentation.</strong></p><p>So I was thinking about using the Google Maps API for my app. Well, I've managed to load my KML file parsing it with a SAX parser and creating a custom overlay for my map.</p><p>It works, but there is a great problem:The placemarks aren't loaded dynamically in relation to my position. They are loaded from the start to the end, and are shown on the map 100 at time.</p><p>So it was going to be harder than I thought, because I'll have to get my position from the GPS and calculate only the nearest points and draw them on the map.</p><p>Second question:<strong>Does exist a built-in function to show only near-to-me placemarks on the map?</strong></p><p>Thank you, guys.</p>","252711","","","","","2011-01-21 15:34:43","Google Maps advanced features in a MapActivity (Google Maps API)","<android><api><android-intent><maps>","1","0","","",""
"4759270","1","4759515","","2011-01-21 13:24:39","0","1001","<p>I want to set an alarm at a particular date and time . iam getting my date and time with the webservice.i have parsed and splitted the date and time and used SimpleDateFormat and now i want to put this date and time in  [alarmManager.set(AlarmManager.RTC_WAKEUP,dt, pendingIntent );] but my alarm doesnot work on the given time</p><pre><code>       String str_date= hr+"":""+min+"":""+sec+"" ""+dat+""/""+mon+""/""+year;    SimpleDateFormat sdf = new SimpleDateFormat(""HH:mm:ss dd/MM/yyyy"");    ParsePosition position = new ParsePosition(0);    java.util.Date stringToDate = sdf.parse(str_date, position);     dt = stringToDate.getDate();</code></pre><p>Please help thanks in advance</p>","584493","","21234","","2011-01-21 13:37:40","2011-08-16 17:10:53","Alarm Manager problem in time setting","<android><android-alarms>","2","0","","",""
"4759306","1","","","2011-01-21 13:27:09","0","2531","<p>I have created a service which is supposed to receive the <code>android.bluetooth.device.action.ACL_DISCONNECTED/ACL_CONNECTED</code> events.</p><p>I am aware that services in android may be restarted/stopped when android decides.</p><p>However, I am wondering whether a service is always guaranteed to receive the events it registered for, even it has been killed by android?</p><p>I assume this means that android will need to restart a killed service which has registered to listen to events when that event takes place.Is the above assumption correct ?</p><hr><p>Thank you very much for the quick reply.</p><p>Let me give some more information, sample of the code follows:</p><pre><code>public class my_service extends Service {    @Override         public int onStartCommand(Intent intent, int flags, int startId) {           ...           IntentFilter filterDisconnected = new IntentFilter(BluetoothDevice.ACTION_ACL_DISCONNECTED);this.registerReceiver(mReceiverDisconnected, filterDisconnected);          ...    }    private final BroadcastReceiver mReceiverDisconnected = new BroadcastReceiver() {          @Override          public void onReceive(Context context, Intent intent) {              ...          }    }    ...}</code></pre><p>So with this code the BroadcastReceiver is implemented within the service class.</p><p>This code is working fine under normal cirmustances but are you saying that this is not proper and a different class (BroadcastReceiver ) is needed ?</p><p>If the above is proper, i  am wondering if this service class is stopped for any reason, when the relevant event is raised,  the class will be restarted and the BroadcastReceiver will get the event.</p>","584498","","476747","","2012-04-06 04:33:32","2012-04-06 04:33:32","A service will always receive the Broadcast Action that registered for?","<android><service><broadcastreceiver>","1","1","","",""
"4759392","1","4791786","","2011-01-21 13:36:49","3","3165","<p>how to get selected person email id  programmatically in android contacts   </p><p>that should support all version.i tried with people class but there primary email method is deprecated</p><p>Thanks in advance</p><p>Aswan</p>","1746300","","","","","2011-01-25 09:39:17","get email from android contact list","<android>","2","0","3","",""
"4759442","1","","","2011-01-21 13:40:57","1","162","<p>I've noticed that e.g. the Samsung Galaxy S allows apps to allocate much more memory (>24Mb) than a Droid (&lt;=24Mb) or a G1 (&lt;=16Mb) before OutOfMemoryExceptions are thrown. I'd like my app to scale to higher end devices like the Galaxy and take advantage of the higher allocation limit.</p><p>Is there a reliable way to detect how much memory my app can use? Is it risky to attempt to use e.g. 70% of the maximum memory reported? Otherwise, I'd need to limit my app to what the G1 allows to guarantee my app won't crash.</p>","580100","","","","","2011-01-21 13:40:57","Making the most of available memory on higher end devices?","<java><android>","0","9","","",""
"4759487","1","","","2011-01-21 13:47:13","2","1442","<p>On galaxy S the zoom controls work on multitouch, but on HTC Legend, the same code doesnt work. What is the matter?</p>","472537","","","","","2011-01-21 23:03:30","Android webview multitouch zoom not work in HVGA","<android><webview>","2","1","","",""
"4759500","1","4759501","","2011-01-21 06:28:37","6","4829","<p>Using AdMob, how can I give an advertisement in an Android Application?</p>","584040","AndroidDanger","","","","2013-08-10 17:51:54","How do I use Admob on the Android OS?","<android><admob>","2","0","5","",""
"4759566","1","4759656","","2011-01-21 13:54:40","1","319","<p>I am just about complete building an application.  I've tested it on 1.6-2.3 android versions.  My concern is how to distribute it.  Does each phone already have the google apis installed?  In particular one portion of my application is using the com.google.android.maps.* features.  When developing I have to use a separate google apis library for each android version.  Do I need to bundle the library for each version with my application?</p><p>Thanks in advance for any insight into this matter.</p>","147862","","","","","2011-01-21 14:01:57","Supporting Multiple Android Versions using the Google APIs Add On","<android><api><google-maps><version>","1","0","","",""
"4759569","1","","","2011-01-21 13:54:49","0","753","<p>Hi i'm trying to make search suggestions but when i query the database to get word matches, i get an error. Here's what i got so far:</p><pre><code>public static final String WORD = SearchManager.SUGGEST_COLUMN_TEXT_1;public static final String CATEGORY = SearchManager.SUGGEST_COLUMN_TEXT_2;private static final String FTS_VIRTUAL_TABLE = ""Sign"";private Context context;private static final HashMap&lt;String,String&gt; mColumnMap = buildColumnMap();public DictionaryDatabase(Context context) {    mDatabaseOpenHelper = new DictionaryOpenHelper(context);    this.context = context;}private static HashMap&lt;String,String&gt; buildColumnMap() {    HashMap&lt;String,String&gt; map = new HashMap&lt;String,String&gt;();    map.put(WORD, ""Word"");    map.put(CATEGORY, ""Category"");    map.put(BaseColumns._ID, ""rowid AS "" +            BaseColumns._ID);    map.put(SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID, ""rowid AS "" +            SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID);    map.put(SearchManager.SUGGEST_COLUMN_SHORTCUT_ID, ""rowid AS "" +            SearchManager.SUGGEST_COLUMN_SHORTCUT_ID);    return map;}public Cursor getWord(String rowId, String[] columns) {    String selection = ""rowid = ?"";    String[] selectionArgs = new String[] {rowId};    return query(selection, selectionArgs, columns);}public Cursor getWordMatches(String query, String[] columns) {    String selection = mColumnMap.get(WORD) + "" MATCH ?"";    String[] selectionArgs = new String[] {query+""*""};    return query(selection, selectionArgs, columns);}private Cursor query(String selection, String[] selectionArgs, String[] columns) {    SQLiteQueryBuilder builder = new SQLiteQueryBuilder();    builder.setTables(FTS_VIRTUAL_TABLE);    builder.setProjectionMap(mColumnMap);    Cursor cursor = builder.query(mDatabaseOpenHelper.getReadableDatabase(),            columns, selection, selectionArgs, null, null, null);    if (cursor == null) {        return null;    } else if (!cursor.moveToFirst()) {        cursor.close();        return null;    }    return cursor;}</code></pre><p>and here's the error log:</p><pre><code>01-21 14:29:03.503: WARN/SuggestionsAdapter(6413): Search suggestions query threw an exception.01-21 14:29:03.503: WARN/SuggestionsAdapter(6413): android.database.sqlite.SQLiteException: SQL logic error or missing database01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at android.database.sqlite.SQLiteQuery.native_fill_window(Native Method)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:70)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:283)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:264)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:171)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:248)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at com.example.android.searchabledict.DictionaryDatabase.query(DictionaryDatabase.java:156)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at com.example.android.searchabledict.DictionaryDatabase.getWordMatches(DictionaryDatabase.java:118)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at com.example.android.searchabledict.DictionaryProvider.getSuggestions(DictionaryProvider.java:126)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at com.example.android.searchabledict.DictionaryProvider.query(DictionaryProvider.java:99)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at android.content.ContentProvider$Transport.query(ContentProvider.java:163)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at android.content.ContentResolver.query(ContentResolver.java:245)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at android.app.SearchManager.getSuggestions(SearchManager.java:760)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at android.app.SuggestionsAdapter.runQueryOnBackgroundThread(SuggestionsAdapter.java:166)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at android.widget.CursorFilter.performFiltering(CursorFilter.java:49)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at android.widget.Filter$RequestHandler.handleMessage(Filter.java:234)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at android.os.Handler.dispatchMessage(Handler.java:99)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at android.os.Looper.loop(Looper.java:123)01-21 14:29:03.503: WARN/SuggestionsAdapter(6413):     at android.os.HandlerThread.run(HandlerThread.java:60)</code></pre><p>how can i fix this issue? i don't where i'm doing wrong.</p><p>Thanks in advance!</p>","499488","","180538","","2011-01-21 14:00:26","2011-01-21 14:00:26","sqlite problem in android","<android><sqlite>","0","2","","",""
"4759676","1","4759887","","2011-01-21 14:04:10","17","7858","<p>I have a service with a handler that has to write ""Hello"" in the logcat every 5 seconds. But it doesn't write nothing on the logcat... It's like the service is not executing, and I put a breakpoint on it and the debug mode never stops on the breakpoint.</p><p>I start the service, in the first activity of my app, with this:</p><pre><code>startService(new Intent(GPSLoc.this, MyServiceNotifications.class)); //enciendo el service</code></pre><p>I am sure that the code <code>startService</code> is executed because it is called before starting another activity, and the other activity starts.</p><p>This is the code of my service:</p><pre><code>public class MyServiceNotifications extends Service {boolean serviceStopped;private Handler mHandler;private Runnable updateRunnable = new Runnable() {    @Override public void run() {        if (serviceStopped==false)        {            createNotificationIcon();        }        queueRunnable();    }};private void queueRunnable() {    mHandler.postDelayed(updateRunnable, 5000); //600000 : cada 10 minutos, comprueba si hay nuevas notificaciones y actualiza la notification BAR}@Overridepublic IBinder onBind(Intent intent) {    return null;}@Overridepublic void onCreate() {    serviceStopped=false;    ////////////////////////////////////////MANEJADOR SIMILAR A UN HILO    mHandler = new Handler();    queueRunnable();    /////////////////////////////////////// FIN MANEJADOR}@Overridepublic void onDestroy() {    serviceStopped=true;}@Overridepublic void onStart(Intent intent, int startid) {}    public void createNotificationIcon()    {        Log.d(""MyServiceNotifications"", ""Hello"");    }}</code></pre>","479886","","496830","","2011-12-09 22:03:48","2013-09-14 03:19:29","Why is this simple service not starting?","<android><service>","4","3","4","",""
"4759720","1","4759780","","2011-01-21 14:08:12","0","3361","<p>I'm trying to display a message stating what the user clicked, or pressed with their finger.</p><pre><code>public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {   Toast.makeText(layout_4.this, ""you clicked something with a number of "" + Integer.toString(value), Toast.LENGTH_SHORT).show();}</code></pre><p>This displays (with say pressing box 4)</p><p>you clicked something with a number of4</p><p>How can I get it to not add a line break before the number?</p>","584531","","180538","","2011-01-21 14:09:35","2011-04-04 15:01:51","Android toast: appending int to string causes line break","<android><string><integer><toast>","2","1","","",""
"4759818","1","","","2011-01-21 11:37:44","17","48853","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4068559/removing-address-bar-from-browser-to-view-on-android"">Removing address bar from browser (to view on Android)</a>  </p></blockquote><p>I'm trying to run a web-based application in Android, and I want to hide the webpage address bar while running the application. Is that possible? How do I do it?</p>","","prateekraj","","","","2012-11-02 15:24:19","How to hide the address bar of a webpage in android?","<android><javascript><html>","3","1","6","2012-01-10 21:05:28",""
"4759859","1","4766447","","2011-01-21 14:21:42","0","841","<p>I have app in the android marketI add to this app admob ,I can see the advertisement in the test mode.so I upload a upgrade version to the market.after that I download the app to my device but I dont see there nothing.On the website of admob I can see 635 Requests but no money 0.0$So what is the reason that the advertisement don't show up?</p><p>ThanksBeno</p>","577616","","","","","2011-01-22 06:04:49","Can't see admob on real android device","<android><admob>","1","1","","",""
"4759907","1","4760447","","2011-01-21 14:27:09","8","6819","<p>I'm currently developing an app that has the potential to create a very large database. I had planned on installing the app on the SD card to allow for some extra room. Recent dealings here have warned me that that might not be a good idea. Are there any steps I can take to mitigate the danger of this course of action? Or are there any better alternatives?</p>","543677","","135152","","2011-07-05 17:50:08","2011-11-24 16:06:40","Dealing with a large database in Android","<android><sqlite>","4","0","3","",""
"4759950","1","4768942","","2011-01-21 14:30:37","2","616","<p>I've been working with a custom ExpandableList (see example picture below) where each item always has one child. This child consists of three parts. Each part has a header (red bars) and below that an Empty item OR a list of items. The length of this list will vary.</p><p>The first way I tried to do this is by adding a ViewStub below the empty item, which I inflated with a custom view, which also contained a ViewStub at the end which I inflated in turn for the next item, thus adding items recursively to create this sort of list of items. Sadly this resulted in StackOverflowError's when the list became too long (With short lists this worked perfectly).</p><p>So on my second try I tried using a ListView with a custom adapter instead. Sadly this list only used a small part of my screen and the rest of the items where occluded behind the header of the next part (This mini list looked scrollable as a second scrollbar appeared next to it, but it did not scroll. Not that I would consider this scrolling inside a scrolling list to be a good solution, but just wanted to mention this).</p><p>Can anyone tell me how I can tell this list of items to not be scrollable and take up all the room that it needs (does it know what size it is going to be when the child node is created??) or help me with a alternative solution to my problem? (Ooh, and I have considered putting an unholy amount of ViewStubs inside my layout, but that just seems idiotic and really bad practice. Correct me if I'm wrong)</p><p><img src=""http://i.stack.imgur.com/7sZDJ.jpg"" alt=""alt text""></p>","562365","","","","","2011-01-22 16:14:30","How to use a ListView inside a ExpandableList?","<android><listview><expandablelistview>","1","1","2","",""
"4759962","1","4760045","","2011-01-21 14:31:36","0","288","<p>I am having a default layout from which i have to inflate new layout..My code is here   </p><pre><code>super.onCreate(savedInstanceState);     setContentView(R.layout.mydeals_list);     list_layout=(RelativeLayout) findViewById(R.id.mydeals_list_layout);</code></pre><p>If this condition satisfies i want new Layout how i can hide the R.layout.mydeals_list layout and make new layout Visible</p><pre><code>if(Signin.login_flag){     list_layout.setVisibility(View.GONE);     LayoutInflater inflater = (LayoutInflater) DbServerActivity.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);     final View layout = inflater.inflate(R.layout.slider, (ViewGroup)findViewById(R.id.slider_main_layout));</code></pre><p>---------Place i want to display new layout ----------------</p><pre><code>         Animation slideUpIn = AnimationUtils.loadAnimation(DbServerActivity.this,R.anim.slide);         slide_layout.startAnimation(slideUpIn);      }</code></pre>","555221","","321697","","2011-01-21 14:45:33","2011-01-21 14:45:33","Animation in Android","<android>","1","0","","",""
"4759977","1","","","2011-01-21 14:33:17","5","2738","<p>Please tell following: -<br>1. What is jquery mobile?.<br>2. Knowledge of which language is required to work with it?.<br>3. Whether its purpose is just to create web sites, which looks good on all smart phones?.<br>4. <strong>Is it capable to create Games for Android?</strong> If yes, which tools are required for that?. </p><p><em>Comments to Responders</em></p><p>@ hunter: Thanks, your Quoted introduction properly guides. Regarding ""pain of creating Apps for different Smart phones"", I want to say that with Phonegap, an App can be deployed to all major Smart phones with some code tweaking, as I read here. The referred Javasript Games are also good.</p><p>@ altcognito: Thanks.</p><p>@ Nick Campion: I am talking about those Type of high profile rich UI games, which are created with java for Android. Whether such type of games can be created with jQuery Mobile?</p><p>@ BandsOnABudget: thanks</p><p>@ Knossos: thanks and please tell, are you talking about browser based web games?</p>","514892","","54680","","2011-01-24 14:29:51","2011-01-27 09:26:04","What is jQuery Mobile?. Is it capable to Create Games for Android?","<jquery><iphone><android><jquery-mobile>","3","2","","",""
"4760058","1","4760518","","2011-01-21 14:41:22","0","1164","<p>Trying to understand best practice for the lifecycle of my android application, and how activities fit into it.</p><p>For example, I have a main activity, sort of the ""home"" of my application.  But, on start-up there are several activities that I 'might' need to run, depending on several cases, one being that it is the first time the app's been run.</p><p>Is best practice to call these 'start-up'/house-keeping activities FROM my 'home' activity?  Or should the application begin with a 'house-keeping' activities, do the work, then finish() and start the 'home' activity?</p><p>Thanks for advice about this,</p><p>-- J</p>","561534","","","","","2012-11-25 06:43:31","Best Practices for Activity Flow in Android Applications","<android><activity><activity-lifecycle>","3","0","","",""
"4760205","1","","","2011-01-21 14:54:57","1","1935","<p>I have a singleton class that creates a connection to a Sqlite db and runs queries. I need to pull the database stuff out of the Singleton and create a database handler class.My question is: Does the database handler class also need to be a Singleton?Thanks.</p>","552447","","21234","","2011-01-21 15:01:55","2011-01-21 15:18:24","Singleton - database connection to Sqlite","<android><sqlite><singleton>","2","1","","",""
"4760225","1","10448382","","2011-01-21 14:57:10","6","11879","<p>I am developing a mobile version of my website which I am testing on my Samsung Galaxy S <strong>android</strong> mobile device running <strong>Froyo (2.2)</strong>.</p><p>I would like to , when viewed with the standard internet browser, have a <strong>fixed header</strong> and a *<em>fixed foote</em>*r ( which are always visible on screen) with the contents of the pages scrollable in between.</p><p>I tried all sorts of combinations with padding of body and the sorts (which seem to work when viewed on a browser on the pc), but can't seem to find a solution.</p><p>Can anybody help here ?</p><p>Note: if I try something like this :</p><pre><code>&lt;div id=""header"" style=""position:absolute; top:0px; left:0px;height:200px;overflow:hidden;""&gt;&lt;/div&gt; &lt;div id=""content"" style=""position:absolute; top:200px; bottom:200px; left:0px;overflow:auto;""&gt;&lt;/div&gt; &lt;div id=""footer"" style=""position:absolute; bottom:0px; height:200px; left:0px;overflow:hidden;""&gt;&lt;/div&gt; </code></pre><p>Both the header and footer are fixed but the content is not scrollable , e.g. it also appears fixed .</p><p>It might be the browser of the Android Froyo 2.2 of course.</p><p>Anyone ?</p>","231181","","","","","2012-05-10 23:02:34","Fixed header and footer in mobile version a website","<android><html><css><android-2.2-froyo><mobile-website>","4","0","4","",""
"4760254","1","","","2011-01-21 15:00:13","0","562","<p>I am planning to create an application which protects images from unauthorized access by anyone. What I'm planning to do is protect the images by putting a password in the image so that every time I view the image it will prompt to input first the password assigned. How can I do this? or is it possible?</p>","516160","","","","","2013-09-25 07:46:58","Password Protection for Images on Android","<java><android><eclipse><password-protection>","2","5","","",""
"4760284","1","","","2011-01-21 15:03:37","1","1921","<p>I am looking for a way in Android how to place some transparent buttons over a (background)image so i have good control to position the buttons and they stay were they meant to be also if the screen is much larger. </p><p>As you can imagine the image contains also the button art... </p><p>The best thing would be if I could position the buttons by using percentage, but sadly this is not possible in android.</p><p>This is my current base of the 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=""fill_parent""     android:background=""@drawable/art_main_background"" &gt;</code></pre><p>As an alternative, I could also extract the button art and place them over the image, but this would lead to the same problem, how can I control the position if the buttons are not in a 'linear' kind of order, i.e. rather random.</p>","408659","","321697","","2011-01-21 16:04:24","2011-01-21 16:04:24","How to place transparent buttons over an image relatively?","<android><button><background><position><relative>","1","0","","",""
"4760392","1","","","2011-01-21 15:15:35","1","1184","<p>I have an application in android which receives SMS in a specific port. When my application is not running or it is running in background, how can i get the application to foreground and receive the SMS automatically?Currently it is not receiving an SMS when it is in background. The SMS is only received by the native Messages application.</p><p>Also  I want to use sendOrderedBroadcast because my messages should not be stored in native message inbox. So, i have to use sendOrderedBroadcast. Does anyone have an example code for how to do this?</p><p>Thanks in advance</p>","543133","","","","","2011-03-25 23:28:17","How to bring application to foreground when SMS is received in Android","<android>","1","0","","",""
"4760609","1","4760756","","2011-01-21 15:37:06","1","353","<p>In the Android app I'm writing I want my activity to display my company's logo and then launch a new activity three seconds after. I have the layout done and the graphic in the right place but I don't know how to make the timer. </p><p>What is the simplest, shortest way to create the three second timer?</p><p>Thank you very much in advance for all of the responses I receive.</p>","473481","","","","","2012-11-30 09:40:07","What is the simplest way to make a three second timer in Android?","<java><android><timer><activity>","3","0","","",""
"4760677","1","4795071","","2011-01-21 15:41:59","0","1604","<p>I have an app in which I display nine views within a 3x3 GridView using an adapter class. Within each of the nine views that are contained within the cells of the GridView, I use Canvas and Paint objects to display a 2-dimensional line graphic; these line graphics are subsequently modified and re-displayed by invoking the invalidate() method of each view.</p><p>The line graphics in all nine views are displayed correctly when the views are created in the Adapter class’s overridden getView() method, but when I attempt to modify and then redisplay the line graphics subsequently, all of the views are refreshed successfully <em>except</em> for the <em>first</em> view in the top-left-hand corner of the grid, which continues to show the original line drawing. I’ve stepped through my code to establish that the first view is definitely being invalidated, and it is, so I’m baffled as to why the call to the invalidate() method on the first view doesn’t cause it to be redrawn, while the same call on all of the remaining views causes them to be redrawn successfully. I’ve also logged calls to the view’s onDraw method, and this shows that the first view’s onDraw method is called each time, so I’m pretty sure this problem is not being caused by any bugs in the application code.</p><p>The code that modifies and refreshes the nine views is as follows:</p><pre><code>void updateViews(int parentTestCanvas) {    TestCanvasView testCanvas = testCanvass[parentTestCanvas];    double[] parentGenome = testCanvas.getGenome();    // Assign the parent genome to the testCanvass in the array    // The inherited genome will be subject to mutation in all cases except the first testCanvas    for(int testCanvasItem = 0; testCanvasItem &lt; TestCanvasApp.geneCount; testCanvasItem++) {        testCanvas = testCanvass[testCanvasItem];        testCanvas.setGenome(parentGenome);        // Invalidate the testCanvas view to force it to be redrawn using the new genome        testCanvas.invalidate();    }}</code></pre><p>The onDraw method in the TestCanvasView class is as follows:</p><pre><code>protected void onDraw(Canvas canvas) {    float xOrigin = getMeasuredWidth() / 2;    float yOrigin = getMeasuredHeight() / 2;    canvas.drawPaint(cellPaint);    canvas.translate(xOrigin, yOrigin);    drawBranch(canvas, linePaint, 0, 0, this.length, this.direction, this.xInc, this.yInc, this.scale);    Log.d(""TestCanvasView"", ""Drawing testCanvas "" + mCellIndex);}private void drawBranch(Canvas canvas, Paint linePaint, double startX,        double startY, double branchLen, int branchDir, double[] xInc,        double[] yInc, double scale) {    branchDir = (branchDir + 8) % 8;    double newX = startX + branchLen * xInc[branchDir];    double newY = startY + branchLen * yInc[branchDir];    canvas.drawLine((float) (startX / scale), (float) (-startY / scale),            (float) (newX / scale), (float) (-newY / scale), linePaint);    if (branchLen &gt; 1) {        drawBranch(canvas, linePaint, newX, newY, branchLen - 1, branchDir + 1, xInc, yInc, scale);        drawBranch(canvas, linePaint, newX, newY, branchLen - 1, branchDir - 1, xInc, yInc, scale);    }}</code></pre><p>Anyone got any ideas as to why the first view is not being redrawn?</p>","584656","","","","","2011-01-25 15:08:11","When invalidate method called on an array of Views, the first View is not redrawn","<android><view><invalidate>","2","0","","",""
"4760723","1","","","2011-01-21 15:46:20","2","1521","<p>I've managed to simulate a <em>fake</em> sdcard on Android 2.2, so that when I don't have a real sdcard, applications that need sdcard will still work. To achieve this, I borrowed some code from the Android-x86 project's extended version of `vold', and did the following: </p><pre><code># dd if=/dev/zero of=/data/sdcard.img bs=1024 count=1 seek=1000000 (1GB image, a sparse file)# busybox losetup /dev/block/loop7 /data/sdcard.img# newfs_msdos /dev/block/loop7</code></pre><p>The problem is, when a real sdcard is inserted, I wish to use both of them without switching back and forth between them - namely, a `dual sdcard setup' on a system which only allows one sdcard. How can this be achieved?</p><hr><p>Personally I'm not quite familiar with the Android system (actually today is my second day working on an Android project). I was told that the 2.2 version only supports one sdcard mounted on ""/mnt/sdcard"", applications that read/write sdcard will follow this path. I'm not quite sure about this. Can someone please shed me some light on the Android sdcard limitations and how its presence affects applications?</p>","489571","","","","","2011-01-21 15:46:20","How to make a simulated SD card (an image) work together with a real one in Android 2.2?","<android><linux><embedded><android-sdcard>","0","1","","",""
"4760771","1","4760865","","2011-01-21 15:50:56","4","1114","<p>I'm implementing an EditText that is used to obtain an rtsp URI from the user. Though it's not a huge issue functionally, I would like to disable the default behavior of the on screen keyboard where the state of the caps key is enabled for the first character of every sentence. From what I've gathered, this cannot be done in the XML via <code>android:inputType</code> flags.  Any pointers as to how to do this programatically would be helpful.</p><p>I'd like to include the code, but the nature of the project prevents me from doing so.  But I can say that nothing fancy is being done here.  The EditText itself has no other input flags in use, and the only IME option in place is the flag to disable the Extract UI in landscape.  The layout is implemented via XML, not programatically, so there are no custom classes or extensions in the mix either.</p><p><strong>EDIT:</strong>  The <code>android:capitalize</code> constant inherited from <code>TextView</code> isn't working.  I'm specifically targetting 2.2 on a Galaxy Tab, so I don't know if this has something to do with Samsung's OS tweaks, or if it has something to do with the <code>capitalize</code> constant being deprecated.</p><p><strong>EDIT 2:</strong>  Swype is the culprit for not allowing the use of the <code>capitalize</code> constant.  Does anyone know if there is a way to make Swype play nice without having to inform the end user to disable Swype?</p>","411216","","411216","","2011-01-21 16:30:28","2011-02-01 00:03:59","UPDATE: This is now a Swype related issue: Disable the automatic capitalizing of a sentence's first character in an EditText","<android>","3","0","","",""
"4760830","1","","","2011-01-21 15:57:22","2","1074","<p>I'm currently working on an Android application that have different behaviors according to the screen orientation.</p><p>I'm using  getWindowManager().getDefaultDisplay().getRotation() to get the screen orientation in the onCreate() method and manage from there. </p><p>Basically, my problem is that I need a control over the orientation. In landscape mode, when the user decides it, the application must switch to portrait mode, and stays like that, but only until the use goes to portrait mode, and then again to landscape.</p><p>I'm using setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) to change the orientation when in Landscape. The problem is, using this, I can not go back to landscape.If I use setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) in onCreate(), the problem is that is switches back to landscape mode after a few seconds (since the screen is still in landscape).</p><p>Is there any other way to manage this? Basically, is there a way to catch the screen orientation change with a listner (or anywhere else than in onCreate, since it's not called when the views is locked in portrait mode)? I can't find anything about that... </p><p>Any idea is welcome!</p><p>Thanks!</p>","483291","","","","","2011-04-06 08:16:56","Android - Handle Screen Orientation","<android><screen-orientation><onconfigurationchanged>","1","1","1","",""
"4760970","1","4761334","","2011-01-21 16:09:22","3","76","<p>Here is my problem:<br><img src=""http://i.stack.imgur.com/fGu3I.png"" alt=""The problem""><br>The keyboard covers up the EditText. How can I prevent this from happening? Here is my original view (without the keyboard):<br><img src=""http://i.stack.imgur.com/OPqBW.png"" alt=""Original""></p>","200477","","","","","2011-01-21 16:41:07","Make entire EditText viewable?","<java><android><edittext><android-softkeyboard>","1","0","0","",""
"4761052","1","4762815","","2011-01-21 16:17:11","17","9685","<p>The app uses the <a href=""http://developer.android.com/reference/android/location/Geocoder.html"">Geocoder</a> object. It works fine on my stock Froyo Nexus One. But then I run the exact same app on a different device (an Advent Vega 10"" tablet also running Froyo) and I get this exception: <em>Service not Available</em>. The method I'm using is <code>getFromLocationName()</code>, I'm building against the Android 1.6 Google API.</p><p>I'm aware of an issue where this exception is thrown on the emulator, but I suspect this is different. Why would it be thrown on one device running Froyo but not another?</p><p>The app is a location app, and as the tablet has no GPS or mobile network, in a scenario where the Wi-Fi connection doesn't provide a location, the user must manually specify it, so not being able to use the Geocoder object is bad news.</p><p>I could add a way for the user to select the location on a map, but it's not ideal. Possibly I could use the Google Maps API directly, but I'm keen to understand the nature of the issue first as would be nice to have an easier solution.</p><p>Hopefully in a future release Android will include an OS-level ""default location"" for non-Geocoder devices, so location-aware apps work out of the box on devices like Google TV.</p>","477415","","","user1521536","2013-03-26 10:51:14","2013-11-27 15:55:40","Why is Android Geocoder throwing a ""Service not Available"" exception?","<android><google-geocoder>","4","2","5","",""
"4761126","1","4762010","","2011-01-21 16:23:11","2","4456","<p>I have a <code>listpreference</code>. No matter how I copy the code here, it appears wrong, so I just copy the matter of it:</p><pre><code>string-array name=""listArray""items: Mercedes, Audi, Porschestring-array name=""listValues""items: car1, car2, car3</code></pre><p>I have this code in the <code>preferences.xml</code> at the listpreference part:</p><pre><code> &lt;ListPreference          android:title=""List Preference""          android:summary=""This preference allows to select an item in a array""          android:key=""listPref""          android:defaultValue=""digiGreen""          android:entries=""@array/listArray""          android:entryValues=""@array/listValues"" /&gt;</code></pre><p>And this is the code I want to fetch the selected item with:</p><pre><code>   String listpref = preferences.getString(""listPref"", ""n/a"");    Toast.makeText(TutorialPref.this, ""Chosen item of ListPref:"" + listpref, Toast.LENGTH_LONG).show();</code></pre><p>Problem is, it returns the values not the items. So if I select Mercedes, the value I got is ""car1"".</p><p>How can I get ""Mercedes""? </p>","571648","","92837","","2011-11-10 08:45:09","2011-11-10 08:45:09","Android listpreference - fetching value","<android><listpreference>","2","0","","",""
"4761141","1","","","2011-01-21 16:24:14","1","5245","<p>I was wondering if there a class diagram available for Android API on the internet? I think it help you to learn and visualize the system in your head.</p><p>Thanks.</p>","146603","","","","","2011-11-13 01:32:15","Android API class diagram","<android><class-diagram>","3","0","","",""
"4761262","1","4761624","","2011-01-21 16:34:11","1","448","<p>I have been searching for the past few hours to the answer to a very dumb question. I know how to draw on the canvas in android if you extend the view class, modify onDraw and set setContentView() to a new instance of that class. However, I need to also have 2 TextViews and 2 EditTexts at the bottom of the activity and if setContentView() is set to only have that view, these views will, obviously, not display. How can put all of these on the screen?</p><p>EDIT: Here is my code: (the package name is android.physicsengine)</p><pre><code>package android.physicsengine;import android.app.Activity;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.os.Bundle;import android.util.AttributeSet;import android.view.View;import android.widget.EditText;import android.widget.RelativeLayout;public class ResultantForceEngine extends Activity {private EditText mag;private EditText dir;private View image;private RelativeLayout layout;protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.resultant_force);    mag = (EditText)findViewById(R.id.magnitude);    dir = (EditText)findViewById(R.id.direction);}public class MyView extends View{    public MyView(Context context){        super(context);    }    public MyView(Context context, AttributeSet attrs){        super(context, attrs);    }    public MyView(Context context, AttributeSet attrs, int defStyle){        super(context, attrs, defStyle);    }    @Override    protected void onDraw(Canvas canvas){        canvas.drawColor(Color.BLACK);        Paint circlePaint = new Paint(Paint.ANTI_ALIAS_FLAG);        circlePaint.setColor(Color.RED);        canvas.drawLine(canvas.getWidth()/2, canvas.getHeight()/2-200, canvas.getWidth()/2 ,canvas.getHeight()/2+200, circlePaint);        canvas.drawLine(canvas.getWidth()/2-200, canvas.getHeight()/2, canvas.getWidth()/2+200 ,canvas.getHeight()/2, circlePaint);    }}}</code></pre><p>and the xml</p><p></p><pre><code>&lt;view class=""android.physicsengine.ResultantForceEngine$MyView""              android:id=""@+id/image""              android:layout_alignParentLeft=""true""              android:layout_alignParentRight=""true""              android:layout_alignParentTop=""true""              android:layout_alignParentBottom=""true""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent"" /&gt;&lt;TextView     android:id=""@+id/magText""              android:text=""Magnitude (N) =""              android:textSize=""15dip""              android:layout_width=""wrap_content""              android:layout_height=""wrap_content""              android:padding=""3dip""              android:gravity=""center_vertical""               android:layout_alignParentLeft=""true""              android:layout_alignParentBottom=""true"" /&gt;    &lt;EditText android:id=""@+id/magnitude""              android:inputType=""numberDecimal""              android:layout_alignParentBottom=""true""               android:layout_toRightOf =""@id/magText""              android:layout_width=""wrap_content""              android:padding=""3dip""              android:layout_height=""wrap_content"" /&gt;    &lt;TextView android:id=""@+id/dirText""              android:text=""Angle (deg) =""              android:layout_width=""wrap_content""              android:layout_height=""wrap_content""              android:textSize=""15dip""              android:layout_alignParentBottom=""true""              android:layout_toRightOf =""@id/magnitude""              android:padding=""3dip""              android:gravity=""center_vertical"" /&gt;    &lt;EditText android:id=""@+id/direction""              android:inputType=""numberDecimal""              android:layout_alignParentBottom=""true""               android:layout_toRightOf =""@id/dirText""              android:layout_alignParentRight=""true""              android:layout_height=""wrap_content""               android:padding=""3dip""              android:layout_width=""wrap_content""/&gt;</code></pre><p></p>","583082","","1765573","","2013-07-25 10:07:39","2013-07-25 10:07:39","Drawing on a screen with other views in android","<android><android-layout><android-canvas><android-edittext><android-textview>","2","0","","",""
"4761280","1","4763102","","2011-01-21 16:35:23","0","800","<p>I was trying to read the HTTP messages between the browser in the Android simulator and other third party web-servers using <code>tcpdump</code>. However, since the browser can accept <code>gzip</code> content-encoding, I can't see the HTML content as plain-text in the <code>tcpdump</code> output. Is there a way to change the configs of the browser so that it doesn't send that <code>Accept-Encoding: gzip</code> header line?</p>","287810","","","","","2011-01-21 19:47:33","Disable gzip content-encoding in android simulator","<android><http><android-emulator>","1","0","1","",""
"4761284","1","4762517","","2011-01-21 16:35:31","3","874","<p>This is for Android which is a mobile device. Is a switch statement really more efficient? It takes more lines of code,, but that seems to be the more common approach.</p><pre><code>public void onClickWithSwitch(View v) {   switch(v.getId()) {       case R.id.buttonA:           buttonA();           break;       case R.id.buttonB:           buttonB();           break;       case R.id.buttonC:           buttonC();   }}public void onClickWithIf(View v) {   int id = v.getId();   if(id == R.id.buttonA)       buttonA();   else if (id == R.id.buttonB)       buttonB();   else if (id == R.id.buttonC)       buttonC();}</code></pre><p>So switch takes 10 lines and if takes 7. Why would switch be more common?</p>","463304","","","","","2011-01-21 18:39:50","Java: Why is switch more common than if for Android Events? It takes more lines of code.. is it better for performance?","<java><android><performance><if-statement><switch>","5","13","1","",""
"4761406","1","4761909","","2011-01-21 16:47:26","11","12627","<p>First I thought that I could find this list on the net, but I'm either looking for the wrong term or such list doesn't exist.</p><p>What I need is basically a cheat sheet of all predefined resource folders in an Android project. For example, a list could say something like this</p><ul><li>res/drawable - all graphics go here  </li><li>res/drawable-hdpi - all graphics of higher resolution go here  </li><li>res/layout - some-meaningful-description</li><li>res/values - some-meaningful-description</li><li>res/layout-land - some-meaningful-description</li><li>etc.</li></ul><p>I am really surprised that such list isn't easily found on the net. Whenever I need to add some resource I haven't used before, I have to look on the net for the correct naming (and I would rather look at the list of res folders). </p>","437039","","","","","2013-10-06 07:44:53","Complete list of all Android resource folders?","<android><resources>","4","1","4","",""
"4761467","1","4904232","","2011-01-21 16:53:34","2","1974","<p>i have a ringtone preference. How can i get the selection? I have the following kind-of-code:</p><pre><code>if(preferences.getString(""ringtonePref"", ""n/a"") != ??)            {                Toast.makeText(TutorialPref.this,   ""Chosen ringtone: silent"", Toast.LENGTH_LONG).show();            }            else if(preferences.getString(""ringtonePref"", ""n/a"") != ""DEFAULT_RINGTONE_URI"" )            {                Toast.makeText(TutorialPref.this,   ""Chosen ringtone: + default"", Toast.LENGTH_LONG).show();            }</code></pre>","571648","","","","","2011-02-05 00:23:03","Android ringtone preference - fetch data","<android><ringtone><preference>","1","0","1","",""
"4761502","1","4761536","","2011-01-21 16:57:40","6","2359","<p>I have to extract some information from a web page, and reformat it for the user.</p><p>Since the web page is somewhat regular, now I use HttpClient to retrive the HTML as a string, and I extract substrings in given locations with the relevant data.</p><p>Anyhow I'm wondering if there is a better way, maybe an HTML-aware way. How would you do it?</p><p>Cheers</p>","269931","","","","","2011-01-21 18:32:57","Parsing HTML from a web page","<java><android><html>","4","4","1","",""
"4761686","1","4761825","","2011-01-21 17:13:17","31","67974","<p>How can I set the background color of an Activity to white programatically?</p>","2144370","","321697","","2011-01-21 17:58:47","2013-12-30 11:48:56","How to set background color of Activity to white programmatically?","<java><android>","6","0","10","",""
"4761696","1","","","2011-01-21 17:13:49","0","4169","<p>I want to inject an external javascript in webview and execute one of its functions <code>execute()</code>. After completion an alert is raised and the string returns to the activity<br>this is how I do it but it doesn't seem to work (the js is already tested)</p><p><code>view.loadUrl(""javascript:(function() { var script=document.createElement('script');script.type='text/javascript';script.src="" + jsFileURL + "";"" + ""document.getElementsByTagName('head').item(0).appendChild(script);window.HTMLOUT.showHTML(execute());})()"");</code></p><p>this is how I implement HTMLOUT, while the alert is overrided in ChromeClient</p><p><code>browser.addJavascriptInterface(new MyJavaScriptInterface(), ""HTMLOUT"");    browser.setWebViewClient(new mWebViewClient());    browser.setWebChromeClient(new mChromeClient());    browser.loadUrl(""file:///android_asset/Travian comx2b.htm"");</code></p>","584736","","584736","","2011-01-22 14:50:24","2011-02-09 11:31:06","Android Inject in webview external js, execute function, and raise an alert","<javascript><android><webview><alert>","3","0","2","",""
"4761741","1","4794338","","2011-01-21 17:18:06","4","1390","<p>This code seems not to work in Landscape mode:</p><blockquote><pre><code>EditText destinationSearch = (EditText) findViewById(R.id.destinationSearch); </code></pre>    <p>destinationSearch.requestFocus(); InputMethodManager imm = (InputMethodManager)                        getSystemService(Context.INPUT_METHOD_SERVICE);<br>  imm.showSoftInput(destinationSearch, InputMethodManager.SHOW_IMPLICIT);</p></blockquote><p>Is there any solution to show the soft keyboard in Landscape mode ?</p>","358306","","188704","","2012-04-30 23:02:35","2012-04-30 23:02:35","Show soft keyboard when the device is landscape mode","<java><android><landscape><android-softkeyboard>","1","1","1","",""
"4761800","1","","","2011-01-21 17:23:28","21","11648","<p>I have a layout that contains some text fields and has a background image that's displayed at the top of my activity.  I'd like the background image to scale to wrap the content (don't care about aspect ratio).  However, the image is larger than content, so the layout instead wraps the background image.  Here's my original code:</p><pre><code>&lt;RelativeLayout     android:layout_width=""fill_parent""    android:id=""@+id/HeaderList""     android:layout_gravity=""top""    android:layout_height=""wrap_content""     android:background=""@drawable/header""&gt;    &lt;TextView         android:layout_height=""wrap_content""        android:layout_width=""wrap_content""         android:id=""@+id/NameText""        android:text=""Jhn Doe""         android:textColor=""#FFFFFF""        android:textSize=""30sp""         android:layout_alignParentLeft=""true""        android:layout_alignParentTop=""true""         android:paddingLeft=""4dp""        android:paddingTop=""4dp""     /&gt;    &lt;TextView         android:layout_height=""wrap_content""        android:layout_width=""wrap_content""         android:textColor=""#FFFFFF""        android:layout_alignParentLeft=""true""        android:id=""@+id/HoursText""        android:text=""170 hours""         android:textSize=""23sp""        android:layout_below=""@+id/NameText""         android:paddingLeft=""4dp""     /&gt;&lt;/RelativeLayout&gt;</code></pre><p>After searching through some other questions, I found these two:</p><p><a href=""http://stackoverflow.com/questions/4312133/how-to-wrap-content-views-rather-than-background-drawable"">How to wrap content views rather than background drawable?</a></p><p><a href=""http://stackoverflow.com/questions/1400782/android-scale-a-drawable-or-background-image"">Scale a Drawable or background image?</a></p><p>Based on this, I created a FrameLayout w/ an ImageView showing the background.  Unfortunately, I still can't get it to work.  I want the height of the background image to shrink/expand w/ the size of the text views, but with the FrameLayout, the ImageView fits to the size of it's parent, and I can't find a way to make the parent fit to the size the text view layout.  Here's my updated code:</p><pre><code>&lt;FrameLayout     android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" &gt;    &lt;ImageView android:src=""@drawable/header""        android:layout_width=""fill_parent""         android:scaleType=""fitXY""        android:layout_height=""fill_parent""         /&gt;    &lt;RelativeLayout         android:layout_width=""fill_parent""        android:id=""@+id/HeaderList""         android:layout_gravity=""top""        android:layout_height=""wrap_content""        &gt;        &lt;TextView             android:layout_height=""wrap_content""            android:layout_width=""wrap_content""             android:id=""@+id/NameText""            android:text=""John Doe""             android:textColor=""#FFFFFF""            android:textSize=""30sp""             android:layout_alignParentLeft=""true""            android:layout_alignParentTop=""true""             android:paddingLeft=""4dp""            android:paddingTop=""4dp""             /&gt;        &lt;TextView             android:layout_height=""wrap_content""            android:layout_width=""wrap_content""             android:textColor=""#FFFFFF""            android:layout_alignParentLeft=""true""             android:id=""@+id/HoursText""            android:text=""170 hours""             android:textSize=""23sp""            android:layout_below=""@+id/NameText""             android:paddingLeft=""4dp""             /&gt;    &lt;/RelativeLayout&gt;&lt;/FrameLayout&gt;</code></pre><p>Does anybody have any suggestions for how best to make an image scale to the size of the contents of some layout?  I'm not concerned with the aspect ratio of the image, as it won't matter, I just want it to fill the background.</p><p>Thanks!</p>","433792","","433792","","2011-01-21 17:44:36","2013-07-23 04:57:00","Scale background image to wrap content of layout","<android><background><android-linearlayout><relativelayout><framelayout>","9","2","5","",""
"4761866","1","5064910","","2011-01-21 17:28:44","1","1706","<p>I am using code (not written by me) with dependencies on GSON libraries. I have downloaded the libraries and when I try to include them in the project I get a duplication error. Specifically:</p><pre><code>Error generating final archive: Found duplicate file for APK: assembly-descriptor.xml</code></pre><p>Here's a screenshot of the error:<img src=""http://i.stack.imgur.com/7AQuw.png"" /></p><p>I don't have a lot of experience with using external libraries. Can anyone help me out?</p><p>Thanks in advance.</p>","348261","","","","","2011-10-30 10:08:52","Does anyone know how to get rid of this error while trying to use GSON libraries?","<android><libraries><apk><gson><duplication>","3","0","","",""
"4761888","1","4762015","","2011-01-21 17:30:56","18","14355","<p>When I was trying to use this code to enable preferences into my app</p><pre><code>import android.app.Activity;import android.content.SharedPreferences;import android.os.Bundle;import android.preference.Preference;import android.preference.PreferenceActivity;import android.preference.Preference.OnPreferenceClickListener;import android.widget.CheckBox;import android.widget.CompoundButton;import android.widget.RadioButton;import android.widget.Toast;import android.widget.CompoundButton.OnCheckedChangeListener;public class Preferences extends PreferenceActivity {private RadioButton btn01;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    addPreferencesFromResource(R.xml.preferences);    btn01 = (RadioButton)findViewById(R.id.RadioButton01);    Preference customPref = (Preference) findPreference(""customPref"");    customPref.setOnPreferenceClickListener(new OnPreferenceClickListener(){        public boolean onPreferenceClick(Preference preference) {            Toast.makeText(getBaseContext(),""The Custom Preference Has Been Clicked"",Toast.LENGTH_LONG).show();            SharedPreferences customSharedPreference = getSharedPreferences(""myCutomSharedPrefs"", Activity.MODE_PRIVATE);            SharedPreferences.Editor editor = customSharedPreference.edit();            editor.putString(""myCustomPref"",""The preference has been clicked"");            editor.commit();            return true;        }        public void CheckBox() {            final CheckBox ThisCheckBox = (CheckBox) findViewById (R.id.checkboxPref);            ThisCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener(){                @Override               public void onCheckedChanged(CompoundButton compoundButton,boolean test) {                    if (ThisCheckBox.isChecked()){                         btn01.setVisibility(0);                    } else {                        btn01.setVisibility(2);                    }                }            });        };    });}}</code></pre><p>An error is generated on this line</p><pre><code> public void onCheckedChanged(CompoundButton compoundButton,boolean test) {</code></pre><p>saying:</p><pre><code>Multiple markers at this line- The method onCheckedChanged(CompoundButton, boolean) of type new  CompoundButton.OnCheckedChangeListener(){} must override a superclass method- implements  android.widget.CompoundButton.OnCheckedChangeListener.onCheckedChanged </code></pre><p>If i remove the @Override annotation then the code doesn't work and a warning tells me that the that part of the code is not used locally.</p><p>Having run this past someone and baffling them I was wondering if you could help?</p><p>Are there any common scenarios that causes this error?</p><p>I thought it might be my project set up</p><p>Thanks  </p>","562562","","","","","2011-05-31 19:39:25","@Override annotation error (android prefs)","<android><annotations><override><android-preferences>","3","0","5","",""
"4761898","1","4766729","","2011-01-21 17:32:01","0","1261","<p>I am performing a simple delete of a ormlite object. The code is below. But no matter what, the object never get deleted.</p><pre><code>Dao&lt;Subscription, Object&gt; dao = helper.getSubscriptionDataDao();dao = helper.getSubscriptionDataDao();QueryBuilder&lt;Subscription, Object&gt; query = dao.queryBuilder();query.where().eq(""key"", subKey);Subscription sub = dao.queryForFirst(query.prepare());int r = dao.delete(sub); // r is 1</code></pre><p>Am I missing anything here?</p>","42340","","","","","2012-09-23 07:00:06","OrmLite delete failed","<android><sqlite><ormlite>","2","1","1","",""
"4762011","1","","","2011-01-21 17:45:00","5","88","<p>First off, I'm totally brand new to any kind of coding.  I started trying to make an app with App Inventor, but it became too big for that and couldn't do exactly what I was wanting.  So now I'm attempting to do it all from scratch.</p><p>I think I'm getting things figured out, but I'd like to check and see if this makes sense before I got and build the whole thing.</p><p>What I'm aiming for is a main screen with a bunch of buttons on it.  Each of those buttons will take you to a set of directions that is a series of pictures and text that you can flip through.  </p><p>What I'm thinking is to make an activity for the main screen and one for each set of directions.  On the main one, I put a table layout which contains all the buttons.  Each of the directions sets will be its own activity with a view flipper to go through all the pics/text.</p><p>Does that make sense?  Is there a better way to do this or is this good?  Thanks!</p>","584786","","","","","2011-01-21 19:38:34","Does this set up for my app make sense?","<android>","2","0","1","",""
"4762027","1","","","2011-01-21 17:46:46","4","2314","<p>I want to have an EditTextPreference that will disable the OK button if there is no text in the EditText field. I created a custom EditTextPreference class and I am able to get the EditText object and set a TextWatcher, but I can't find a way to disable the button. It looks like I just don't have access to the OK and Cancel buttons in the Dialog.</p><p>Anyone know a way to get at these buttons or to do what I am trying to do?</p><p>Only other option is to try to create from scratch a custom Dialog that looks like and mimics the EditTextPreference.</p>","548949","","","","","2013-07-22 11:13:02","EditTextPreference Disable Buttons?","<android><dialog><edittext><preference>","2","1","2","",""
"4762047","1","","","2011-01-21 17:49:17","1","217","<p>I've created a custom component based on a LinearLayout. The idea is to make it a part of the XML layout, like:</p><pre><code>&lt;com.test.MyComponent     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""center_vertical|center_horizontal""    /&gt;</code></pre><p>At runtime, the component creates its content dynamically (by adding instances of a View subclass). This works perfectly well on Android 2.2 and 2.3 but on the earlier platforms the component is simply not displayed. I spent a lot of time to figure out why it disappears and finally was able to figure out the reason.</p><p>On pre-2.2 platforms, Android does a ""clever"" optimisation. It figures out that the custom class used in the XML layout is a LinearLayout, and it doesn't have any children - so it doesn't bother displaying it at all.</p><p>I have tried numerous workarounds. The only one that was more or less successful is adding to the component a dummy view, so that it wasn't empty:</p><pre><code>&lt;com.test.MyComponent     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""center_vertical|center_horizontal""    &gt;    &lt;View        android:layout_width=""1px""        android:layout_height=""1px""        /&gt;&lt;/com.test.MyComponent&gt;</code></pre><p>And then adding to the component's code the following override:</p><pre><code>protected void dispatchDraw (Canvas canvas) {    super.dispatchDraw(canvas);    for (ChildView c : children) {        c.draw(canvas);    }}</code></pre><p>This allowed the component and its contents to appear, but the presence of the dummy view messed up the interaction with the component, and any attempt to hide the dummy causes the component to disappear.</p><p>Looks like someone has put quite a lot of effort into creating an optimisation that now causes me to spend the whole day to get rid of it. Does anybody know, if there is a way to disable this ""helpful"" optimisation?</p>","584816","","","","","2011-01-21 18:41:06","How to disable layout optimisation in pre-2.2 Android?","<android><optimization><layout><components>","1","0","","",""
"4762251","1","","","2011-01-21 18:11:02","3","3915","<p>I'd like one of my activities to pick up a particular url. The pattern is:</p><pre><code>http://www.example.com/abc123/foo/xyz789</code></pre><p>The path components ""abc123"" and ""xyz789"" can be any sequence of alpha-numerics, length > 1.</p><p>Doing this in my manifest:</p><pre><code>&lt;activity&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=""example.com""       android:pathPattern=""/.*/foo/.*"" /&gt;</code></pre><p>but it seems that any pattern from my domain is getting matched, ie:</p><pre><code>myexample.commyexample.com/whatever</code></pre><p>both get matched. I guess maybe the .* operator is not working as I expect here? Any help would be great,</p><p>Thanks</p><p><a href=""http://developer.android.com/guide/topics/manifest/data-element.html"" rel=""nofollow"">http://developer.android.com/guide/topics/manifest/data-element.html</a> </p>","291701","","291701","","2011-01-21 22:14:44","2013-06-03 22:54:28","Android - matching a url pattern?","<android>","4","0","","",""
"4762475","1","4763356","","2011-01-21 18:36:13","0","290","<p>I have a textview that has its text set from a local xml file. Anytime the string is over 18175 characters long, the entire textview is blank. Anything at 18175 or under will display perfectly fine. </p><p>This only happens on OS 2.1 and under. I've tried looking around for a similar issue but have not had any luck. Does anyone know if this is a bug?</p>","1639706","","","","","2011-01-21 20:16:12","Textview doesn't display anything if the string is over 18175 characters long","<android><textview>","1","0","","",""
"4762488","1","4762726","","2011-01-21 18:37:27","3","1660","<p>I am aware that I should decide how many pixels based on density.. not hard coded.</p><p>I have section headers and items displayed in a scrollview and I want to scroll to a certain section header (the one for the current date) while making it clear that it is not the top of the screen (show about half of the previous item).</p><p>How can I do that? I do not want this automatic scroll to be animated.</p>","463304","","","","","2011-01-21 19:10:31","Android ScrollView: Automatically scroll to a few pixels (dips) above a certain view","<android><scrollview><scrollto>","1","0","1","",""
"4762512","1","","","2011-01-21 18:39:28","3","2284","<p>I have a shape that I'm using in a layout. I want the color to be programmatically changed in my activity.</p><pre><code>&lt;shape android:id=""@+id/shape1"" xmlns:android=""http://schemas.android.com/apk/res/android"" android:shape=""rectangle""&gt;    &lt;gradient android:id=""@+id/gradient1""        android:startColor=""@color/widget_header""        android:endColor=""#0000CC""         android:angle=""270""/&gt;    &lt;corners android:bottomRightRadius=""1dp""        android:bottomLeftRadius=""1dp""         android:topLeftRadius=""7dp""        android:topRightRadius=""7dp""/&gt; &lt;/shape&gt;</code></pre><p>Is there any way I could change the ""startColor"" and ""endColor"" attributes in my Activity?</p>","403733","","403733","","2011-01-21 18:45:39","2012-11-06 16:05:25","How to programatically change the startColor attribute of gradient - Android","<android><shape>","1","0","","",""
"4762542","1","","","2011-01-21 18:42:12","0","579","<p>I am developing an android application,In my application using Urban Airship for Push notification.It is working fine,I want to if i click on ""Notification On"" in UI,I will receive Notification  to my device,when i click ""Notification OFF"" in my UI,I will not receive notification to my device.How to implement the code in Urban Airship?How is possible?</p><p>Thanks</p>","500595","","","","","2012-03-09 11:11:57","How to implement Notification On or Notification OFF for Urban AirShip?","<android>","2","0","","",""
"4762548","1","","","2011-01-21 18:42:37","0","1559","<p>I've declared a background service from the android manifest, this service is to be started from within the main Activity of the application and run in an infinite loop to perform location updates to an external server.</p><p>This background service runs in a separate process than the process of the main activity of the application (using the android:process tag in the manifest declaration of the service). The issue I am having is that when requesting GPS location updates from within the service, then the LocationListener's onLocationChanged() method is never called, even when I send mock location using DDMS/geo command. But on the other hand, requesting GPS location updates from the main activity of the application does work and the onLocationChanged() method is being called properly when a fix is received, so I am wondering what is needed to be modified in order to get the same behaviour from within a service rather than an activity.</p><p>Thanks in advance for your help;Hass.</p>","582689","","","","","2011-01-22 02:26:59","Android background service problem","<android>","1","1","3","",""
"4762620","1","4768062","","2011-01-21 18:51:49","1","2326","<p>I am a completely new at programming, and must get this task completed for a demonstration. I have a Samsung Captivate that I need to send simple messages to a device over USB. I'm not worried about having the droid act as host, not the issue here. I just need to find the proper code to access the USB functions in Android 2.1. I need to send simple on/off commands and audio level changes.</p><p>It would seem to me that this shouldn't be that hard, as the droid will communicate with my laptop and act as a storage device, so I know the two can talk. Can anybody help me find these  resources? I have been looking extensively, to no avail.</p><p>Thanks!</p><p>Bill</p>","584822","","","","","2011-01-22 13:27:36","Sending simple commands from Android through USB","<java><android><usb>","2","1","","",""
"4762688","1","4763614","","2011-01-21 18:58:36","-1","1655","<p>Need help with some real estate math in java this blows up each time</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        // This app total real estate fees for a client selling a house        Button button = (Button) findViewById(R.id.Button01);         //  Sample data for priceText 360000        final EditText priceText = (EditText) findViewById(R.id.EditText01);        // Sample data for rateText .04        final EditText rateText = (EditText) findViewById(R.id.EditText02);        button.setOnClickListener(new OnClickListener() { public void onClick(View v)  { Toast.makeText(jsclosingcost.this, ""Doing Closing Cost Breakdown"", Toast.LENGTH_SHORT)                //  Sample data for priceText 360000  float fPrice=Float.parseFloat(priceText.getText().toString() + """");                 // Sample data for rateText .04  float fRate=Float.parseFloat(rateText.getText().toString() + """");  float fRealEsate = fPrice * fRate;  Toast.makeText(jsclosingcost.this, ""Real Estate Brokerage Fee: "" + fRealEsate, Toast.LENGTH_SHORT).show(); } });    }</code></pre>","2144370","","142162","","2011-01-21 19:06:03","2011-01-21 21:34:30","Need help with some real estate math in java","<java><android><math>","1","3","0","2013-05-25 11:01:43",""
"4762748","1","4763189","","2011-01-21 19:05:16","2","2441","<p>I created a ListView in Android, and a corresponding ListActivity. Each individual item in the ListView has just one TextView (I plan to add an image and a CheckBox later).The ListActivity overrides the  onListItemClick to perform certain tasks on click of any item on the list. </p><p>Heres whats happening - </p><ul><li>When I first tried clicking on any item, nothing happened.</li><li>I then tried setting the properties ""Focusable"" and ""Focusable in Touch Mode"" to false for the TextView, as mentioned <a href=""http://stackoverflow.com/questions/3789943/using-android-how-can-i-select-rows-from-a-listview-which-contains-button-contro/3791340#3791340"">here</a>, <a href=""http://stackoverflow.com/questions/3611551/textview-and-button-in-each-row-and-onlistitemclick"">here</a> and <a href=""http://stackoverflow.com/questions/1121192/android-custom-listview-unable-to-click-on-items"">here</a>. The List items started recognizing clicks, but only when I clicked somewhere away from the TextView. Whenever I tried clicking on the TextView or anywhere near it, it did not work.</li><li>I also tried changing various attributes like Clickable, but nothing has worked so far.</li></ul><p>Any idea what I could be doing wrong ?</p><p>Thanks</p>","526635","","","","","2012-10-15 18:27:32","Android ListView - onListItemClick does not work properly","<java><android><listactivity><android-listview>","2","2","","",""
"4762852","1","4762921","","2011-01-21 19:17:11","2","1181","<p>Seems like there should be some convenient way to do this?  </p><p>I couldn't find one, so I threw together the below algorithm.  Is it memory/computationally optimal? </p><p>Thanks:</p><p>Edit: Original algorithm was stupidly wrong, maybe this is better?</p><pre><code>public static float minDistance(RectF rect, PointF point){    if(rect.contains(point.x, point.y))    {        //North line         float distance = point.y - rect.top;        //East line        distance = Math.min(distance, point.x - rect.left);        //South line        distance = Math.min(distance, rect.bottom - point.y);        //West line        distance = Math.min(distance, rect.right - point.x);        return distance;    }    else    {        float minX, minY;        if (point.x &lt; rect.left)         {            minX = rect.left;        }         else if (point.x &gt; rect.right)         {            minX = rect.right;        }         else         {            minX = point.x;        }        if (point.y &lt; rect.top)         {            minY = rect.top;        }         else if (point.y &gt; rect.bottom)         {            minY = rect.bottom;        }         else         {            minY = point.y;        }        float vectorX = point.x - minX;        float vectorY = point.y - minY;        float distance = (float) Math.sqrt((vectorX * vectorX) + (vectorY * vectorY));         return distance;    }}</code></pre>","426493","","426493","","2011-01-21 19:48:42","2012-08-01 09:21:05","Android: optimal way to find shortest distance between Point and Rect?","<android><math>","3","1","0","",""
"4762882","1","","","2011-01-21 19:20:16","0","573","<p>I have a wierd problem. I have the following code:</p><pre><code>if (fbIntent.hasExtra(""Link"")) {            try{            postData[0]= fbIntent.getStringExtra(""Link"");            } catch (Exception e) {Log.d(""fbIntent error"",e.getMessage() );}         }</code></pre><p>fbIntent.hasExtra(""Link"") is true. So the compiler goes into the if statement. But I am not able to get the string using fbIntent.getStringExtra(""Link""). This I know from debugging in eclipse. When I run it, I get :</p><pre><code>01-21 14:12:01.030: ERROR/AndroidRuntime(311): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.examples.Kikin/com.examples.Kikin.FacebookLogin}: java.lang.NullPointerException: println needs a message</code></pre><p>Please help me.</p>","556167","","","","","2011-01-21 21:02:25","android intent extra data retrieval problem","<android><facebook><android-intent><extras>","2","9","","",""
"4762927","1","","","2011-01-21 19:25:07","0","958","<p>I'm looking for an intro into designing and making a custom and dynamic UI on mobile specific platforms. As I understand Nokia(Qt), Android, and iOS all use OpenGL ES (2.0?). I haven't looked into Windows phone 7 yet so not sure what that uses. So I think OpenGL would be a pretty good place to start. While OpenGL is mostly about 3D, I'm also open to 2d ways of creating dynamic UI. </p><p>I've never really been big on designing interfaces or coming up with cool concepts but now I have an idea for a mobile app that really needs a good looking user-interface. It's sort of a half app, half game type of thing. It really targets people in the gaming community who I think are used to a bit more polish and advanced UI. I could still probably get away with a simple UI(simple not being a bad thing) but I think I at least should learn <em>some</em> design techniques for future reference.</p><p>Of course I realise that excessive eye candy which hurts usability, like bloated graphics that slow down the mobile, are of no use at all. I'm trying to make a sleek UI that while looking good allows the user to interact well with the app effectively.</p><p>Any suggestions, resources, experience you can share would be most helpful.</p><p>EDIT: While I'm looking for ways to use 3D graphics, I'm more concerned with how to come up with a sleek UI in a mobile. I come from a mostly web developer background, with some experience in Photoshop(CSS is the furthest I've gone in designing). I have never really had to design a dynamic interface that reacted to touch and moved all around the screen with some laws of physics attached. There are lots of such effects, such as the carousal effect, which gives the user an enhanced experience. I have no idea how to incorporate these effects into a mobile device. For example, one of the things I need this app to do is take a glassy circular object(a button) that moves around, then turn it into a sort of convex glass lens so it's sort of zooming in on the image underneath to make it look like its actually a magnifying glass. I looked around and this effect is created by a ""grid warp"" or a ""mesh warp"". Suffice it to say I have no idea how to do it.</p>","482994","","482994","","2011-01-21 20:32:44","2011-01-22 12:31:59","How to make good looking custom ui in mobile and tablet devices?","<iphone><android><qt><user-interface><windows-phone-7>","2","2","2","",""
"4763007","1","","","2011-01-21 19:35:18","1","789","<p>First off, I'm totally new at all of this and am mostly learning be searching the internet for directions on how to do what I want and then figuring out how to use it.</p><p>So I've found these two versions of how to start an activity, but I don't really understand the difference.  Is one better than the other?  Or should they be used in different circumstances?  Or are they just two different ways of doing the same thing?</p><pre><code>Button home = (Button) findViewById(R.id.to_home);    home.setOnClickListener (new View.OnClickListener() {        public void onClick(View view) {            Intent i = new Intent(view.getContext(), Home.class);                startActivityForResult (i, 0);        }    });</code></pre><p>or this one</p><pre><code>Button button = (Button)findViewById(R.id.b_cup);    button.setOnClickListener (new View.OnClickListener() {        public void onClick (View view) {            Intent i = new Intent (Home.this, Cup.class);            startActivity (i);        }    });</code></pre>","584786","","","","","2011-01-22 13:41:14","What is the difference between these two ways to start an activity?","<android>","2","1","1","",""
"4763103","1","4763916","","2011-01-21 19:47:35","8","11814","<p>How can a <code>Drawable</code> loaded from a resource be rotated when it is drawn? For example, I would like to draw an arrow and be able to rotate it to face in different directions when it is drawn?</p>","118391","","21234","","2011-01-22 05:16:59","2013-07-01 16:42:39","Rotating a drawable in Android","<android><graphics>","3","2","3","",""
"4763233","1","6616169","","2011-01-21 20:00:56","5","2481","<p>Friend's   I need to get slider pop up window,when i click a tab control available at bottom.when i click the tab,i need to show the slider pop up from bottom to top animated to show the login button,after login i have to move my actual tab Activity.How can i get the view for slider pop up.</p><p>lets refer the screenshots,i attached here what i need exactly..</p><p>.<img src=""http://i.stack.imgur.com/yRFwp.png"" alt=""enter image description here"">From these when user to choose login at the time second screen appears looks like it.</p><p><img src=""http://i.stack.imgur.com/cNfGx.png"" alt=""enter image description here""></p><p>How can i get the view like this above.Thanks in advance..</p>","393953","","393953","","2011-01-24 08:54:53","2011-07-07 19:43:41","Need help to get Slider popup window","<android>","2","0","2","",""
"4763284","1","","","2011-01-21 20:07:15","7","320","<p>I've all but finished my little wallpaper app. The only thing now is that I can't find any method for offset on API level 3.No matter what size image I use, it is not centered in my test phone. It looks great on the emulator, but what to do about people with older phones like the backflip?Does anyone know of any fix for this?</p>","580162","","321697","","2011-01-21 20:11:28","2012-03-22 15:12:42","Wallpaper offset for API level 3?","<android><screen><center><wallpaper>","1","3","","",""
"4763373","1","4763603","","2011-01-21 20:18:13","0","197","<p>I am trying to write a code that lets me programmatically switch a file from one of my resources folders to my assets folder.  I have tried the usual  method that has worked so very well for me in the past....but with android it seems to do nothing....HELP!!!</p>","497763","","","","","2011-01-21 20:43:35","Android systems files ,<resource> and <assets> in particular","<android><file><manipulation><system>","1","1","","",""
"4763459","1","4767864","","2011-01-21 20:28:52","2","3713","<p>Sending out SMS messages from my Android phone in Java, how can I do them one at a time?</p><p>I made this application to send out a number of SMS messages from my phone, but how do I change it to send one at a time?</p><p>I am trying to make this send a SMS message and wait for the reply code to get back before sending the next one:</p><pre><code>import android.telephony.gsm.SmsManager;import android.app.Activity;import android.app.PendingIntent;import android.content.Intent;import android.os.Bundle;import android.telephony.gsm.SmsManager;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.Toast;import android.util.Log;import android.widget.Button;import java.io.*;import android.util.LogPrinter;import java.io.*;import android.app.Activity;import android.app.PendingIntent;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.widget.TextView;import android.os.*;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.Toast;import java.io.*;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.Toast;public class JSSMS extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button button = (Button) findViewById(R.id.Button01);        button.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                Toast.makeText(JSSMS.this, ""Starting SMS"", Toast.LENGTH_LONG)                        .show();                String message = ""Hello This Is John, Please save my new number"";                String number;                try {                    BufferedReader buffreader = new BufferedReader(                            new FileReader(Environment                                    .getExternalStorageDirectory().toString()                                    + ""/numbers.txt""));                    int i = 0;                    while ((number = buffreader.readLine()) != null) {                        Toast.makeText(JSSMS.this, ""Sending text to:"" + number,                                Toast.LENGTH_SHORT).show();                        sendSMS(number, message);                    }                    buffreader.close();                } catch (java.io.FileNotFoundException e) {                    Toast.makeText(JSSMS.this, e.toString(), Toast.LENGTH_SHORT)                            .show();                } catch (Exception e) {                    Toast.makeText(JSSMS.this, e.toString(), Toast.LENGTH_SHORT)                            .show();                }                Toast.makeText(JSSMS.this, ""DONE!!"", Toast.LENGTH_LONG).show();            }        });    }    // ---Sends an SMS message to another device.---    private void sendSMS(String phoneNumber, String message) {        String SENT = ""SMS_SENT"";        String DELIVERED = ""SMS_DELIVERED"";        PendingIntent sentPI = PendingIntent.getBroadcast(this, 0, new Intent(                SENT), 0);        PendingIntent deliveredPI = PendingIntent.getBroadcast(this, 0,                new Intent(DELIVERED), 0);        // ---When the SMS has been sent---        registerReceiver(new BroadcastReceiver() {            @Override            public void onReceive(Context arg0, Intent arg1) {                switch (getResultCode()) {                case Activity.RESULT_OK:                    Toast.makeText(getBaseContext(), ""SMS sent"",                            Toast.LENGTH_SHORT).show();                    break;                case SmsManager.RESULT_ERROR_GENERIC_FAILURE:                    Toast.makeText(getBaseContext(), ""Generic failure"",                            Toast.LENGTH_SHORT).show();                    break;                case SmsManager.RESULT_ERROR_NO_SERVICE:                    Toast.makeText(getBaseContext(), ""No service"",                            Toast.LENGTH_SHORT).show();                    break;                case SmsManager.RESULT_ERROR_NULL_PDU:                    Toast.makeText(getBaseContext(), ""Null PDU"",                            Toast.LENGTH_SHORT).show();                    break;                case SmsManager.RESULT_ERROR_RADIO_OFF:                    Toast.makeText(getBaseContext(), ""Radio off"",                            Toast.LENGTH_SHORT).show();                    break;                }            }        }, new IntentFilter(SENT));        // ---When the SMS has been delivered---        registerReceiver(new BroadcastReceiver() {            @Override            public void onReceive(Context arg0, Intent arg1) {                switch (getResultCode()) {                case Activity.RESULT_OK:                    Toast.makeText(getBaseContext(), ""SMS delivered"",                            Toast.LENGTH_SHORT).show();                    break;                case Activity.RESULT_CANCELED:                    Toast.makeText(getBaseContext(), ""SMS not delivered"",                            Toast.LENGTH_SHORT).show();                    break;                }            }        }, new IntentFilter(DELIVERED));        SmsManager sms = SmsManager.getDefault();        sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI);    }}</code></pre>","2144370","","63550","","2012-06-11 19:06:48","2014-02-01 18:34:21","Sending out SMS messages from my Android phone in Java, how can I do them one at a time?","<java><android><sms>","2","1","","",""
"4763464","1","","","2011-01-21 20:30:13","4","3548","<p>Is it possible to register a BroadcastReceiver or something to get notifications of media player volume changes?</p><p>Thanks</p>","569164","","","","","2011-01-21 21:55:24","howto receive media volume change notifications?","<android>","1","0","2","",""
"4763540","1","4765202","","2011-01-21 20:37:29","0","507","<p>I am having a weird problem.</p><p>I am developing a program to log GPS and sensor readings periodically. My friend runs the code on his machine using Eclipse Galileo 3.6 and it works perfectly fine for her. </p><p>When I run the code on my machine which has Eclipse Galileo 3.5.2 it shows service stopped unexpectedly. </p><p>We have the same JDK version. I am not able to figure out what may be the exact problem.</p><p>Please let me know what else information I need to give in order to fix the problem.</p><p>logcat</p><pre><code>    I/ActivityManager( 1104): Start proc com.sensor.test for service com.sensor.test/.SensorReadings: pid=3539 uid=10057 gids={3003, 1015}D/AndroidRuntime( 3539): Shutting down VMW/dalvikvm( 3539): threadid=1: thread exiting with uncaught exception (group=0x4001d7e0)E/AndroidRuntime( 3539): FATAL EXCEPTION: mainE/AndroidRuntime( 3539): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.BATTERY_CHANGED flg=0x60000000 (has extras) } in com.sensor.test.SensorReadings$2@44770958E/AndroidRuntime( 3539):    at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:905)E/AndroidRuntime( 3539):    at android.os.Handler.handleCallback(Handler.java:587)E/AndroidRuntime( 3539):    at android.os.Handler.dispatchMessage(Handler.java:92)E/AndroidRuntime( 3539):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 3539):    at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime( 3539):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 3539):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 3539):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime( 3539):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime( 3539):    at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime( 3539): Caused by: java.lang.NullPointerExceptionE/AndroidRuntime( 3539):    at com.sensor.test.SensorReadings$2.onReceive(SensorReadings.java:327)E/AndroidRuntime( 3539):    at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:892)E/AndroidRuntime( 3539):    ... 9 moreW/ActivityManager( 1104): Activity destroy timeout for HistoryRecord{44b38508 com.sensor.test/.MainScreen}D/WifiService( 1104): acquireWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@44963d80}D/LocationMasfClient( 1104): getNetworkLocation(): Location not found in cache, making network requestD/LocationMasfClient( 1104): getNetworkLocation(): Number of prefetched entries 10E/LocationMasfClient( 1104): getNetworkLocation(): Returning *server* computed location with accuracy 28D/libgps  ( 1104): GpsInterface_inject_location( 35.772249, -78.673950, 28.000 )D/WifiService( 1104): releaseWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@44963d80}D/WifiService( 1104): acquireWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@44963d80}D/WifiService( 1104): releaseWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@44963d80}D/NativeCrypto( 1104): Freeing OpenSSL sessionD/dalvikvm( 1104): GC_FOR_MALLOC freed 22104 objects / 1169312 bytes in 128msD/NativeCrypto( 1104): Freeing OpenSSL sessionI/Process ( 3539): Sending signal. PID: 3539 SIG: 9W/InputManagerService( 1104): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44b40dd0I/ActivityManager( 1104): Process com.sensor.test (pid 3539) has died.</code></pre><p>The pertinent code for line 88 with parsing going on:</p><pre><code>public void startService(){        //startService(new Intent(MainScreen.this,SensorReadings.class));        Intent intent = new Intent(MainScreen.this, SensorReadings.class);        **intent.putExtra(""lp"", Integer.parseInt(""""+longPeriod.getText()));// LINE 88**        intent.putExtra(""gp"", Integer.parseInt(""""+gpsPeriod.getText()));        intent.putExtra(""sp"", Integer.parseInt(""""+snrPeriod.getText()));        //startActivity(intent);        startService(intent);    }</code></pre><p>Thanks.AG</p>","585030","","585030","","2011-01-22 00:06:48","2011-01-22 00:14:28","NumberFormatException in GPS processing","<android>","2","6","","",""
"4763778","1","4764866","","2011-01-21 21:02:53","0","527","<p>I'm developing an Android application that uses a <code>MapView</code>.  I'd like to run a procedure whenever the visible portion of the map changes (due to zooming/panning/rotating the phone/etc), and I'd like to pass the new latitude and longitude values to the procedure.  </p><p>I thought I could override <code>onInterceptTouchEvent</code> to do this, but then the procedure only seems to run when you first touch the screen (so, for example, panning by dragging your finger only calls the procedure at the beginning of the dragging motion).  Which means the procedure is never called with the new coordinates.</p><p>So -- what's the correct way to do it?</p>","145988","","","","","2011-01-22 18:30:39","What's the correct way to determine when a MapView's Lat/Lon window has changed?","<android><android-mapview>","1","0","","",""
"4763825","1","","","2011-01-21 21:07:55","0","2012","<p>What are the possible reasons for a failed insertion into an sqlite3 database? The trace from the SQLiteException isn't especially helpful. </p><p>Is there any way to obtain better information about what caused the exception?</p><p>Where the table is created (sorry for any wonky spacing):</p><p><a href=""http://pastebin.com/QqUgdDz0"" rel=""nofollow"">http://pastebin.com/QqUgdDz0</a></p><p>Where the values are parsed in endElement of a SAX parser:</p><p><a href=""http://pastebin.com/iN1M8QMe"" rel=""nofollow"">http://pastebin.com/iN1M8QMe</a></p><p>Where the insert is called:</p><p><a href=""http://pastebin.com/xUqrmexw"" rel=""nofollow"">http://pastebin.com/xUqrmexw</a></p><p>Insert case in the provider:</p><pre><code>case SUBMATERIAL_SINGLE_URI:            rowId = db.insert(jobName+JobMetaData.SubmaterialTableMetaData.TABLE_NAME_SUFFIX,                              JobMetaData.SubmaterialTableMetaData.TYPE, validValues);            if (rowId &gt; 0)            {                Uri submaterialUri = ContentUris.withAppendedId(JobMetaData.SubmaterialTableMetaData.CONTENT_URI,                        rowId);                getContext().getContentResolver().notifyChange(submaterialUri, null);                return submaterialUri;            }            break;</code></pre><p>Stacktrace:</p><pre><code>System.err( 8048): android.database.SQLException: Failed to insert row into content://dsndata.sds2mobile.jobprovider/C_1/submaterial/NULLSystem.err( 8048):  at dsndata.sds2mobile.JobProvider.insert(JobProvider.java:341)System.err( 8048):  at android.content.ContentProvider$Transport.insert(ContentProvider.java:180)System.err( 8048):  at android.content.ContentResolver.insert(ContentResolver.java:587)System.err( 8048):  at dsndata.sds2mobile.parser.MobileParser.endElement(MobileParser.java:227)System.err( 8048):  at org.xml.sax.helpers.XMLReaderAdapter.endElement(XMLReaderAdapter.java:355)System.err( 8048):  at org.apache.harmony.xml.ExpatParser.endElement(ExpatParser.java:160)System.err( 8048):  at org.apache.harmony.xml.ExpatParser.append(Native Method)System.err( 8048):  at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:505)System.err( 8048):  at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:492)System.err( 8048):  at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:308)System.err( 8048):  at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:264)System.err( 8048):  at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:225)System.err( 8048):  at javax.xml.parsers.SAXParser.parse(SAXParser.java:361)System.err( 8048):  at dsndata.sds2mobile.parser.MobileParser.parse(MobileParser.java:120)System.err( 8048):  at dsndata.sds2mobile.UI.onClick(UI.java:90)System.err( 8048):  at android.view.View.performClick(View.java:2408)System.err( 8048):  at android.view.View$PerformClick.run(View.java:8817)System.err( 8048):  at android.os.Handler.handleCallback(Handler.java:587)System.err( 8048):  at android.os.Handler.dispatchMessage(Handler.java:92)System.err( 8048):  at android.os.Looper.loop(Looper.java:144)System.err( 8048):  at android.app.ActivityThread.main(ActivityThread.java:4937)System.err( 8048):  at java.lang.reflect.Method.invokeNative(Native Method)System.err( 8048):  at java.lang.reflect.Method.invoke(Method.java:521)System.err( 8048):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)System.err( 8048):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)System.err( 8048):  at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I should note that NULL in the URI here is a string value and is acceptable according to the URI matching scheme. This is a test run and isn't using real values yet. </p><p>Update:It turns out that my partner (who was producing the XML) left out a few items. Got it all figured out.</p><p>Thanks for your help! I appreciate the time.</p>","543677","","543677","","2011-01-23 20:16:36","2013-07-13 08:27:24","SQLiteException failed to insert row","<android><database><sqlite>","3","4","","",""
"4763889","1","4763958","","2011-01-21 21:16:33","1","447","<p>I have a couple quick questions. They all deal with 1 general topic, and one strategy may take care of everything, so I hope that its ok I put them under the same topic.</p><p>I have had trouble finding solid info on garbage collection, so would appreciate any help, I think perhaps I don't fully understand what I am reading in the MAT. Even if you can answer 1 question I would be super happy</p><ol><li><p>What is the best strategy for finding memory leaks in Android? As best I can tell it is to get the Eclipse MAT, picking an object that isn't getting garbage collected (using the dominator tree, or whatever is easiest for you to find it with), and displaying the shortest merged paths to the gc of that object and find the furthest incoming reference to that object that you can control and killing that reference on destroy. This works to kill the references, but sometimes the object still doesn't get garbage collected</p></li><li><p>Is it good practice to null all of your handlers/runnables/threads/listeners on destroy? Some of these seem to stick around indefinitely if I don't, and sometimes even if I do.</p></li><li><p>What is the best way to ensure that a thread gets garbage collected, even if the reference is nulled (they seem to stick around sometimes)?</p></li><li><p>Why oh why can't I get the google analytics tracker to get garbage collected, even though it has no reference from my application at all. It seems to maintain a reference to my activity, so I think that might have something to do with my GC problems.</p></li></ol><p>Thanks you!</p>","415422","","","","","2011-01-21 21:26:13","General Android Memory leaks and specifically google analytics tracker","<android><memory-management>","1","0","","",""
"4763915","1","4764102","","2011-01-21 21:19:33","0","238","<p>Consider that activity is destroyed and onDestroy was fired. Can I be sure that no other messages will be dispatched into this activity handlers like onKeyDown?</p>","62192","","","","","2011-01-21 21:42:22","Can an event be dispatched to Activity after onDestroy?","<android>","1","0","","",""
"4763943","1","4765586","","2011-01-21 21:22:56","1","1030","<p>I'm having the problem that my textures are rendering incorrect colors and based on <a href=""http://www.opengl.org/resources/faq/technical/color.htm"" rel=""nofollow"">this</a> it seems like Android's reading the colors in reverse order.</p><p>I tried solving the problem as the reference says but GL_BGR_EXT is not defined in the Android NDK nor is GL_UNSIGNED_SHORT_5_6_5_REV. How can I reverse the color byte order in the Android NDK?</p>","38258","","","","","2011-01-22 01:32:59","Android OpenGL ES Color Byte Order","<android><opengl-es><android-ndk><byte-order>","1","0","","",""
"4763954","1","4807592","","2011-01-21 21:25:41","2","5193","<p>If I want to remove an item from my list view by tapping it, do I remove the object from the ArrayList I'm using with my ArrayAdapter, or do I remove the object directly from the adapter and call the notifyDatasetChange?</p><p>Also I want to store the data from the list on the disk, do I save the adapter or the arraylist I use?</p><p>Here is the code: The idea I'm going for is to save the data from the list and load it back when the activity launches again, however once this happens I cannot delete items from the list anymore.</p><pre><code>public class EditKeywords extends ListActivity implements Serializable{    private ArrayList&lt;String&gt; keyWordList;    private EditText keywordEditText;    private IconicAdapter adapter;    private Button enterButton;    private int position;    private Button finishedButton;    public static final String KEYWORDS = ""keywords"";    public static final String ADAPTER = ""adapter"";    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.editkeyowords);        getKeywordsAndAdapter();        keywordEditText = (EditText) findViewById(R.id.keywordedittext);        setListAdapter(adapter);        enterButton = (Button) findViewById(R.id.enterkeywords);        enterButton.setOnClickListener(enterButtonListener);        finishedButton = (Button) findViewById(R.id.finishedbutton);        finishedButton.setOnClickListener(finishedButtonListener);    }    public void onResume(){    super.onResume();    getKeywordsAndAdapter();    }    public void onPause(Bundle savedInstanceState){    super.onPause();    writeKeywordsAndAdapter();    }    public void getKeywordsAndAdapter(){    try {        InputStream fi = openFileInput(KEYWORDS);        if (fi!=null) {            ObjectInputStream in = new ObjectInputStream(fi);                    keyWordList = (ArrayList&lt;String&gt;) in.readObject();                    in.close();        }    }    catch (java.io.FileNotFoundException e) {        // that's OK, we probably haven't created it yet    }    catch (Throwable t) {        Toast            .makeText(this, ""Exception: ""+t.toString(), Toast.LENGTH_LONG)            .show();    }    if(keyWordList == null){        keyWordList = new ArrayList&lt;String&gt;();    }    try {        InputStream fi = openFileInput(ADAPTER);        if (fi!=null) {            ObjectInputStream in = new ObjectInputStream(fi);                adapter = (IconicAdapter) in.readObject();                in.close();        }    }    catch (java.io.FileNotFoundException e) {        // that's OK, we probably haven't created it yet    }    catch (Throwable t) {        Toast            .makeText(this, ""Exception: ""+t.toString(), Toast.LENGTH_LONG)            .show();    }    if(adapter == null){        adapter = new IconicAdapter();    }    }    public void writeKeywordsAndAdapter(){    try {        OutputStream fi = openFileOutput(KEYWORDS, 0);        if (fi!=null) {            ObjectOutputStream out = new ObjectOutputStream(fi);                out.writeObject(keyWordList);                out.close();        }    }    catch (java.io.FileNotFoundException e) {        // that's OK, we probably haven't created it yet    }    catch (Throwable t) {        Toast            .makeText(this, ""Exception: ""+t.toString(), Toast.LENGTH_LONG)            .show();    }    try {        OutputStream fi = openFileOutput(ADAPTER, 0);        if (fi!=null) {            ObjectOutputStream out = new ObjectOutputStream(fi);            out.writeObject(adapter);            out.close();        }    }    catch (java.io.FileNotFoundException e) {        // that's OK, we probably haven't created it yet    }    catch (Throwable t) {        Toast            .makeText(this, ""Exception: ""+t.toString(), Toast.LENGTH_LONG)            .show();    }    }    public void onListItemClick(ListView parent, View v,        int aPosition, long id) {        ImageView image = (ImageView) findViewById(R.id.icon1);        image.setImageResource(R.drawable.delete);        image.setOnClickListener(deleteImageListener);        getListView().getChildAt(aPosition).invalidate();        //adapter.notifyDataSetInvalidated();        position = aPosition;    }    public void startHome() {    Intent intent = new Intent(this, ECS.class);    this.startActivity(intent);    finish();    }    public class IconicAdapter extends ArrayAdapter&lt;String&gt; implements Serializable {    private static final long serialVersionUID = 6175078429973952022L;    IconicAdapter() {        super(EditKeywords.this, R.layout.rowkeywords, keyWordList);    }    public View getView(int position, View convertView,ViewGroup parent) {        LayoutInflater inflater=getLayoutInflater();        View row=inflater.inflate(R.layout.rowkeywords, parent, false);        TextView label=(TextView)row.findViewById(R.id.label1);        label.setText(keyWordList.get(position));        return(row);    }    }    private OnClickListener enterButtonListener = new OnClickListener() {    @Override    public void onClick(View arg0){        if(keywordEditText.getText().toString() != """"){        boolean unique = true;        for(String s : keyWordList){            if(s.equals(keywordEditText.getText().toString())){            unique = false;             }        }        if(unique == true){            adapter.add(keywordEditText.getText().toString());            keywordEditText.setText("""");            adapter.notifyDataSetChanged();        }        }    }    };    private OnClickListener deleteImageListener = new OnClickListener() {    @Override    public void onClick(View arg0){        //keyWordList.remove(position);        adapter.remove(keyWordList.get(0));        adapter.notifyDataSetChanged();        writeKeywordsAndAdapter();    }    };    private OnClickListener finishedButtonListener = new OnClickListener() {    @Override    public void onClick(View arg0){       writeKeywordsAndAdapter();       startHome();    }    };}</code></pre>","180825","","180825","","2011-01-21 22:08:30","2011-01-26 17:13:29","Remove an item from a list view","<android>","3","2","","",""
"4764279","1","","","2011-01-21 22:04:20","0","574","<p>If I look at the source code for AudioManager, there is:</p><p>@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)public static final String VOLUME_CHANGED_ACTION = ""android.media.VOLUME_CHANGED_ACTION"";</p><p>However, is not visible by Eclipse, even when you specify the minimum SDK level.</p><p>How can this happen?</p><p>Is this part of the API or not?</p><p>Thanks</p>","569164","","","","","2011-01-21 23:22:08","Java source vs. Android SDK differences?","<android>","1","1","","",""
"4764431","1","","","2011-01-21 22:21:34","1","1890","<p>I am following a tutorial to get my current location. I wrote exactly what the tutorial said, but i just do not get my lat/lon. I am using a wifi connection. I tried:<br>geo fix -77.036519 38.896143<br>still do not get the lat/lon. My code is as follows;</p><pre><code>import java.util.List;import android.app.Activity;import android.content.Context;import android.location.Location;import android.location.LocationManager;import android.location.LocationListener;import android.os.Bundle;import android.widget.TextView;public class TestProviderController extends Activity { LocationManager locationManager;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        String location_context=Context.LOCATION_SERVICE;        locationManager=(LocationManager)getSystemService(location_context);        testProvider();    }    public void testProvider(){     TextView tv = (TextView)findViewById(R.id.myTextView);     StringBuilder sb = new StringBuilder(""Enabled Providers:"");     List&lt;String&gt; providers = locationManager.getProviders(true);     for (String provider : providers) {     locationManager.requestLocationUpdates(provider, 1000, 0,     new LocationListener() {     public void onLocationChanged(Location location) {}     public void onProviderDisabled(String provider){}     public void onProviderEnabled(String provider){}     public void onStatusChanged(String provider, int status,     Bundle extras){}     });     sb.append(""\n"").append(provider).append("":"");     Location location = locationManager.getLastKnownLocation(provider);     if (location != null) {     double lat = location.getLatitude();     double lng = location.getLongitude();     sb.append(lat).append("","").append(lng);     } else {     sb.append(""No Location"");     }     }     tv.setText(sb);    }}</code></pre><p>Can anybody please help about what went wrong?</p>","574308","","139010","","2011-01-21 22:24:00","2011-01-21 23:45:47","current location is not working in android emulator","<android><emulator>","1","1","","",""
"4764506","1","4764602","","2011-01-21 22:29:42","2","4059","<p>Here is what LogCat says:  </p><pre><code>01-21 17:20:06.057: ERROR/AndroidRuntime(27463): java.lang.NoSuchMethodError: com.mohit.geo2do.activities.TasksList.showDialog01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at com.mohit.geo2do.activities.TasksList.onContextItemSelected(TasksList.java:190)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at android.app.Activity.onMenuItemSelected(Activity.java:2183)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at com.android.internal.policy.impl.PhoneWindow$ContextMenuCallback.onMenuItemSelected(PhoneWindow.java:2785)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:140)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at com.android.internal.view.menu.MenuDialogHelper.onClick(MenuDialogHelper.java:129)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:898)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at android.widget.AdapterView.performItemClick(AdapterView.java:301)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at android.widget.ListView.performItemClick(ListView.java:3626)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:3600)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at android.os.Handler.handleCallback(Handler.java:587)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at android.os.Handler.dispatchMessage(Handler.java:92)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at android.os.Looper.loop(Looper.java:123)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at android.app.ActivityThread.main(ActivityThread.java:4363)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at java.lang.reflect.Method.invokeNative(Native Method)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at java.lang.reflect.Method.invoke(Method.java:521)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)01-21 17:20:06.057: ERROR/AndroidRuntime(27463):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I get an error at this phrase:  </p><pre><code>Bundle args = new Bundle();args.putLong(""id"", ...);           //Some arbitrary valueshowDialog(DELETE_DIALOG, args);</code></pre><p>I have an <code>onPrepareDialog</code> method:  </p><pre><code>@Overrideprotected void onPrepareDialog(int id, Dialog dialog, Bundle args) {    switch (id) {    case DELETE_DIALOG:        AlertDialog log = (AlertDialog) dialog;        final Bundle bundle = args;        log.setButton(DialogInterface.BUTTON_POSITIVE, ""Ok"", new DialogInterface.OnClickListener() {            @Override            public void onClick(DialogInterface dialog, int which) {                long id = bundle.getLong(""id"");                getContentResolver().delete(Tasks.CONTENT_URI, Tasks._ID + ""="" + id, null);                adapter.notifyDataSetChanged();            }        });        break;    default:        break;    }}</code></pre><p>What could be the problem?</p>","200477","","","","","2011-04-15 11:25:22","java.lang.NoSuchMethodError on Activity.showDialog (int, Bundle)?","<java><android><showdialog><nosuchmethoderror>","2","5","1","",""
"4764557","1","4907610","","2011-01-21 22:37:40","4","7394","<p>I am trying to figure out how to setup android development with Visual Studio. I plan on using C++ (targeting 2.3 and above), but I see very little on the subject. Does anyone know how to do this?</p><p>I know that Android development suggests Java/Eclipse, however, I want to do C++/VS.</p>","552853","","","","","2012-06-22 14:02:09","Android C++ Development with Visual Studio","<c++><android><visual-studio><visual-studio-2010><mobile>","3","1","2","",""
"4764711","1","","","2011-01-21 22:57:31","1","6097","<p>I was trying to pass some parameters to an AlertDialog, this dialog most show these two parameters (suppose ""foo"" and ""bar"" parameters), and I'm calling this dialog using <code>showDialog(int id)</code>. There is another method in Activity class which take a <code>Bundle</code> object to pass parameters: <code>showDialog(int id, Bundle args)</code>, but this method is only available to API 8 or greater and I need to work with API 7.</p><p>Here I put some chunks of code to make easier what I am doing.</p><p>In my activity I create AlertDialog like this:</p><pre><code>    protected Dialog onCreateDialog(int id) {        final LayoutInflater factory = LayoutInflater.from(this);        switch(id) {        case DIALOG_ID:            final View view = factory.inflate(R.layout.dialog_layout, null);            final TextView fooValue = (TextView)view.findViewById(R.id.foo_label);            final TextView barValue = (TextView)view.findViewById(R.id.foo_label);            //fooLabel.setText(""HERE MUST BE FOO PARAMETER VALUE"");            //barLabel.setText(""HERE MUST BE BAR PARAMETER VALUE"");            return new AlertDialog.Builder(this).                setIcon(R.drawable.icon).                setTitle(R.string.app_name).                setView(view).                setPositiveButton(R.string.close, null).                create();...</code></pre><p>And in other part I call this dialog:</p><pre><code>    // THESE PARAMETERS MUST BE PASSED TO DIALOG    int foo = result.getInt(""foo"");    String bar = result.getString(""bar"");    showDialog(DIALOG_ID);...</code></pre><p>Thank you very much!</p>","576931","","","","","2011-01-22 11:49:13","Pass parameters to AlertDialog in Android","<android><activity><bundle><builder><alertdialog>","2","0","","",""
"4764834","1","4769998","","2011-01-21 23:14:43","0","2957","<p>Got stuck a bit since i cannot understand how to get the path from a picture i click in the GridView.</p><p>This listener is the problem since i load the GridView with images from a folder on the sdcard.</p><pre><code>public void onItemClick(AdapterView parent, View v, int position, long id)</code></pre><p>I can only see example on how to use the ""position"" when the GridView is loaded from resources.</p><p>Can anyone give me a hint how to do this.Im reading and trying this </p><pre><code>String[] projection = {MediaStore.Images.Media.DATA};Cursor cursor = managedQuery( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,projection,null, null, null)</code></pre><p>But that will give me all images from sdcard root.My folder is ""sdcard/PTPPservice""</p><p>I will from here send an intent to show the image like:</p><pre><code>      Intent intent = new Intent(getApplicationContext(), ViewImage.class);      intent.putExtra(""filename"", imagePath);      startActivity(intent);</code></pre>","538837","","538837","","2011-01-21 23:19:55","2013-01-23 23:55:25","android How to get image path from GridView through onItemClick listener","<android>","1","0","1","",""
"4764943","1","4765066","","2011-01-21 23:29:15","1","893","<p>I have ListActivity with CustomArrayAdapter. My extension of ArrayAdapter allows me to do add/remove operations with the rows. It works fine...inside ListActivity. But then I need to add/edit rows in my list from different Activity and troubles begin. How can I do that? All I need inside my EditActivity is CustomArrayAdapter object. I made it static and tried. It worked, but is it a right thing?Thanks for the answers, masters!</p>","577841","","","","","2011-01-21 23:50:37","Android: refreshing list view from different activity","<android><listview><activity><refresh>","1","0","","",""
"4765159","1","4765673","","2011-01-22 00:06:35","0","465","<p>I'm trying to create an app widget that, when pressed, triggers a background job that saves time+location to a database.</p><p>From what I have been able to gather so far, the setup I probably want consists of an AppWidgetProvider subclass whose onUpdate() is responsible for setting up a PendingIntent on a RemoteView representing the widget button. Its onReceive() method would catch the broadcast from the PendingIntent, and I would perhaps start off a service from here to perform the background job.</p><p>If I'm on the right track so far, I have one challenge, which is that onUpdate() is not triggered on adding the app widget to the desktop, and thus the widget button is not getting set up properly (it ends up doind nothing). Do I have to set the widget up with a configurationactivity, which in turn triggers AppWidgetProvider.onUpdate(), or is there a simpler solution to this?</p><p>If I'm not on the right track at all, any pointers to a better way of achieving what I'm trying to achieve would be very much appreciated. :)</p><p><strong>Update:</strong></p><p>Thought I might post some of the code here as well. Here is the receiver definition from the manifest:</p><pre><code>&lt;receiver android:name="".widget.QuickAddWidgetProvider"" &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/quickadd_widget_info"" /&gt;&lt;/receiver&gt;</code></pre><p>This is my resource file, defining the widget:</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:minWidth=""72dp""    android:minHeight=""72dp""    android:initialLayout=""@layout/quickadd_widget""    android:updatePeriodMillis=""0""&gt;&lt;/appwidget-provider&gt;</code></pre><p>This is QuickAddWidgetProvider:</p><pre><code>public class QuickAddWidgetProvider extends AppWidgetProvider {    @Override    public void onReceive(Context context, Intent intent) {        Log.v(""QuickAdd"", ""onReceive()"");     }    @Override    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {        Log.v(""QuickAdd"", ""onUpdate()"");    }}</code></pre>","543617","","543617","","2011-01-22 18:22:00","2011-01-22 18:22:00","Setting up widget button for performing background job","<android><android-widget>","1","0","","",""
"4765380","1","4765455","","2011-01-22 00:46:10","2","2673","<p>I have an activity that is launched from another activity through an intent. The intent carries an extra ""id"" information. Now, the launched activity has a custom view (actually, a extension of LinearLayout class). I want to access the ""id"" information in the custom view. Can the activity pass that value to its contained view? Or can the view get a handle to the activity?</p>","585246","","","","","2013-10-03 05:53:31","Passing extra Intent information from Activity to View","<android>","3","0","1","",""
"4765389","1","","","2011-01-22 00:47:56","4","3132","<p>I have a complex Android app with a decent amount of application state that needs to be persisted (in a specific format). Writing out the data is not an instantaneous operation and so it would be ideal to minimize persisting it unnecessarily.</p><p>Because of the persistence overhead it is not practical to persist the state every time it is changed. Ideally, persisting state would be triggered when the app is ""backgrounded"" by the user tapping the 'home' button or tapping the 'back' button on the app's root Activity (or by an incoming call, etc.). This minimizes persistence overhead while maintaining state consistency from the user's perspective. The question is how can you detect if the app is being ""backgrounded""?</p><p>The Activity lifecycle calls (onStart, onResume, onPause and friends) don't help as the app has many different activities, any one of which could be active when the user taps 'home'. Furthermore, the calls get called when Activities get pushed, popped (and bottom killed) on the Activity stack and so they don't reflect if the app is going away or not.</p><p>So how does an app detect when it is going to the background?</p>","210048","","","","","2012-10-05 07:17:57","Android: saving application state when going to the ""background""","<android><activity><persistence><state>","4","0","2","",""
"4765420","1","","","2011-01-22 00:54:04","2","2566","<p>I'm working on an Android application at the moment. Basically, I have multiple ViewFlippers which will be used to create sets of 'panels'. For example, I have a ViewFlipper to simulate a home screen environment (multiple panels that can be accessed by swiping left or right), as well as a different ViewFlipper to simulate an application launcher (panels for favorite apps, all apps, settings etc). I've done this by creating each set of panels, or each ViewFlipper in it's own activity, to preserve memory when a set of panels aren't being used.</p><p>Basically, I want to keep the same background image across all the activities. Now, I know this can be done by creating a style, and applying it in the  tags in the manifest, but my issue is that the background image is included in the activity transition animation (my own custom animation has been set, but regardless, using stock transition animations or not, the background image is included).</p><p>So, what I am asking is, is there a way to keep a common background image across multiple activities that is NOT animated when switching between activities?</p><p>At the moment, my style xml file looks like this:</p><pre><code>&lt;style name=""Theme"" parent=""android:Theme""&gt;    &lt;item name=""android:windowNoTitle""&gt;true&lt;/item&gt;     &lt;item name=""android:windowBackground""&gt;@drawable/background_port&lt;/item&gt; &lt;/style&gt;</code></pre><p></p><p>So as you can see, the same drawable is being set as the background for all activities, but it is included in the transition animations between activities, which I don't want. I also have tried android:detachWallpaper=""true"", but that seems useless in this case.</p><p>I'm fairly experienced in Android code, so no need to explain things in simple manners. If I don't understand something, I'll ask.</p><p>Thanks for all your help, it's really appreciated.</p>","585251","","","","","2011-01-22 05:11:34","Keeping the same background across multiple activities in Android and excluding them from activity transitions","<android><android-layout><android-manifest>","2","0","1","",""
"4765465","1","4767347","","2011-01-22 01:03:27","9","25366","<p>I started off creating libraries as shared libraries, but I considered it would be more efficient to create one shared libraries and the rest static. When it was all shared, it compiled and linked fine, but moving to static, I get on linking ""undefined reference"".</p><p><strong>Edit:</strong> I build all the libraries in one <code>Android.mk</code></p><p>Android.mk:</p><pre><code>MY_LOCAL_PATH := $(call my-dir)MY_LOCAL_CFLAGS := -DDEBUGTARGET_PLATFORM := 'android-4'LOCAL_PATH := $(MY_LOCAL_PATH)/../../Baseinclude $(CLEAR_VARS)LOCAL_MODULE     := BaseLOCAL_SRC_FILES  := &lt;Base src files&gt;include $(BUILD_STATIC_LIBRARY)MY_LOCAL_STATIC_LIBRARIES := BaseMY_LOCAL_C_INCLUDES := $(MY_LOCAL_PATH)/../../BaseLOCAL_PATH := $(MY_LOCAL_PATH)/../../Frameworkinclude $(CLEAR_VARS)LOCAL_MODULE     := FrameworkLOCAL_C_INCLUDES := $(MY_LOCAL_C_INCLUDES)LOCAL_SRC_FILES  := &lt;Framework src files&gt;LOCAL_CFLAGS := $(MY_LOCAL_CFLAGS)include $(BUILD_STATIC_LIBRARY)MY_LOCAL_STATIC_LIBRARIES += FrameworkMY_LOCAL_C_INCLUDES += $(MY_LOCAL_PATH)/../../FrameworkLOCAL_PATH := $(MY_LOCAL_PATH)/Graphicsinclude $(CLEAR_VARS)LOCAL_MODULE    := GraphicsLOCAL_SRC_FILES := &lt;Graphics src files&gt;LOCAL_EXPORT_LDLIBS := -lGLESv1_CMLOCAL_CFLAGS := $(MY_LOCAL_CFLAGS)LOCAL_C_INCLUDES := $(MY_LOCAL_C_INCLUDES)include $(BUILD_STATIC_LIBRARY)MY_LOCAL_STATIC_LIBRARIES += GraphicsMY_LOCAL_C_INCLUDES += $(MY_LOCAL_PATH)/GraphicsLOCAL_PATH := $(MY_LOCAL_PATH)/Platforminclude $(CLEAR_VARS)LOCAL_MODULE := PlatformLOCAL_SRC_FILES := &lt;Platform src files&gt;LOCAL_CFLAGS := $(MY_LOCAL_CFLAGS)LOCAL_C_INCLUDES := $(MY_LOCAL_C_INCLUDES)include $(BUILD_STATIC_LIBRARY)MY_LOCAL_STATIC_LIBRARIES += PlatformMY_LOCAL_C_INCLUDES += $(MY_LOCAL_PATH)/PlatformLOCAL_PATH := $(MY_LOCAL_PATH)include $(CLEAR_VARS)LOCAL_MODULE    := FinalLOCAL_SRC_FILES := &lt;Final src files&gt;LOCAL_STATIC_LIBRARIES := $(MY_LOCAL_STATIC_LIBRARIES)LOCAL_LDLIBS    := -llogLOCAL_CFLAGS := $(MY_LOCAL_CFLAGS)LOCAL_C_INCLUDES := $(MY_LOCAL_C_INCLUDES)include $(BUILD_SHARED_LIBRARY)</code></pre><p>Last line of <code>ndk-build V=1 -B</code>:</p><pre><code>SharedLibrary  : libFinal.so/Users/robbie/Library/Frameworks/Android-NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-g++ -Wl,-soname,libFinal.so -shared --sysroot=/Users/robbie/Library/Frameworks/Android-NDK/platforms/android-4/arch-arm &lt;object files&gt;   /Users/robbie/Documents/Apps/Revolution/Android/obj/local/armeabi/libBase.a /Users/robbie/Documents/Apps/Revolution/Android/obj/local/armeabi/libFramework.a /Users/robbie/Documents/Apps/Revolution/Android/obj/local/armeabi/libGraphics.a /Users/robbie/Documents/Apps/Revolution/Android/obj/local/armeabi/libPlatform.a /Users/robbie/Documents/Apps/Revolution/Android/obj/local/armeabi/libstdc++.a  /Users/robbie/Library/Frameworks/Android-NDK/platforms/android-4/arch-arm/usr/lib/libc.so /Users/robbie/Library/Frameworks/Android-NDK/platforms/android-4/arch-arm/usr/lib/libstdc++.so /Users/robbie/Library/Frameworks/Android-NDK/platforms/android-4/arch-arm/usr/lib/libm.so   -Wl,--no-undefined -Wl,-z,noexecstack -L/Users/robbie/Library/Frameworks/Android-NDK/platforms/android-4/arch-arm/usr/lib -llog -lGLESv1_CM -lstdc++ -Wl,-rpath-link=/Users/robbie/Library/Frameworks/Android-NDK/platforms/android-4/arch-arm/usr/lib -lsupc++ -o /Users/robbie/Documents/Apps/Revolution/Android/obj/local/armeabi/libFinal.so/Users/robbie/Documents/Apps/Revolution/Android/obj/local/armeabi/libPlatform.a(ATexture.o): In function `ATexture':/Users/robbie/Documents/Apps/Revolution/Android/jni/SpinTap/ATexture.cpp:9: undefined reference to `TextureRenderer::TextureRenderer(unsigned int)'/Users/robbie/Documents/Apps/Revolution/Android/jni/SpinTap/ATexture.cpp:9: undefined reference to `TextureRenderer::TextureRenderer(unsigned int)'</code></pre><p><strong>Edit2:</strong> TextureRenderer is in Graphics, which is included.</p><p>Does anyone have an idea why it may not be working and how to fix it?</p>","398640","","398640","","2011-01-22 02:04:11","2011-01-22 10:39:29","Android NDK, two Static Libraries and Linking","<android><shared-libraries><static-libraries><android-ndk>","2","2","3","",""
"4765517","1","4765741","","2011-01-22 01:16:38","26","66944","<p>I want to call a service when a certain activity starts. So, here's the Service class:</p><pre><code>public class UpdaterServiceManager extends Service {    private final int UPDATE_INTERVAL = 60 * 1000;    private Timer timer = new Timer();    private static final int NOTIFICATION_EX = 1;    private NotificationManager notificationManager;    public UpdaterServiceManager() {}    @Override    public IBinder onBind(Intent intent) {        // TODO Auto-generated method stub        return null;    }    @Override    public void onCreate() {        // code to execute when the service is first created    }    @Override    public void onDestroy() {        if (timer != null) {            timer.cancel();        }    }    @Override    public int onStartCommand(Intent intent, int flags, int startid) {        notificationManager = (NotificationManager)                 getSystemService(Context.NOTIFICATION_SERVICE);        int icon = android.R.drawable.stat_notify_sync;        CharSequence tickerText = ""Hello"";        long when = System.currentTimeMillis();        Notification notification = new Notification(icon, tickerText, when);        Context context = getApplicationContext();        CharSequence contentTitle = ""My notification"";        CharSequence contentText = ""Hello World!"";        Intent notificationIntent = new Intent(this, Main.class);        PendingIntent contentIntent = PendingIntent.getActivity(this, 0,                notificationIntent, 0);        notification.setLatestEventInfo(context, contentTitle, contentText,                contentIntent);        notificationManager.notify(NOTIFICATION_EX, notification);        Toast.makeText(this, ""Started!"", Toast.LENGTH_LONG);        timer.scheduleAtFixedRate(new TimerTask() {            @Override            public void run() {                // Check if there are updates here and notify if true            }        }, 0, UPDATE_INTERVAL);        return START_STICKY;    }    private void stopService() {        if (timer != null) timer.cancel();    }}</code></pre><p>and here is how I call it:</p><pre><code>Intent serviceIntent = new Intent();serviceIntent.setAction(""cidadaos.cidade.data.UpdaterServiceManager"");startService(serviceIntent);</code></pre><p>The problem is that nothing happens. The above code block is called at the end of the activity's <code>onCreate</code>. I already debugged and no exception is thrown.</p><p>Any idea?</p>","320586","","281545","","2013-04-03 21:03:59","2013-09-11 16:47:46","Start service in android","<android><service><activity>","4","0","7","",""
"4765593","1","4788512","","2011-01-22 01:34:31","0","715","<p>I have a n app widget that is pretty much working, with one quirk.  I've got a LinearLayout in the widget, and I can add rows of my data to it just fine.  There doesn't seem to be any obvious way for me to tell how big the linear layout is and if a given row will fit, so I just add the entire data set (since it isn't very large).  The text in my layout gets cropped at the bottom, which is what I'd expect.  However, the ImageView next to it is not being cropped, but is instead being scaled.  It, frankly, looks goofy.  </p><p>If there's a way for me to tell if a row will fit in my LinearLayout, that would be great.  If there's a way I can tell it to just crop my image, that would be fine too.  This is what the cropping looks like.</p><p>The layout for the rows I'm adding (if there's a goof here, it's probably from the anonymization I applied):</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/checkbox""        android:layout_width=""28sp""        android:layout_height=""28sp""        android:src=""@drawable/check_off""        android:layout_marginLeft=""5dp""        android:layout_marginTop=""1dp""        android:layout_alignParentLeft=""true""/&gt;    &lt;TextView         android:id=""@+id/textview""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:textSize=""16sp""        android:minHeight=""28sp""        android:paddingLeft=""5dp""        android:layout_centerVertical=""true""        android:layout_alignWithParentIfMissing=""true""        android:layout_toRightOf=""@id/checkbox""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>EDIT: The container for the rows is just a simple LinearLayout:</p><pre><code>&lt;LinearLayout    android:id=""@+id/list_items""    android:layout_height=""wrap_content""    android:layout_width=""fill_parent""    android:layout_above=""@id/logo""    android:layout_marginBottom=""4dp""    android:padding=""1dp""    android:orientation=""vertical""    android:background=""@drawable/widget_background""/&gt;</code></pre>","104918","","104918","","2011-01-24 21:42:16","2011-01-24 23:44:12","LinearLayout in RemoteViews not cropping ImageView","<android><android-widget><android-linearlayout>","2","2","","",""
"4765633","1","","","2011-01-22 01:48:55","0","3122","<p>I upgraded my SDK to 2.3 and my build scripts start to fail. I am getting this error:</p><p>build.xml:363: aaptexec doesn't support the ""basename"" attribute</p><p>For the following line in my build script:</p><pre><code>&lt;aapt 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;</code></pre><p>I do not know what changed in aapt but apparently basename is not there any more. Can you tell me what should I use instead?</p>","33885","","","","","2011-01-22 14:50:13","aapt basename attribute","<android><ant><aapt>","1","0","","",""
"4765677","1","","","2011-01-22 02:01:23","0","155","<p>Polling for mail uses up battery life and can't be done too often. I have written a Qt program to run on my always on server and use the IMAP IDLE command to notice mail nearly instantly and send me a SMS message when mail shows up in my account. That allows me to see the text message in a timely fashion and then go read mail and manually sync to actually fetch the message (very handy for the mail account I have setup for things like traffic alerts). I can then save battery life by turning off sync on my mail account.</p><p>The next obvious step is to get a mail client that looks for the specially formatted text messages and pulls the mail down itself. Any mail client developers out there who'd like to add a poll via sms option to their client? (Just curious).</p>","585285","","","","","2011-08-28 06:44:34","Mail client that polls when it gets an SMS message?","<android><email><sms>","1","0","","",""
"4765831","1","4903743","","2011-01-22 02:37:33","1","1074","<p>I am using SeparatedListAdapter as written by <a href=""http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/"" rel=""nofollow"">Jeff Sharkey</a> . I originally started developing this application on Nexus One, where I have gotten it to work exactly as intended.  Now I am moving on testing certain parts, and my application is crashing on all these other phones that are running Android 2.1 .  My project Build Target is 2.1-update1 same as all these phones.  </p><p>Here is the LogCat for the error</p><pre><code>01-21 18:24:01.486: ERROR/AndroidRuntime(4615): Uncaught handler: thread main exiting due to uncaught exception01-21 18:24:01.588: ERROR/AndroidRuntime(4615): java.lang.NullPointerException01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.widget.SimpleAdapter.bindView(SimpleAdapter.java:171)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.widget.SimpleAdapter.createViewFromResource(SimpleAdapter.java:138)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.widget.SimpleAdapter.getView(SimpleAdapter.java:116)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at com.hitpost.GamesList$SeparatedListAdapter.getView(GamesList.java:347)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.widget.AbsListView.obtainView(AbsListView.java:1274)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.widget.ListView.makeAndAddView(ListView.java:1668)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.widget.ListView.fillDown(ListView.java:637)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.widget.ListView.fillSpecific(ListView.java:1224)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.widget.ListView.layoutChildren(ListView.java:1511)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.widget.AbsListView.onLayout(AbsListView.java:1113)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.view.View.layout(View.java:6830)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.widget.RelativeLayout.onLayout(RelativeLayout.java:900)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.view.View.layout(View.java:6830)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.view.View.layout(View.java:6830)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.view.View.layout(View.java:6830)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.view.ViewRoot.performTraversals(ViewRoot.java:996)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.os.Handler.dispatchMessage(Handler.java:99)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at android.os.Looper.loop(Looper.java:123)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at  android.app.ActivityThread.main(ActivityThread.java:4363)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at java.lang.reflect.Method.invokeNative(Native Method)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at java.lang.reflect.Method.invoke(Method.java:521)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)01-21 18:24:01.588: ERROR/AndroidRuntime(4615):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>The relevant part of my code that is referenced by the logcat</p><pre><code>     @Override      public View getView(int position, View convertView, ViewGroup parent) {          int sectionnum = 0;          for(Object section : this.sections.keySet()) {              Adapter adapter = sections.get(section);              int size = adapter.getCount() + 1;              // check if position inside this section              if(position == 0)                 return headers.getView(sectionnum, convertView, parent);              if(position &lt; size) {                //View row = convertView;                ScoreViewHolder viewHolder;                HashMap&lt;String,Object&gt; map = (HashMap&lt;String,Object&gt;) adapter.getItem(position - 1);                if (convertView == null) {                    convertView = inflater.inflate(R.layout.league_list_item, null);                    viewHolder = new ScoreViewHolder();                    viewHolder.row = (RelativeLayout) convertView.findViewById(R.id.ListItem);                    viewHolder.checkinImage = (ImageView) viewHolder.row.findViewById(R.id.CheckinLeagueImage);                    viewHolder.score1 = (TextView) viewHolder.row.findViewById(R.id.Team1Score);                    viewHolder.score2 = (TextView) viewHolder.row.findViewById(R.id.Team2Score);                    convertView.setTag(viewHolder);                } else {                    viewHolder = (ScoreViewHolder) convertView.getTag();                }                if ((Integer) map.get(""position"") % 2 == 1)                    viewHolder.row.setBackgroundColor(Color.DKGRAY);                else                    viewHolder.row.setBackgroundColor(Color.GRAY);                if (map.get(""gamestatus"").equals(""Final"")) {                    viewHolder.gameFinal();                } else if (map.get(""gamestatus"").equals(""In-Progress"")) {                    viewHolder.gameInProgress();                } else if (map.get(""gamestatus"").equals(""Pre-Game"")) {                    viewHolder.gameFinal();                }                viewHolder.row.setOnClickListener(new GameItemListener((String)map.get(""id""),                         map.get(""team2Name"") + "" "" +                        map.get(""team2Score"") + "" @ "" +                        map.get(""team1Name"") + "" "" +                        map.get(""team1Score"")                                               ));                return adapter.getView(position - 1, convertView, parent);                                  }            // otherwise jump into next section              position -= size;              sectionnum++;          }          return null;      }</code></pre><p>With the error coming on ""return adapter.getView(position - 1, convertView, parent);""</p><p>Having spent a fair amount on StackOverflow, I know that its very hard to understand what is going, here is a summary. The ListView displays a list of scores for sports, so each item consists of 2 team names, 2 scores and an icon.</p><p>Would appreciate any hints. I have tried looking though the code of SimpleAdapter to figure out what is causing the error but can't figure it out. Thanks.</p>","292851","","","","","2011-02-04 22:57:34","Using SeparatedListAdapter for ListView crashes on Android 2.1 but works with 2.2","<android><listview><android-2.2-froyo><listadapter><simpleadapter>","1","0","","",""
"4765855","1","","","2011-01-22 02:46:05","1","939","<p>Relative to the below code, how do I make</p><pre><code>if (savering(R.raw.sound1)){</code></pre><p>and</p><pre><code>String filename=”sound1?+”.ogg”;</code></pre><p>and</p><pre><code>values.put(MediaStore.MediaColumns.TITLE, “sound1?);</code></pre><p>dynamic instead of static so that the sound file that will be saved is based on the button pressed?</p><p>My sound files are in a soundArray saved as sound1, sound2, sound3, etc. There is a button for each sound file. Click to play, long click brings up the below contex menu.</p><p>Any help or hints would be greatly appreciated.</p><p>Thanks</p><pre><code>//CONTEXT MENU    @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.sound1)){         // 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.sound1)){         // 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();      }    }//Save into Ring tone Folder    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=""sound1""+"".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, ""sound1 Ringtone"");        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, 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;     }//Save in Notification Folder    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=""sound1""+"".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, ""sound1 Notification"");        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, 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>","585308","","585308","","2011-01-22 03:36:06","2011-01-22 05:59:46","android: Making save to SD card and Context Menu functions dynamic, or relative to button pressed","<java><android><eclipse><context><android-sdcard>","1","5","","",""
"4765881","1","4765900","","2011-01-22 02:56:22","0","542","<p>I am attempting to put a ListView beneath a Text View in an Android App. However, the first line of the ListView shows up on the same line as the TextView. How do I get this to move underneath? </p><p>Here is the 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=""wrap_content""        android:layout_height=""wrap_content""&gt;    &lt;TextView android:id=""@+id/android:question""          android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""@string/dummy_question"" /&gt;        &lt;ListView android:id=""@+id/android:list""          android:layout_width=""wrap_content""            android:layout_height=""wrap_content""/&gt;    &lt;TextView android:id=""@+id/android:empty""          android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""@string/no_notes""/&gt;&lt;/LinearLayout&gt;</code></pre>","64895","","","","","2011-01-22 03:12:05","Android - how to get ListView to line up underneath Text View","<android><layout>","3","0","","",""
"4765944","1","","","2011-01-22 03:14:59","0","445","<pre><code>public class ActivityForShow extends Activity{     //have a ListView layout     ListView.setAdapter(SingleRowAdapter);}public class SingleRowAdapter extends ArrayAdapter{    //every row has a CheckBox ,a TextView and a Button}</code></pre><p>Now I want to handle CheckBox and Button events,do some background work and show result in a dialog.<br>But how to getRefences of Checkbox and Button in ActivityForShow?<br>findViewById() will cause Exception.</p>","509138","","","","","2013-10-16 09:46:23","Event handle on customized ListView","<android><listview>","4","0","0","",""
"4766042","1","4766268","","2011-01-22 03:45:37","0","548","<p>I am attempting to improve the amount time it takes to fill the items into the ScrollView. If I hard code the height (not in pixels of course) of every <code>RelativeLayout</code> in the <code>LinearLayout</code> in the other <code>LinearLayout</code> in the <code>ScrollView</code>... can I get ScrollView to display the visible ones first and then when they are displayed to load up the rest later? The ScrollView should start off scrolled to a specific location.. not just the top of the screen. Now if we have to load from the top that is OK because there is about one third above the visible area and the rest below.</p>","463304","","106224","","2012-09-14 10:29:33","2012-09-14 10:29:33","ScrollView that does not render views that aren't visible","<android><scrollview>","1","0","2","",""
"4766210","1","4766229","","2011-01-22 04:40:27","6","5618","<p>hias we can get the resolution in android but how can we know the density of the device(screen)?</p><p>thnakx</p>","411359","","","","","2013-02-21 19:03:45","how to know density of device?","<android>","1","0","2","",""
"4766274","1","4766306","","2011-01-22 05:03:36","2","917","<p>I have a program which will sample accelerometer data all the time and do some analysis. But I find that when pressing the power button or in the sleep mode, the system will not sample data after a period of time. Does anybody know how to let accelerometer run in the background to collect data?</p><p>Thanks a lot!!!</p>","582327","","","","","2011-01-22 05:15:23","How to sample accelerometer data in the background or on the sleep mode","<java><android>","1","1","0","",""
"4766433","1","","","2011-01-22 06:00:22","0","768","<p>I have a ListActivity with a custom layout. Now I'd like try to add AdMod my activity but I get the same problems I had when I added a button to the layout. If I have the layouts at 100px I see both list and ad but it really isn't looking good.</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""    xmlns:myapp=""http://schemas.android.com/apk/res/se.javalia.myDrinks""    android:orientation=""vertical""&gt;    &lt;RelativeLayout android:layout_width=""fill_parent""        android:layout_height=""200px""        android:gravity=""center""&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/main_no_items"" /&gt;    &lt;/RelativeLayout&gt;    &lt;RelativeLayout android:layout_width=""fill_parent""        android:layout_height=""48px""        android:gravity=""bottom""&gt;        &lt;com.admob.android.ads.AdView android:id=""@+id/ad""            android:layout_width=""fill_parent"" android:layout_height=""wrap_content""            myapp:backgroundColor=""#000000"" myapp:primaryTextColor=""#FFFFFF""            myapp:secondaryTextColor=""#CCCCCC"" android:layout_alignParentBottom=""true""            myapp:keywords=""drink alcohol wiskey rum soda"" myapp:refreshInterval=""300"" /&gt;    &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Do you have any idea about why I don't see the ads when I have increased use 200px, and how to fill the screen without the ad disapering.</p><p>Thanks in advanceRoland</p>","435267","","435267","","2011-01-22 06:48:24","2011-01-22 06:48:24","Admob and ListActivity","<android><layout><admob><listactivity>","1","0","","",""
"4766521","1","","","2011-01-22 06:37:14","0","489","<p>Hi i am an android newbie looking for some advice.</p><p>Have a look at the attached image of mashable's android app. </p><p>It so gorgeous and look even better than their website.</p><p>Any advise would be truly appreciated. </p><p><img src=""http://i.stack.imgur.com/Rct1s.jpg"" alt=""alt text""> </p>","430748","","","","","2011-01-23 16:20:47","How does one build an amazing UI in android","<android><android-layout><android-ui>","2","1","1","",""
"4766665","1","","","2011-01-22 07:21:20","0","642","<p>In my android application i would like to use linked list view wherein i would like to open a webview on click of initial list view.Is it possible to open a webview inside a listview in android??</p><p>Please share your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","","","","2011-01-22 07:46:06","open webview inside a linked list view in android","<android>","1","0","","",""
"4766668","1","5019736","","2011-01-22 07:22:06","1","1491","<p>friends,</p><p>i am using following tutorial to lazy load list view</p><p>now problem is i cannot update if new data comes in any one guide me what mistake am i doing?<a href=""http://open-pim.com/tmp/LazyList.zip"" rel=""nofollow"">Lazy Load Tutorial</a></p><p>my changed code</p><pre><code>public class MainActivity extends Activity {    ListView list;    LazyAdapter adapter;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        list=(ListView)findViewById(R.id.list);        adapter=new LazyAdapter(this, mStrings,mValues);        list.setAdapter(adapter);        Button b=(Button)findViewById(R.id.button1);        b.setOnClickListener(listener);    }    @Override    public void onDestroy()    {        adapter.imageLoader.stopThread();        list.setAdapter(null);        super.onDestroy();    }    public OnClickListener listener=new OnClickListener(){        @Override        public void onClick(View v) {            adapter.imageLoader.clearCache();            ChangeData();           // adapter=new LazyAdapter(MainActivity.this, mStrings,mValues);            adapter.notifyDataSetChanged();        }    };    public void ChangeData()    {        mValues = mValues1;        mStrings = mStrings2;    } private String[] mValues = {            ""670625317/aam-logo-v3-twitter.png"",            ""740897825/AndroidCast-350_normal.png"",            ""121630227/Droid_normal.jpg"",            ""957149154/twitterhalf_normal.jpg"" };    private String[] mValues1 = {            ""670625317/aam-logo-v3-twitter.png"",            ""740897825/AndroidCast-350_normal.png"",            ""121630227/Droid_normal.jpg"",            ""957149154/twitterhalf_normal.jpg"",            ""97470808/icon_normal.png"",            ""511790713/AG.png"",            ""956404323/androinica-avatar_normal.png"",            ""909231146/Android_Biz_Man_normal.png"",    };    private String[] mStrings ={ ""http://zef.me/wp-content/uploads/2008/02/funny-cat.jpg"",            ""http://www.prchurch.com/data/43_800px-Bulgaria_stub.svg.png"",            ""http://a3.twimg.com/profile_images/121630227/Droid_normal.jpg"",            ""http://a1.twimg.com/profile_images/957149154/twitterhalf_normal.jpg""};    private String[] mStrings2={            ""http://zef.me/wp-content/uploads/2008/02/funny-cat.jpg"",            ""http://www.prchurch.com/data/43_800px-Bulgaria_stub.svg.png"",            ""http://a3.twimg.com/profile_images/121630227/Droid_normal.jpg"",            ""http://a1.twimg.com/profile_images/957149154/twitterhalf_normal.jpg"",            ""http://a1.twimg.com/profile_images/97470808/icon_normal.png"",            ""http://a3.twimg.com/profile_images/511790713/AG.png"",            ""http://a3.twimg.com/profile_images/956404323/androinica-avatar_normal.png"",            ""http://a1.twimg.com/profile_images/909231146/Android_Biz_Man_normal.png"",               };}</code></pre>","249991","","","","","2011-02-16 17:18:08","Lazy Loading tutorial by fedor in list update problem?","<android><listview>","2","0","0","",""
"4766679","1","4766741","","2011-01-22 07:25:02","4","1532","<p>If I use the default group indicator (not setting a new one), how can I know the padding width for the layout of groupview?</p><p>So can let my layout won't overlap with the group indicator.</p><p>Is that possible? Because I can't find a method to getGroupIndicator.Or I must have to set a new one that I know its size.</p><p>Thanks!</p>","428022","","","","","2013-06-08 18:37:17","How can I get the width of ExpandableListView's group indicator drawable on Android?","<android><group><expandablelistview><indicator>","2","0","1","",""
"4766680","1","","","2011-01-22 07:25:25","2","275","<p>I recently wrote my first app for android, and I created a listview for selecting an element from a list of about 500 items.  Since it's basically the default listview, it's searchable, and I can bring up the onscreen keyboard by holding down the menu button, but I was wondering if there was a way to bring up the keyboard automatically (and not make it freak out if the phone has a physical keyboard).  Does anyone know how I can do this?  I've been searching around and haven't found anything.</p>","585419","","","","","2011-01-28 05:59:03","Android app, showing a keyboard","<android>","2","0","0","",""
"4766794","1","4778770","","2011-01-22 07:57:18","0","250","<p>I need your quick assistance for the problem stated below</p><p>In my android application I show a marker on specific location. </p><p>Here is my code </p><pre><code>double latitude = Double.parseDouble(this.latitude);    double longitude = Double.parseDouble(this.longitude);    int latitudeE6 = (int) (latitude * 1e6);    int longitudeE6 = (int) (longitude * 1e6);    Log.i(""Latitude"",""String = ""+this.latitude+"",Double = ""+latitude+"", int = ""+latitudeE6);    Log.i(""Longitude"",""String = ""+this.longitude+"",Double = ""+longitude+"", int = ""+longitudeE6);    GeoPoint point = new GeoPoint(latitudeE6, longitudeE6);    Log.i(""Point a"", """"+point.getLatitudeE6()+"",""+point.getLongitudeE6());    OverlayItem overlay = new OverlayItem(point, title, detail);    Drawable drawable = mapView.getContext().getResources().getDrawable(            R.drawable.pin);    HelloOverlayItem helloOverLay = new HelloOverlayItem(drawable, this);    Log.i(""Point b"", """"+point.getLatitudeE6()+"",""+point.getLongitudeE6());    helloOverLay.addOverlay(overlay);    mapView.getOverlays().add(helloOverLay);    MapController controller = mapView.getController();    Log.i(""Point c"", """"+point.getLatitudeE6()+"",""+point.getLongitudeE6());    controller.animateTo(point);    controller.setCenter(point);    controller.setZoom(10);</code></pre><p>I can get proper location integers in ""Point C"" log entry, which is not 0,0 (some where near London) But in map it always show me on 0,0 how can it be possible?? How to get rid of this??</p>","246942","","246942","","2011-01-22 11:51:47","2011-01-24 04:53:08","Need help regarding placement of map marker","<android><android-maps><itemizedoverlay>","1","0","","",""
"4766812","1","4766883","","2011-01-22 08:04:40","3","4505","<p>Though i have asked the question before but dint get any proper answer. I have an EditText when edit text is focused android virtual keyboard pops up, i have added Done button to the keyboard using ime option from property window. Now i want to perform some action by pressing the Done button. How to do this? Please any body help.</p>","489762","","1471203","","2013-01-09 10:16:28","2013-01-09 10:16:28","android virtual keyboard listener","<android>","1","0","1","",""
"4766881","1","","","2011-01-22 08:27:54","0","720","<p>Is there a way to find the codec difference for a video file on Android? I need to find out if the file is encoded as H.263 or as H.264? The mime type is always video/3gp, so that's not useful.</p><p>I read something about magic cookies, but I cannot find the magic cookie format for H.263 encoded files. Any ideas?</p>","585442","","","","","2011-04-25 11:48:38","Android H.263 or H.264 file?","<android><mime-types><video-encoding>","1","0","","",""
"4766910","1","","","2011-01-22 08:39:34","0","428","<p>This is more of a theoretical question on how to do it rather then an actual programming question. Target platform is Android, though.</p><p>I have a list of waypoints. And I have my current position. I want to know if any of the waypoints are close to me, eg. +/-5 km. I could calculate the distans to each waypoint seperately to find out if it is within the specified radius, but isn't there a better way to do this? Like, are these points included in this area (area beeing a 5km circle around my position) (you can do something like this when working with graphics and click/touch events)?</p><p>Any help is appreciated!</p><p>/Magnus</p>","513932","","","","","2011-01-22 09:39:05","Find distance to waypoints? Or waypoint within x miles?","<android><google-maps><positioning><distance>","1","0","","",""
"4766912","1","4766965","","2011-01-22 08:39:44","3","3702","<p>My question is simple. Are all unicode characters available in Android?I actually am using the soft keyboard and i want to add a few arabic letters which i cant find the code for it.</p>","585449","","","","","2013-02-26 16:14:53","Are all the unicode characters supported on android","<android><unicode><character><android-softkeyboard>","3","0","1","",""
"4766938","1","4766970","","2011-01-22 08:46:00","0","2758","<p>I have created a custom View which I usually attach an onClickListener to. I'd like to have some button like behavior: if it is pressed, it should alter its appearance which is defined in the onDraw() method. However, this code does not work:</p><pre><code>//In my custom View:@Overrideprotected void onDraw(Canvas canvas){    boolean pressed = isPressed();    //draw depending on the value of pressed}//when creating the view:MyView.setClickable(true);</code></pre><p>pressed always has the value false. What's wrong?</p><p>Thanks a lot!</p>","292233","","","","","2011-04-08 04:28:41","Custom view with button like behavior on click/touch","<android>","3","0","","",""
"4766977","1","","","2011-01-22 08:54:21","2","1888","<p>Whenever I try to run my app, the following exception is thrown:</p><p>01-22 00:40:51.868: ERROR/AndroidRuntime(2219): java.lang.RuntimeException: Unable to start activity ComponentInfo{[Redacted]}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'</p><p>Here is the markup for the ListView in question:</p><pre><code>&lt;ListView  android:id=""@+id/list""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent"" android:dividerHeight=""1px""&gt;&lt;/ListView&gt;</code></pre><p>So, since the id is clearly defined as ""list,"" what gives here? I've run through my code multiple times in the past couple of hours trying to track down the cause of this and I'm stumped. Can anyone offer any pointers?</p>","585454","","234938","","2011-01-24 11:06:15","2011-01-24 11:06:15","Why does my Android app keep telling me I need to define a ListView id when it is already defined?","<android><listview>","4","1","","",""
"4767004","1","","","2011-01-22 09:00:04","0","2019","<p>I have an Android project using some native functions. Native functions are using some functions from external shared library ""external_lib.so""I've added to Android.mk: ""-lexternal_lib -L/path/to/external/lib"" line and myjni.so have been linked successfully. But during runtime  myjni.so loading error occurred. The size of myjni.so reflects that external_lib.so is not included. How to fix the problem?</p><p>LOCAL_PATH := $(call my-dir)</p><p>include $(CLEAR_VARS)</p><p>LOCAL_MODULE    := myjniLOCAL_SRC_FILES := myjni.cLOCAL_LDLIBS :=  -ldl -llog -lz <strong>-lexternal_lib -L/path/to/external/lib</strong></p><p>include $(BUILD_SHARED_LIBRARY)</p>","462742","","","","","2011-12-27 10:03:59","Add shared lib.so to android project","<android><shared-libraries><android-ndk>","1","0","","",""
"4767011","1","4767094","","2011-01-22 09:01:24","0","200","<p>I'm a developer and <strong><em>I have the desire to do everything technically possible</em></strong> with my mobile device, such as programmatically placing calls, programmatically deciding whether what to do with an incoming call (hang up, divert to voicemail, play an automated message etc), programmatically sending text messages, accepting push notifications from my own servers, allowing me to read data from the GPS device, periodically taking pictures, running my own programs without making them to the app store, etc...</p><p>Which of the existing mobile device platforms has the most liberal and feature-complete API that may allow some of the above? Good documentation would be a plus :=)</p>","250827","","250827","","2011-01-22 10:06:27","2011-01-22 10:06:27","iOS, Android, Blackberry etc, which of the mobile OS is the most hacker-friendly?","<iphone><android><ios><blackberry><hacking>","1","0","","2011-01-22 10:12:26",""
"4767123","1","4767454","","2011-01-22 09:31:50","0","395","<p>I have a singleton object ""MySingle"" which all through my classes I retrevie as <code>MySingle.createOrGetInstance();</code></p><p>Now the problem I am having is that I would like to do some Method Logging and other stuff before a method in MySingle is called, so I looked into the Java InvocationHandler class <a href=""http://download.oracle.com/javase/1.3/docs/guide/reflection/proxy.html"" rel=""nofollow"">Source Link</a></p><p>However the problem is now how would I call the singleton method, because when I use the same code and instead of doing</p><pre><code>DebugProxy.newInstance(new FooImpl());</code></pre><p>I do this</p><p><code>DebugProxy.newInstance(MySingle.createOrGetInstance());</code> But when I do this, I get a class Cast expression when I end up assigning the result to a variable `(MySingle sing).</p><p>Im developing on Android but I doubt that makes any difference :).</p><p>Thanks,Faisal abid</p>","117691","","117691","","2011-01-22 09:38:19","2011-01-22 11:08:19","Java InvocationHandler and a Singleton","<java><android><reflection>","2","0","","",""
"4767135","1","4767604","","2011-01-22 09:36:22","0","1098","<p>I'm writing an Android app that uses zxing (barcode scanner).  I've gotten to the point where the barcode scanner returns a product id (example: 798709102087), and I put that in a url (example: <a href=""http://www.google.com/products?q=798709102087"" rel=""nofollow"">http://www.google.com/products?q=798709102087</a>).</p><p>What I would like to do is once I construct that url string... I'd display the first result returned by that url.</p><p>Here's the flow:1) They turn on my app2) They select barcode scan3) They scan the product (which automagically sends them back to the main page of my app)4) The user is then shown the first product (if any) found on the google product site.</p><p>I don't need you guys to write code for me, I just need suggestions on how I should go about doing this!  I'm relatively new to Android apps, so be gentle!</p><p>Thanks for your help guys, and let me know if I can clarify anything.</p>","585474","","","","","2011-08-08 08:43:39","Android - How to read contents of a webpage","<android><zxing>","1","0","1","",""
"4767183","1","4767257","","2011-01-22 09:53:48","1","2061","<p>i have an app, that shows a list of friends (each friend haves fullName and movilephone).</p><p>i'm using a variation of the listActiviti example of android developers guide</p><p>can someone complete my code or tell me code examples of how to put a button on the right side of the items of each list, that when the user press on that button, the phone calls to the phone number of that user. Also, now, when the user press on the list item (but not on the button) it's opened a new activity for showing details of the friend... this functionality haves to be working separatedly of the button</p><p>this is my <code>list_item.xml</code>:</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""    android:padding=""10dp""    android:textSize=""16sp"" &gt;&lt;/TextView&gt;</code></pre><p>and this is my code for the listActivity:</p><pre><code>public class AllActivity extends ListActivity {RemoteConnection con; //conexion remota private List&lt;Friend&gt; friends; //lista de amigosprivate List&lt;String&gt; usernames; //lista de usernames de amigos, para rellenar el listviewstatic SharedPreferences settings;static SharedPreferences.Editor configEditor;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);            settings=PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext());    configEditor = settings.edit();    friends = new ArrayList&lt;Friend&gt;();    usernames = new ArrayList&lt;String&gt;();    con = new RemoteConnection();    actualizar();}protected void onActivityResult(int requestCode, int resultCode, Intent data) {    if (resultCode == 1) {        setResult(1);        finish();                       }}public void onResume() {    super.onResume();          }       public void actualizar()    {        friends = MyApplication.getDatabaseAdapter().retrieveAllFriends();        usernames.clear();for (int i=0;i&lt;friends.size();i++)        {            usernames.add(i,friends.get(i).getFullName());        }        setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, usernames));        ListView lv = getListView();        lv.setTextFilterEnabled(true);        lv.setOnItemClickListener(new OnItemClickListener() {          public void onItemClick(AdapterView&lt;?&gt; parent, View view,              int position, long id) {              Bundle bundle = new Bundle(); //bundle is like the letter                         bundle.putString (""user"", friends.get(position).getFullName()); //arg1 is the keyword of the txt, arg2 is the txt              bundle.putString (""email"", friends.get(position).getEmail());              bundle.putString (""permission"", friends.get(position).getPermission());              Intent i=null;              if (friends.get(position).getPermission().equals(""total""))                  i = new Intent (AllActivity.this, Locate.class);              else if (friends.get(position).getPermission().equals(""perhours""))                  i = new Intent (AllActivity.this, LocatePerHours.class);              else                  i = new Intent (AllActivity.this, LocatePerDays.class);              i.putExtras(bundle);              startActivity(i);          }        });    }}</code></pre>","479886","","","","","2011-01-22 10:12:55","How can i add a button that makes a phone call to a programatically given phone number?","<android><call><listactivity><phonecalls>","1","0","1","",""
"4767242","1","4767297","","2011-01-22 10:09:24","0","522","<p>how can we get popup by touching on particular image and popup should be cancel by moving out from image in android?? code will be better help for me...</p>","432559","","432559","","2011-01-22 11:29:13","2011-01-22 11:29:13","how can we get popup by touching on particular image i n android?? code will be better help for me","<android>","2","0","","",""
"4767472","1","","","2011-01-22 11:11:35","0","129","<p>I am working android application.I have store 1000 values in database.when i retrieve the data from database,it's take more time to retrieve.how can i solve this problem.help me......... </p>","533787","","","","","2011-01-22 11:19:41","how to solve lazy loading?","<android>","1","0","","",""
"4767519","1","","","2011-01-22 11:22:59","3","1821","<p>I am developing an Android app with an Activity with a ScrollView that contains, among other stuff, a HorizontalScrollView. When I touch the HorizontalScrollView I want to disable vertical scrolling of the outer ScrollView. How do I achieve that? </p><p>ThanksMarkus</p>","574499","","","","","2012-01-21 12:26:23","Android: How to disable vertical scroll of ScrollView when scrolling a HorizontalScrollView?","<android><scrollview><horizontalscrollview>","1","1","2","",""
"4767520","1","4767637","","2011-01-22 11:24:22","0","479","<p>im making an Android app, i have a service, that update my local DB in background, by downloading data from the remote DB.</p><p>i have to put a thread on the service, because i dont know why, when i use a simple handle style bucle on the service it frozen my app during some secs when it is updating the local db. (i have my local db in a dbAdapter on MyApplication class)</p><p>OK, then i put a thread on the service, but i dont know why, if i start the service, the  thread of the service is frezzing my APP :S. it's suposed that when u use services and threads code is executed in background and doesnt froze nothing, but in this case is frezzing my app. ¿how to avoid it?</p><p>this is the code of my service:</p><pre><code>public class MyServiceLocalDB extends Service implements Runnable{RemoteConnection con; //conexion remota//para almacenar la config local de mi appstatic SharedPreferences settings;static SharedPreferences.Editor configEditor;boolean serviceStopped;private static MyDbAdapter         mDb;@Overridepublic IBinder onBind(Intent intent) {    return null;}@Overridepublic void onCreate() {    serviceStopped=false;    settings = PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext());    configEditor = settings.edit();    con = new RemoteConnection();     mDb = new MyDbAdapter(this);    mDb.open();}@Overridepublic void onDestroy() {    //player.stop();    serviceStopped=true;}@Overridepublic void onStart(Intent intent, int startid) {    //player.start();    this.run();}public void updateDB(){      mDb.clearDB();    List&lt;Friend&gt; myFriends=con.RetrieveFriends(settings.getString(""login"",""""));    List&lt;Permission&gt; myPermissions=con.RetrievePermissions(settings.getString(""login"",""""));    Permission p1 = null;    for (int i=0;i&lt;myFriends.size();i++)    {        mDb.createUser(myFriends.get(i).getEmail(),myFriends.get(i).getFullName(),myFriends.get(i).getMovilephone(),myFriends.get(i).getMovileOperatingSystem(),myFriends.get(i).getPermission());        //p1=con.RetrievePermissionWithUser(""pablo@upv.es"", myFriends.get(i).getEmail());    }    for (int i=0;i&lt;myPermissions.size();i++)    {        p1=myPermissions.get(i);        String hour1=formatHourFromTime(p1.getHour1());        String hour2=formatHourFromTime(p1.getHour2());        mDb.createPermission(p1.getFk_email1(),p1.getFk_email2(),""""+p1.getValidated(),hour1,hour2,p1.getDate1Formated(),p1.getDate2Formated(),""""+p1.getWeekend(),p1.getFk_type());        p1=null;    }    //MyApplication.getDatabaseAdapter().clearDB();    MyApplication.setDatabaseAdapter(mDb);}public String formatHourFromTime(Time time){    String hour1;    if (time.getHours()&lt;10)        hour1=""0""+time.getHours();    else        hour1=""""+time.getHours();    if (time.getMinutes()&lt;10)        hour1=hour1+"":0""+time.getMinutes()+"":00"";    else         hour1=hour1+"":""+time.getMinutes()+"":00"";    return hour1;}public void run() {    while (serviceStopped==false)     {        //handler.sendEmptyMessage(0);        try {           Thread.sleep(25000);// sleeps        } catch (InterruptedException e) {}        updateDB();    }   }</code></pre><p>}</p>","479886","","","","","2011-01-22 11:49:21","Why this thread is blocking my Android APP?","<android><multithreading><service>","1","0","","",""
"4767564","1","","","2011-01-22 11:34:43","0","1550","<p>Sorry about this guys. This must be like the third question I've had to ask about this project alone. =(</p><p>What i want to be able to do is toggle the visibility of a radio button using a check box in a preferences activity.</p><p>There are no errors in my code and both activities run fine, but there is no change in visibility when the check box is checked or unchecked.</p><p>Here is my Activity with the radiobuttons</p><pre><code>import android.app.Activity;import android.content.SharedPreferences;import android.os.Bundle;import android.preference.PreferenceManager;import android.view.View;import android.widget.EditText;import android.widget.RadioButton;import com.medialets.android.analytics.MMAnalyticsManager;public class Temperature extends Activity {MMAnalyticsManager mManager;private EditText text;public void onStart(Bundle savedInstanceState){    super.onStart();    getPrefs();}    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.temperature);        text = (EditText)findViewById(R.id.EditText01);mManager = MMAnalyticsManager.sharedInstance(this);mManager.start(""codeHere"", ""1.0"",    false);}@Overridepublic void onPause() {super.onPause();mManager.pause();}@Overridepublic void onResume() {super.onResume();mManager.resume();}@Overridepublic void onDestroy() {super.onDestroy();mManager.stop();}    public void myClickHandler(View view){        switch (view.getId()) {        case R.id.Button01:            RadioButton celsiustokelvinButton = (RadioButton) findViewById (R.id.RadioButton05);            RadioButton celsiustofarenheitButton = (RadioButton) findViewById(R.id.RadioButton01);            RadioButton farenheittocelsiusButton = (RadioButton) findViewById(R.id.RadioButton02);            RadioButton farenheittokelvinButton = (RadioButton) findViewById(R.id.RadioButton06);            RadioButton kelvintocelsiusButton = (RadioButton) findViewById (R.id.RadioButton03);            RadioButton kelvintofarenheitButton=(RadioButton) findViewById (R.id.RadioButton04);            float inputValue = Float.parseFloat(text.getText().toString());              if (celsiustofarenheitButton.isChecked())  {                text.setText(String                        .valueOf(convertCelsiusToFarenheit(inputValue)));            } if (farenheittocelsiusButton.isChecked()) {                text.setText(String                        .valueOf(convertFarenheitToCelsius(inputValue)));            } if (celsiustokelvinButton.isChecked()) {                text.setText(String                        .valueOf(convertCelsiusToKelvin(inputValue)));            } if (farenheittokelvinButton.isChecked()) {                text.setText(String                        .valueOf(convertFarenheitToKelvin(inputValue)));            } if (kelvintocelsiusButton.isChecked()) {                text.setText(String                        .valueOf(convertKelvinToCelsius(inputValue)));            } if (kelvintofarenheitButton.isChecked()) {                text.setText(String                        .valueOf(convertKelvinToFarenheit(inputValue)));            }            break;        }}    private float convertFarenheitToCelsius(float fahrenheit){        return ((fahrenheit - 32) * 5 / 9);    }    private float convertCelsiusToFarenheit(float celsius){        return ((celsius * 9) / 5) + 32;           }    private double convertCelsiusToKelvin(float celsius){        return celsius + 273.15;    }    private double convertFarenheitToKelvin(float farenheit){        return ((farenheit-32)/(1.8));    }    private double convertKelvinToCelsius(float kelvin){        return kelvin-273.1;    }    private double convertKelvinToFarenheit(float kelvin){        return kelvin*1.8-459.67;    }    boolean CheckboxPreference;    private void getPrefs() {            // Get the xml/preferences.xml preferences            SharedPreferences prefs = PreferenceManager                            .getDefaultSharedPreferences(getBaseContext());            CheckboxPreference = prefs.getBoolean(""checkboxPref"", true);}}</code></pre><p>And here is my Preferences Activity </p><pre><code>import android.app.Activity;import android.content.SharedPreferences;import android.os.Bundle;import android.preference.Preference;import android.preference.PreferenceActivity;import android.preference.Preference.OnPreferenceClickListener;import android.widget.CheckBox;import android.widget.CompoundButton;import android.widget.RadioButton;import android.widget.Toast;import android.widget.CompoundButton.OnCheckedChangeListener;public class Preferences extends PreferenceActivity {private RadioButton btn01;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    addPreferencesFromResource(R.xml.preferences);    btn01 = (RadioButton)findViewById(R.id.RadioButton01);    Preference customPref = (Preference) findPreference(""customPref"");    customPref.setOnPreferenceClickListener(new OnPreferenceClickListener(){        public boolean onPreferenceClick(Preference preference) {            Toast.makeText(getBaseContext(),""The Custom Preference Has Been     Clicked"",Toast.LENGTH_LONG).show();            SharedPreferences customSharedPreference =     getSharedPreferences(""myCutomSharedPrefs"", Activity.MODE_PRIVATE);            SharedPreferences.Editor editor = customSharedPreference.edit();            editor.putString(""myCustomPref"",""The preference has been clicked"");            editor.commit();            CheckBox();            return true;        }        private void CheckBox() {            final CheckBox ThisCheckBox = (CheckBox) findViewById (R.id.checkboxPref);            ThisCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener(){                @Override               public void onCheckedChanged(CompoundButton compoundButton,boolean     test) {                    if (ThisCheckBox.isChecked()){                         btn01.setVisibility(View.VISIBLE);                    } else {                        btn01.setVisibility(View.GONE);                    }                }            });        };    });}}</code></pre><p>Sorry there is other stuff in there as well such as an analytics plug in</p><p>Anyone have any idea as to why this just isn't working</p><p>(Just a side note. When looking at the logcat, clicking the checkbox returned no results)</p><p><strong>EDIT:</strong> OK i've just ammended my code as suggested but i'm afraid that the preferences still do not affect anything. Anybody have any ideas?? =(</p>","562562","","562562","","2011-01-23 14:06:38","2011-01-23 14:06:38","How do I get android preferences to work?","<android><checkbox><activity><radio-button><preferences>","1","1","","",""
"4767631","1","","","2011-01-22 11:47:41","3","447","<p>My intent filter looks like this:</p><pre><code>&lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.VIEW"" /&gt;    &lt;action android:name=""android.intent.action.SENDTO"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT""&gt;&lt;/category&gt;    &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;    &lt;data android:scheme=""http"" android:host=""mywebsite"" android:pathPattern=""/oauth/authorize?.*oauth_verifier=.*"" /&gt;&lt;/intent-filter&gt;</code></pre><p>however this fails to match.</p><p>If I remove the <strong>?</strong> and everything after it, it matches but the site I am matching uses that URL several times, and the only one I am interested in is the oauth_verifier.</p><p>Is there anyway to make an intent filter match the bit (query parameters?) after the <em>/oauth/authorize</em> </p><p>thanks,sam</p>","73135","","","","","2011-01-22 13:32:26","Matching complex patterns with intent filters and data","<android>","1","0","","",""
"4767781","1","5290974","","2011-01-22 12:23:44","0","163","<p>I use a MapActivity and have the following problem:</p><p>When I zoomin or zoomout with a multitouch-gesture, sometimes the Map freezes and a blank display is shown. Has anybody seen this?</p>","566994","","246246","","2012-05-13 07:28:54","2012-05-13 07:28:54","MapActivity Gesture Problem","<android><android-maps>","1","0","","",""
"4767790","1","","","2011-01-22 12:26:17","1","1228","<p>Is it possible to change the blue line that appears beneath an inactive tab? I've tried setting the background of the TabWidget, but it seems to be something on the tab itself, being drawn <em>over</em> the drawable I am setting. </p><p>Thanks</p>","585573","","","","","2011-12-16 07:36:52","Change the blue line that appears under an inactive tab","<android><tabwidget>","2","0","","",""
"4767897","1","4768046","","2011-01-22 12:53:29","1","1293","<p>I am creating an application which uses a steganography algorithm. Now I can encrypt and decrypt text. But I want my application to ask for password after encrypting the text into the image, so that whenever someone will decrypt the image it would ask for the password for authentication. Is this even possible? If yes, how?</p>","516160","","","","","2011-01-24 08:31:39","Encryption Algorithm","<android><eclipse><algorithm><encryption>","3","0","","",""
"4767929","1","4768275","","2011-01-22 12:59:49","0","545","<p>I have developed html5 canvas based animations (non-interacive) which work very well in latest desktop browsers but perform miserably on iphone and android. I want to port these web based html5 canvas application to native iphone and android applications. I am looking for something that will provide the quickest way to port such applications to native iphone and android applications without having to learn something completely different like opengl es. Is there such native API ( something like canvas 2d drawing surface) and if so what is the API?</p>","574122","","","","","2011-01-22 14:09:45","What is the native application API for iphone and android that is equivalent html5 canvas?","<iphone><android><html5><canvas>","2","0","","",""
"4767940","1","","","2011-01-22 13:02:35","0","2390","<p>Hi i am implementing a gridView and i have trouble making it scroll down 1 row at a time with every scroll event. </p><p>my grid has a height of 1 row item (items height is 75dp). i don't want scrolling to be left in a middle of a row. </p><p>is there a way i can intercept and modify the scroll distance so that it only returns fixed value ex: +-75dp.</p><p>i would appreciate any help or suggestions you can give me. tnx</p>","448192","","","","","2011-01-22 14:07:43","GridView Scroll By one row","<android><gridview><custom-scrolling>","1","0","1","",""
"4767950","1","4767982","","2011-01-22 13:05:25","0","343","<p>I'm trying to modulate an alpha value in a Java application I'm building on Android. Right now it goes like this:</p><pre><code>if (goingUp) {    newAlpha = oldAlpha + rateOfChange;    if (newAlpha &gt; maxAlpha) {        newAlpha = maxAlpha;        goingUp = false;    }} else {    newAlpha = oldAlpha - rateOfChange;    if (newAlpha &lt; minAlpha) {        newAlpha = minAlpha;        goingUp = true;    }}</code></pre><p>Where <i>rateOfChange</i> is an arbitrary int that cannot be greater than maxAlpha. The equation is evaluate every tick in a thread and is independent of time.</p><p>Is there a way using only the variables given + Math.PI and other Math elements (I'm assuming Math.Sine will be in there) to get newAlpha to be a number on a Sine?</p><p>I'm thinking min and max would be the amp of the wave and rateOfChange would be a product of the Sine function, I just can't figure out how it all goes together.</p>","333525","","","","","2011-01-22 15:35:00","How would I change an equation to modulate a number on a line, to one that that modulates on a sine curve?","<java><android><math><equation><sine>","3","0","","",""
"4767999","1","4769089","","2011-01-22 13:16:20","0","1200","<p>I am trying to make a program the makes a graph using user input values from 2 EditText Fields. The program should use this input to draw a line from the center of an axis to a point specified by the information. I have a button that each time it is clicked should make a new line to the point specified (so there can be more than one line) I have created a custom view to hold the axis, but that utilizes its onDraw method, obviously, so I cant use it also to draw the new line.</p><p>Here is the code for my custom view:</p><pre><code>package android.physicsengine;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.util.AttributeSet;import android.view.View;public class AxisDrawing extends View{public AxisDrawing(Context context){    super(context);}public AxisDrawing(Context context, AttributeSet attrs){    super(context, attrs);}public AxisDrawing(Context context, AttributeSet attrs, int defStyle){    super(context, attrs, defStyle);}@Overrideprotected void onDraw(Canvas canvas){    canvas.drawColor(Color.BLACK);    Paint linePaint = new Paint(Paint.ANTI_ALIAS_FLAG);    linePaint.setColor(Color.RED);    canvas.drawLine(canvas.getWidth()/2, canvas.getHeight()/2-200,        canvas.getWidth()/2 ,canvas.getHeight()/2+100, linePaint);    canvas.drawLine(canvas.getWidth()/2-150, canvas.getHeight()/2-75, canvas.getWidth()/2+150 ,canvas.getHeight()/2-75, linePaint);}}</code></pre>","583082","","","","","2013-07-16 05:24:05","Drawing onClick in Android","<android><button><canvas><ondraw>","2","0","","",""
"4768039","1","4768066","","2011-01-22 13:23:26","1","286","<p>Using the standard Eclipse-based development environment to develop Android apps, you press Control-F11 to squirt your app down the USB cable to your phone.  This works great, but if you've done practically any work at all between tests the screen will have timed out and turned off.  You then have to press the power button, then slide the slider, then do the pattern unlock pattern, and only then can you see your app running.  This gets old pretty quickly.</p><p>It would be nice to be able to somehow have a message sent down with your app to do all this for you.  </p><p>I accept that I could probably configure my phone to not turn the screen off, and disable the slider and pattern lock, but I don't really want to as I always want that behaviour when I'm not developing.</p><p>Any idea if the behaviour I'm after is possible?  I've looked unsuccessfully for any documentation describing how to customize whatever happens when you send data to the phone.  If possible the solution should be possible from within eclipse, but even having to send it via Terminal (I use Ubuntu to develop) or something would similar would be better than nothing.</p>","146043","","","","","2013-11-20 00:32:58","How to avoid manually turning on, sliding and unlocking screen each time I run Android app remotely","<android><debugging>","2","0","1","",""
"4768142","1","","","2011-01-22 13:41:26","1","476","<p>I need some help for a little problem in my little Android-Test program. ;) Is it possible in Android to extend the little popup by a long click on contact by an own icon/handler? My target is to click on the new icon and give my intent the contactId and with that I want to go further like this. Here is a little example what I mean:</p><p><a href=""http://img41.imageshack.us/img41/3550/unbenanntmrp.jpg"" rel=""nofollow"">http://img41.imageshack.us/img41/3550/unbenanntmrp.jpg</a></p><p>If this isn't possible than how can the given handler extended. In my case a click on the message handler (the 2nd one in screenshot) should popup a possibility to open my program. I know this is possible and I searched around a little bit, but I can't find a solution. Maybe you can give me a direction to the right way.</p><p>The 3rd and the last question is if it is also possible to extend the Send-Button in the dialogues view of android. I mean if someone sends you a text you can answer directly in this dialogue without calling the message-app. I hope you understand what I mean.</p><p>Thanks in advance,tommyboy66</p>","371089","","","","","2011-01-22 13:41:26","Register a own handler in Contacts (or extend given ones)","<android>","0","3","1","",""
"4768165","1","4969213","","2011-01-22 13:47:44","1","7659","<p>I know the subject was on the board many times, but i can not get it work anyhow...I want to save view frames from preview to jpeg files. It looks more or less(code is simplified- without additional logic, exception etc) like this...</p><pre><code>public void onPreviewFrame(byte[] data, Camera camera) {  int width = camera.getParameters().getPreviewSize().width;  int height = camera.getParameters().getPreviewSize().height;  final int[] rgb = decodeYUV420SP(data, width, height);  Bitmap bmp = Bitmap.createBitmap(rgb, width, height,Bitmap.Config.ARGB_8888);  String filename=""/sdcard/file"" + (index++)+ "".jpg"";   FileOutputStream out;  out = new FileOutputStream(filename);  bmp.compress(Bitmap.CompressFormat.JPEG, 90, out);  out.flush();  out.close();  out=null; }</code></pre><p>Here is the one of the methods i tried to convert colors(from this board i believe)</p><pre><code>public int[] decodeYUV420SP( byte[] yuv420sp, int width, int height) {       final int frameSize = width * height;       int rgb[]=new int[width*height];       for (int j = 0, yp = 0; j &lt; height; j++) {           int uvp = frameSize + (j &gt;&gt; 1) * width, u = 0, v = 0;           for (int i = 0; i &lt; width; i++, yp++) {               int y = (0xff &amp; ((int) yuv420sp[yp])) - 16;               if (y &lt; 0) y = 0;               if ((i &amp; 1) == 0) {                   v = (0xff &amp; yuv420sp[uvp++]) - 128;                   u = (0xff &amp; yuv420sp[uvp++]) - 128;               }               int y1192 = 1192 * y;               int r = (y1192 + 1634 * v);               int g = (y1192 - 833 * v - 400 * u);               int b = (y1192 + 2066 * u);               if (r &lt; 0) r = 0; else if (r &gt; 262143) r = 262143;               if (g &lt; 0) g = 0; else if (g &gt; 262143) g = 262143;               if (b &lt; 0) b = 0; else if (b &gt; 262143) b = 262143;               rgb[yp] = 0xff000000 | ((r &lt;&lt; 6) &amp; 0xff0000) | ((g &gt;&gt; 2) &amp;        0xff00) | ((b &gt;&gt; 10) &amp; 0xff);           }       }       return rgb;       } </code></pre><p>The problem is that the picture always looks like three 'strange green pictures'...I ama new user so i can't post it:(</p><p>I dont know if it has something to do with the size or what but i am stuck...Can you support me with it?</p>","573046","","","","","2012-09-11 12:24:58","Android - Problem whith converting preview frame to bitmap","<android><camera><frame><preview><yuv>","3","0","","",""
"4768173","1","4768644","","2011-01-22 13:49:12","5","3291","<p>I'm still learning about Android, and while playing around with <code>TabHost</code> and <code>TabWidget</code>, I can't help but notice that there's no option to turn off the icons.</p><p>It's eating up valuable space even when I don't actually set an icon into the <code>TabSpec</code>. Is there any way to reduce the height of the tab bar? It's really hard to find small icons (at 3 different sizes) that perfectly fits what I intended those tabs to contain. I have zero skills with graphics.</p>","124111","","","","","2012-09-20 12:01:32","Don't want icons on my TabWidget","<android>","2","0","1","",""
"4768295","1","4769231","","2011-01-22 14:13:37","0","517","<p>I need to retrive information from a <a href=""http://mobile.viaggiatreno.it/viaggiatreno/mobile/stazione?lang=EN"" rel=""nofollow"">web page</a> which accept only a form as an input.</p><p>I usually use HttpClient to retrieve info and parse the html, but this page take a Javascript rather than an explicit url as argument, and print input again as a javascript.</p><p>I tried HTMLUnit but is painfully slow, especially on Android. Moreover it seems like I can't make it works correctly, as I'm not able to retrive the html after filling the form, maybe due to the page being a javascrpit (see attached code).</p><p>How can I retrive information from this <a href=""http://mobile.viaggiatreno.it/viaggiatreno/mobile/stazione?lang=EN"" rel=""nofollow"">web page</a> in Android? </p><p>Cheers :D</p><pre><code>package com.htmlUnitTest;import com.gargoylesoftware.htmlunit.WebClient;import com.gargoylesoftware.htmlunit.html.HtmlForm;import com.gargoylesoftware.htmlunit.html.HtmlPage;import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;import com.gargoylesoftware.htmlunit.html.HtmlTextInput;public class HtmlUnitTest {    /**     * @param args     */    public static void main(String[] args) {        try {            submittingForm();        } catch (Exception e) {            System.out.println(""Something bad happened"");            e.printStackTrace();        }    }    static public void submittingForm() throws Exception {        final WebClient webClient = new WebClient();        // Get the first page        final HtmlPage page1 = webClient.getPage(                  ""http://mobile.viaggiatreno.it/viaggiatreno/mobile/stazione?lang=IT"");        System.out.println(page1.getForms());        // Get the form that we are dealing with and within that form,         // find the submit button and the field that we want to change.        final HtmlForm form = page1.getForms().get(0);        final HtmlSubmitInput button = form.getInputByValue("" Cerca "");        final HtmlTextInput textField = form.getInputByName(""stazione"");        // Change the value of the text field        textField.setValueAttribute(""Milano Centrale"");        // Now submit the form by clicking the button and get back the second page.        final HtmlPage page2 = button.click();        System.out.println(page2.getAnchors());        webClient.closeAllWindows();    }}</code></pre>","269931","","319618","","2011-01-22 14:45:22","2011-01-22 17:05:43","Automatic interactions with web pages","<java><javascript><android><webforms>","1","6","","",""
"4768439","1","5144389","","2011-01-22 14:42:39","3","5702","<p>I've created an opengl surface and everything works fine, however when I try to draw text onto it using the following method:</p><pre><code>public void loadFPSTexture(GL10 gl){    Bitmap bitmap = Bitmap.createBitmap(256, 256, Bitmap.Config.RGB_565);    bitmap.eraseColor(Color.BLACK);    Canvas canvas = new Canvas(bitmap);    Paint textPaint = new Paint();    textPaint.setTextSize(35);    textPaint.setFakeBoldText(true);    textPaint.setAntiAlias(true);    textPaint.setARGB(255, 255, 255, 255);    canvas.drawText(""FPS ""+reportedFramerate, 10,35, textPaint);    gl.glGenTextures(1, texturesFPS, 0);    gl.glBindTexture(GL10.GL_TEXTURE_2D, texturesFPS[0]);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);    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_CLAMP_TO_EDGE);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);    bitmap.recycle();}</code></pre><p>Then used in my onDraw function with:</p><pre><code>gl.glPushMatrix();gl.glEnable(GL10.GL_TEXTURE_2D);gl.glBindTexture(GL10.GL_TEXTURE_2D, texturesFPS[0]);gl.glTranslatef(-surfaceSize.x/1.5f, surfaceSize.y/1.5f, 0.0f);gl.glScalef(10, 10, 1.0f);gl.glColor4f(1.0f, 1.0f, 1.0f, saturation_head); gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);gl.glVertexPointer(3, GL10.GL_FLOAT, 0,vertexBuffer);gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureFPSBuffer);gl.glDrawElements(GL10.GL_TRIANGLES, indices.length,GL10.GL_UNSIGNED_SHORT, indexBuffer);gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);gl.glDisable(GL10.GL_TEXTURE_2D);gl.glPopMatrix();</code></pre><p>I get a weird crash and the surface is unable to be drawn after this point. Logcat shows a constant stream of the following:</p><pre><code>E/Adreno200-EGL( 2578): eglLockWindowSurface: failed to map the memory for fd=32 offs=1536000E/SurfaceFlinger( 2578): GL error 0x0505E/Adreno200-EGL( 2578): eglLockWindowSurface: failed to map the memory for fd=32 offs=1536000E/Adreno200-EGL( 2578): egliSwapWindowSurface: oglSwapBuffer failedE/SurfaceFlinger( 2578): eglSwapBuffers: EGL error 0x3003 (EGL_BAD_ALLOC)</code></pre><p>I'm not sure why this is happening? any help would be much appreciated!</p>","315998","","1765573","","2013-07-17 14:28:53","2013-07-17 14:28:53","Android Drawing text with opengl es crashes after a few minutes","<android><text><opengl-es><canvas><frame-rate>","3","0","1","",""
"4768451","1","4768512","","2011-01-22 14:45:50","0","365","<p>I have one class called Budget.java, within that i start Keypad.java. This was all working fine up until recently when i added a bunch of code to Keypad.java (The added code was to update a row in my SQLite database on the press of a button, all the unrelated methods were working until i tried to implement this). Now using breakpoints i think i've figured out that i get the error message as soon as i try to open the Keypad activity and i don't have a clue what could be the problem.</p><p>Maybe it's my misunderstanding of the sqlite open helper? Or perhaps its because i'm using StartActivityForResult?</p><p>Any suggestions would be very appreciated! I can upload the logcat if you think that would help.I uploaded the two little classes to pastebin, you might find it easier to read?</p><p><a href=""http://pastebin.com/LX61QzdS"" rel=""nofollow"">Budget.java ( look for ListItemCommonIntent )</a></p><p><a href=""http://pastebin.com/KjbKbka5"" rel=""nofollow"">keypad.java</a></p>","523874","","","","","2011-01-22 14:56:36","NullPointerException's on StartActivityForResult, Struggling with SQLite in android i think?","<android><database><sqlite><activity><android-intent>","1","2","","",""
"4768511","1","","","2011-01-22 14:56:24","0","626","<p>Given a simple Adobe Air application (xml is provided below) I want to run a startup swf file that will be run prior to the execution of the original script.</p><p>I am ok with running it manually via the ADL API but I don't want to change the original swf file or my application source code.</p><p>Is there a way to implant a pre-script? if not, can you think of different approach for this scenario? My main goal is to notify a server about this execution (for debugging purposes)</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8"" standalone=""no""?&gt;&lt;application xmlns=""http://ns.adobe.com/air/application/2.5""&gt;    &lt;id&gt;test.debug&lt;/id&gt;    &lt;filename&gt;test&lt;/filename&gt;    &lt;name&gt;test-debug&lt;/name&gt;    &lt;versionNumber&gt;1.0.0&lt;/versionNumber&gt;    &lt;initialWindow&gt;        &lt;content&gt;test.swf&lt;/content&gt;    &lt;/initialWindow&gt;    &lt;android&gt;        &lt;manifestAdditions&gt;&lt;![CDATA[            &lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android"" android:installLocation=""auto""&gt;                &lt;uses-permission android:name=""android.permission.INTERNET""/&gt;            &lt;/manifest&gt;        ]]&gt;&lt;/manifestAdditions&gt;    &lt;/android&gt;&lt;/application&gt;</code></pre>","382596","","382596","","2011-01-22 15:55:29","2011-01-22 15:55:29","Adding a startup script to an Adobe AIR application","<android><flex><adobe><air>","0","3","0","",""
"4768648","1","4769014","","2011-01-22 15:19:32","0","1453","<p>I want to create an IME for android in arabic language.</p><p>I needed some refrence and found this :</p><p><a href=""http://android.git.kernel.org/?p=platform/packages/inputmethods/LatinIME.git;a=tree;f=java/res;h=4aa09f391807cb18015472862776b1efe930623d;hb=HEAD"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/packages/inputmethods/LatinIME.git;a=tree;f=java/res;h=4aa09f391807cb18015472862776b1efe930623d;hb=HEAD</a></p><p>Now i wanted to clone one of the directory trees onto my system as it was said there.</p><p>I installed git on windows and i got a 'git bash' icon. I opened it , what it asked and got this error :</p><p>fatal: The remote end hung up unexpectedly</p><p>Now i am clueless how should i download that source </p>","585449","","","","","2011-01-22 16:26:22","how to use git bash in windows for cloning an android project","<android><git><ime>","1","1","","",""
"4768738","1","","","2011-01-22 15:38:17","27","28252","<p>When I have a <code>TextView</code> with a <code>\n</code> in the text,, on the right I have two <code>singleLine</code> <code>TextView</code>s, one below the other with no spacing in between. I have set the following for all three <code>TextView</code>s.</p><pre><code> android:lineSpacingMultiplier=""1"" android:lineSpacingExtra=""0pt"" android:paddingTop=""0pt"" android:paddingBottom=""0pt""</code></pre><p>The first line of the left <code>TextView</code> lines up perfectly with the top right <code>TextView</code>. The second line of the left <code>TextView</code> is a little higher than the second line of the bottom right <code>TextView</code>.</p><p>It seems that there is some kind of hidden padding on the top and the bottom of the <code>TextView</code>s. How can I remove that?</p>","463304","","","","","2012-11-29 14:05:30","Android: TextView: Remove spacing and padding on top and bottom","<android><textview><padding><spacing>","6","1","8","",""
"4768795","1","","","2011-01-22 15:46:25","0","807","<p>I have a simple dialog box.  When I click a button the dialog box is supposed to be shown, while a file save operation is performed, and then the dialog box is dismissed.  The problem I am having is the dialog box isn't shown until after the onClick event of the button finishes.</p><p>Taken from the Dialog developer doc:</p><blockquote>  <p>The setup is simple. Most of the code  needed to create a progress dialog is  actually involved in the process that  updates it. You <strong><em>might find</em></strong> that it's  necessary to create a second thread in  your application for this work and  then report the progress back to the  Activity's UI thread with a Handler  object. If you're not familiar with  using additional threads with a  Handler, see the example Activity  below that uses a second thread to  increment a progress dialog managed by  the Activity.</p></blockquote><p>Why isn't the dialog shown until after the onClick method finishes?  Is the dialog added to the end of the UI thread?</p><p>Is the only way to do this to create a new thread and handler?  That's fairly bad wording in the developer doc if so.</p><p>Thanks all.</p><pre><code>    Button send = (Button) findViewById(R.id.send);    send.setOnClickListener(new OnClickListener() {                 @Override        public void onClick(View v) {            showDialog(SAVING_DIALOG);                          //Do all the file saving operations            ...            ...            dismissDialog(SAVING_DIALOG);        }    });</code></pre><p>Here is the dialog</p><pre><code>@Overrideprotected Dialog onCreateDialog(int id) {    switch (id) {        case SAVING_DIALOG: {            ProgressDialog dialog = new ProgressDialog(this);            dialog.setMessage(""Saving file..."");            dialog.setIndeterminate(true);            dialog.setCancelable(false);            return dialog;        }    }    return null;}</code></pre>","432209","","","","","2011-01-22 16:08:54","Are progress/indeterminate dialog boxes added to the end of the UI thread? Do they require a second thread?","<android><multithreading><dialog>","2","0","","",""
"4768930","1","7088772","","2011-01-22 16:12:47","4","8661","<p>Is it possible to install an apk programmatically in the background or does the user have to accept the installation. </p><p>My scenario is that I want my employees to all have the same set of applications installed.</p><p>Of course they can install applications by them self, but I want them all to have at least some applications installed.</p><p><strong>I'm not talking about installing applications from the market.</strong></p>","452861","","467090","","2011-01-22 18:43:16","2011-08-17 06:35:50","Android install apk programmatically","<android><install><apk><android-install-apk>","5","0","1","",""
"4768939","1","4769017","","2011-01-22 16:13:28","0","736","<p>I am attempting to show an indeterminate ProgressDialog while grabbing an RSS feed.  I get the dialog to pop, but as soon as the results are returned, I get a force close.  My suspicion is that the adapter is populated and goes to update the UI.  The code is below.  Is my suspicion correct?</p><pre><code>        public void getRSS(String rss)    {        new GetRSS().execute(rss);    }    private class GetRSS extends AsyncTask&lt;String, Void, Void&gt;    {        private ProgressDialog Dialog = new ProgressDialog(View2.this);        protected void onPreExecute() {            Dialog.setMessage(""Please wait..."");            Dialog.show();        }        protected void onPostExecute(Void nothing)        {            Dialog.dismiss();        }        protected Void doInBackground(String... rss) {        URL feedUrl;        try            {                feedUrl = new URL(rss[0]);                SyndFeedInput input = new SyndFeedInput();                SyndFeed feed = input.build(new XmlReader(feedUrl));                List entries = feed.getEntries();                Iterator iterator = entries.listIterator();                while (iterator.hasNext())                    {                        SyndEntry ent = (SyndEntry) iterator.next();                        String title = ent.getTitle();                        //String uri = ent.getUri();                        //d.add(uri);                        SyndContent content = (SyndContent)ent.getContents().get(0);                        d.add(content.getValue());                        adapter.add(title);                    }                adapter.notifyDataSetChanged();            }        catch (MalformedURLException e)            {                e.printStackTrace();            }        catch (IllegalArgumentException e)            {                e.printStackTrace();            }        catch (FeedException e)            {                e.printStackTrace();            }        catch (IOException e)            {                e.printStackTrace();            }        return null;        }    }    */</code></pre><p>Here's the stack dump -- clearly the call to notify is the issue.  Now I'm just having trouble figuring out where to call notify:</p><pre><code>01-22 12:02:28.701: ERROR/WindowManager(571): Activity com.digthisband.dtb.jg.View2 has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@43e6ae88 that was originally added here</code></pre><p>01-22 12:02:28.701: ERROR/WindowManager(571): android.view.WindowLeaked: Activity com.digthisband.dtb.jg.View2 has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@43e6ae88 that was originally added here01-22 12:02:28.701: ERROR/WindowManager(571):     at android.view.ViewRoot.(ViewRoot.java:247)01-22 12:02:28.701: ERROR/WindowManager(571):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)01-22 12:02:28.701: ERROR/WindowManager(571):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)01-22 12:02:28.701: ERROR/WindowManager(571):     at android.view.Window$LocalWindowManager.addView(Window.java:424)01-22 12:02:28.701: ERROR/WindowManager(571):     at android.app.Dialog.show(Dialog.java:241)01-22 12:02:28.701: ERROR/WindowManager(571):     at com.digthisband.dtb.jg.View2$GetRSS.onPreExecute(View2.java:97)01-22 12:02:28.701: ERROR/WindowManager(571):     at android.os.AsyncTask.execute(AsyncTask.java:391)01-22 12:02:28.701: ERROR/WindowManager(571):     at com.digthisband.dtb.jg.View2.getRSS(View2.java:87)01-22 12:02:28.701: ERROR/WindowManager(571):     at com.digthisband.dtb.jg.View2.onCreate(View2.java:68)01-22 12:02:28.701: ERROR/WindowManager(571):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)01-22 12:02:28.701: ERROR/WindowManager(571):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)01-22 12:02:28.701: ERROR/WindowManager(571):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)01-22 12:02:28.701: ERROR/WindowManager(571):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)01-22 12:02:28.701: ERROR/WindowManager(571):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)01-22 12:02:28.701: ERROR/WindowManager(571):     at android.os.Handler.dispatchMessage(Handler.java:99)01-22 12:02:28.701: ERROR/WindowManager(571):     at android.os.Looper.loop(Looper.java:123)01-22 12:02:28.701: ERROR/WindowManager(571):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-22 12:02:28.701: ERROR/WindowManager(571):     at java.lang.reflect.Method.invokeNative(Native Method)01-22 12:02:28.701: ERROR/WindowManager(571):     at java.lang.reflect.Method.invoke(Method.java:521)01-22 12:02:28.701: ERROR/WindowManager(571):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-22 12:02:28.701: ERROR/WindowManager(571):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-22 12:02:28.701: ERROR/WindowManager(571):     at dalvik.system.NativeStart.main(Native Method)</p>","197353","","197353","","2011-01-22 17:05:21","2011-01-22 17:05:21","Android Force Close on ProgressDialog","<android><multithreading><asynchronous><rss>","1","0","","",""
"4768963","1","","","2011-01-22 16:17:48","3","3000","<p>I'm writing an application that must not run on rooted devices. I want to store some secure data and which is possible only on non-rooted devices as nobody can access files in <em>/data/data/package-name</em>.</p><p>Does anyone know:</p><p><strong>1)</strong> Is it possible to prevent the installation of an application on rooted devices? I read something about the ""copy-protection mechanism"" of Android Market. This feature seems to be outdated and replaced by the licensing feature. However, licensing is only possible for paid application and mine is free...</p><p><strong>2)</strong> Is it possible to check programmatically whether a device is rooted or not? If it would be possible to do so I could simply stop the application if the device is rooted.</p><p>Any help regarding this topic is appreciated!</p>","502396","","244296","","2011-01-23 03:41:07","2013-07-02 13:49:36","Android application must not run on rooted devices","<android><security><check><root>","5","2","2","",""
"4768969","1","4769184","","2011-01-22 16:18:32","4","35707","<p>I am working on a andriod program and one the users clicks on a button I do some math and I would like to change the valules I have on my view in some TextView objexts.  Can someone please tell me how to do it in my code</p>","2144370","","","","","2013-09-04 18:52:52","How do I change TextView Value inside Java Code","<java><android><textview>","2","0","","",""
"4768977","1","4818254","","2011-01-22 16:19:47","4","2450","<p>On the default ListViews if you long press on an item the background fades from dark blue to light blue(on Galaxy Tab. Its orange to light orange on some other devices) during the time it takes to register a LongClick. I am assuming this is done somehow with a selector but thus far I've only seen how to use selectors for state:selected, state:focused, and state:pressed. </p><p><a href=""http://developer.android.com/guide/topics/resources/color-list-resource.html"" rel=""nofollow"">This page</a> doesn't seem to show anything about a LongClick state so perhaps my assumption that this is accomplished with a selector is incorrect? </p><p>Can anyone fill me in on how the default ListView gets this effect and how I can apply it to other views?</p>","507810","","","","","2012-02-12 01:37:51","ListView item LongClick state for selector","<android><listview><background><selector>","3","0","5","",""
"4768984","1","","","2011-01-22 16:21:03","4","10758","<p>I'm developing a simple Android application with SQL.I followed the following guides -<a href=""http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/"" rel=""nofollow"">http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/</a></p><p>I get an error when trying to open the database.Here is my DataBaseHelp.Java Class-</p><pre><code>public class DataBaseHelper extends SQLiteOpenHelper{private static String DB_PATH = ""/data/data/and.testDB/databases/"";private static String DB_NAME = ""MyData"";private SQLiteDatabase myDataBase; private final Context myContext;public DataBaseHelper(Context context) { super(context, DB_NAME, null, 1);    this.myContext = context;} public void createDataBase() throws IOException{ boolean dbExist = checkDataBase(); if(dbExist){  //do nothing - database already exist }else{     this.getReadableDatabase();     try {   copyDataBase();  } catch (IOException e) {      throw new Error(""Error copying database"");     } }}private boolean checkDataBase(){ SQLiteDatabase checkDB = null; try{  String myPath = DB_PATH + DB_NAME;  checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY); }catch(SQLiteException e){  //database does't exist yet. } if(checkDB != null){  checkDB.close(); } return checkDB != null ? true : false;}private void copyDataBase() throws IOException{ //Open your local db as the input stream InputStream myInput = myContext.getAssets().open(DB_NAME); // Path to the just created empty db String outFileName = DB_PATH + DB_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();}public void openDataBase() { //Open the database    String myPath = DB_PATH + DB_NAME; myDataBase = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);}@Override public synchronized void close() {         if(myDataBase != null)          myDataBase.close();         super.close(); } @Override public void onCreate(SQLiteDatabase db) { } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {  }}</code></pre><p>And this is my testDB.Java class-</p><pre><code>public class testDB extends Activity {SQLiteDatabase myDataBase;public String[] gur = new String[4];/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    DataBaseHelper myDbHelper = new DataBaseHelper(this);    myDbHelper = new DataBaseHelper(this);    try {        myDbHelper.createDataBase();} catch (IOException ioe) {    throw new Error(""Unable to create database"");}try {    myDbHelper.openDataBase();// Here is the problem-Can't open the database/}catch(SQLException sqle){    throw sqle;}    myDataBase = myDbHelper.getWritableDatabase();    Cursor c = myDataBase.rawQuery(""SELECT * FROM beer"", null);if (c != null ) {    if  (c.moveToFirst()) {          for(int x=0;x&lt; 1;x++)          {              gur[x] = (c.getString(c.getColumnIndex(""name"")));              c.moveToNext();          }}    Toast.makeText(this,gur[0],Toast.LENGTH_LONG).show();}        }    }</code></pre><p>I created the database using SQLite Database Browser, created a table named ""beer"", added 2 rows and put it in the /assests folder in my project.</p><p>Please note that i'm new to SQL, and its my first time using it. I searched all day for an answer and couldn't find one.</p><p>Thanks!</p>","585740","","278836","","2011-01-22 16:32:27","2011-04-27 05:47:04","Can't open database-Android","<android><sqlite>","3","1","1","",""
"4769020","1","5487854","","2011-01-22 16:27:23","61","38834","<p>I'd like to pose a question as to which XMPP library would be the best choice nowadays, for Android development.</p><ul><li><p>I've been using the patched Smacklibrary from <strong><a href=""http://davanum.wordpress.com/2008/12/29/updated-xmpp-client-for-android/"" rel=""nofollow"">here</a></strong> as issuggested in many other questionshere in SO. However, that's a patched version ofthe Smack API from two years ago. Andalthough it generally works well I'mexploring any other, more recentoptions.</p></li><li><p>I've been looking at the official<strong><a href=""http://www.igniterealtime.org/projects/smack/"" rel=""nofollow"">Smack API</a></strong> and after a littleresearch, it seems it might work justfine nowadays (although I have nottried it yet in a real application).</p></li><li><p>There's also another solution I cameacross, <strong><a href=""http://www.beem-project.com/projects/beem/files"" rel=""nofollow"">Beem's aSMACK library</a></strong>.Beem is a fairly new XMPP client forandroid and from what I understandthey are using their own patchedversion of aSMACK.</p></li><li><p>Finally, there's <strong><a href=""http://code.google.com/p/asmack/"" rel=""nofollow"">aSMACK</a></strong> but thattoo hasn't been updated for quitesome time (as the site suggests).</p></li></ul><p>Do you have any other suggestions or can you explain why I should choose one of the above over the rest?</p>","95656","","2940642","","2014-04-03 15:37:57","2014-04-14 17:04:05","Android and XMPP: Currently available solutions","<android><xmpp><smack><asmack>","3","13","68","",""
"4769046","1","4769554","","2011-01-22 16:32:10","2","1308","<p>I have one activity and three intet filters, each with different label set on, (AndroidManifiest.xml below)</p><pre><code>    &lt;activity android:name="".activities.RecordActivity""&gt;        &lt;intent-filter&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;action android:name=""com.keitai.enigma.OPEN_RECORD"" /&gt;        &lt;/intent-filter&gt;        &lt;intent-filter android:label=""@string/newRecord""&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;action android:name=""com.keitai.enigma.NEW_RECORD"" /&gt;        &lt;/intent-filter&gt;        &lt;intent-filter android:label=""@string/editRecord""&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;action android:name=""com.keitai.enigma.EDIT_RECORD"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>But activity title is not changing to label set in intent filter :( Activity always contains application label.</p><p>What I'm donig wrong?</p>","585743","","","","","2011-01-22 18:01:32","Different activity title in different intent actions","<android><activity><label><title><intentfilter>","3","0","1","",""
"4769084","1","4769492","","2011-01-22 16:40:55","1","623","<p>I've looked into achartengine and a couple other options, but none of them seem to support any way to implement drill down into the data.  </p>","372528","","","","","2012-04-22 08:20:17","What's the best way to draw a pie chart in Android with selectable slices?","<android><charts>","1","0","","",""
"4769225","1","4769265","","2011-01-22 17:05:13","1","269","<pre><code>float fRealEsate = 360000.00 * 0.04; Toast.makeText(v.getContext(), ""Real Estate Brokerage Fee: ""                      + fRealEsate, Toast.LENGTH_SHORT).show();</code></pre><p>I need it to display 15600.00 but its displaying 15600.0</p>","2144370","","44390","","2012-06-04 16:02:10","2012-06-04 16:02:10","float is not displaying the right format . looking for xxxxxx.xx","<java><android><floating-point>","3","1","","",""
"4769307","1","4769409","","2011-01-22 17:19:26","0","3967","<p>I have been searching the 'net for a bit here, I can't seem to stop the SoftKeyboard from appearing when an EditText gets focus, I've tried at least 3 different methods, setting the Input Type to None (think I saw that in the Android Dev Docs), and two different ways inside the onCreate method, they are:</p><pre><code>getWindow().requestFeature(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);</code></pre><p>And</p><pre><code>getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);</code></pre><p>I know I can disable it for the entire app in the manifest file, but I only need it disabled in this activity.</p>","388992","","","","","2012-01-25 10:03:31","Hide softkeyboard in single activity - Android","<android><android-softkeyboard>","3","0","1","",""
"4769366","1","4769504","","2011-01-22 17:29:29","0","106","<p>I have an activity that has the following intent filter:</p><pre><code>&lt;intent-filter android:label=""Name Of Activity""&gt;    &lt;action android:name=""android.intent.action.SEND"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;data android:mimeType=""text/plain"" /&gt;&lt;/intent-filter&gt;</code></pre><p>However, if I try to share some plain text, for example, from the browser's ""Share link"" option, the activity appears at the very bottom of the list with several other actions/apps that are far less relevant to sharing this type of content.</p><p>How can I improve the intent filter so that the OS recognizes that this can handle this type of content better, so it doesn't have to be below things that are far less relevant to the user?</p><p>Thanks        </p>","445348","","","","","2011-01-22 17:52:03","How do you get an activity to resolve higher up in a Share via menu?","<android><sharing><intentfilter>","1","0","","",""
"4769367","1","","","2011-01-22 17:29:29","2","4722","<p>How do I change the text size of a spinner in android.I have read that if you get your items from a resource (like R.array.items) you use ArrayAdapter.createFromResource(context, R.array.items, R.layout.textview), but what if a get my items from a list that changes, how would I then change text size of the spinner.</p>","585779","","","","","2012-03-31 08:36:26","how to change text size of android-spinner","<android><spinner>","1","0","1","",""
"4769470","1","4769513","","2011-01-22 17:46:51","0","187","<p>When I comes to specifying colours for an application, I recently came across <code>@android:color</code>. Is it recommended to try to always use predefined system colors?</p><p>I changed the colours of some of my labels to something brighter, so that they'll stand out against the black background. But then I start to wonder... would themes/skins (not familiar with those) and such cause the default background colour to be something other than black?</p><p>If so... what's the proper way to deal with colouring one's widgets?</p>","124111","","","","","2011-01-22 19:11:08","Should I set my TextView colours if my background colour is not set?","<android>","2","0","0","",""
"4769481","1","","","2011-01-22 17:48:53","0","387","<p>I have to integrate an existing javabased Framework (whith different components which communicate via SOAP) in my Android. Every Component needs to receive and send SOAP-Messages, needs to act as a Server. </p><p>Is it true that Android OS &lt; 2.0 does not support Server functionalities? What would be the min. Version?</p><p>Which framework can i use? I only found a few kSOAP examples for the client side, but none for servers.</p><p>Thanks for every hint, link, idea... help:)Fabi</p>","585791","","","","","2011-02-12 21:08:19","implement WebServices on Android","<android><web-services><publish><server-side>","2","2","","",""
"4769577","1","4769626","","2011-01-22 18:05:40","1","2349","<p>i'm working on an android application with an EditText box. In this box i want the user to enter currency.</p><p>I have already restricted the keyboard to numbers and decimals using the handy <em>android:inputType=""numberDecimal""</em> but i would like to be able to stop the user from entering more than two digits after the decimal place (so that the content is saved as a currency and also just because i think it's important that the user is clear about what they're entering). </p><p>However i don't have much programming experience and i don't know where to start looking (validation is a pretty huge topic haha). A bit of googling and it sounds like i should make my own extension of the InputFilter class but i'm not sure how to go about that or if there's a better way. So Any advice would really be appreciated!</p>","523874","","","","","2011-01-22 18:15:30","How can I limit the EditText box input to two characters after a decimal place?","<java><android><validation><input><edittext>","1","1","","",""
"4769701","1","4769880","","2011-01-22 18:28:33","0","336","<p>I have a MyDBAdapter class, that can do some simple selects, but now I need a special select. I need to implement this select:</p><pre><code>SELECT * FROM position WHERE fk_email='given value by variable'</code></pre><p>But my dbadapter skills with android are very low... I don't know how to do it.</p><p>I must add two new methods:</p><pre><code>public Cursor fetchPositionsByEmail(String fk_email)public List&lt;Position&gt; retrievePositionsByEmail(String fk_email) </code></pre><p>I tried with these implementations but they didn't work, they return me an empty array of positions:</p><pre><code>public Cursor fetchPositionsByEmail(String email) throws SQLException {    Cursor mCursor = mDb.query(true, ""position"", new String[] {""idposition"", ""latitude"", ""longitude"", ""timestamp"", ""fk_email""}        , ""fk_email"" + ""='"" + email+""'"", null, null, null, null, null);    if (mCursor != null) {        mCursor.moveToFirst();    }    return mCursor;}public List&lt;Position&gt; retrievePositionsByEmail(String email) { List &lt;Position&gt; positions=new ArrayList&lt;Position&gt;(); Cursor result=fetchPositionsByEmail(email); if( result.moveToFirst() ){        do{         positions.add(new Position(result.getString(result.getColumnIndexOrThrow(""idposition"")),           result.getString(result.getColumnIndexOrThrow(""latitude"")),            result.getString(result.getColumnIndexOrThrow(""longitude"")),           result.getString(result.getColumnIndexOrThrow(""timestamp"")),           result.getString(result.getColumnIndexOrThrow(""fk_email""))));        }while( result.moveToNext() );    } return positions;}</code></pre><p>Can someone help me to implement these two methods on this MyDBAdapter Class?</p><p>This is the class:</p><pre><code>public class MyDbAdapter {    private static final String TAG = ""NotesDbAdapter"";    private DatabaseHelper mDbHelper;    private SQLiteDatabase mDb;    private static final String DATABASE_NAME = ""gpslocdb"";    private static final String PERMISSION_TABLE_CREATE = ""CREATE TABLE permission ( fk_email1 varchar, fk_email2 varchar, validated tinyint, hour1 time default '08:00:00', hour2 time default '20:00:00', date1 date, date2 date, weekend tinyint default '0', fk_type varchar, PRIMARY KEY  (fk_email1,fk_email2))"";    private static final String USER_TABLE_CREATE = ""CREATE TABLE user ( email varchar, password varchar, fullName varchar, mobilePhone varchar, mobileOperatingSystem varchar, PRIMARY KEY  (email))"";    private static final String POSITION_TABLE_CREATE = ""CREATE TABLE position (idposition bigint, latitude varchar, longitude varchar, timestamp datetime, fk_email varchar, PRIMARY KEY (idposition))"";    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(""DROP TABLE IF EXISTS user"");            db.execSQL(""DROP TABLE IF EXISTS permission"");            db.execSQL(""DROP TABLE IF EXISTS position"");            db.execSQL(PERMISSION_TABLE_CREATE);            db.execSQL(USER_TABLE_CREATE);            db.execSQL(POSITION_TABLE_CREATE);        }        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {            //db.execSQL(""DROP TABLE IF EXISTS user"");            //db.execSQL(""DROP TABLE IF EXISTS permission"");            //onCreate(db);        }  @Override  public void onOpen(SQLiteDatabase db) {   super.onOpen(db);            //onCreate(db);  }  public void clearDb(SQLiteDatabase db){   db.execSQL(""DROP TABLE IF EXISTS user"");            db.execSQL(""DROP TABLE IF EXISTS permission"");            db.execSQL(""DROP TABLE IF EXISTS position"");            onCreate(db);  }  public void deleteUser(SQLiteDatabase db, String email)  {   db.execSQL(""DELETE FROM user Where email='""+email+""'"");  }  public void deletePermission(SQLiteDatabase db, String email)  {   db.execSQL(""DELETE FROM permission Where fk_email2='""+email+""'"");  }    }    /**     * Constructor - takes the context to allow the database to be     * opened/created     *      * @param ctx the Context within which to work     */    public MyDbAdapter(Context ctx) {        this.mCtx = ctx;    }    /**     * Open the 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 MyDbAdapter open() throws SQLException {        mDbHelper = new DatabaseHelper(mCtx);        mDb = mDbHelper.getWritableDatabase();        return this;    }    public void close() {     //clearDB();        mDbHelper.close();    }    public long createUser(String email, String password, String fullName, String mobilePhone, String mobileOperatingSystem)     {        ContentValues initialValues = new ContentValues();        initialValues.put(""email"",email);        initialValues.put(""password"",password);        initialValues.put(""fullName"",fullName);        initialValues.put(""mobilePhone"",mobilePhone);        initialValues.put(""mobileOperatingSystem"",mobileOperatingSystem);        return mDb.insert(""user"", null, initialValues);    }    public long createPermission(String email1, String email2, String validated, String hour1, String hour2,   String date1, String date2, String weekend, String fk_type)     {        ContentValues initialValues = new ContentValues();        initialValues.put(""fk_email1"",email1);        initialValues.put(""fk_email2"",email2);        initialValues.put(""validated"",validated);        initialValues.put(""hour1"",hour1);        initialValues.put(""hour2"",hour2);        initialValues.put(""date1"",date1);        initialValues.put(""date2"",date2);        initialValues.put(""weekend"",weekend);        initialValues.put(""fk_type"",fk_type);        return mDb.insert(""permission"", null, initialValues);    }    public long createPosition(String idposition, String latitude, String longitude, String timestamp, String fk_email)     {        ContentValues initialValues = new ContentValues();        initialValues.put(""idposition"",idposition);        initialValues.put(""latitude"",latitude);        initialValues.put(""longitude"",longitude);        initialValues.put(""timestamp"",timestamp);        initialValues.put(""fk_email"",fk_email);        return mDb.insert(""position"", null, initialValues);    }    public void clearDB() {     mDbHelper.clearDb(mDb);            }    public Cursor fetchAllUsers() {        return mDb.query(""user"", new String[] {""email"", ""password"", ""fullName"", ""mobilePhone"", ""mobileOperatingSystem""}, null, null, null, null, null);    }    public Cursor fetchAllPermissions() {        return mDb.query(""permission"", new String[] {""fk_email1"", ""fk_email2"", ""validated"", ""hour1"", ""hour2"", ""date1"", ""date2"", ""weekend"", ""fk_type""}, null, null, null, null, null);    }    public Cursor fetchUser(String email) throws SQLException {        Cursor mCursor = mDb.query(true, ""user"", new String[] {""email"", ""password"", ""fullName"", ""mobilePhone"", ""mobileOperatingSystem""}            , ""email"" + ""="" + email, null, null, null, null, null);        if (mCursor != null) {            mCursor.moveToFirst();        }        return mCursor;    }    public List&lt;Friend&gt; retrieveAllFriends()     {     List &lt;Friend&gt; friends=new ArrayList&lt;Friend&gt;();     Cursor result=fetchAllUsers();     if( result.moveToFirst() ){            do{                friends.add(new Friend(result.getString(result.getColumnIndexOrThrow(""email"")),result.getString(result.getColumnIndexOrThrow(""password"")), result.getString(result.getColumnIndexOrThrow(""fullName"")),result.getString(result.getColumnIndexOrThrow(""mobilePhone"")),result.getString(result.getColumnIndexOrThrow(""mobileOperatingSystem""))));            }while( result.moveToNext() );        }     return friends;    }    public List&lt;Permission&gt; retrieveAllPermissions()     {     List &lt;Permission&gt; permissions=new ArrayList&lt;Permission&gt;();     Cursor result=fetchAllPermissions();     if( result.moveToFirst() ){            do{             permissions.add(new Permission(result.getString(result.getColumnIndexOrThrow(""fk_email1"")),               result.getString(result.getColumnIndexOrThrow(""fk_email2"")),                Integer.parseInt(result.getString(result.getColumnIndexOrThrow(""validated""))),               result.getString(result.getColumnIndexOrThrow(""hour1"")),               result.getString(result.getColumnIndexOrThrow(""hour2"")),               result.getString(result.getColumnIndexOrThrow(""date1"")),               result.getString(result.getColumnIndexOrThrow(""date2"")),               Integer.parseInt(result.getString(result.getColumnIndexOrThrow(""weekend""))),               result.getString(result.getColumnIndexOrThrow(""fk_type""))));            }while( result.moveToNext() );        }     return permissions;    }    public void deleteUser(String email) throws SQLException    {     mDbHelper.deleteUser(mDb, email);    }    public void deletePermission(String email) throws SQLException    {     mDbHelper.deletePermission(mDb, email);    }}</code></pre>","479886","","56338","","2011-01-22 18:34:23","2011-01-22 19:07:51","How can I do this query with MyDbAdapter on Android?","<android><sql><sqlite>","1","0","","",""
"4769802","1","","","2011-01-22 18:44:17","0","541","<p>When implementing SurfaceHolder.Callback, some online tutorials suggest (actually, I found this is what Google wrote in API demo)</p><pre><code>    public void surfaceChanged(SurfaceHolder holder, int format, int width,            int height) {        Parameters params = camera.getParameters();        params.setPreviewSize(width, height);        camera.setParameters(params);        camera.startPreview();    }</code></pre><p>However, this is not practical. As on real device, code like this would likely raise an exception on <code>camera.setParameter(params)</code>, as the height and width specified isn't likely supported by the device.</p><p>After reading some Q&amp;As on stackoverflow, I understood why that wasn't right. Those posts said I should find one that suits best for the screen. I then decided to print a table of the dimensions my phone (HTC Magic, android 2.1) supports, using <code>params.getSupportedPreviewSizes();</code>. Got these, regardless of the phone's orientation.</p><pre><code> h:720  , w:1280  h:480  , w:800   h:480  , w:720   h:480  , w:640   h:432  , w:576   h:320  , w:480   h:240  , w:400   h:288  , w:384   h:288  , w:352   h:240  , w:320   h:272  , w:272   h:240  , w:240   h:160  , w:240   h:144  , w:176  </code></pre><p>After all, I don't have any clue on how to find the most suitable dimension for the screen. And I'm now very confused on what the correct program is. I think this program should be quite common and I don't have to come up with one myself.</p><p>Can anyone help me and post a well-written <code>public void surfaceChanged</code> sample here?</p><p>Thank you!</p>","521525","","","","","2011-01-22 19:08:27","Android: camera.setParameter question","<android><camera><android-camera>","1","0","","",""
"4769852","1","4770091","","2011-01-22 18:53:30","4","6226","<p>i am trying to vertically align a button or a textview, but i can't.Neither <code>android:layout_gravity=""center_vertical|center_horizontal""</code> nor <code>android:gravity=""center_vertical|center_horizontal""</code> works. Not even <code>android:gravity=""center""</code> does the trick.They only aligns the object horizontally. How can i align it to the center or bottom of the view?</p>","571648","","142162","","2011-01-22 19:09:32","2011-01-22 19:36:20","Android button or TextView vertical align","<android><vertical-alignment>","1","0","","",""
"4769885","1","","","2011-01-22 18:58:34","17","7733","<p>I've been trying to get android to dither the background image of an activity - so far without success. I have no clue what's wrong.</p><p>This is what I did:</p><p>The root element of my activity layout is a LinearLayout:</p><pre><code>&lt;LinearLayout android:id=""@+id/AbsoluteLayout01""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical"" android:gravity=""center_horizontal""android:background=""@drawable/background_dither""&gt;</code></pre><p>where I added @drawable/background_dither as the background image.I put an XML file ""background_dither.xml"" in drawable-hdpi with the following content:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;bitmapxmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/backimg""android:src=""@drawable/background""android:dither=""true""android:antialias=""true"" /&gt;</code></pre><p>which references the actual image background.png in drawable-hdpi. The image, which includes a large color gradient, does show up, but with heavy color banding. From what I've learned from the SDK, this can be mitigated by using the /above proxy image definition together with specifying android:dither=""true"". This however, has absolutely no effect.</p><p>What am I missing to get dithering working?</p><p><code>EDIT</code>: Uploaded the <a href=""http://rapidshare.com/files/444144083/lottofee.zip"">sources here</a> </p><p><code>EDIT2</code>: After none of the suggested methods helped to get rid of color banding, after reading <a href=""http://www.curious-creature.org/2010/12/08/bitmap-quality-banding-and-dithering/"">this blog post from Romain Guy</a>  I had the idea to check whether my PNG background has an alpha channel. It didn't. After adding one, android actually seems to use RGB8888, as said in the post and the banding is gone (also for 2.2). Still wondering why the other methods didn't work.</p><p><code>EDIT3</code>: One has to make sure that the PNG not only has an alpha channel, but also at least one pixel that has an alpha value != FF, otherwise the android build tools will again strip that bitmap down to an indexed palette without alpha channel.</p>","580482","","68805","","2012-01-13 13:25:44","2012-01-13 13:25:44","android:dither=""true"" does not dither, what's wrong?","<android><android-layout>","5","0","8","",""
"4769953","1","4770121","","2011-01-22 19:10:49","1","1100","<p>my app is loading some data from a web server.this time i would like to have a progress dialog in order to avoid a black screen to the app users.</p><pre><code> Button ok = (Button) findViewById(R.id.ok);        ok.setOnClickListener(new View.OnClickListener() {              public void onClick(View view) {                 MyDialog = ProgressDialog.show( yassou.this, "" "" , "" Loading. Please wait ... "", true);                    MyDialog.show();               // myIntent.username.getText();                  try {                      Send();                } catch (IOException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }                  Status();                  //MyDialog=null;              }           });</code></pre><p>this is the btn witch ""onclick"" is loading the data.<code>Send()</code>; is a method that sends some data that the user enters to my server,and<code>Status();</code> is a second method that directs me to a new page.unfortunately,as i press the ok button,the app first goes to the second page and secondly appears a non stop progress dialog.Where is my wrong please?</p>","519526","","","","","2012-05-15 10:32:20","ProgressDialog cant stop","<java><android><progressdialog>","2","1","","",""
"4770004","1","4770586","","2011-01-22 19:18:39","14","8997","<p>I am downloading files from the internet and saving the streaming data to a temp file in my app's internal storage given by <a href=""http://developer.android.com/reference/android/content/Context.html#getFilesDir%28%29"">getFilesDir()</a>.</p><p>Once the download is complete, I need to move the temp file to my download directory on External Memory (usually an SD Card).  For some reason though, File.renameTo() isn't working for this.  I'm guessing there's a problem because it's two separate file systems, but I can still download directly to the SD Card and the file URIs are correct.</p><p>Is there another simple and quick way to transfer that file from internal memory to external or do I have to do a byte stream copy and delete the original?</p>","131871","","","","","2014-03-06 15:54:22","How to move/rename file from internal app storage to external storage on Android?","<java><android><file>","5","0","8","",""
"4770103","1","4770248","","2011-01-22 19:38:17","2","1079","<p>In the Android resources xml to reference the value of an attribute for a theme you use the question-mark (?) instead of at (@). Such as ListViewCustomStyle below: </p><pre><code> &lt;ListView      android:id=""@+id/MainScreenListView""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""     style=""?ListViewCustomStyle""/&gt;</code></pre><p>How can I use the value of the ListViewCustomStyle in code? If I try it the normal way i.e.</p><pre><code>com.myapp.R.attr.ListViewCustomStyle</code></pre><p>Then the code crashes. Is there a special way to access this since it is a reference to an item and not an actual item?</p>","467569","","467569","","2011-01-25 04:09:27","2011-01-31 11:56:34","Android access attribute reference","<android>","2","0","0","",""
"4770225","1","","","2011-01-22 20:02:55","0","215","<p>Hi I am new to android development and using Netbeans IDE with an Android Plugin.</p><p>Although the code builds successfully I inconsistently end up with forms that either do not display the controls or loses the functionality.</p><p>So far the only way to solve the problem is to go through each of the files and re-add the names of the resources / ID's etc. of the controls that no longer work.</p><p>I have also tried checking if the files are read only.</p><p>Any help would be greatly appreciated.</p><p>Thanks.</p>","585886","","","","","2011-04-11 21:18:04","Android Dev (NetBeans) Loses resources and ID's","<android><build><emulator><functionality>","3","0","","",""
"4770256","1","4770412","","2011-01-22 20:08:15","0","94","<p>I am trying to learn how to put apps out in the market and I made a quick JS-Light (Flashlight) app with Esclipe-IDE. I did and export of a signed package and uploaded to the market.  it downloads and then I get the following error</p><p>Error Package file was not signed corrctly</p>","2144370","","","","","2011-01-22 20:36:09","Error Package file was not signed corrctly","<java><android><google-play>","1","1","","",""
"4770258","1","4771461","","2011-01-22 20:08:46","2","8648","<p>I am trying to use an image from the sd card and set it as the background for a relativelayout.  I have tried other solutions that i have found here and elsewhere but they havent seemed to work for me.  here is my code.  I have commented out other ways that i have tried and didnt work.  the only thing that worked for me was using setBackgroudnResource and using a resource from the app, but this was just to test to make sure mRoot was set up correctly.  when I have tried all the other ways, it just doesn't set anything.  Anyone know what I am doing wrong, or if there is a better way to do this?</p><pre><code>        //one way i tired...//String extDir = Environment.getExternalStorageDirectory().toString();//Drawable d = Drawable.createFromPath(extDir + ""/pic.png"");//mRoot.setBackgroundDrawable(d);//another way tried..//Drawable d = Drawable.createFromPath(""/sdcard/pic.png"");//mRoot.setBackgroundDrawable(d);//last way i tried...mRoot.setBackgroundDrawable(Drawable.createFromPath(new File(Environment.getExternalStorageDirectory(), ""pic.png"").getAbsolutePath()));//worked, only to verify mRoot was setup correctly and it could be changed//mRoot.setBackgroundResource(R.drawable.bkg);</code></pre>","274365","","274365","","2011-01-22 22:14:32","2012-06-19 16:44:06","creating a drawable from sd card to set as a background in android","<android><image><layout><background><sd-card>","3","0","3","",""
"4770388","1","4770614","","2011-01-22 20:32:14","0","3643","<p>I'm debugging application on my android device (Motorola Defy, 2.1), the application gets Russian HTML page from network, but can't display it. It displays as <a href=""http://habreffect.ru/files/a17/2bf565b01/DSC02569.jpg"" rel=""nofollow"">link text</a>.HTML page is in UTF-8 (100% sure). Source code:</p><pre><code>HttpClient httpclient = new DefaultHttpClient();        HttpGet httpget = new HttpGet(""http://m.rasp.yandex.ru/direction?direction="" + direction);        httpget.setHeader(""charset"", ""utf-8"");        ResponseHandler&lt;String&gt; responseHandler = new BasicResponseHandler();        String html = httpclient.execute(httpget, responseHandler);</code></pre><p>What am I need for normal displaying of Russian text? Sorry for bad English knowledge.</p>","497132","","","","","2011-11-17 19:38:29","Android - displaying UTF-8 (russian) on device","<java><android><unicode><utf-8>","2","0","0","",""
"4770398","1","","","2011-01-22 20:33:56","0","503","<p>I got my hands on the port of <a href=""https://github.com/pelya/commandergenius"" rel=""nofollow"">SDL</a> to Android not long ago. So, I tried to compile AlienBlaster using the tips in the readme. I updated the project, deleted the src directory, and made the symbolic link successfully. Then I tried to compile it with the build script. It looks like it compiled the native code, but when it tried to combine it with the java code:</p><pre><code>BUILD FAILED/home/srinivas/Downloads/pelya-commandergenius-9de018c/project/build.xml:65: org.xml.sax.SAXParseException; Premature end of file.        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:471)    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:518)    at com.android.ant.SetupTask.checkManifest(SetupTask.java:284)    at com.android.ant.SetupTask.execute(SetupTask.java:180)    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)    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.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)    at org.apache.tools.ant.Task.perform(Task.java:348)    at org.apache.tools.ant.Target.execute(Target.java:390)    at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:179)    at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:80)    at org.apache.tools.ant.Main.runBuild(Main.java:786)    at org.apache.tools.ant.Main.startAnt(Main.java:218)    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)--------------- linked to ------------------javax.xml.xpath.XPathExpressionException    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:476)    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:518)    at com.android.ant.SetupTask.checkManifest(SetupTask.java:284)    at com.android.ant.SetupTask.execute(SetupTask.java:180)    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)    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.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)    at org.apache.tools.ant.Task.perform(Task.java:348)    at org.apache.tools.ant.Target.execute(Target.java:390)    at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:179)    at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:80)    at org.apache.tools.ant.Main.runBuild(Main.java:786)    at org.apache.tools.ant.Main.startAnt(Main.java:218)    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)Caused by: org.xml.sax.SAXParseException; Premature end of file.    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:471)    ... 17 more</code></pre><p>Note that I'm using NDK r4b, because of the bug in r5. Is it because of that?</p><p>Any help would be appreciated.</p>","498680","","","","","2011-01-22 20:33:56","Strange build error when building an sdl program for android using libSDL","<java><android><sdl><native><android-ndk>","0","3","","",""
"4770444","1","","","2011-01-22 20:41:39","0","460","<p>I have a background bitmap if you will and I'm drawing another bitmap with font into the background bitmap. When just drawn on top of each other and zoomed in the level I'm needing they appear perfectly without artifacting and exactly how I want it. But for my purpose I'm needing to merge the font bitmap into the background bitmap so it essentially becomes one item. I obviously need it to be done at run-time and the solution I'm using is this....</p><pre><code>canvas2 = new Canvas(backgroundBitmap);canvas2.drawBitmap(fontBitmap.getBitmap(), null, rects.get(backgroundRectIndex), null);invalidate();</code></pre><p>Now when I zoom into the level I'm needing the font has artifacting. I'm fairly new to graphics and have read several articles and questions about similar issues and I've tried playing with the dithering in the paint and using it in canvas2.drawBitmap instead of null, but nothing seems to be helping. I came across this...</p><blockquote>  <p>This does not apply for the case that an application creates an in-memory bitmap internally and draws something on it, for later display on the screen. The platform auto-scales such bitmaps on the fly, at draw time. Other side effects of such a case might be that fonts drawn in such a bitmap will be scaled at the bitmap level, when the off-screen bitmap is finally rendered to the display, resulting in scaling artifacts.</p></blockquote><p><a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">link text</a></p><p>Which sounds like it might be my issue, but how do I resolve that? Any help would be much appreciated.</p>","490642","","21234","","2011-01-24 13:36:07","2011-01-24 13:36:07","How to remove artifacting from text being drawn into a bitmap","<android><graphics><canvas><bitmap><visual-artifacts>","1","1","0","",""
"4770502","1","","","2011-01-22 20:50:32","0","861","<p>In my Android application I am trying to read an xml file using XMLPullParser using the following code:</p><pre><code>while (eventType != XmlPullParser.END_DOCUMENT)                 {                    if (eventType == XmlPullParser.START_TAG)                     {                        s = xpp.getName();                        if (xpp.getName().equalsIgnoreCase(""container""))                        {                            state = stateContainer;                            con = new Container();                            con.setId(xpp.getAttributeValue(0));                            con.setParentId(xpp.getAttributeValue(1));                            con.setRestricted(xpp.getAttributeValue(2));                        }                        else if (xpp.getName().equalsIgnoreCase(""title""))                         {                            state = stateTitle;                        }                         else                         {                            state = stateUnknown;                        }                    }                     else if (eventType == XmlPullParser.TEXT)                     {                        s = xpp.getText();                        if (state == stateTitle)                         {                            con.setTitle(s);                        }                    }                     else if (eventType == XmlPullParser.END_TAG)                     {                        s = xpp.getText();                        if (xpp.getText().equalsIgnoreCase(""container""))                         {                            listAdapter.add(con);                        }                    }                    eventType = xpp.next();                }</code></pre><p>However, it seems to jump into the line 'listAdapter.add(con);' when none of the other if clauses are true in the other if statements. For example:</p><p><code>else if (eventType == XmlPullParser.TEXT)</code> returns <code>true</code>. It then tries <code>if (state == stateTitle)</code> which returns <code>false</code>. It should jump to <code>eventType == xpp.next();</code> but instead goes to <code>listAdapter.add(con);</code> which is nested in a different if statement. This also happens with some other if statements. </p><p>I would say I'm no beginner when it comes to programming but I can not seem to work out where this problem is coming from! </p><p>Thanks</p>","585922","","11296","","2011-01-22 21:53:59","2011-01-22 21:53:59","Android : Nested if statements jump between statements","<java><android><eclipse>","1","1","0","",""
"4770587","1","4770967","","2011-01-22 21:07:54","15","3100","<p>I'm running ADT (Android Development Tools) in Eclipse and verified that my debugger is working by putting a breakpoint in <code>MainMenu.oncreate (class Activity)</code>. But when I put it in the first line of my <code>AsyncTask.doInBackground</code>, it never hits it. I know it's running because I put a Log statement in the <code>AsyncTask</code> and it shows up in LogCat. Any help would be appreciated as I prefer the debugger over the logging.</p><p>My versions:</p><pre><code>Eclipse SDK Version: 3.6.1  Build id: M20100909-0800</code></pre><p><img src=""http://i.stack.imgur.com/tBYWI.png"" alt=""alt text""></p>","135414","","15177","","2011-10-20 11:13:54","2011-10-20 11:13:54","How do I use the Eclipse debugger in an AsyncTask when developing for Android?","<android><eclipse><debugging><android-asynctask><adt>","1","2","8","",""
"4770687","1","","","2011-01-22 21:22:10","0","572","<p>Has anyone done a layout for android tabs like twitter's ""retweets"" or ""messages"" sceens. I find the stock android tabs quite ugly compared to twitter's tabs.</p>","461421","","","","","2011-01-22 21:22:10","android layout for tabs like twitter messages/retweets","<android><xml><layout><twitter><tabs>","0","2","1","",""
"4770702","1","","","2011-01-22 21:25:14","0","837","<p>I'm trying to use Eclipse to write Android Apps. When I try to connect my Samsung Epic I get a message that shows it Offline. Does anyone know what the problem could be?</p>","585938","","15541","","2011-01-22 21:28:32","2013-03-16 10:38:12","Device Chooser Offine","<android><eclipse><device><offline>","2","1","","",""
"4770783","1","","","2011-01-22 21:39:59","0","1478","<p>I have 2 files for <code>SharedPreferences</code> (one is displayed in a <code>PreferenceActivity</code>, and the second stores values which must not be seen in the <code>PreferenceActivity</code>). The problem - I want to load these values from both files at startup. </p><ol><li><p>I tried <code>getSharedPreferences()</code> and passed the file name. Strangely, I can't read the real values - it always returns default values.</p></li><li><p>If I am using <code>addPreferencesFromResource()</code> and passing the resource file ID, it reads the values, but I cant use this approach because my <code>Activity</code> must subclass <code>PreferenceActivity</code>, which I dont want to do.</p></li></ol><p>How can I read values from multiple preference files? What must be passed in <code>getSharedPreferences()</code> as first argument (file name with extension, file name with no extension, etc.)?</p><p>There is a method <code>PreferenceManager.getDefaultSharedPreferences()</code>. What is ""default"" when I have more than 1 file? </p><p>So simple task to do, so much time wasted...</p>","515477","","1210260","","2012-04-06 21:20:08","2012-04-06 21:20:08","SharedPreferences from multiple files","<android><sharedpreferences>","1","0","","",""
"4770835","1","4770994","","2011-01-22 21:48:54","2","1287","<p>I believe I have figured out how to detect if an android device has a microphone, like so:</p><pre><code>Intent speechIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);        List&lt;ResolveInfo&gt; speechActivities = packageManager.queryIntentActivities(speechIntent, 0);        TextView micAvailView = (TextView) findViewById(R.id.mic_available_flag);        if (speechActivities.size() != 0) { //we have a microphone        }        else { //we do not have a microphones        }</code></pre><p>However, how does one detect whether the android device has speech-to-text capability? Or should the above be used to detect that? If so, how does one detect if the device has a microphone?</p><p>Any feedback is appreciated, thanks.</p>","45974","","","","","2011-01-23 16:21:13","How to detect if speech to text is available on android?","<java><android><media><speech-recognition><microphone>","2","0","1","",""
"4770847","1","4771708","","2011-01-22 21:50:21","10","7100","<p>All my apps have the same sharedUserId. I would like to start a class of another app using the class of my current app. I want to use intent extras but I do not want to use intent URLs. I also would prefer not to have to change the AndroidManifest of my target activity's app.</p>","463304","","","","","2011-01-23 01:14:09","Android Intents: Start activity using class name from another app that has the same sharedUserId","<android><activity><android-intent><shared>","1","2","1","",""
"4770853","1","","","2011-01-22 21:52:00","1","1646","<p>I tried to research around to find the answer to this question, and I have found bits and pieces to different parts of my question, but I still can't decipher whether it's possible (or at least within the confines of our very small, beginner operation). I'll explain what him and I are hoping to acheive, and just a fairly simply response or maybe some links to some literature on the possibilities would be much appreciated.</p><p>I'm not looking for someone to have to spill some code or something like that, as I realize my request will be somewhat vague (as I don't want to give away too much of what our application is about, which we will simply call Alpha) but also because my knowledge into the world of program is very minimal (I'm more behind the design and everything else than the programming).</p><p>We would like to be able to send and receive SMS text messages within the application we are creating, without having to deal with the native messaging application. We would like to do this because (at least with HTC phones), there is no option to easily ""copy"" a received, individual text message. On an HTC phone, when you long-press an individual text message, the ability to copy the message is simply not there (but it is on Samsung, and I'm not sure about Motorola, so I assume it's a Sense UI limitation).</p><p>Because we need an easy way to move the received text message into our application, and since the easy, intuitive way is not available (again, at least not to HTC owners), we have had to try to come up with other ways of doing so. So, we were wondering if it's possible to create your own small text messaging area within our application so that only the text messages that pertain to our application will show up within the application without first popping up in the native messaging application?</p><p>Or, is it possible to add a function to the ""Message Options"" that pop up after long-pressing an individual text, allowing the user to ""Send to Alpha application""?</p><p>Again, I know this might be kind of vague, or not the easiest to follow, and I wish I had more programming knowledge to put it into more specific terms.</p><p>I'm new to the Android development world, as is a buddy of mine who I'm creating an Android application with.</p>","588012","","63550","","2011-11-04 16:57:32","2011-11-04 16:57:32","Sending and receiving SMSes without a native messaging application","<android><sms>","2","0","","",""
"4770907","1","4771315","","2011-01-22 22:01:00","2","1050","<p>i'm new to development and i'm just starting my journey into the daunting world of validation. So far i've had it easy and been able to restricted the inputtype just with these two lines: <em>android:inputType=""phone"" android:digits=""1234567890.""</em> </p><p>Now i want to try and stop my user from entering digits past two decimal places. I think i either need to be working with an <strong>InputFilter or using onTextChange</strong> to check for use of the decimal and digits thereafter( alas i don't have a clue how i would go about doing that either). I've got no experience with either of these and i'm having a hard time finding examples online that i can understand, If someone could tell me where to start that would be really appreciated, i think i'm on the right track but im not even sure how i'd go about checking characters let alone restricting them. Any answers welcome, thank you.</p>","523874","","523874","","2011-01-22 22:11:26","2011-01-22 23:26:20","How can i customise an EditText Box to just allow currency?","<java><android><validation><input><currency>","1","0","","",""
"4770970","1","4771090","","2011-01-22 22:13:58","1","1309","<p>I have a popupwindow in my application that is meant to act as a sort of settings window.  Inside of this there will be a couple little views like checkboxes and what not, but I seem to be having a problem getting one to work properly.</p><p>Currently I only have one button in the view that it's inflating, and I'm trying to use it to close the popup window, but I am getting a NullPointerException when I try to setup the onClickListener.  In fact, if I refer to the button at all, even in something like ""button.isShown()"", it gives me the exception as if the button didn't exist.</p><p>I've tried everything I could think of, but nothing quite solves this problem.  I assume there would be a way to have working buttons inside a PopupWindow, or do I need to modify some form of dialog to get the effect I am after?  </p><p>Thank you for your help.</p>","571451","","","","","2012-02-28 14:37:49","Android Button Inside PopupWindow","<android><button><popup><onclick><popupwindow>","1","0","","",""
"4771072","1","4772251","","2011-01-22 22:34:58","0","1392","<p>Does anyone know how to disable touch gestures using JavaScript while running content in the browser on Android?</p><p>For example, I want to disable the pinch to zoom gesture via JavaScript.</p>","10232","","","","","2013-10-09 14:38:32","Disable Touch Gestures in Android Browser via JavaScript","<javascript><android><mobile><webkit><touch>","2","2","","",""
"4771119","1","","","2011-01-22 22:45:33","3","1141","<p>getTextContent() is not a recognized function.  getNodeValue() works fine for strings, but anytime I try to parse a number using getNodeValue(), it returns null!</p><p>How can I parse a Long from XML using this class?</p>","216363","","","","","2011-01-23 00:04:16","org.w3c.dom.Node with Android version less than 2.2","<java><android><xml><w3c>","3","0","","",""
"4771201","1","13507342","","2011-01-22 23:02:31","1","1181","<p>is it possible to use the new Google 3D Maps for Android in my app? I'm developing an app and I want to add this.</p><p>thanx!</p><p><a href=""http://www.google.com/mobile/maps/3d/"" rel=""nofollow"">http://www.google.com/mobile/maps/3d/</a></p>","574687","","","","","2013-02-17 23:17:58","Implement Google 3D maps for my Android app?","<android><twitter><3d><maps>","2","0","2","",""
"4771213","1","4771454","","2011-01-22 23:06:48","0","584","<p>Is there a way to intercept whenever the Application creates a new Activity instance?  I'm only interested in Activities belonging to the Application process not all Activities on the phone.  Is there some way to do this?  Is the Application class involved in doing this in some way?  What methods can I override to get at the Activity instance after it's been created?</p>","155020","","","","","2011-01-23 00:02:00","Is there a way to intercept Android Activity after it is instantiated?","<android><activity><instantiation>","1","2","","",""
"4771258","1","4771401","","2011-01-22 23:15:17","0","670","<p>Anyone have links to tutorials on this topic? I cannot seem to find any related to 2d culling. Or if anyone here could explain how it's done. I use gluOrtho2D and gluLookAt currently.</p>","507007","","44729","","2011-01-22 23:36:43","2011-01-22 23:53:16","Android opengles 2d culling","<android><opengl-es><2d><culling>","2","0","","",""
"4771259","1","4771308","","2011-01-22 23:15:38","1","1256","<p>In my string xml file I have a line like this:</p><pre><code>&lt;string name=""infoHeader""&gt;random ""text"" here&lt;/string&gt;</code></pre><p>But it is only displayed as </p><blockquote>  <p>random text here</p></blockquote><p>on the phone's display, that is, without the quotation marks.</p><p>I read about it via Google, and tried some HTML styling:</p><pre><code>&lt;string name=""infoHeader""&gt;random &amp;quot;text&amp;quot; here&lt;/string&gt;</code></pre><p>And then used:</p><pre><code>String hej = res.getString(R.string.infoHeader);     Spanned marked_up = Html.fromHtml(hej);((TextView)findViewById(R.id.infoHeader)).setText(marked_up, BufferType.SPANNABLE);</code></pre><p>But it still doesn't work. I tried some other HTML, like <code>&amp;lt;i&gt;text&amp;lt;/i&gt;</code>, and that works just fine. What's wrong?</p>","554002","","","","","2011-01-22 23:31:19","Quotation marks not shown on display","<android><html><xml><mark>","3","0","1","",""
"4771345","1","4771375","","2011-01-22 23:34:21","0","577","<p>I'm having a lot of problems trying to get eclipse to recognize that the ADT plugin was installed, which refers to the android development kit.</p><p>When I try to go to windows-preferences, nothing related to android appears.  If I try to start a new project, android is not an option.</p><p>I've read through this page: <a href=""http://developer.android.com/sdk/eclipse-adt.html"" rel=""nofollow"">http://developer.android.com/sdk/eclipse-adt.html</a> and am still having issues.</p><p>Things I've tried:1. Re-installing eclipse, then re-installing the plugin2. running eclipse -clean3. running eclipse as an administrator4. everything listed here <a href=""http://stackoverflow.com/questions/3723450/android-adt-plugin-doesnt-show-up-in-eclipse"">Android ADT Plugin doesn't show up in Eclipse</a></p>","213203","","","","","2011-01-22 23:41:32","Eclipse is not recognizing that the ADT plugin for android development is intalled","<android>","1","1","","",""
"4771397","1","","","2011-01-22 23:47:28","8","5005","<p>I'm having trouble getting <code>getIdentifier</code> to work with a class variable. It's strange, because this works:</p><pre><code>public Drawable getStationIcon(Context context) {    int resId = context.getResources().getIdentifier(""m1m2_16"", ""drawable"", ""com.mypackage.namehere"");    Drawable drawable = context.getResources().getDrawable(resId);    return drawable;}</code></pre><p>But this doesn't:</p><pre><code>public Drawable getStationIcon(Context context) {    int resId = context.getResources().getIdentifier(this.stationIcon, ""drawable"", ""com.mypackage.namehere"");    Drawable drawable = context.getResources().getDrawable(resId);    return drawable;}</code></pre><p>And nor does this:</p><pre><code>public Drawable getStationIcon(Context context) {    String stationI = this.stationIcon;    int resId = context.getResources().getIdentifier(stationI, ""drawable"", ""com.mypackage.namehere"");    Drawable drawable = context.getResources().getDrawable(resId);    return drawable;}</code></pre><p>And <code>this.stationIcon</code> definitely equals <code>m1m2_16</code>. I've tried other alternatives, ie using <code>""""+this.stationIcon</code>, but nothing works when the first parameter is a variable. Is there something I'm missing?</p>","373712","","","","","2012-12-05 21:59:48","android/java getIdentifier with","<java><android>","1","2","2","",""
"4771430","1","4836300","","2011-01-22 23:55:58","0","1138","<p>I've seen that my background service is allocating 25Mbs according to the Running Services android window.As it is a lot of memory that I think I don't use I looked to ddms and also made a head dump of my process and then the memory usage is only 2.9Mb</p><p>What's is the real memory usage?If it is the ddms one is there any way to let running services give the correct usage? Because I'm afraid that if some user look at the running services it will say that the application is wasting a lot of memory.</p>","269454","","","","","2011-01-29 10:19:43","High memory usage reported in Running Services","<android><memory-allocation><memory-management>","1","0","1","",""
"4771562","1","4773154","","2011-01-23 00:33:01","2","605","<p>What is the recommended way to call TextToSpeech without invoking any UI change? The examples given are all bound to Activities, and the default behavior for an activity is to display its own UI.</p><p>I'm trying to call a TextToSpeechActivity via my main activity via an Intent. I don't want the UI to change at all. I want the TextToSpeech to sound without anything in the UI changing. Here's what I have so far.</p><pre><code> public class MyActivity extends Activity {    public void onClick(View v) {       Intent intent = new Intent(this, TextToSpeechActivity.class);       startActivity(intent);    }    public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);       setContentView(R.layout.main);    }}</code></pre><p>Every time I click, the main UI is replaced with the UI for the TextToSpeech activity. And no, I don't want the main Activity to implement TextToSpeech.OnInitListener. There's already enough code in main. It's messy enough already.</p>","561772","","561772","","2011-10-06 20:22:08","2011-10-06 20:22:08","Call TextToSpeech Activity Without Any UI Display","<android><text-to-speech><android-intent>","1","0","","",""
"4771700","1","5053635","","2011-01-23 01:13:29","-1","532","<p>I am trying to sent SMS message one at a time. I would like to send one and wait for the it to be delivered before sending the next one. can someone please help me out</p><pre><code> package com.smith.johnathan.jssms;//import android.telephony.SmsManager;import android.telephony.gsm.SmsManager;import android.app.Activity;import android.app.PendingIntent;import android.content.Intent;import android.os.Bundle;import android.telephony.gsm.SmsManager;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.Toast;import android.util.Log;import android.widget.Button;import java.io.*;import android.util.LogPrinter;import java.io.*;import android.app.Activity;import android.app.PendingIntent;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.widget.TextView;import android.os.*;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.Toast;import java.io.*;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.Toast;public class JSSMS extends Activity {    boolean sendingSMS = false;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button button = (Button) findViewById(R.id.Button01);        button.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                Toast.makeText(JSSMS.this, ""Starting SMS"", Toast.LENGTH_LONG)                        .show();                String message = ""This is Johnathan and this is my new number"";                String number;                try {                    BufferedReader buffreader = new BufferedReader(                            new FileReader(Environment                                    .getExternalStorageDirectory().toString()                                    + ""/numbers.txt""));                    int i = 0;                    while ((number = buffreader.readLine()) != null) {                        Toast.makeText(JSSMS.this, ""Sending text to:"" + number,                                Toast.LENGTH_SHORT).show();                        if(sendingSMS)                        {                            wait(100);                        }                        sendingSMS = true;                        sendSMS(number, message);                    }                    buffreader.close();                } catch (java.io.FileNotFoundException e) {                    Toast.makeText(JSSMS.this, e.toString(), Toast.LENGTH_SHORT)                            .show();                } catch (Exception e) {                    Toast.makeText(JSSMS.this, e.toString(), Toast.LENGTH_SHORT)                            .show();                }                Toast.makeText(JSSMS.this, ""DONE!!"", Toast.LENGTH_LONG).show();            }        });    }    // ---sends an SMS message to another device---    private void sendSMS(String phoneNumber, String message) {        String SENT = ""SMS_SENT"";        String DELIVERED = ""SMS_DELIVERED"";        PendingIntent sentPI = PendingIntent.getBroadcast(this, 0, new Intent(                SENT), 0);        PendingIntent deliveredPI = PendingIntent.getBroadcast(this, 0,                new Intent(DELIVERED), 0);        // ---when the SMS has been sent---        registerReceiver(new BroadcastReceiver() {            @Override            public void onReceive(Context arg0, Intent arg1) {                sendingSMS = false;                switch (getResultCode()) {                case Activity.RESULT_OK:                    Toast.makeText(getBaseContext(), ""SMS sent"",                            Toast.LENGTH_SHORT).show();                    break;                case SmsManager.RESULT_ERROR_GENERIC_FAILURE:                    Toast.makeText(getBaseContext(), ""Generic failure"",                            Toast.LENGTH_SHORT).show();                    break;                case SmsManager.RESULT_ERROR_NO_SERVICE:                    Toast.makeText(getBaseContext(), ""No service"",                            Toast.LENGTH_SHORT).show();                    break;                case SmsManager.RESULT_ERROR_NULL_PDU:                    Toast.makeText(getBaseContext(), ""Null PDU"",                            Toast.LENGTH_SHORT).show();                    break;                case SmsManager.RESULT_ERROR_RADIO_OFF:                    Toast.makeText(getBaseContext(), ""Radio off"",                            Toast.LENGTH_SHORT).show();                    break;                }            }        }, new IntentFilter(SENT));        // ---when the SMS has been delivered---        registerReceiver(new BroadcastReceiver() {            @Override            public void onReceive(Context arg0, Intent arg1) {                switch (getResultCode()) {                case Activity.RESULT_OK:                    Toast.makeText(getBaseContext(), ""SMS delivered"",                            Toast.LENGTH_SHORT).show();                    break;                case Activity.RESULT_CANCELED:                    Toast.makeText(getBaseContext(), ""SMS not delivered"",                            Toast.LENGTH_SHORT).show();                    break;                }            }        }, new IntentFilter(DELIVERED));        SmsManager sms = SmsManager.getDefault();        sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI);    }}</code></pre>","2144370","","142162","","2011-01-23 01:14:45","2011-02-19 21:25:49","Trying to send SMS messages one at a time ONLY","<java><android><sms>","1","0","0","2013-05-25 09:40:38",""
"4771706","1","","","2011-01-23 01:14:01","0","531","<p>I am fairly new to android and am having some problems with a layout. Below is an approximation of what I want the layout to look like. (I would like the list to be below the screen at first so that the user can scroll down to see it.) However my code as it currently stands makes all of the views on the left only take up a quarter the screen instead of half, as depicted, even though I have all widths set to fill_parent. </p><p>Also, this layout seems to mess up the coordinate system on my custom view. Normally this wouldn't be much of an issue, but in this case I am using that view to draw a picture and the picture ends up in the wrong place. Does anybody have any idea how to resolve these issues? <img src=""http://i.stack.imgur.com/r8QWo.jpg"" alt=""alt text""></p>","583082","","","","","2011-01-23 01:59:57","Android Layout Fill_Parent Problem","<android><layout><fill>","1","1","","",""
"4771844","1","4771871","","2011-01-23 01:58:28","16","3307","<p>What's the difference between ""?android:"" and ""@android:"" in an android layout xml file?  They seem to be interchangeable ways of reusing android SDK resources.  </p><p>The only difference I discovered is illustrated by the following example.</p><p>Here the TextView's right edge is rendered aligned with the left edge of the ImageButton</p><pre><code> &lt;RelativeLayout    android:id=""@id/header""    android:layout_width=""match_parent""    android:layout_height=""wrap_content""    android:background=""#888888""&gt;    &lt;TextView        android:id=""@android:id/text1""        android:layout_alignParentLeft=""true""        android:text=""blah blah""        android:layout_width=""match_parent""        android:layout_height=""wrap_content""        android:layout_toLeftOf=""@android:id/button1"" /&gt;    &lt;ImageButton        android:id=""@android:id/button1""        android:layout_alignParentRight=""true""        style=""@style/PlusButton"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Here, however, the right edge of the TextView is aligned with the right edge of the RelativeLayout.  The TextView overlaps the ImageButton.</p><pre><code>&lt;RelativeLayout    android:id=""@id/header""    android:layout_width=""match_parent""    android:layout_height=""wrap_content""    android:background=""#888888""&gt;    &lt;TextView        android:id=""@android:id/text1""        android:layout_alignParentLeft=""true""        android:text=""blah blah""        android:layout_width=""match_parent""        android:layout_height=""wrap_content""        android:layout_toLeftOf=""?android:id/button1"" /&gt;    &lt;ImageButton        android:id=""?android:id/button1""        android:layout_alignParentRight=""true""        style=""@style/PlusButton"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>The only difference between the two layouts is the use of @android vs ?android.  Both compile with no errors.</p><p>Thanks much.</p>","369722","","","","","2013-05-22 05:48:05","What's the difference between ""?android:"" and ""@android:"" in an android layout xml file?","<android><layout><reference>","1","0","4","",""
"4771875","1","4832983","","2011-01-23 02:08:57","0","704","<p>I have an android widget which has a very simple function.  The widget simply launches an activity when pressed, runs through the activity, pops a toast, and closes the activity.</p><p>The annoying thing is that when the widget is pressed on the home screen, the screen flickers as it opens and closes the activity.  Is there any way to launch the activity from the background, to avoid this flicker?  I'm kind of looking to do something similar to the ATK widget, which simply pops up a toast after closing all the background processes.</p><p>If it's possible to just run a single function in place of a PendingIntent, that would definitely work as well.  Thanks!</p>","342745","","","","","2011-10-08 16:18:14","How to launch a background activity from a widget?","<android><background><android-widget><android-intent>","3","0","","",""
"4771895","1","4771911","","2011-01-23 02:14:58","80","50802","<p>Not sure what I'm doing wrong here. I installed the Android SDK Manager, and am now trying to install a platform like the Android Dev website suggests. Once I clicked install I got an error stating that the Manager could not create a temp folder within the Android directory. So I created it. Now I'm getting this error:</p><blockquote>  <p>Downloading SDK Platform Android 2.3,  API 9, revision 1 File not found:  C:\Program Files  (x86)\Android\android-sdk-windows\temp\android-2.3_r01-linux.zip  (Access is denied)</p></blockquote><p>There is also a little message under the progress bar that says ""Done. Nothing was installed.""</p><p>I'm running Windows 7 Ultimate, in case that's of any use.</p>","391369","","580556","","2011-10-18 18:05:18","2014-03-31 16:20:46","Android SDK Manager Not Installing Components","<android><sdk>","6","0","13","",""
"4771933","1","4772062","","2011-01-23 02:22:49","3","807","<p>I've created an app that records audio, saves the sample to the sd card then plays it back, using the record and play buttons. I need to reverse this sample. I can do all this and the the reversed sample is saved on the SD card under a different name. The original sample is <code>test.wav</code> and the same sample reversed is save as <code>revFile.wav</code>. when i try play <code>revFile.wav</code> android says it can't play this format.</p><p>I've litterally put the sample in an array then reversed the contents, something is telling me that there could be header info at the start of the sample that needs striping first, any ideas. thanks.</p><p>Here's what i have so far.</p><pre><code>public class recorder extends Activity  {    MediaRecorder myRecorder = null;    DataInputStream dis = null;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    public void onClickPlay(View v){        Log.v(""onClickplay"", ""play clicked"");        try{            MediaPlayer mp = new MediaPlayer();            mp.setDataSource(Environment.getExternalStorageDirectory().getPath() + ""/test.wav"");            mp.prepare();            mp.start();        } catch(Exception e3) {            e3.printStackTrace();        }        TextView text = (TextView)findViewById(R.id.TextView01);        text.setText(""playing"");    }    public void onClickRecord(View v){        Log.v(""onClickRecord"", ""record clicked"");        File path = Environment.getExternalStorageDirectory();        Log.v(""file path"", """"+path.getAbsolutePath());        File file = new File(path, ""test.wav"");        if(file.exists()){            file.delete();        }        path.mkdirs();        Log.v(""file path"", """"+file.getAbsolutePath());        myRecorder = new MediaRecorder();        myRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);        myRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);        myRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);        myRecorder.setOutputFile(file.getAbsolutePath());         Log.i(""myrecorder"", ""about to prepare recording"");        try{            myRecorder.prepare();        } catch(Exception e) {            e.printStackTrace();        }        Log.i(""myrecorder"", ""prepared"");        myRecorder.start();   // Recording is now started        Log.i(""myrecorder"", ""recording"");        TextView text = (TextView)findViewById(R.id.TextView01);        text.setText(""recording"");    }    public void onClickStop(View v){        Log.v(""onClickStop"", ""stop clicked"");            try{             myRecorder.stop();             myRecorder.reset();   // You can reuse the object by going back to setAudioSource() step             myRecorder.release(); // Now the object cannot be reused            }catch(Exception e){}             TextView text = (TextView)findViewById(R.id.TextView01);             text.setText(""recording stopped"");        }    public void onClickReverse(View v){        Log.v(""onClickReverse"", ""reverse clicked"");        File f = Environment.getExternalStorageDirectory();        String path = f.getAbsolutePath();        path = path + ""/test.wav"";        Log.v(""path = "", """"+path);        Log.v(""dir = "", """"+f.getAbsolutePath());        Log.v(""test file exists? = "", """"+f.getAbsolutePath()+""/test.wav"");        File f2 = new File(path);        Log.v(""f2 = "", """"+f2.getAbsolutePath());        try {            InputStream is = new FileInputStream(f2);            BufferedInputStream bis = new BufferedInputStream(is);            dis = new DataInputStream(bis);        } catch (Exception e) {            e.printStackTrace();        }        int fileLength = (int)f2.length();        byte[] buffer = new byte[fileLength];        /*File reversedFile = Environment.getExternalStorageDirectory();          File revFile = new File(reversedFile, ""reversedFile.wav"");          Log.v(""reversedfile path"", """"+ revFile.getAbsolutePath());          if(revFile.exists()){              revFile.delete();          }          reversedFile.mkdirs();    */        byte[] byteArray = new byte[fileLength +1];        Log.v(""bytearray size = "", """"+byteArray.length);        try {            while(dis.read(buffer) != -1 ) {                dis.read(buffer);                Log.v(""about to read buffer"", ""buffer"");                byteArray = buffer;            }            Log.v("" buffer size = "", """"+ buffer.length);        } catch (IOException e) {            e.printStackTrace();        }          byte[] tempArray = new byte[fileLength];          int j=0;          for (int i=byteArray.length-1; i &gt;=0; i--) {              tempArray[ j++ ] = byteArray[i];          }          File revPath = Environment.getExternalStorageDirectory();          Log.v(""revpath path"", """"+revPath.getAbsolutePath());          File revFile = new File(revPath, ""revFile.wav"");          Log.v(""revfile path "", """"+revFile.getAbsolutePath());          if(revFile.exists()){              revFile.delete();          }          revPath.mkdirs();          try {              OutputStream os = new FileOutputStream(revFile);              BufferedOutputStream bos = new BufferedOutputStream(os);              DataOutputStream dos = new DataOutputStream(bos);              Log.v(""temparray size = "", """"+ tempArray.length);              dos.write(tempArray);              dos.flush();              dos.close();          } catch (Exception e) {              e.printStackTrace();          }          try{              MediaPlayer mp = new MediaPlayer();              mp.setDataSource(Environment.getExternalStorageDirectory().getPath()                                                                    +""/revFile.wav"");              mp.prepare();              mp.start();         } catch(Exception e3) {                e3.printStackTrace();         }          TextView text = (TextView)findViewById(R.id.TextView01);           text.setText(""playing reversed file"");      }}// end of onclickrev</code></pre>","532462","","501557","","2011-01-23 02:30:44","2011-01-23 03:12:59","Can't play a reversed .wav file with MediaPlayer","<java><android><wav>","3","0","","",""
"4771949","1","4771988","","2011-01-23 02:26:52","1","1191","<p>I am fairly new to android and am having some problems with a layout. Below is an approximation of what I want the layout to look like. (I would like the list to be below the screen at first so that the user can scroll down to see it.) However my code as it currently stands makes all of the views on the left only take up a quarter the screen instead of half, as depicted, even though I have all widths set to fill_parent. </p><p>Also, this layout seems to mess up the coordinate system on my custom view. Normally this wouldn't be much of an issue, but in this case I am using that view to draw a picture and the picture ends up in the wrong place. Does anybody have any idea how to resolve these issues? <img src=""http://i.stack.imgur.com/Q83tV.jpg"" alt=""alt text""></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:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:orientation=""vertical""&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:orientation=""vertical""&gt;&lt;TableRow&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_height=""fill_parent"" android:orientation=""vertical""android:layout_width=""fill_parent""&gt;&lt;TableRow&gt; &lt;TextView android:text=""Resultant Force"" android:id=""@+id/resForceTitle""  android:textSize=""25dip"" android:layout_width=""fill_parent""  android:layout_height=""fill_parent"" android:padding=""3dip""  android:gravity=""center"" android:layout_span=""2"" /&gt;&lt;/TableRow&gt;&lt;TableRow&gt; &lt;TextView android:id=""@+id/magText"" android:text=""Magnitude (N) =""  android:textSize=""15dip"" android:layout_width=""fill_parent""  android:layout_height=""fill_parent"" android:padding=""3dip""  android:gravity=""center_vertical"" android:layout_span=""2"" /&gt;&lt;/TableRow&gt;&lt;TableRow&gt; &lt;EditText android:id=""@+id/magnitude"" android:inputType=""numberDecimal""  android:layout_width=""fill_parent"" android:padding=""3dip""  android:layout_height=""fill_parent"" android:layout_span=""2"" /&gt;&lt;/TableRow&gt;&lt;TableRow&gt; &lt;TextView android:id=""@+id/dirText"" android:text=""Angle (deg) =""  android:layout_width=""fill_parent"" android:layout_height=""fill_parent""  android:textSize=""15dip"" android:gravity=""center_vertical""  android:layout_span=""2"" /&gt;&lt;/TableRow&gt;&lt;TableRow&gt; &lt;EditText android:id=""@+id/direction"" android:inputType=""numberDecimal""  android:layout_height=""fill_parent"" android:padding=""3dip""  android:layout_width=""fill_parent"" android:layout_span=""2"" /&gt;&lt;/TableRow&gt;&lt;TableRow&gt; &lt;Button android:id=""@+id/pushButton"" android:text=""Add Force""  android:layout_height=""fill_parent"" android:padding=""3dip""  android:layout_width=""fill_parent"" /&gt; &lt;Button android:id=""@+id/clearButton"" android:text=""Clear""  android:layout_height=""fill_parent"" android:padding=""3dip""  android:layout_width=""fill_parent"" /&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;android.physicsengine.AxisDrawing android:id=""@+id/image"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" /&gt;&lt;/FrameLayout&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;ListView android:id=""@android:id/list"" android:layout_height=""wrap_content""android:padding=""3dip"" android:layout_width=""fill_parent""android:clickable=""false"" /&gt;&lt;TextView android:id=""@android:id/empty"" android:text=""Add Forces to List Components""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:textSize=""15dip"" android:gravity=""center_vertical"" /&gt;&lt;/LinearLayout&gt;</code></pre>","583082","","","","","2011-01-23 02:54:50","Layout Problem in Android","<android><layout><parent><fill>","2","0","0","",""
"4772191","1","4774080","","2011-01-23 03:46:37","3","1164","<p>I am following the instructions to build Scala app for Android at:<a href=""http://lamp.epfl.ch/~michelou/android/scala-to-android.html"" rel=""nofollow"">scala-to-android</a></p><p>Basically, I installed Scala and changed the ant build.properties to point to Scala and changed build.xml to include build-scala.xml.</p><pre><code>ant scala-compile </code></pre><p>is successful, However,</p><pre><code>ant debug</code></pre><p>generates the following build errors:</p><p>scala-compile:</p><pre><code>-shrink-if-test:     [echo] Checking if Scala libraries are installed on emulator or device...      [adb] BOOTCLASSPATH=/system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar-shrink-config:  [taskdef] Could not load definitions from resource scala/tools/ant/task.properties. It could not be found.BUILD FAILED/home/salil/Programs/android-projects/FirstScala/build-scala.xml:82: Problem: failed to create task or type invokedCause: The name is undefined.Action: Check the spelling.Action: Check that any custom tasks/types have been declared.Action: Check that any &lt;presetdef&gt;/&lt;macrodef&gt; declarations have taken place.</code></pre><p>I am a beginner in ant, Android and Scala. Any help would be appreciated. Thanks so much in advance!</p>","359120","","","","","2011-09-10 23:07:06","Scala - Android App build fails","<android><scala><ant>","3","0","1","",""
"4772469","1","","","2011-01-23 05:25:13","2","913","<p>I am working on a program that has the following situation.</p><p>You want to look up a recipe, so the <code>Activity</code> will call the db <code>ContentProvider</code>.  </p><p>The recipe isn't stored locally, so it will call out to a web service to get the data.</p><p>This data will be stored in the database as I am assuming that if you don't want to keep a local copy you will choose to delete it later, but you may want to shop and cook without going to the Internet constantly.</p><p>So I think my design may be getting overly complicated.</p><p>I currently have a <code>Service</code> that will call the REST service, and a <code>ContentProvider</code> to go to the database.</p><p>I am now considering replacing the <code>Service</code> with a <code>ContentProvider</code>, as I don't need a long-running Service as it should infrequently go out.</p><p>So, the Activities would call the db ContentProvider, and if the query is empty then the ContentProvider would call the REST ContentProvider, as the Activity shouldn't care where the data comes from, and the db ContentProvider would then store the information before returning back to the Activity.</p><p>Is this the best approach for my scenario, or is it bad form to have ContentProviders chained together? </p>","67566","","","","","2012-01-05 09:51:02","Should content providers that check db call REST content provider if db doesn't have information","<android><design><rest><android-contentprovider>","2","3","1","",""
"4772537","1","","","2011-01-23 05:49:27","1","1902","<p>I need to change the stroke color from the app.  The user is able to change the background color so I need to also let them change the stroke (outline) of the button. As its is already set in the drawable (sample below) I have not found a way to change this. Seems like all of the other questions like this just said to use the XML file.... but that doesnt let me make it dynamic.  Thank you for any help!</p><p><strong>I need to change the stroke color to a user defined color.  Nothing to do with the state.</strong></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=""#ffffffff""/&gt;          &lt;stroke                android:width=""3dp""                android:color=""@color/Dim_Gray"" /&gt;  &lt;&lt;&lt;&lt;--- This is what I need to change    &lt;padding android:left=""10dp""             android:top=""10dp""             android:right=""10dp""             android:bottom=""10dp""             /&gt;     &lt;corners android:bottomRightRadius=""12dp"" android:bottomLeftRadius=""12dp""      android:topLeftRadius=""12dp"" android:topRightRadius=""12dp""/&gt; &lt;/shape&gt;</code></pre>","528130","","528130","","2011-01-23 14:29:43","2013-02-23 19:53:50","I need to change the stroke color to a user defined color. Nothing to do with the state","<android><shape><stroke>","3","0","","",""
"4772539","1","5165763","","2011-01-23 05:49:45","1","1385","<p>Is it possible to use the <a href=""http://code.google.com/apis/language/transliterate/overview.html"" rel=""nofollow"">Google Transliterate API</a> on iOS particularly and/or Android? </p><p>The key here is to be able to let users type non-english (transliterated from english) text anywhere in any regular text field without opening any app and copy/paste. </p>","172637","","50776","","2012-05-04 20:17:44","2012-05-04 20:17:44","Transliteration on iOS/Android","<android><ios><api><transliteration>","1","0","1","",""
"4772565","1","","","2011-01-23 06:05:31","2","2996","<p>I am making an Android App and i need one of my Layouts to have Zoom control and have it be Scrollable Vertical, but i don't know how to successfully do this?</p>","583952","","","","","2013-04-09 03:18:02","How to make a Scrollable Layout and Zoomable Layout in an Android App?","<android>","2","1","","",""
"4772663","1","","","2011-01-23 06:50:27","4","1202","<p>I have a FrameLayout containing a subclassed SurfaceView and an ImageView.  I want to do a TranslateAnimation on the ImageView.  The only way I can make it work is to add a vacuous View to the FrameLayout.  Otherwise, the ImageView gets clipped (to the bounds of the ImageView's position at the start of the animation) during the animation.</p><p>I'm curious as to why the empty sibling View allows the ImageView to animate correctly.  The line that makes it work is marked with a comment in the code below.</p><pre><code>public class Test5 extends Activity {    private static final String TAG = ""Test5"";    private MySurfaceView mMSV;    private ImageView mRectView;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        mMSV = new MySurfaceView(this);        mRectView = new ImageView(this);        ShapeDrawable sd = new ShapeDrawable(new RectShape());        sd.getPaint().setColor(Color.RED);        sd.setIntrinsicWidth(300);        sd.setIntrinsicHeight(100);        mRectView.setImageDrawable(sd);        FrameLayout frameLayout = new FrameLayout(this);        frameLayout.addView(mMSV);        frameLayout.addView(mRectView, new FrameLayout.LayoutParams(                FrameLayout.LayoutParams.WRAP_CONTENT,                FrameLayout.LayoutParams.WRAP_CONTENT));        // I don't know why the following line prevents clipping during        // animation. It simply adds a vacuous View.        frameLayout.addView(new View(this));        setContentView(frameLayout);    }  // onCreate    public class MySurfaceView extends SurfaceView implements            SurfaceHolder.Callback {        public MySurfaceView(Context context) {            super(context);            getHolder().addCallback(this);        }        @Override        public void surfaceCreated(SurfaceHolder holder) {            Canvas can = mMSV.getHolder().lockCanvas();            can.drawColor(Color.GRAY);            mMSV.getHolder().unlockCanvasAndPost(can);        }        @Override        public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2,                int arg3) {        }        @Override        public void surfaceDestroyed(SurfaceHolder holder) {        }        @Override        public boolean onTouchEvent(MotionEvent ev) {            if (ev.getAction() == MotionEvent.ACTION_UP) {                Log.v(TAG, String.format(""ACTION_UP, w=%d, h=%d"", mRectView                        .getWidth(), mRectView.getHeight()));                Animation an = new TranslateAnimation(0f, 200f, 0f, 200f);                // Animation an = new RotateAnimation(0f, 90f);                an.setStartOffset(200);                an.setDuration(1000);                mRectView.startAnimation(an);            }            return true;        }    } // MySurfaceView}  // Test5</code></pre>","586176","","586176","","2011-01-23 07:00:31","2014-03-14 22:33:15","Why are View animations sometimes clipped?","<android><animation><clipping>","3","0","1","",""
"4772668","1","4772772","","2011-01-23 06:54:12","0","403","<p>Let's say I write an app that displays restaurant menus and lets a user order items from them. I'll call it RestaurantMenuApp. I'd like to have this main application be branded under my company name. It would allow users to view multiple different restaurants and place orders on any of them. Purchases are done through API calls to my web service using my company's merchant account.</p><p>Now let's say I also want to sell customized versions of this app to individual restaurants. The customized version would be themed just for that restaurant, only show their menus, locations, their promos, and so forth. It would make the restaurant look like they built their own custom app. Purchases are still done through API calls to my web service, but each branded version can use their own merchant account.</p><p>I'm wondering if each application (the main RestaurantMenuApp and each individually customized restaurant app) has to contain an entire copy of the entire application. Is it possible to have each app install a shared library that all of the apps use? If any of the apps has already installed this shared library, the others apps don't need to install it as well?</p><p>I'm new to mobile app development and searched for answers, but could only find solutions for how to build lite vs. full versions of the same app. It was not clear if these apps could SHARE code to make each install smaller.</p>","220599","","","","","2011-01-23 07:37:23","Can multiple versions of the same iphone or android app use shared code or libraries?","<iphone><android><cocoa><cocoa-touch>","2","0","","",""
"4772674","1","4772705","","2011-01-23 06:56:20","4","486","<p>When trying to read my xml from a webpage i get: ""Error: At line 8, column 23: unbound prefix""Below is my xml:</p><pre><code>&lt;?xml version=""1.0""?&gt;&lt;outertag&gt;&lt;innertag sampleattribute=""innertagAttribute""&gt;    &lt;Retailer&gt;        RetailerName:        &lt;xsl:template match=""link""&gt;            &lt;a href=""LinkGoesHere""&gt;Link&lt;/a&gt;        &lt;/xsl:template&gt;    &lt;/Retailer&gt;&lt;/innertag&gt;</code></pre><p></p><p>Any ideas as to what is wrong? Can I not use xsl:template within my xml? Any help is greatly appreciated.</p>","567772","","918472","","2013-10-18 07:39:43","2013-10-18 07:39:43","Problems parsing XML with XSL in it","<android><xml><xslt><xml-parsing>","1","3","","",""
"4772686","1","","","2011-01-23 07:02:29","4","17367","<p>I am calling the method and expect location updates multiple times:</p><pre><code>locationManager.requestLocationUpdates(""gps"",0 ,0, loc_listener);</code></pre><p>My <code>loc_listener</code> is defined as:</p><pre><code>LocationListener loc_listener = new LocationListener() {    private final String TAG = ""xoxoxo.LocationListener"";    public void onLocationChanged(Location l) {        Intent locationAlert = new Intent(""xoxoxo.LOCATION_CHANGED"")                .putExtra(""target_location"", l);        sendBroadcast(locationAlert);        // locationManager.requestLocationUpdates(""gps"", 0 ,0, this);    }    public void onProviderEnabled(String p) {        Log.i(TAG, ""Provider enabled"");    }    public void onProviderDisabled(String p) {        Log.i(TAG, ""Provider disabled"");    }    public void onStatusChanged(String p, int status, Bundle extras) {        Log.i(TAG, ""Status changed"");    }};</code></pre><p>Defined as is, I will only get an update once, both on HTC Evo 2.2 and 2.2 + Google API emulator.The hack to get multiple updates is to uncomment the line which registers for updates on each update:</p><pre><code>locationManager.requestLocationUpdates(""gps"", 0 ,0, this);</code></pre><p>Have you guys seen anything like this?</p>","2029411","","707111","","2013-05-25 15:10:26","2013-05-25 15:55:41","Location Manager's requestLocationUpdates called only once","<android><location>","1","4","8","",""
"4772693","1","6305218","","2011-01-23 07:04:02","14","15991","<p>I have a C++ game running through JNI in Android. The frame rate varies from about 20-45fps due to scene complexity. Anything above 30fps is silly for the game; it's just burning battery. I'd like to limit the frame rate to 30 fps.</p><ul><li>I could switch to RENDERMODE_WHEN_DIRTY, and use a Timer or ScheduledThreadPoolExecutor to requestRender(). But that adds a whole mess of extra moving parts that might or might not work consistently and correctly.</li><li>I tried injecting Thread.sleep() when things are running quickly, but this doesn't seem to work at all for small time values. And it may just be backing events into the queue anyway, not actually pausing.</li></ul><p>Is there a ""capFramerate()"" method hiding in the API? Any reliable way to do this?</p>","460007","","","","","2012-11-11 20:57:35","How to limit framerate when using Android's GLSurfaceView.RENDERMODE_CONTINUOUSLY?","<android><opengl-es>","3","0","15","",""
"4772876","1","12978630","","2011-01-23 08:08:39","0","1603","<p>I verified using SQLite Database Browser that the table contains no rows. I stepped through the query builder code to get the generated query and ran the query in SQLite Database Broswer. The query returned zero rows. But still, the cursor returned by Android's SQLiteQueryBuilder.query method returns true on cursor.moveToFirst() call and returns null values.</p><p>Anyone seen something like this before?</p>","585246","","","","","2013-10-19 14:46:23","Android database (SQLite) returns a non-empty cursor from an empty table","<android><sqlite>","3","1","","",""
"4772949","1","4773095","","2011-01-23 08:36:10","1","887","<p>I have worked on a simple application. It application includes diffrent levels that can be solved by placing some components inside a canvas, dragging them to the right place and so on.</p><p>The application is working fine, but when trying it on my HTC Desire 2.2, I <em>sometimes</em> get the warning message:</p><p><strong>Sorry:Activity xxxxx is not respoding.<em>Force Close - Wait</em></strong></p><p>If I press the wait-button and let it be for some seconds (up to ~30 sec sometimes), then it runs without any problems. I don´t know where I should start debugging the code, since it happenes only once in a while.</p><p>I have read the stuff in google developer site and it was just mostly very general stuff that did not really help.</p><p>any ideas?</p><p>since, I was not able to debug the problem myself, I am going to post the most important parts of the application. Please check and let me know If I need to post more classes.</p><pre><code>//Evrything elseBitmap bitmap;GraphicObject.Coordinates coords;for (GraphicObject graphic : _graphics) {    bitmap = graphic.getGraphic();    coords = graphic.getCoordinates();    canvas.drawBitmap(bitmap, coords.getX(), coords.getY(), null);}// draw current graphic at last...if (_currentGraphic != null) {    bitmap = _currentGraphic.getGraphic();    coords = _currentGraphic.getCoordinates();    canvas.drawBitmap(bitmap, coords.getX(), coords.getY(), null);}</code></pre>","576671","","390177","","2012-05-26 13:04:30","2012-05-26 13:04:30","Where to start debugging, when you get the ""Activity is not responding, Force Close, Wait""?","<java><android><drag-and-drop><thread-safety><unresponsive>","4","0","2","",""
"4772975","1","","","2011-01-23 08:42:10","1","173","<p>i am trying to make an application for android that actually needs to reads users email with users permission. Is it possible to read the email from user's inbox from gtalk or the inbuilt email app and get the text in the body and subject with intents or anything?Any help will be appreciated.</p>","586222","","","","","2012-01-04 14:56:39","Read user's email on android gtalk","<android><email><gmail><android-intent>","1","0","","",""
"4772982","1","","","2011-01-23 08:44:03","-1","485","<p>I am facing errors at the following places inside the custom dialogs that i hav created. Is is not possible to hav such functions inside a custom dialog??</p><blockquote>  <p>final EditText x= (EditText)findViewById(R.id.edtLocationName);</p>    <p>String strTextValue = x.getText().toString();  //here</p>    <p>int x1 =geoLat.intValue()xt().toString();  //and here</p></blockquote>","576031","","","","","2012-07-11 22:56:22","getting error at "" edittext.getText().toString() "" inside a custom dialog","<android>","2","2","0","",""
"4773031","1","4773041","","2011-01-23 08:58:02","4","680","<p>I am trying to do an program where i need to find the time take for doing a mathematical function. Suppose i am doing a calculation a/b, then how can i find the time taken to finish that calculation in millisecond??Please help me</p>","466474","","","","","2011-01-23 09:13:37","How to find Time taken for doing a mathematical operation?","<android><time>","2","1","1","",""
"4773067","1","","","2011-01-23 09:07:30","0","435","<p>I have non-interactive 2d animation application using html5 canvas and it works great under desktop browsers but performance is miserable under android. How does the performance of android native  <a href=""http://developer.android.com/reference/android/graphics/Canvas.html"" rel=""nofollow"">Canvas</a> vs html5 canvas compare? Since the API is radically different before I spend all the efforts I am posting this question. Is there alternative native android API that is very similar to html5 canvas for 2d animations applications?</p>","574122","","","","","2013-09-06 10:13:03","What is the performance difference between native Canvas api and html5 canvas API for android?","<android>","2","1","0","",""
"4773175","1","5663990","","2011-01-23 09:41:48","2","4185","<p>I am inserting an Image in the MediaStore cache using the following code snippet:</p><p><CODE>MediaStore.Images.Media.insertImage(getContentResolver(), selectedFile.getParent() + file.separator + selectedFile.getName(), selectedFile.getName(),null); </CODE></p><p>The insertion is ok but it also creates another image thumbnail at the same path. This is not visible in the gallery but when browsed using file browser this image thumbnail is visible. How can I stop this image thumbnail to be created here so as not to confuse the user.</p>","586250","","","","","2011-04-14 13:33:03","Android MediaStore Insert Image Additional file created","<android><image><insert><mediastore>","1","0","1","",""
"4773205","1","","","2011-01-23 09:50:43","2","1211","<pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""org.example.sudoku""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".Sudoku""                  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;  //error here-&gt;//      &lt;activity android:name="".about""        android:label=""@string/about_title""&gt;&lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre><p>//Th problem is ,when I was developing a sudoku game I got an error in defining the activity (.about).Above I have written the code and the place where the error occurred. Please help// </p>","586255","","546999","","2011-01-23 09:56:32","2011-01-23 12:37:04","Error in AndroidManifest.xml file !","<android><android-manifest>","3","3","","",""
"4773264","1","","","2011-01-23 10:08:20","1","656","<p>I'm trying to create my first android application, but it's all too mysterious for me, so I am asking.</p><p>My program uses <code>FrameLayout</code> and Circles. When I click background I want a new circle to appear. That's easy. In <code>MainActivity</code> I just set <code>FrameLayout.setOnTouchListener</code>. That's OK.</p><p>But I also want to delete circle when I touch it. My circles have more properties, so I created my own class and named it Ball. This Ball class extends <code>View</code> class and implements <code>OnTouchListener</code>. Than I added method:</p><pre><code>boolean onTouch(View arg0, MotionEvent arg1)</code></pre><p>It works too. But If I want to catch both events in my program (<code>FrameLayout.onTouch</code> and <code>Ball.onTouch</code>) than only one is catched. It does not matter where I click. My program always things that I clicked background.</p><p>I do not know what to do with it :(</p><p>Balls are added like this (constructor does it):</p><pre><code>mPaint.setColor(c);this.x = x;this.y = y;this.r = r;</code></pre><p>And constructor is called:</p><pre><code>myNewBall = new Ball(x,y,r,c)</code></pre><p>And ball is added to FrameLayout:</p><pre><code>myLayout.addView(currentBall);</code></pre><p>Can you help please?</p>","457128","","119895","","2011-01-23 13:02:41","2011-01-23 13:02:41","Events in Android. How to catch events in my classes / objects?","<android><events>","2","0","","",""
"4773415","1","","","2011-01-23 10:47:16","2","1193","<p>I am totally new to Box2D in Android.I am trying to create a body in ANDROID, but it never seems to work.I imported the library to the lib folder.And I tried somthing like this.</p><pre><code>            BodyDef bodyDef  = new BodyDef();        Vec2 initVel = new Vec2();        PolygonShape shape = new PolygonShape();        FixtureDef fd = new FixtureDef();                bodyDef.position.set(3.303636f, 7.712577f);            bodyDef.userData = block1;            bodyDef.angle = 0.000000f;            Body rectangle = world.createBody(bodyDef);            initVel.set(0.000000f, 0.000000f);            rectangle.setLinearVelocity(initVel);            rectangle.setAngularVelocity(0.000000f);            Vec2[] rectangle_vertices = new Vec2[4];            rectangle_vertices[0].set(-0.921088f, -0.614059f);            rectangle_vertices[1].set(0.921088f, -0.614059f);            rectangle_vertices[2].set(0.921088f, 0.614059f);            rectangle_vertices[3].set(-0.921088f, 0.614059f);            shape.set(rectangle_vertices, 4);            fd.shape = shape;            fd.density = 0.015000f;            fd.friction = 0.300000f;            fd.restitution = 0.600000f;            rectangle.createFixture(fd);  </code></pre><p>can anyone help me on this.Or PLease provide me with a sample code or how to start with Box2D.My main problem was some of the things like ""FixtureDef"" was not imported.Actually I tried to port the code which I used in Iphone Box2D to android.</p><p>Please anyone help.Thanks for reading.</p>","655814","","","","","2011-01-23 12:30:41","How to create a dynamic body in Box2D?","<android>","2","0","","",""
"4773424","1","4773490","","2011-01-23 10:49:22","3","31077","<p>hi how to create one game in android application i am very new android any one tell me basic things....simple android game now i am using android 2.2 version </p>","486554","","","","","2011-01-23 11:13:16","how to create one simple android game?","<java><android>","4","1","3","2011-01-23 11:16:09",""
"4773431","1","4773776","","2011-01-23 10:50:32","0","2386","<p>Recently i have downloaded the src code of the browser from source.android.com(projects / platform/packages/apps/Browser.git /). In that am getting the error ""android.os.ServiceManager cannot be resolved"", if i execute it on eclipse as the build version 2.3 - api level 9.</p><p>Am i missin g something?? plz help me on this asap.</p>","205929","","118073","","2012-05-23 22:45:12","2012-05-23 22:45:12","android.os.ServiceManager cannot be resolved","<java><android><mobile><service><android-sdk-2.3>","1","0","1","",""
"4773434","1","","","2011-01-23 10:51:28","1","1311","<p>An application that is running for a long time in foreground will acquire more priority in time?I explain my problem. I ported a software for communication with a  fixed infrastructure in Android. I'm making some tests. Each test makes 5 experiments (the mobile node sends some queries to the infrastructure and evalutes the number of query successful and the mean time) and the result of the test is the mean of the results of these experiments.During the test the application is always in foreground.In the experiments the result improve e. g. (10% 15% 30% 40% 55% of query ok).I implemented the system as activity and not yet as service.For the test the app aquire the locks SCREEN_DIM_WAKE_LOCK and WIFI_MODE_FULL.Thanks</p>","580318","","","","","2011-01-23 12:26:12","Application priority","<android>","1","1","","",""
"4773506","1","","","2011-01-23 11:13:07","1","1138","<p>In my application i would like to simulate a click (X,Y) in my webView.I don't find the response.</p>","586298","","213269","","2011-01-23 17:53:37","2014-02-07 23:07:02","Simulate a click in my webview","<android><webview><simulation>","1","0","1","",""
"4773576","1","","","2011-01-23 11:34:07","4","2804","<p>I've been looking around the interwebs for a while now for a PDF parser that actually works on android. I've tried quiet a few java libraries already but they all seem to crash when running on Android.</p><p>Can anyone that has successfully parsed PDFs in Android please recommend a library to use? </p>","451575","","","","","2012-10-20 00:39:02","Are there any free PDF parsing libraries that work in Android?","<java><android><parsing><pdf><text>","3","4","1","",""
"4773620","1","4792059","","2011-01-23 11:49:00","4","1021","<p>I'm writing application for Android 2.1. with Google Maps. Everything works fine except one detail: there is a white square box on the bottom left corner of devices screen. (like on the screenshot below). This is independent on my location - always bottom left corner is blank.</p><p>Here is java code, where I create mapView:</p><pre><code>mapView = new MapView(activity,""myCorrectApiCode"");// Configure the map display optionsmapView.setBuiltInZoomControls(false);mapView.setSatellite(true);mapView.setStreetView(true);</code></pre><p>Any idea to exclude this blank square?</p><p><img src=""http://i.stack.imgur.com/D1MeA.png"" alt=""alt text""></p><p>code details:my main activity xml file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    android:id=""@+id/LinearLayoutMain""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""android:layout_height=""fill_parent"" android:gravity=""center""&gt;&lt;LinearLayoutandroid:background=""@drawable/mapback""android:id=""@+id/LinearLayoutMainUp"" xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""80sp"" android:gravity=""center""&gt;    &lt;TextView android:textColor=""#000000"" android:gravity=""center"" android:id=""@+id/TextViewResultTxt"" android:layout_height=""wrap_content"" android:text=""@string/result_txt"" android:layout_width=""wrap_content""&gt;&lt;/TextView&gt;    &lt;TextView android:textColor=""#000000"" android:textStyle=""bold"" android:layout_height=""wrap_content"" android:id=""@+id/myLocationText"" android:singleLine=""true"" android:gravity=""center"" android:layout_width=""fill_parent"" android:text=""@string/hello""&gt;&lt;/TextView&gt;    &lt;TextView android:textColor=""#000000"" android:textStyle=""bold"" android:layout_height=""wrap_content"" android:id=""@+id/myLocationTextDist"" android:singleLine=""true"" android:gravity=""center"" android:layout_width=""fill_parent"" android:text=""@string/waiting_for_gps""&gt;&lt;/TextView&gt;&lt;TextView android:text="""" android:id=""@+id/timerTextView"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/TextView&gt; &lt;/LinearLayout&gt;</code></pre><p></p><p>mapView I'm adding dynamic:</p><pre><code>LinearLayout l = ((LinearLayout) activity.findViewById(R.id.LinearLayoutMain));l.addView(mapView);</code></pre>","301556","","301556","","2011-01-24 23:42:04","2011-01-25 09:58:13","Blank square in Google Maps","<java><android><google-maps>","2","4","1","",""
"4773645","1","","","2011-01-23 11:53:27","2","1612","<p>I'm trying to retrieve the height of a webview's content. it contains a html-string.The problem is that getContentHeight() returns always the same value (392), no matter how long the html-string is.</p>","564256","","","","","2012-05-17 04:12:01","GetContentHeight() does not work properly","<android><webview>","2","1","","",""
"4773708","1","","","2011-01-23 12:07:12","1","315","<p>I'm trying to build the andengine ( <a href=""http://www.andengine.org/"" rel=""nofollow"">http://www.andengine.org/</a> )examples in eclipse, but can't continue because eclipse is trying to parse a .mod file (an audio resource?) as XML.  Do I need to change the project configuration or change something in eclipse?  The exact error is:</p><pre><code>Description The markup declarations contained or pointed to by the document type declaration must be well-formed.   Resource    lepeltheme.mod  Path    /AndEngineExamples/assets/mfx   Location    line 1  TypeDTD Problem</code></pre><p>I'm very new to eclipse and a beginner in Java.</p><p>Thanks for any suggestions.</p>","525759","","","","","2011-01-24 08:10:27","DTD problem in media file","<android><eclipse><dtd><assets><andengine>","1","0","","",""
"4773756","1","4773912","","2011-01-23 12:22:21","14","556","<p>I'm interested in starting developing on the iOS platform, after a couple of years of Android work. What are the main things that are likely to trip me up when designing/coding for iOS instead of Android?</p>","319618","","319618","","2011-01-23 12:28:45","2011-10-11 11:38:40","Android developer moving to iOS - What do I need to know?","<iphone><android><transition>","2","8","7","",""
"4773796","1","","","2011-01-23 12:33:34","1","612","<p>I have looked at this topic to dynamically add views when needed: <a href=""http://stackoverflow.com/questions/3995215/add-and-remove-views-in-android-dynamically"">add and remove views in android dynamically?</a></p><p>However, I have a few questions.</p><p>1) Will there be a visible stutter or lag when creating these views on the go? For example, I use a panel system where each panel holds a separate view. However, these panels could reach a high number in quantity (40 odd panels?) when the program is complete. In order to preserve resources, I want only the view that is currently visible to actually be created, and the others views to not be instantiated until they are brought into the visible region. I have been told to use a ViewFlipper, but due to animation and user interaction requirements of my program, I cannot use a ViewFlipper, but have something along the same lines that I have created.</p><p>For example:</p><p>Imagine one of my ""panels"" to be pretty much like a screen in the Android Home launcher. The thing with the Home Launcher is that all it's views can be kept alive at any given time, because there's only really 7 of them. However, seeing as there are closer to 40 in mine (not all left and right, some above and below as well), I cannot have them all instantiated at the same time, or else the phone will begin to lag.</p><p>2) What is the code to destroy the views once they aren't in the visible region?</p><p>My program will determine when the panels are in the visible region or not, hence I will only need the code to destroy the views on the go.</p><p>Thanks.</p>","585251","","","","","2011-01-23 13:21:53","Dynamically removing and adding views when needed","<android>","1","0","","",""
"4773923","1","","","2011-01-23 12:58:14","0","161","<p>I want to keep my <code>activity</code> on TOP always.</p><p>I need to get my <code>Activity</code> called to TOP in every 5 sec.( not re-create).I used <code>Timer</code>, but not able to do so.</p><p>Please help me.If possible provide some code also.</p>","586344","","119895","","2011-01-23 13:05:15","2011-01-23 13:14:41","Bring your custom Activity get launched at in fixed time duration","<android>","1","0","","",""
"4773972","1","4774924","","2011-01-23 13:08:14","1","1910","<p>im doing an android app, and i have a local DB with MyDBAdapter</p><p>i insert a lot of positions in my DB with this code (myPositions haves a lot of positions on it)</p><pre><code>for (int i=0;i&lt;myPositions.size();i++)        {            MyApplication.getDatabaseAdapter().createPosition(myPositions.get(i).getIdposition(),myPositions.get(i).getLatitude(),myPositions.get(i).getLongitude(),myPositions.get(i).getpositiontimeFormated(),myPositions.get(i).getFk_email());        }</code></pre><p>ok, but when i try to get the positions of a user that haves a lot of possitions i get an empty cursor..... here is the code i use to get the cursor with the positions of the user, i call retrievePositionsByEmail, and that function calls fetchPositionsByEmail, but <strong>fetchPositionsByEmail returns en EMPTY CURSOR</strong></p><pre><code>public Cursor fetchPositionsByEmail(String email) throws SQLException {    Cursor mCursor = mDb.query(true, ""position"", new String[] {""idposition"", ""latitude"", ""longitude"", ""timestamp"", ""fk_email""}        , ""fk_email"" + ""='"" + email+""'"", null, null, null, null, null);    //Cursor mCursor = mDb.query(true, ""position"", new String[] {""idposition"", ""latitude"", ""longitude"", ""timestamp"", ""fk_email""}    //, ""fk_email=?"", new String[] { email } , null, null, null, null);    if (mCursor != null) {        mCursor.moveToFirst();    }    return mCursor;}public List&lt;Position&gt; retrievePositionsByEmail(String email) {    List &lt;Position&gt; positions=new ArrayList&lt;Position&gt;();    Cursor result=fetchPositionsByEmail(email);    if( result.moveToFirst() ){        do{            positions.add(new Position(result.getString(result.getColumnIndexOrThrow(""idposition"")),                    result.getString(result.getColumnIndexOrThrow(""latitude"")),                     result.getString(result.getColumnIndexOrThrow(""longitude"")),                    result.getString(result.getColumnIndexOrThrow(""timestamp"")),                    result.getString(result.getColumnIndexOrThrow(""fk_email""))));        }while( result.moveToNext() );    }    return positions;}</code></pre><p>and here is the full code of my local DB adapter:</p><pre><code>public class MyDbAdapter {    private static final String TAG = ""NotesDbAdapter"";    private DatabaseHelper mDbHelper;    private SQLiteDatabase mDb;    private static final String DATABASE_NAME = ""gpslocdb"";    private static final String PERMISSION_TABLE_CREATE = ""CREATE TABLE permission ( fk_email1 varchar, fk_email2 varchar, validated tinyint, hour1 time default '08:00:00', hour2 time default '20:00:00', date1 date, date2 date, weekend tinyint default '0', fk_type varchar, PRIMARY KEY  (fk_email1,fk_email2))"";    private static final String USER_TABLE_CREATE = ""CREATE TABLE user ( email varchar, password varchar, fullName varchar, mobilePhone varchar, mobileOperatingSystem varchar, PRIMARY KEY  (email))"";    private static final String POSITION_TABLE_CREATE = ""CREATE TABLE position (idposition bigint, latitude varchar, longitude varchar, timestamp datetime, fk_email varchar, PRIMARY KEY (idposition))"";    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(""DROP TABLE IF EXISTS user"");            db.execSQL(""DROP TABLE IF EXISTS permission"");            db.execSQL(""DROP TABLE IF EXISTS position"");            db.execSQL(PERMISSION_TABLE_CREATE);            db.execSQL(USER_TABLE_CREATE);            db.execSQL(POSITION_TABLE_CREATE);        }        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {            //db.execSQL(""DROP TABLE IF EXISTS user"");            //db.execSQL(""DROP TABLE IF EXISTS permission"");            //onCreate(db);        }        @Override        public void onOpen(SQLiteDatabase db) {            super.onOpen(db);            //onCreate(db);        }        public void clearDb(SQLiteDatabase db){            db.execSQL(""DROP TABLE IF EXISTS user"");            db.execSQL(""DROP TABLE IF EXISTS permission"");            db.execSQL(""DROP TABLE IF EXISTS position"");            onCreate(db);        }        public void deleteUser(SQLiteDatabase db, String email)        {            db.execSQL(""DELETE FROM user Where email='""+email+""'"");        }        public void deletePermission(SQLiteDatabase db, String email)        {            db.execSQL(""DELETE FROM permission Where fk_email2='""+email+""'"");        }    }    /**     * Constructor - takes the context to allow the database to be     * opened/created     *      * @param ctx the Context within which to work     */    public MyDbAdapter(Context ctx) {        this.mCtx = ctx;    }    /**     * Open the 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 MyDbAdapter open() throws SQLException {        mDbHelper = new DatabaseHelper(mCtx);        mDb = mDbHelper.getWritableDatabase();        return this;    }    public void close() {        //clearDB();        mDbHelper.close();    }    public long createUser(String email, String password, String fullName, String mobilePhone, String mobileOperatingSystem)     {        ContentValues initialValues = new ContentValues();        initialValues.put(""email"",email);        initialValues.put(""password"",password);        initialValues.put(""fullName"",fullName);        initialValues.put(""mobilePhone"",mobilePhone);        initialValues.put(""mobileOperatingSystem"",mobileOperatingSystem);        return mDb.insert(""user"", null, initialValues);    }    public long createPermission(String email1, String email2, String validated, String hour1, String hour2,            String date1, String date2, String weekend, String fk_type)     {        ContentValues initialValues = new ContentValues();        initialValues.put(""fk_email1"",email1);        initialValues.put(""fk_email2"",email2);        initialValues.put(""validated"",validated);        initialValues.put(""hour1"",hour1);        initialValues.put(""hour2"",hour2);        initialValues.put(""date1"",date1);        initialValues.put(""date2"",date2);        initialValues.put(""weekend"",weekend);        initialValues.put(""fk_type"",fk_type);        return mDb.insert(""permission"", null, initialValues);    }    public long createPosition(String idposition, String latitude, String longitude, String timestamp, String fk_email)     {        ContentValues initialValues = new ContentValues();        initialValues.put(""idposition"",idposition);        initialValues.put(""latitude"",latitude);        initialValues.put(""longitude"",longitude);        initialValues.put(""timestamp"",timestamp);        initialValues.put(""fk_email"",fk_email);        return mDb.insert(""position"", null, initialValues);    }    public void clearDB() {        mDbHelper.clearDb(mDb);            }    public Cursor fetchAllUsers() {        return mDb.query(""user"", new String[] {""email"", ""password"", ""fullName"", ""mobilePhone"", ""mobileOperatingSystem""}, null, null, null, null, null);    }    public Cursor fetchAllPermissions() {        return mDb.query(""permission"", new String[] {""fk_email1"", ""fk_email2"", ""validated"", ""hour1"", ""hour2"", ""date1"", ""date2"", ""weekend"", ""fk_type""}, null, null, null, null, null);    }    public Cursor fetchUser(String email) throws SQLException {        Cursor mCursor = mDb.query(true, ""user"", new String[] {""email"", ""password"", ""fullName"", ""mobilePhone"", ""mobileOperatingSystem""}            , ""email"" + ""="" + email, null, null, null, null, null);        if (mCursor != null) {            mCursor.moveToFirst();        }        return mCursor;    }    public Cursor fetchPositionsByEmail(String email) throws SQLException {        Cursor mCursor = mDb.query(true, ""position"", new String[] {""idposition"", ""latitude"", ""longitude"", ""timestamp"", ""fk_email""}            , ""fk_email"" + ""='"" + email+""'"", null, null, null, null, null);        //Cursor mCursor = mDb.query(true, ""position"", new String[] {""idposition"", ""latitude"", ""longitude"", ""timestamp"", ""fk_email""}        //, ""fk_email=?"", new String[] { email } , null, null, null, null);        if (mCursor != null) {            mCursor.moveToFirst();        }        return mCursor;    }    public List&lt;Friend&gt; retrieveAllFriends()     {        List &lt;Friend&gt; friends=new ArrayList&lt;Friend&gt;();        Cursor result=fetchAllUsers();        if( result.moveToFirst() ){            do{                friends.add(new Friend(result.getString(result.getColumnIndexOrThrow(""email"")),result.getString(result.getColumnIndexOrThrow(""password"")), result.getString(result.getColumnIndexOrThrow(""fullName"")),result.getString(result.getColumnIndexOrThrow(""mobilePhone"")),result.getString(result.getColumnIndexOrThrow(""mobileOperatingSystem""))));            }while( result.moveToNext() );        }        return friends;    }    public List&lt;Permission&gt; retrieveAllPermissions()     {        List &lt;Permission&gt; permissions=new ArrayList&lt;Permission&gt;();        Cursor result=fetchAllPermissions();        if( result.moveToFirst() ){            do{                permissions.add(new Permission(result.getString(result.getColumnIndexOrThrow(""fk_email1"")),                        result.getString(result.getColumnIndexOrThrow(""fk_email2"")),                         Integer.parseInt(result.getString(result.getColumnIndexOrThrow(""validated""))),                        result.getString(result.getColumnIndexOrThrow(""hour1"")),                        result.getString(result.getColumnIndexOrThrow(""hour2"")),                        result.getString(result.getColumnIndexOrThrow(""date1"")),                        result.getString(result.getColumnIndexOrThrow(""date2"")),                        Integer.parseInt(result.getString(result.getColumnIndexOrThrow(""weekend""))),                        result.getString(result.getColumnIndexOrThrow(""fk_type""))));            }while( result.moveToNext() );        }        return permissions;    }    public List&lt;Position&gt; retrievePositionsByEmail(String email)     {        List &lt;Position&gt; positions=new ArrayList&lt;Position&gt;();        Cursor result=fetchPositionsByEmail(email);        if( result.moveToFirst() ){            do{                positions.add(new Position(result.getString(result.getColumnIndexOrThrow(""idposition"")),                        result.getString(result.getColumnIndexOrThrow(""latitude"")),                         result.getString(result.getColumnIndexOrThrow(""longitude"")),                        result.getString(result.getColumnIndexOrThrow(""timestamp"")),                        result.getString(result.getColumnIndexOrThrow(""fk_email""))));            }while( result.moveToNext() );        }        return positions;    }    public void deleteUser(String email) throws SQLException    {        mDbHelper.deleteUser(mDb, email);    }    public void deletePermission(String email) throws SQLException    {        mDbHelper.deletePermission(mDb, email);    }}</code></pre>","479886","","","","","2011-01-23 16:33:49","Why this query is giving me an empty cursor?","<android><sql><sqlite><cursor>","1","1","0","",""
"4774002","1","","","2011-01-23 13:15:20","0","909","<p>my list items implements OnTouchListener and therefore the OnItemClicked() method of the ListView is not invoked. Can anyone help me to make it work?</p>","586353","","","","","2012-09-05 20:42:16","invoke OnItemClicked() in a ListView while list items catch onTouchEvent","<android>","1","0","1","",""
"4774004","1","4775316","","2011-01-23 13:15:37","11","6983","<p>Is there any possibility to show a spinning progress bar in a button?e.g. as background drawable?</p>","586350","","759866","","2013-12-29 13:16:20","2013-12-29 13:16:20","Android progressbar in button","<android><button><progress-bar>","3","2","8","",""
"4774009","1","","","2011-01-23 13:16:20","7","3842","<p>I've been trying to get the status result code from sendMultipartTextMessage, the thing i don't understand is if the broadcast receiver works with sendTextMessage, why doesnt it work with sendMultipartTextMessage? I've searched far and wide and looked and code examples but just cant see any obvious reasons as to why this wont work. Can anyone shed any light on this?<br><pre><code>ArrayList<code>&lt;String&gt;</code> messages = sms.divideMessage(text);int messageCount = messages.size();ArrayList<code>&lt;PendingIntent&gt;</code> deliveryIntents = new ArrayList<code>&lt;PendingIntent&gt;</code>(messageCount);ArrayList<code>&lt;PendingIntent&gt;</code> sentIntents = new ArrayList<code>&lt;PendingIntent&gt;</code>(messageCount);</p><p>for (int j = 0; j &lt; messageCount; j++) {   sentIntents.add(PendingIntent.getBroadcast(context, 0,                                               new Intent(SENT_ACTION),                                              0));   }sms.sendMultipartTextMessage( phoneNumber, null, messages, sentIntents, null);</code></pre></p><p><br />Here's my broadcastreceiver</p><pre><code>private BroadcastReceiver messageSentReceiver = new BroadcastReceiver() {          @Override    public void onReceive(Context context, Intent intent) {        switch (getResultCode()) {           case Activity.RESULT_OK:               Toast.makeText(context, ""SMS sent"", Toast.LENGTH_SHORT).show();               break;           case SmsManager.RESULT_ERROR_GENERIC_FAILURE:              Toast.makeText(context, ""Generic failure"", Toast.LENGTH_SHORT).show();              break;          case SmsManager.RESULT_ERROR_NO_SERVICE:              Toast.makeText(context, ""No service"", Toast.LENGTH_SHORT).show();              break;          case SmsManager.RESULT_ERROR_NULL_PDU:              Toast.makeText(context, ""Null PDU"", Toast.LENGTH_SHORT).show();              break;          case SmsManager.RESULT_ERROR_RADIO_OFF:              Toast.makeText(context, ""Radio off"", Toast.LENGTH_SHORT).show();              break;          }      }    };</code></pre><p><br>The code is done as below: <p><code><pre>sentIntents = new ArrayList<code>&lt;PendingIntent&gt;</code>();sentIntent = PendingIntent.getBroadcast(context, 0, new Intent(SENT_ACTION), 0);deliveredIntent = PendingIntent.getBroadcast(context, 0, new Intent(DELIVERED_ACTION), 0);</p><p>context.registerReceiver(messageSentReceiver, new IntentFilter(SENT_ACTION));context.registerReceiver(messageDeliveredReceiver, new IntentFilter(DELIVERED_ACTION));</pre></code></p><p>If anyone could shed any light on this, i would really appreciate it. I just can't see why this could work with sendTextMessage but not on sendMultipartTextMessage. </p><p>Thanks.</p>","586355","","586355","","2011-01-23 14:23:59","2013-06-18 09:11:23","Broadcast Receiver with sendMultiPartTextMessage","<android>","2","0","4","",""
"4774013","1","","","2011-01-23 13:16:55","2","878","<p>I have a special request to implement dynamic language packs and themes in Android. This basically means:</p><ol><li>to download a zip file containing a file named strings.xml (containing the translation)</li><li>replace in the application the file /res/values/strings.xml with the one downloaded</li></ol><p>Is this possible? Thank you for your help.</p>","586357","","","","","2011-01-23 13:24:28","Change string.xml at runtime","<android><runtime>","1","0","2","",""
"4774087","1","4774103","","2011-01-23 13:31:20","3","7868","<p>I am trying to make a program that takes some user input, runs a few calculations and outputs the answer. My problem is that this answer is sometimes many decimal places long which is causing some aesthetic and layout problems.  I only need to display 4 decimal places worth of data. Is there anyway to limit the precision of these numbers at output time? (The Numbers are stored in floats and I'm programming for Android.)</p>","583082","","44390","","2012-05-31 15:50:09","2012-05-31 15:50:09","Float Precision Display (Android)","<android><floating-point><precision>","1","0","","",""
"4774160","1","5022333","","2011-01-23 13:51:25","2","5684","<p>I've been trying for a few days to integrate Google Calendar in my Android app to little success. I've implemented the GData APIs, and used the code they've given for test purposes but keep getting a SAXParser error as below. All I need to do is to create new events in the user's Calendar.</p><pre><code>01-23 19:10:40.420: WARN/XmlParser(28605): javax.xml.parsers.ParserConfigurationException: org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/features/external-parameter-entities01-23 19:10:40.420: WARN/XmlParser(28605): javax.xml.parsers.ParserConfigurationException: org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/features/external-parameter-entities01-23 19:10:40.420: WARN/XmlParser(28605):     at org.apache.harmony.xml.parsers.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:84)01-23 19:10:40.420: WARN/XmlParser(28605):     at com.google.gdata.util.XmlParser.parse(XmlParser.java:682)01-23 19:10:40.420: WARN/XmlParser(28605):     at com.google.gdata.util.XmlParser.parse(XmlParser.java:576)01-23 19:10:40.420: WARN/XmlParser(28605):     at com.google.gdata.data.BaseEntry.parseAtom(BaseEntry.java:1015)01-23 19:10:40.420: WARN/XmlParser(28605):     at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:59)01-23 19:10:40.420: WARN/XmlParser(28605):     at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:39)01-23 19:10:40.420: WARN/XmlParser(28605):     at com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.java:100)01-23 19:10:40.420: WARN/XmlParser(28605):     at com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java:52)01-23 19:10:40.420: WARN/XmlParser(28605):     at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:66)01-23 19:10:40.420: WARN/XmlParser(28605):     at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:34)01-23 19:10:40.420: WARN/XmlParser(28605):     at com.google.gdata.client.Service.parseResponseData(Service.java:2165)01-23 19:10:40.420: WARN/XmlParser(28605):     at com.google.gdata.client.Service.parseResponseData(Service.java:2098)01-23 19:10:40.420: WARN/XmlParser(28605):     at com.google.gdata.client.Service.insert(Service.java:1410)01-23 19:10:40.420: WARN/XmlParser(28605):     at com.google.gdata.client.GoogleService.insert(GoogleService.java:606)01-23 19:10:40.420: WARN/XmlParser(28605):     at &lt;packagename&gt;.CalendarDialog.addToCalendar(CalendarDialog.java:160)01-23 19:10:40.420: WARN/XmlParser(28605):     at &lt;packagename&gt;.CalendarDialog.onClick(CalendarDialog.java:125)01-23 19:10:40.420: WARN/XmlParser(28605):     at android.view.View.performClick(View.java:2421)01-23 19:10:40.420: WARN/XmlParser(28605):     at android.view.View$PerformClick.run(View.java:8869)01-23 19:10:40.420: WARN/XmlParser(28605):     at android.os.Handler.handleCallback(Handler.java:587)01-23 19:10:40.420: WARN/XmlParser(28605):     at android.os.Handler.dispatchMessage(Handler.java:92)01-23 19:10:40.420: WARN/XmlParser(28605):     at android.os.Looper.loop(Looper.java:143)01-23 19:10:40.420: WARN/XmlParser(28605):     at android.app.ActivityThread.main(ActivityThread.java:5097)01-23 19:10:40.420: WARN/XmlParser(28605):     at java.lang.reflect.Method.invokeNative(Native Method)01-23 19:10:40.420: WARN/XmlParser(28605):     at java.lang.reflect.Method.invoke(Method.java:521)01-23 19:10:40.420: WARN/XmlParser(28605):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-23 19:10:40.420: WARN/XmlParser(28605):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-23 19:10:40.420: WARN/XmlParser(28605):     at dalvik.system.NativeStart.main(Native Method)01-23 19:10:40.420: WARN/System.err(28605): com.google.gdata.util.ParseException: org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/features/external-parameter-entities01-23 19:10:40.420: WARN/System.err(28605):     at com.google.gdata.util.XmlParser.parse(XmlParser.java:708)01-23 19:10:40.420: WARN/System.err(28605):     at com.google.gdata.util.XmlParser.parse(XmlParser.java:576)01-23 19:10:40.420: WARN/System.err(28605):     at com.google.gdata.data.BaseEntry.parseAtom(BaseEntry.java:1015)01-23 19:10:40.420: WARN/System.err(28605):     at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:59)01-23 19:10:40.420: WARN/System.err(28605):     at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:39)01-23 19:10:40.420: WARN/System.err(28605):     at com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.java:100)01-23 19:10:40.420: WARN/System.err(28605):     at com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java:52)01-23 19:10:40.420: WARN/System.err(28605):     at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:66)01-23 19:10:40.420: WARN/System.err(28605):     at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:34)01-23 19:10:40.420: WARN/System.err(28605):     at com.google.gdata.client.Service.parseResponseData(Service.java:2165)01-23 19:10:40.420: WARN/System.err(28605):     at com.google.gdata.client.Service.parseResponseData(Service.java:2098)01-23 19:10:40.420: WARN/System.err(28605):     at com.google.gdata.client.Service.insert(Service.java:1410)01-23 19:10:40.420: WARN/System.err(28605):     at com.google.gdata.client.GoogleService.insert(GoogleService.java:606)01-23 19:10:40.430: WARN/System.err(28605):     at &lt;packagename&gt;.CalendarDialog.addToCalendar(CalendarDialog.java:160)01-23 19:10:40.430: WARN/System.err(28605):     at &lt;packagename&gt;.CalendarDialog.onClick(CalendarDialog.java:125)01-23 19:10:40.430: WARN/System.err(28605):     at android.view.View.performClick(View.java:2421)01-23 19:10:40.430: WARN/System.err(28605):     at android.view.View$PerformClick.run(View.java:8869)01-23 19:10:40.430: WARN/System.err(28605):     at android.os.Handler.handleCallback(Handler.java:587)01-23 19:10:40.430: WARN/System.err(28605):     at android.os.Handler.dispatchMessage(Handler.java:92)01-23 19:10:40.430: INFO/dalvikvm(28605): Jit: resizing JitTable from 4096 to 819201-23 19:10:40.440: WARN/System.err(28605):     at android.os.Looper.loop(Looper.java:143)01-23 19:10:40.440: WARN/System.err(28605):     at android.app.ActivityThread.main(ActivityThread.java:5097)01-23 19:10:40.440: WARN/System.err(28605):     at java.lang.reflect.Method.invokeNative(Native Method)01-23 19:10:40.440: WARN/System.err(28605):     at java.lang.reflect.Method.invoke(Method.java:521)01-23 19:10:40.440: WARN/System.err(28605):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-23 19:10:40.440: WARN/System.err(28605):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-23 19:10:40.440: WARN/System.err(28605):     at dalvik.system.NativeStart.main(Native Method)01-23 19:10:40.440: WARN/System.err(28605): Caused by: javax.xml.parsers.ParserConfigurationException: org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/features/external-parameter-entities01-23 19:10:40.450: WARN/System.err(28605):     at org.apache.harmony.xml.parsers.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:84)01-23 19:10:40.450: WARN/System.err(28605):     at com.google.gdata.util.XmlParser.parse(XmlParser.java:682)01-23 19:10:40.450: WARN/System.err(28605):     ... 25 more</code></pre><p>The code I used for adding the event is:</p><pre><code>void addToCalendar() throws IOException, ServiceException    {        CalendarService myService = new CalendarService(""exampleCo-exampleApp-1"");        myService.setUserCredentials(""&lt;username&gt;@gmail.com"", ""&lt;password&gt;"");    URL postUrl =          new URL(""https://www.google.com/calendar/feeds/&lt;username&gt;@gmail.com/private/full"");        CalendarEventEntry myEntry = new CalendarEventEntry();        myEntry.setTitle(new PlainTextConstruct(""Tennis with Beth""));        myEntry.setContent(new PlainTextConstruct(""Meet for a quick lesson.""));        DateTime startTime = DateTime.parseDateTime(""2011-01-26T15:00:00+05:30"");        DateTime endTime = DateTime.parseDateTime(""2011-01-26T15:12:00+05:30"");        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>Any idea what's causing the problem? Also, if anyone's got the Calendar API running, can they provide some help? Like I said, all I need is to add events (both single and recurring)</p><p>Thanks!</p>","560481","","","","","2011-03-08 07:14:48","Unable to integrate Google Calendar API in Android app","<android><google-calendar>","3","0","3","",""
"4774271","1","4774512","","2011-01-23 14:20:15","3","5006","<p>As far as I'm aware, each Android phones limits all apps to a maximum memory usage of about 16, 24 or 32Mb. I've just seen people discussing the app Dungeon Defenders which apparently seems to make use of 256 Mb of RAM.</p><p>App description: ""Minimum Requirements: 512 MB RAM (256 free at runtime)""<a href=""http://www.appbrain.com/app/dungeon-defenders%3A-first-wave/com.trendy.ddapp"" rel=""nofollow"">http://www.appbrain.com/app/dungeon-defenders%3A-first-wave/com.trendy.ddapp</a></p><p>A guide on how to get this game to run on a Droid (where a custom ROM is require to get 256Mb of RAM free to run the game):<a href=""http://www.forums.trendyent.com/showthread.php?447-How-to-play-Dungeon-Defenders-on-your-"" rel=""nofollow"">http://www.forums.trendyent.com/showthread.php?447-How-to-play-Dungeon-Defenders-on-your-</a>Motorola-Droid-Milestone-(requires-root)</p><p>How is this possible? Does anyone know what is going on here? Having access to that much RAM would make certain projects I'm working on much easier to write so I'm very interested to know what this game is doing.</p>","580100","","","","","2011-04-02 21:05:32","How can an Android app use >=256Mb of RAM?","<java><android><memory><mobile>","4","0","3","",""
"4774304","1","4775202","","2011-01-23 14:27:43","0","814","<p>I have an android app in which i am using Facebook Android SDK to post content from my application to Facebook Wall. My code was working perfectly till i updated the Facebook app on my phone. Since that time, whenever i try to post content on Facebook, i get the login screen with the ""Loading"" option and after a few seconds, nothing happens. Here is the code which i am using</p><p>On Facebook Button CLick</p><pre><code>if(isOnline())        {        mFacebook = new Facebook(""APP ID"");        mFacebook.authorize(this,new String[] {""publish_stream"", ""read_stream"", ""offline_access""}, new AuthorizeListener());        }</code></pre><p>The Code for Authorize listener is</p><pre><code>class AuthorizeListener implements DialogListener { public void onComplete(Bundle values) {       //  Handle a successful login    postOnWall(""My wall text"");      }    @Override    public void onCancel() {    }    @Override    public void onError(DialogError e) {    }    @Override    public void onFacebookError(FacebookError e) {    }    }</code></pre><p>After debugging i found that the OnComplete method is not being called after calling the authorize function and there is also no exception. This was working perfectly till i update the Facebook app on my Android phone.</p><p>Any help will be appreciated</p>","282826","","","","","2011-01-23 17:25:47","Unable to share Content on Facebook through Android App","<android>","1","0","","",""
"4774312","1","","","2011-01-23 14:29:13","2","407","<p>I'm playing with RenPy's pygame for android and I encountered problem with unicode...</p><p>Even this simple script crashes:</p><pre><code>#-*- coding: utf-8 -*-blah = u""zzc""def main():    pass</code></pre><p>Here's what adb logcat is telling me:</p><pre><code>I/python  ( 6957): Traceback (most recent call last):I/python  ( 6957):   File ""start.pyx"", line 59, in init start (/home/tom/ab/pygame-droid/android-sdl/jni/../jni/application/src//start.c:1372)I/python  ( 6957): LookupError: unknown encoding: utf-16-be</code></pre><p>I know that it simply doesn't have this encoding, but why does it try to use utf-16-be at all? I'm saving it as utf-8 (using geany). Sorry, my English isn’t very good >&lt;. Thanks in advance.</p>","586395","","","","","2013-11-24 16:18:02","Pygame Subset for Android and utf-16-be encoding","<python><android><pygame>","1","1","1","",""
"4774346","1","4774580","","2011-01-23 14:35:51","1","2954","<p>I want to show an empty list view, which is then populated by user input. I have the UI flow working, and I populate a list of my custom objects after the user enters some information via a view which is invoked through setContentView (i.e. no a new Activity).</p><p>I take the input and add it to a list, which I want to be summarised on the ListView. However, whenever I add to the list and/or the ArrayAdapter and call adapter.notifyDataSetChanged() it does not do what I want. The ListView is still empty. Argh! It's driving me insane!</p><pre><code>@Overridepublic void onCreate(Bundle blah) {    ListView listView = (ListView) findViewById(R.id.results_list);    listView.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, list));}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case R.id.mnu_add:        final Activity act = this;        setContentView(R.layout.record_details);// the sub-view that takes the user input        // the button on the form to 'add' details:-        ((Button) findViewById(R.id.recored_details_add_btn))        .setOnClickListener(            new OnClickListener() {            public void onClick(View v) {                    // get input from widgets                     list.add(someObject);                    ((ArrayAdapter&lt;Object&gt;) listView.getAdapter()).notifyDataSetChanged();                    setContentView(R.layout.list_view);                }            }        );        ((ArrayAdapter&lt;Object&gt;) listView.getAdapter()).notifyDataSetChanged();        break;    }    return true;}</code></pre><p>Please, save me from my misery and inform me of my stupidty?</p><p>Thanks in advance.</p>","27385","","27385","","2011-01-23 14:42:17","2012-11-16 13:15:12","Update ListView from user input after setContentView call","<android><listview><user-interface><android-listview>","2","0","","",""
"4774526","1","4775108","","2011-01-23 15:14:49","0","822","<p>When I always run app to test in emulator from Eclipse , by default it never uninstalls previous one. It will maintain previous copy of database and files of the same app and run a new compiled code.</p><p>What if I want to remove all app related files, databases every time I compile and run it to test? Any settings for this in Eclipse ? I want to avoid the step of manually uninstalling it before every run. Thanks.</p>","315619","","","","","2011-01-23 19:07:22","How to run android app in emulator by rewriting old databases?","<android><eclipse><android-emulator>","3","0","0","",""
"4774596","1","4775131","","2011-01-23 15:32:03","0","2732","<p><strong>Updated</strong></p><p>I'm trying to print the data retrieved from the database on a list view. For a while my application print for each data in the database, a row on the list view. So if there are 10 data in the database, the app prints 10 rows, corresponding to each row of the database. Here is a view of how it is being printed.</p><p>The new image of how it looks now:</p><p><img src=""http://i.stack.imgur.com/5WN59.png"" alt=""alt text""></p><p>But, it is not printing the data as I want. I want to print a column of the row in a specific text view, but it doesnt show anything.</p><p>So the activity RatedCalss calls the method <code>selectTopCalls()</code> and makes a List receive the list that this method returns. And then I pass this list to the listAdapter.</p><p>Well I have this activity named <strong>RatedCalls.java</strong>:</p><pre><code>public class RatedCalls extends Activity {private static final String LOG_TAG = ""RatedCalls"";private CallDataHelper cdh;private ListView listview;private ArrayList&lt;String&gt; ratedCallsList;private MyListAdapter listAdapter;private View view;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Log.i(LOG_TAG, ""calling from onCreate()"");    cdh = new CallDataHelper(this);    startService(new Intent(this, RatedCallsService.class));    setBasicContent();}public void setBasicContent() {    listview = (ListView) findViewById(R.id.list_view);         ratedCallsList = this.cdh.selectTopCalls();         Log.i(LOG_TAG, ""ratedCallsList size: "" + ratedCallsList.size());            listAdapter = new MyListAdapter(this, this, R.id.list_view, ratedCallsList);    listview.setAdapter(listAdapter);      }}</code></pre><p>I have this class, a ListAdapter class named <strong>MyListAdapter.java</strong>:</p><pre><code>    public class MyListAdapter extends ArrayAdapter { //--CloneChangeRequired    private ArrayList mList;    private Context mContext;    private Activity mActivity;     private int selectedPos = -1;   // init value for not-selected    private ArrayList&lt;String&gt; ratedCallsList;    private CallDataHelper cdh;    public void setSelectedPosition(int pos){        selectedPos = pos;        notifyDataSetChanged();    }    public int getSelectedPosition(){        return selectedPos;    }    public MyListAdapter(Context context, Activity activity, int textViewResourceId, ArrayList list) {        super(context, textViewResourceId, list);        this.mList = list;        this.mContext = context;        this.mActivity = activity;    }    public View getView(int position, View convertView, ViewGroup parent){        View view = convertView;        try{            if (view == null) {                LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);                view = vi.inflate(R.layout.list_item, null);    // --CloneChangeRequired(list_item)            }            // setting STRIP BG                     if(position == selectedPos){                view.findViewById(R.id.rlt_main).setBackgroundColor( Color.rgb(062, 076, 120) );            }else if(position%2==0){                view.findViewById(R.id.rlt_main).setBackgroundColor( Color.rgb(226, 231, 239) );            }else{                view.findViewById(R.id.rlt_main).setBackgroundColor( Color.rgb(200, 210, 223) );            }               setViews(position, view);        }catch(Exception e){            //Log.i(MyListAdapter.class.toString(), e.getMessage());                        }        return view;    }       public void setViews(int position, View view) {                 cdh = new CallDataHelper(mContext);        if(mContext.getClass().equals((RatedCalls.class))){            ratedCallsList = this.cdh.selectTopCalls();            Log.i(""MYLISTADAPTER"", ""size "" + ratedCallsList.size());            if (ratedCallsList != null) {                    ((TextView) view.findViewById(R.id.contact_name)).setText(ratedCallsList.get(0));                    ((TextView) view.findViewById(R.id.phone_number)).setText(ratedCallsList.get(1));                    ((TextView) view.findViewById(R.id.duration)).setText(ratedCallsList.get(2));                    ((TextView) view.findViewById(R.id.date)).setText(ratedCallsList.get(3));            }        }else if(mContext.getClass().equals(RatedContacts.class)){            final PublishersBO listPublisher = (PublishersBO) mList.get(position);            if (listPublisher != null) {                //--setting list_item views                ((TextView) view.findViewById(R.id.contact_name)).setText(listPublisher.getName());                ((TextView) view.findViewById(R.id.phone_number)).setText(listPublisher.getEmail());                //--onClickListener                view.setOnClickListener(new OnClickListener() {                    public void onClick(View arg0) {                        Intent myIntent = new Intent(mContext,RatedContacts.class);                        myIntent.putExtra(""NAME"", listPublisher.getName());                                                                             myIntent.putExtra(""ACTIVITY_NAME"", mContext.getClass().toString());                        mContext.startActivity(myIntent);                        mActivity.finish();                    }                });            }        }           }}</code></pre><p>The method that retrieve the data from the database is in a separated class that deals with SQLite function. This is the method:</p><pre><code>public ArrayList&lt;String&gt; selectTopCalls() {    ArrayList&lt;String&gt; list1 = new ArrayList&lt;String&gt;();    Cursor cursor = this.db.query(TABLE_NAME, null, null, null, null, null,            ""duration desc"");    if (cursor.moveToFirst()) {        do {                            //if (cursor.getString(2) != """") {                cdObj = new CallData();                list1.add(cursor.getString(2));                list1.add(cursor.getString(4));                list1.add(cursor.getString(5));                list1.add(cursor.getString(6));                             } while (cursor.moveToNext());    }    if (cursor != null &amp;&amp; !cursor.isClosed()) {        cursor.close();    }    return list1;}</code></pre><p>And here is the xml file for the view named <strong>list_item.xml</strong>:</p><p>   </p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent"" android:layout_height=""67px"" android:id=""@+id/rlt_main""android:layout_toRightOf=""@+id/iv_forward""&gt;&lt;ImageView     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:layout_centerVertical=""true""    android:id=""@+id/iv_forward""     android:src=""@drawable/icon""    android:layout_alignParentLeft=""true""&gt;&lt;/ImageView&gt;                &lt;TextView     android:layout_height=""wrap_content""     android:layout_width=""fill_parent""     android:id=""@+id/phone_number""     android:layout_alignParentBottom=""true""    android:layout_toRightOf=""@+id/iv_forward""    android:layout_alignBottom=""@+id/iv_forward""&gt;&lt;/TextView&gt; &lt;TextView     android:layout_height=""wrap_content""            android:layout_width=""wrap_content""     android:id=""@+id/duration""     android:layout_alignBottom=""@+id/phone_number""    android:layout_alignRight=""@+id/phone_number""    &gt;&lt;/TextView&gt;&lt;TextView     android:layout_height=""wrap_content""            android:layout_width=""wrap_content""     android:id=""@+id/date""     android:layout_alignBottom=""@+id/contact_name""    android:layout_alignRight=""@+id/contact_name""    &gt;&lt;/TextView&gt;&lt;TextView     android:layout_height=""wrap_content""      android:layout_width=""fill_parent""     android:id=""@+id/contact_name""     android:textSize=""20px""     android:layout_toRightOf=""@+id/iv_forward""    android:layout_alignParentTop=""true""&gt;&lt;/TextView&gt;</code></pre><p></p><p>So I'd like to print the data in the text views in the activity, but I dont know where to set the text, in what class, if in the MyListAdapter class or if in the activity.</p><p>Thanks.</p>","399459","","399459","","2011-01-23 16:36:54","2011-01-23 17:15:02","How to print data in a ListView using ListAdapter","<android><android-layout><android-listview><android-adapter>","1","1","","",""
"4774729","1","4774764","","2011-01-23 15:58:22","1","1370","<pre><code>package com.android.countdown;import android.app.Activity;import android.os.Bundle;import android.os.CountDownTimer;import android.widget.TextView;public class CountDownTest extends Activity {TextView tv; //textview to display the countdown/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);TextView tv = new TextView(this);this.setContentView(tv);//5000 is the starting number (in milliseconds)//1000 is the number to count down each time (in milliseconds)MyCount counter = new MyCount(5000,1000);counter.start();}//countdowntimer is an abstract class, so extend it and fill in methodspublic class MyCount extends CountDownTimer{public MyCount(long millisInFuture, long countDownInterval) {super(millisInFuture, countDownInterval);}@Overridepublic void onFinish() {tv.setText(”done!”);}@Overridepublic void onTick(long millisUntilFinished) {tv.setText(”Left: ” + millisUntilFinished/1000);}</code></pre>","533049","","","","","2011-07-12 16:58:58","How come this timer code is saying setText cannot be resolved or is not a variable?","<android><eclipse>","2","1","","",""
"4774759","1","4774973","","2011-01-23 16:02:19","7","3963","<p>What is the different beetween this, and how i can query what is supported by the actual phone? (GL10 or GL11)</p><p>i have a HTC Legend, that is supported GL11 or not? Or hero...etc... ?</p>","472537","","","","","2012-01-20 11:11:31","Android OpenGL ES GL10 or GL11","<android><opengl-es>","4","0","1","",""
"4774916","1","4775299","","2011-01-23 16:32:31","3","3797","<p>I have this PreferenceScreen loaded from xml.The thing is when i toggle the checkbox im starting a service withsneed like 5-10 sec to connect to a server.How can i disable the checkbox during this time. Since the layout is inflated i cant see how to get checkbox.setEnable = false?</p><pre><code>&lt;PreferenceScreenxmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;CheckBoxPreference    android:key=""checkBoxenableincomingcall""    android:title=""Enable incoming call""    android:defaultValue=""true""    android:summary=""hasse running as background service"" /&gt;&lt;CheckBoxPreference    android:key=""checkBoxmakephoneringonincoming""    android:title=""Dont ring on message""    android:defaultValue=""true""    android:summary=""dont disturb me"" /&gt;&lt;EditTextPreference    android:key=""edittexvalue""    android:title=""EditText""    android:summary=""EditTextPreference"" /&gt;</code></pre><p></p><pre><code>public class EditPreferences extends PreferenceActivity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    addPreferencesFromResource(R.xml.preferences);}</code></pre><p>}</p>","538837","","135152","","2011-05-21 21:22:34","2011-05-21 21:22:34","Android how do i disable checkbox during a long operation in PreferenceScreen","<android><checkbox>","1","0","1","",""
"4774945","1","4774992","","2011-01-23 16:37:09","0","605","<p>I am making an android application with multiple tabs and I followed the developer tutorials that instructed me to make multiple activities. I have spinners on the first tab.</p><p>How do I pass the values that are selected by the spinners to the other tabs?</p><p>Thank you for any help.</p>","412327","","","","","2011-01-23 19:06:56","Android: Passing Spinner Selections Across Tabs","<android><activity><spinner>","4","0","","",""
"4775039","1","4775196","","2011-01-23 16:55:06","0","745","<p>I found <a href=""http://stackoverflow.com/questions/4020503/how-to-change-the-color-of-textview-at-runtime-with-shape-attribute-on-android/4029945#4029945"">this</a> function.How can I now add a Stroke to my Drawable? <br>There is nothing like setStroke(...)</p>","570168","","","","","2011-01-23 17:24:33","Android add Stroke to Drawable on Runtime","<android><runtime><stroke>","1","0","","",""
"4775052","1","5434674","","2011-01-23 16:58:31","1","5840","<p>after reading couple of resources for making HttpClient construction to perform Login over a form available on a website (POST method), I wrote this method:</p><pre><code>public void connect(View v) {    final String TAG = ""&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Activity Log: "";    request = new HttpGet(""http://www.mysite.com/login"");    try {        response = client.execute(request);    } catch (ClientProtocolException e3) {        e3.printStackTrace();    } catch (IOException e3) {        e3.printStackTrace();    }    entity = response.getEntity();    Log.d(TAG, ""Login form get: "" + response.getStatusLine());    if(entity != null) {        try {            entity.consumeContent();        } catch (IOException e) {            e.printStackTrace();        }    }    Log.d(TAG, ""Initial set of cookies:"");    cookies = client.getCookieStore().getCookies();    if (cookies.isEmpty())    {        Log.d(TAG, ""None"");    }    else    {        for(int i = 0; i&lt;cookies.size(); i++)        {            Log.d(TAG, ""- "" + cookies.get(i));        }    }    String action = ""/login.php"";    String yourServer = ""http://www.mysite.com"";    post = new HttpPost(yourServer + action);    List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();    params.add(new BasicNameValuePair(""username"", ""myuser""));    params.add(new BasicNameValuePair(""password"", ""mypass""));    try {        post.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));    } catch (UnsupportedEncodingException e2) {        e2.printStackTrace();    }    try {        response = client.execute(post);    } catch (ClientProtocolException e1) {        e1.printStackTrace();    } catch (IOException e1) {        e1.printStackTrace();    }    entity = response.getEntity();    Log.d(TAG, ""Login form get: "" + response.getStatusLine());    if(entity != null){        try {            entity.consumeContent();        } catch (IOException e) {            e.printStackTrace();        }    }    Log.d(TAG, ""Post logon cookies:"");    cookies = client.getCookieStore().getCookies();    if (cookies.isEmpty())    {        Log.d(TAG, ""None"");    }     else    {        for (int i = 0; i &lt; cookies.size(); i++) {            Log.d(TAG, ""- "" + cookies.get(i));        }    }}</code></pre><p>But <strong>whatever</strong> I put as username/password I get Status: <strong>""OK 200""</strong>. And as cookie I get something like this:</p><blockquote>  <p>[version: 0][name: PHPSESSID][value:  9ismhf3p5c282p1east0drme02][domain:  .mysite.com][path: /][expiry:  null]</p></blockquote><p>When I try to access some URL that is not available for not logged in users, I get the login form page. How do I know I've made a successful login and access the unavailable URLs?</p>","584513","","","","","2011-03-25 15:35:25","Android HttpClient POST Form Login","<java><android><httpclient>","1","4","0","",""
"4775141","1","4775192","","2011-01-23 17:16:45","3","4718","<p>I want to send the bitmap as an attachment in the mail. The image is not stored in SDCARD or anywhere in the device. The bitmap object gets created at runtime and that should be sent as an attachment.</p>","445541","","244296","","2011-01-23 17:24:58","2012-07-11 18:24:37","Send email with bitmap object as an attachment in Android?","<android><email><attachment>","2","0","","",""
"4775295","1","4775394","","2011-01-23 17:38:59","1","1951","<p>I am trying to view files in my application such as audio, video , PDF and others.</p><p>I have successfully done that, now I am trying to view Microsoft office files such as doc, docx, xls and ppt.</p><p>Is there any way to do that in android, like calling an Intent?</p><p>I am so appreciated for any help or guide.</p><p><strong>Edit</strong></p><p>I have downloaded thinkfree office to my nexus S, but the following code still returning false, kindly look at it:</p><pre><code> private boolean checkViewerAvailability(String type)  {    PackageManager packageManager = getPackageManager();    Intent intent = new Intent(Intent.ACTION_VIEW);    intent.setType(""application/doc"");    List&lt;ResolveInfo&gt; list = packageManager.queryIntentActivities(intent,PackageManager.MATCH_DEFAULT_ONLY);    return list.size() &gt; 0;}</code></pre>","488434","","488434","","2012-12-12 05:48:57","2012-12-12 05:48:57","View MS office files in an android application","<java><android><file><ms-office><android-intent>","2","0","","",""
"4775350","1","4995579","","2011-01-23 17:50:00","0","2730","<p>Im trying to get a byte[] from a base64Binary field in my android application.i manage to get the data though for some reason the data array is full with values in some places, where the same data array in C# returns positive numbers, for instance:</p><p>In C# webservice the byte array might look like 46,0,45.....and in android it looks like 46,0, -112...... </p><p>how can i get the correct byte array from a base64Binary field with KASOP2?</p><p>this is the code im currently using:</p><pre><code>SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME1);request.addProperty(""Name"", sName);SoapSerializationEnvelope envelope =  new SoapSerializationEnvelope(SoapEnvelope.VER11);envelope.dotNet = true;envelope.setOutputSoapObject(request);try{HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);androidHttpTransport.call(SOAP_ACTION, envelope);Object o = envelope.bodyIn;SoapPrimitive result =  (SoapPrimitive)envelope.getResponse();//to get the data should be a baseString resultData = result.toString();} </code></pre><p>p.s i have run resultData through about 6 different base64 decoding classes and they all decode it wrong, so im guessing the problem is the the string returned by the response.</p><p>Any help will be greatly appreciated,  Thanks,     Totem</p>","274180","","","","","2011-02-25 03:19:39","Android KSOAP2 base64Binary response from .net webservice","<android><base64><ksoap2>","2","0","1","",""
"4775370","1","","","2011-01-23 17:54:02","0","427","<p>Is there a way to access a users google account to retrieve the list of starred locations that they selected in Google Maps?</p>","412396","","","","","2011-05-27 05:32:06","Accessing users starred locations from Google Maps","<android><maps><location><account><star>","1","0","6","",""
"4775421","1","4775480","","2011-01-23 18:03:19","2","855","<p>I have the following requirement.</p><p>I am developing an Android mobile application. A timer has been set for a specific duration for an activity.</p><p>i> I need to play ""beep"" sound three times when the timer duration is 10 seconds left to complete(i.e. become zero) , two times ""beep"" sound when the timer duration is 5 seconds left to complete &amp; once ""beep"" sound when the timer completes.</p><p>ii> The user may be playing music using the default music player of the Android phone while using the Android mobile application . I need to implement the logic so that when the ""beep"" sound is being played from the mobile application , I need to first decrease the volume of the default music &amp; then play the ""beep"" sound &amp; again reset to the original volume after the ""beep"" sound have been played the required no of times.</p><p>I wanted to know , whether this is technically feasible or not.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2012-04-19 02:27:32","Is it possible to control the volume of the default media player in Android from an Android application","<android>","2","0","","",""
"4775473","1","4776157","","2011-01-23 18:11:53","0","466","<p>I' developing a small android maze game and I'm experiencing a strange effect which I can only describe via screenshot: <a href=""http://www.virtualalbum.eu/fu/39/cepp1523110123182951.jpg"" rel=""nofollow"">http://www.virtualalbum.eu/fu/39/cepp1523110123182951.jpg</a></p><p>At first I thought I needed to set up antialiasing but the advices I followed to enable it changed nothing, and the effect appears to be a little too evident to be that anyway.</p><p>The labyrinth is composed with rectangular-based pieces for the walls and small square-based pillars between walls and on edges, plus a big square as the floor.</p><p>There are 4 lights, I don't know if that matters</p><p>I've been thinking about removing the small pillar faces adjacent to walls as you shouldn't see them anyway, but that would mean writing a lot of code and still wouldn't fix the zigzag with the floor.</p><p>Thanks a lot,J</p><p>EDIT: After some more testing I'm starting to think it may be a z-fighting issue, does anyone has any idea on how to increase the depth buffer precision on android?</p>","586545","","28169","","2011-09-16 10:16:07","2011-09-16 10:16:07","Weird graphical effect on Android","<android><opengl-es>","1","2","","",""
"4775545","1","4777688","","2011-01-23 18:24:40","3","5496","<p>In adb shell, do we have any command to get device info, like lspci?</p><p>Thank you!</p>","547589","","90756","","2011-03-14 22:15:05","2011-03-14 22:15:05","Get hardware info on Android?","<android><hardware>","2","0","","",""
"4775603","1","4786299","","2011-01-23 18:34:36","465","160960","<p>I'm getting this error from time to time and don't know what causing this:<br>When trying to run/debug an Android app on a real device (Galaxy Samsung S in my case) I'm getting the following error in the Console:  </p><blockquote>  <p>Failed to install *.apk on device *: </p>    <p>timeout   Launch canceled!</p></blockquote><p>This is all the Console is telling me. LogCat doesn't provide any information. Eclipse Problems view is not showing any issues. </p><p>I tried the following steps with no success:<br>1. Cleaning the project (Project->Clean)<br>2. Restarting device, Eclipse, laptop, all of the above...<br>3. Moving the project to a location without spaces, according to <a href=""http://stackoverflow.com/questions/4552435/failed-to-install-apk-on-device-emulator-5554-timeout"">Failed to install apk on device &#39;emulator-5554&#39;: timeout</a>   </p><p>The app has been debugged in the past on that device many times (app is live on Market), but this problem happens every so often, and is VERY FRUSTRATING...</p><p>Any help would be greatly appreciated! Thanks.</p>","586576","","55093","","2011-09-14 10:22:38","2014-03-23 03:59:15","Android error: Failed to install *.apk on device *: timeout","<android><timeout><install><apk>","32","6","111","","2013-12-22 19:26:16"
"4775650","1","4811300","","2011-01-23 18:41:32","11","14062","<p>After searching for days to find a solution for my current problem, I'm addressing to you. :)</p><p>What I want to have is a background image, which behaves like the stock homescreen or the weather app here: youtube.com/watch?v=i2Oh4GL5wBE#t=0m54s</p><p>I just need a not animated background image (like the road in that video) which scrolls ""a bit"" while swiping to another view.In my app, I would like to swipe through some ListViews with a scrolling background.</p><p>What I've tested:</p><ul><li>ViewFlipper: I used big image and cut it vertically into 5 pieces. Then I set those cutted images in each Layout (displaying the ListViews) as background. </li><li>HorizontalScrollView: In the HorizontalScrollView I added a LinearLayout and set the big image as background. Then I used GestureDectector to add ""snapping"" when swiping through the ListViews.</li></ul><p>Both worked, but that requires a really big image and I'm not sure if it scales correctly to different screen sizes. Also it doesn't behave like the original homescreen, where the background moves just a little bit while the foreground changes to the next View.</p><p>I read the post here: <a href=""http://stackoverflow.com/questions/2943619/android-make-application-background-behave-like-homescreen-background"">http://stackoverflow.com/questions/2943619/android-make-application-background-behave-like-homescreen-background</a></p><p>I checked the recommended Launcher.java which led me to the Workspace.java </p><p><a href=""http://android.git.kernel.org/?p=platform/packages/apps/Launcher2.git;a=blob;f=src/com/android/launcher2/Workspace.java"">http://android.git.kernel.org/?p=platform/packages/apps/Launcher2.git;a=blob;f=src/com/android/launcher2/Workspace.java</a></p><p>As far as I understand, it uses the WallpaperManager by setting Offsets.</p><pre><code> mWallpaperManager.setWallpaperOffsets(getWindowToken(),                 Math.max(0.f, Math.min(mScrollX/(float)scrollRange, 1.f)), 0);</code></pre><p>API says: </p><blockquote>  <p>setWallpaperOffsets(IBinder  windowToken, float xOffset, float  yOffset)   Set the position of the  current wallpaper within any larger  space, when that wallpaper is visible  behind the given window.</p></blockquote><p>But as far as I understand, this just changes the background image of the phone itself.</p><p>What can I do? Do you know an open source application or sample code which does the same?Probably I have to draw Canvas myself (never did before). Please give me some advice. :)</p>","586490","","142162","","2011-09-25 14:12:23","2014-01-08 11:56:09","Android: Moving background image while navigating through Views","<android><background><viewflipper><horizontalscrollview>","4","0","8","",""
"4775745","1","4776423","","2011-01-23 18:56:17","0","163","<p>I'm using Eclipse.</p><p>I'm burning hours trying to debug my first (very simple) android app.</p><p>When I hit an error, I don't get a proper exception with a description of what went wrong, I get a screen asking for source code and a ""Suspended(Exception RuntimeException))"" on the debug log.</p><p>I'm resorting to logging each line to see where the last execution point was, and then trying to understand by googling why the following line would cause an error.</p><p>See my screenshots: <a href=""http://cde.co.za/shared/hein/wtf.jpg"" rel=""nofollow"">Error</a> and <a href=""http://cde.co.za/shared/hein/source.jpg"" rel=""nofollow"">Missing Source</a>.</p><p>The highlighted line:</p><pre><code>SimpleCursorAdapter scaSights = new SimpleCursorAdapter(this,R.layout.sight_row,sightsCursor,fromDisplayFields,toDataFields);</code></pre><p>is where the exception occurs. I've got no idea what's wrong there, but a good exception message would help, not a prompt for source code.</p><p>Any help is hugely appreciated!</p>","181098","","","","","2011-01-23 20:52:40","Android: More descriptive error please!","<android>","3","4","","",""
"4775812","1","4775860","","2011-01-23 19:09:53","1","2202","<p>I want to make it so that a user clicks a button to launch a dialog. It crashes when I click the button. Here's the logcat:</p><blockquote>  <blockquote>    <p>nullpointerexception at com.shoppinglist.ShoppingList$1$2.onClick(ShoppingList.java:50) at android.view.View.performClick(View.java:2344) at android.view.View.onTouchEvent(View.java:4133) at android.widget.TextView.onTouchEvent(TextView.java:6510) at android.view.View.dispatchTouchEvent(View.java:3672) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) </p>  </blockquote></blockquote><p>Here's my .java file:</p><pre><code>package com.shoppinglist;import java.util.ArrayList;import android.app.Dialog;import android.app.ListActivity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.EditText;import android.widget.ListView;public class ShoppingList extends ListActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final EditText et = (EditText) findViewById(R.id.edittext);        ListView lv = (ListView) findViewById(android.R.id.list);        final ArrayList&lt;String&gt; items = new ArrayList&lt;String&gt;();        final ArrayAdapter&lt;String&gt; adapter;        adapter = new ArrayAdapter&lt;String&gt;(        this, android.R.layout.simple_list_item_1, items);        lv.setAdapter(adapter);        Button button1main = (Button) findViewById(R.id.add);        button1main.setOnClickListener(new OnClickListener()  {            @Override            public void onClick(View v)  {            final Dialog additem = new Dialog(ShoppingList.this);            additem.setContentView(R.layout.maindialog);            additem.setTitle(""Type your item"");            additem.setCancelable(true);            et.setHint(""Type the name of an item..."");        Button button = (Button) findViewById(R.id.cancel);        button.setOnClickListener(new OnClickListener()  {                @Override                public void onClick(View v)  {                    additem.dismiss();                }            });            additem.show();        Button ok = (Button) findViewById(R.id.ok);        ok.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                items.add(et.getText().toString());                adapter.notifyDataSetChanged();                additem.dismiss();                et.setText("""");        }            }        );       }        });    }}</code></pre><p>Here's my 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:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""#FF9900""    android:padding=""10dp""    android:orientation=""vertical""&gt;        &lt;Button            android:id=""@+id/add""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""Add item...""            android:layout_gravity=""center""/&gt;        &lt;ListView android:id=""@android:id/list""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:background=""#FFCC00""/&gt;  &lt;/LinearLayout&gt;</code></pre><p>Here's my dialog 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:id=""@+id/layout_root""  android:orientation=""vertical""  android:background=""#FFFFFF""  android:minHeight=""100dp""  android:minWidth=""300dp""&gt;  &lt;EditText     android:id=""@+id/edittext""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""/&gt; &lt;LinearLayout    android:id=""@+id/button_layout""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""horizontal""    android:layout_gravity=""bottom""&gt;  &lt;Button    android:id=""@+id/ok""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Ok""/&gt;  &lt;Button    android:id=""@+id/cancel""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Cancel""/&gt;  &lt;/LinearLayout&gt;   &lt;/LinearLayout&gt;</code></pre>","560096","","244296","","2011-01-23 19:11:01","2011-01-23 20:35:08","Android App Crashes on Startup due to java.lang.NullPointerException at onClick","<android><crash>","2","2","","",""
"4775873","1","","","2011-01-23 19:19:51","0","467","<p>I'm having some problems writing a program that adds to a list dynamically at runtime. The program has some things above the list and the idea is that the user scrolls down to see the list that the program generates based on the user's input. However, when I use a list it is impossible for the user to see the lower parts of the list because the list takes up a set amount of space and if you try to scroll, the parent ScrollView takes over and assumes that you are trying to scroll the entire activity.</p><p>Is there a way to make the List height expand dynamically to wrap the children that are added so that the user can see all of the items in the list? I have tried setting the height to wrap_content, but that did not work.  Any help is appreciated. Thanks.</p>","583082","","","","","2011-01-23 19:40:34","Expandable Height of a List in Android","<android><list><listview><scroll><scrollview>","1","0","","",""
"4775975","1","","","2011-01-23 19:35:34","1","1058","<p>How can I make a script to run on startup or add an executable to the boot of the Android kernel?</p>","353752","","27835","","2012-01-08 12:34:46","2012-01-08 12:34:46","How to add a script to boot/startup on Android?","<android><executable><startup><boot>","1","2","","",""
"4775980","1","","","2011-01-23 19:36:15","0","445","<p>So I have a tab activity with 2 tabs. Underneath these I would like to have a second view.At the moment I can put the view at the end but it still overlaps with whatever is at the end of the currently visible tab. Does anyone have an idea of how to get the second view beneath the tabs rather than overlap the end of their content?</p><p>So for example if the view is just a textview, my layout looks like this:</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;TabHost android:id=""@android:id/tabhost""     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;        &lt;LinearLayout android:id=""@+id/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;/LinearLayout&gt;    &lt;/TabHost&gt;    &lt;RelativeLayout android:id=""@+id/InnerRelativeLayout""         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""&gt;        &lt;TextView android:id=""@+id/EndView""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""At the end of the screen""/&gt;        &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","223050","","491044","","2011-03-10 15:15:51","2011-03-10 15:15:51","Android: Adding a View underneath a TabActivity","<android><layout><tabview>","1","0","","",""
"4776036","1","","","2011-01-23 19:45:26","1","471","<p>I am trying to port Android on an IP Set top box. </p><p>Can anyone help me in creating the <em>vendor folder (product and board definition files)</em>? I've successfully compiled and ported the bootloader (u-boot) and linux kernel (2.6.34) with required drivers. </p><p>I'm stuck at creating this <strong>vendor folder</strong>.</p>","407364","","805252","","2012-03-01 09:04:39","2012-03-01 09:04:39","Porting Android on Set top box","<android>","1","0","","",""
"4776057","1","4776115","","2011-01-23 19:48:31","3","42856","<p>In my Android activity, I create a custom view that extends SurfaceView (using MonoDroid so slight variations in syntax):</p><pre><code>class FriendsView : SurfaceView{    ...    public FriendsView(Context context) : base(context)    {        ... create my custom view ...    }}</code></pre><p>In my Activity class, I set the content view to the view:</p><pre><code>protected override void OnCreate(Bundle bundle){    base.OnCreate(bundle);    ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);    FriendsView friendsView = new FriendsView(this);    SetContentView(friendsView, layoutParams);}</code></pre><p>I want to add a button to the view, but cannot work out how to do this. Everything I have read starts from the point of view of the main.xml, but I don't see how to use this to declare a button which is visible in my view. Equally, I cannot find a method in either Activity or View classes which lets me add a Button object programatically.</p><p>I feel sure I am missing something conceptually, but would welcome any help to get me going in the right direction.</p>","304582","","5849","","2011-10-28 17:10:18","2012-07-09 20:23:58","Android: How to programmatically add button to view","<android><button><view><add>","2","2","","",""
"4776073","1","4776500","","2011-01-23 19:51:50","1","276","<p>All of a sudden, each time I start my app, my user preferences are being cleared out.  Instead of using preferences directly in an Activity, I have a helper class in my Application object, that accesses preferences like this:</p><pre><code>SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());</code></pre><p>This has worked perfectly, until just now.  I have a custom application class that manages most of the content of the application, to avoid issues of re-generating this content when activites are created/destroyed.</p><p>I do realize there is a way to clear out the user preferences, but I do not have that in my code anywhere.  This did seem to start happening when I started building with Proguard for release builds, but this is now happening with debug builds as well.  Re-downloading a new app from Eclipse, or even just re-starting the app causes the preferences to be wiped out.  </p><p>I've been going through my recent code changes, and haven't found anything related.  As I'm nearing posting the app on the market, I keep switching between debug &amp; release, but I wouldn't think this would cause a problem like this.</p><p>Any ideas?</p><p>-Kevin</p>","271177","","278836","","2011-01-23 20:19:11","2011-01-23 21:04:52","Android app preferences are being cleared automatically","<android><android-preferences>","2","0","","",""
"4776094","1","4776511","","2011-01-23 19:55:46","1","1284","<p>Even though I'm newbie with Android I'm feeling more noob than ever. I have my view that extends SurfaceView, and there I override the onTouchEvent and put this testing code inside:</p><pre><code>if (event.getAction() == MotionEvent.ACTION_MOVE)  {   return true;  }  return false;</code></pre><p>Then when I run the application in the emulator (using Eclipse) in debugging mode, there's no way I can make it return true. I click, keep clicked and drag, and then release, but it will always be event.getAction == 0 no matter what.</p><p>What am I missing?</p>","586638","","","","","2013-02-21 06:48:00","Can't make an ACTION_MOVE with the emulator","<android><android-emulator>","2","0","","",""
"4776236","1","4776286","","2011-01-23 20:17:07","3","4625","<p>I know that ProgressDialog with Threads questions have been asked many times but none of the solutions seem to work for my project. Basically what I want to do is this:1) when a user clicks a button the Activity sends an auth request to the server2) while this is being done a ProgressDialog is shown3) when the reponse comes I want to dismiss the ProgressDialog and the return object to be read and interpreted by the Activity</p><p>If I:1) set the Thread to update the Application field with the reponse, the next method (which is outside of the Thread) throws an NPE when accessing the field2) if I include the next method in the Thread, the second method throws a 'java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()'</p><p>Sorry for a long text, but I am totally losing it over this... My code is sth like this:</p><pre><code>public class XXX extends Activity implements OnClickListener {// (...)private SoapObject returnObject;private String response;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    // (...)        authProgressDialog = ProgressDialog.show(XXX.this, """", ""Authenticating..."", true, false);        new Thread(new Runnable() {            @Override            public void run() {                authenticate(); // method that calls the API via SOAP                authenticateReal(); // method that handles the response            }        }).start();        mHandler = new Handler() {            public void handleMessage(Message msg) {                super.handleMessage(msg);                switch (msg.what) {                    case 10:                        authProgressDialog.dismiss();                        break;                }            }        };    }}public void authenticate() {    // API stuff (...)    AndroidHttpTransport aht = new AndroidHttpTransport(URL);    try {        aht.call(SOAP_ACTION, soapEnvelope);        returnObject = (SoapObject) soapEnvelope.getResponse();        response = returnObject.getProperty(""ResponseStatus"").toString();    }    catch (Exception e) {        e.printStackTrace();    }    finally {        mHandler.sendEmptyMessage(10);    }}// Method that needs to access returnObject and reponse objects and// it is here where the NPE's or other exceptions are thrownpublic void authenticateReal() {// (...)}</code></pre>","561498","","244296","","2011-03-31 16:05:47","2011-03-31 16:05:47","How to implement a ProgressDialog while Activity requests a SoapObject from a Web Service?","<android><multithreading><activity><progressdialog>","4","1","","",""
"4776264","1","","","2011-01-23 20:22:12","1","488","<p>I have a simple problem that I can't seem to figure out.  I am trying to execute a geoname WebService.search method and keep getting a ""java.lang.StringIndexoutOfBoundsException"" error.  I ran the program under plain old Java and it works fine with no problem.  I run it under Android and I get the ""java.lang.StringIndexoutOfBoundsException"" error.  I have ""Internet"" permissions set in my manifest.  The error occurs when the Webservice.search(searchCriteria) is executed.  Here is the code:</p><pre><code>package fau.edu;import org.geonames.*;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class MainRoutine extends Activity { TextView displayObject;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        displayObject = (TextView)findViewById(R.id.TextView01);         try {        String displayString;        //        // Toponomy Search        //        ToponymSearchCriteria searchCriteria = new ToponymSearchCriteria();        searchCriteria.setQ(""Miami"");         searchCriteria.setFeatureClass(FeatureClass.valueOf(""H""));        searchCriteria.setCountryCode(""US"");        searchCriteria.setAdminCode1(""FL"");        searchCriteria.setFeatureCode(""spng"");        WebService.setUserName(""******""); // username '*' out for public consumption.  Actual code has valid name.        ToponymSearchResult searchResult = WebService.search(searchCriteria);        displayString = null;        for (Toponym toponym : searchResult.getToponyms()) {          displayString += toponym.getName() + "" "" + toponym.getCountryName() + ""\n"";         }        displayObject.setText(displayString);        }        catch(Exception e) {         e.printStackTrace();         displayObject.setText(""Try Error...\n"" + e.toString());        }    }}</code></pre><p>The failure occurs when I execute the WebService.search(searchCriteria) method.  The error that I get in LogCat is:</p><pre><code>  java.lang.StringIndexOutOfBoundsException     at java.lang.String.substring(String.java:1646     at org.jdom.input.SAXHandler.startElement(SAXHandler.java:568)     at org.apache.harmony.xml.ExpatParser.startElement(ExpartParser.java:146)     ....</code></pre><p>I have correctly put jdom.jar and geonames.-1.0.6.jar in my Java build path, so I don't think there is a problem there.  The interesting thing is that have re-written the code to use WebService.postalCodeSearch(postalSearch) and WebService.weatherIcao(""KPBI"") and it works perfectly in Android with no issues.  Like I said, this code runs all day under Java SE6.  Any ideas as to what might be wrong?</p>","365435","","496830","","2011-03-15 22:22:51","2011-07-05 03:12:42","OutofBoundsException running geonames on Android","<android><geonames>","3","0","","",""
"4776415","1","","","2011-01-23 20:51:15","0","728","<p>In:</p><p>mMediaPlayer.setDataSource(path);</p><p>what is the format of the 'path' paramter?</p><p>E.g. My file is c:\program\files\file1.mp3. How do i specify the file name and path to the function?</p><p>Thanks.</p>","578716","","","","","2011-01-23 20:58:37","Specifying a file path and name in mMediaPlayer.setDataSource(path);","<android>","2","0","","",""
"4776426","1","4776462","","2011-01-23 20:53:08","4","11613","<p>Everything is in the question. Here is my code : </p><pre><code>    private void createDirectory(File currentDirectory) {  File f = null;  try {   f = new File(currentDirectory.getCanonicalPath() + ""/directory""     + count);   boolean success = f.mkdir();   if (!success) {    Toast.makeText(currentContext,      f.getName() + "" could not be created"", 15).show();   }  } catch (IOException ioe) {   Toast.makeText(currentContext,     f.getName() + "" could not be created"", 15).show();  }  count++; }</code></pre><p>I am writing a small file manager in Android and I would like to add the possibility to create a directory. There is no exception and the variable success always return false. Can someone tell me what is wrong my code??</p><p>Thx for your advice !!</p><p><strong>[EDIT]</strong></p><p>BTW, When the phone is in Developpement mode,  does an application has a write access on the sdcard? I am programming on my phone (Acer liquid)</p>","314862","","314862","","2011-01-23 20:57:36","2011-01-23 20:58:23","How to create a directory in Android?","<java><android><android-sdcard>","3","0","1","",""
"4776502","1","4776788","","2011-01-23 21:05:15","0","575","<p>I am fairly new to Android and I like to have an inputstream be transferred from one class to another.Basically, I am trying to get a geocoded location to be sent to a server and a response to be sent to the other class for parsing.</p><p>here is a snippet of code I have so far for the httppost and inputstream response:</p><p>Location1.java</p><pre><code>private void updateWithNewLocation(Location location) {  if (location != null) {    double lat = location.getLatitude();    String lat1 = Double.toString(lat);    double lng = location.getLongitude();    String lng1 = Double.toString(lng); HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(""http://...""); try {     List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);</code></pre><p>nameValuePairs.add(new BasicNameValuePair(""lat"", lat1));         nameValuePairs.add(new BasicNameValuePair(""lng"", lng1));         httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));</p><pre><code>     HttpResponse response = httpclient.execute(httppost); InputStream is = response.getEntity().getContent();</code></pre><p>BufferedInputStream bis = new BufferedInputStream(is);   ByteArrayBuffer baf = new ByteArrayBuffer(20);</p><pre><code>int current = 0;  while((current = bis.read()) != -1){   baf.append((byte)current);  }  </code></pre><p>Here is a snippet from the other class I want to have the inputstream parsed in... There already was an inputsream in this class and I was trying to figure out how to replace it with the other stream from the other class.</p><p>parser1.java</p><pre><code>       //I already have an inputstream here and this is where I want to inject the other class inputstream          InputStream in = httpConnection.getInputStream();           DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();   DocumentBuilder db = dbf.newDocumentBuilder();   // parse the feed   Document dom = db.parse(in);         Element docEle = dom.getDocumentElement(); ...</code></pre><p>Any help would be much appreciated.</p>","586655","","","","","2011-01-23 21:51:37","I'm trying to figure out a way to have an inputstream from one class be parsed in a different class","<android><dom><inputstream><http-post><xml-parsing>","1","0","","",""
"4776505","1","","","2011-01-23 21:05:33","2","972","<p>I've been using <a href=""http://code.google.com/p/min3d/"" rel=""nofollow"">min3D framework</a> for my last project and I'm stack with couple of problems.</p><p>First - it takes a lot of effort to get it load my car model from <code>.OBJ</code> file. </p><p>I've managed to do it only by converting .obj file to <code>.3ds</code>(this was the only way to reduce size from <code>5mb</code> to <code>1mb</code> which I can put and read from the assets folder) but I still have some issues like missing edges(some parts of the car just doesn't draw).Second - I'm having a hard time to reload my OpenGL on the Resume.</p><p>I need to redraw the model again after hitting 'back' button but I can do it only if I parse the <code>.3ds</code> file again. It takes too much memory and time to do it over and over again and if I try to use already parsed <code>ObjContainer</code> it just doesn't draw(I got blank OpenGL view).</p><p>So to summarize my questions are:</p><ol><li><p>How to properly load huge(3-5mb) <code>.OBJ</code> or <code>.3DS</code> files via <code>min3D</code> framework and don't loose any parts of a model?</p></li><li><p>How to redraw a model again onResume without parsing <code>.OBJ</code> file over and over again?</p></li></ol>","235015","","881286","","2013-08-18 01:43:05","2013-08-18 01:43:05","min3D framework load .OBJ and .3DS. Resume redraw","<android><opengl-es><.obj><onresume>","0","1","0","",""
"4776514","1","4776556","","2011-01-23 21:06:48","0","3442","<p>I've been very confused about this recently and can't find an answer anywhere.</p><p>When programming for android, I want to update a textview every 10 seconds, but how would I go about that?  I've seen some samples use ""Run()"" and ""Update()"", but that doesn't seem to help when I try it, any ideas?</p><p>Right now I have:<pre></p><code>public void onCreate(Bundle savedInstanceState){  super.onCreate(savedInstanceState);  setContentView(R.layout.slideshow);  CONST_TIME = (int) System.currentTimeMillis();  Resources res = getResources();          myString = res.getStringArray(R.array.myArray);}public void checkTime(View V){ TextView text = (TextView) findViewById(R.id.fadequote); CUR_TIME = (int) System.currentTimeMillis(); text.setText(""""+(int) (CUR_TIME-CONST_TIME));//Debugs how much time has gone by if(CUR_TIME-CONST_TIME&gt;10000){  getNextQuote(null); //A function that gets a random quote  CONST_TIME = CUR_TIME; }}</code></pre><p>I guess what I'm REALLY asking is how do I make checkTime() repeat it-self endlessly until onPause() is called?</p>","586680","","94363","","2013-01-23 13:15:12","2013-01-23 13:15:12","Updating TextView every N seconds?","<android><textview><self-updating>","4","0","0","",""
"4776548","1","","","2011-01-23 21:14:37","7","3008","<p>I know .apk are zip files, but AndroidManifest.xml looks binary and certainly grep or hex editors haven't been successful extracting the versionCOde.</p><p>Does anybody know how to parse or extract it? I find myself in a python script with the apks AndroidManifest.xml file open.</p>","586684","","","","","2014-01-21 02:05:26","Parse versionCode from android apk files","<android><packaging><android-manifest><apk>","4","0","2","",""
"4776570","1","4777097","","2011-01-23 21:18:12","12","8517","<p>I want to rotate an image using ImageView.setImageMatrix(matrix) but it simply doesn't have any effect.I call matrix.postRotate(45, 20, 20); before passing it to the function above but no effect, the image is not rotated. Why?</p><pre><code>matrix.postRotate(45, 20, 20);ImageView.setImageMatrix(matrix)</code></pre>","480894","","","","","2011-01-23 22:50:32","Why does ImageView.setImageMatrix() not work?","<android><android-layout>","1","0","1","",""
"4776609","1","4777873","","2011-01-23 21:24:22","1","360","<p>I'm writing a language learning app, currently only German&lt;->Russian. </p><p>There are several <code>EditTexts</code> where the user is supposed to enter text in one or the other language. As these languages use different alphabets, the app uses its own soft keyboard by implementing <code>InputMethodService</code> and providing both Latin and Cyrillic keyboard layout. It is known for each <code>EditText</code> field which language is expected. </p><p>What I would like is that, e.g., whenever an <code>EditText</code> field expecting Russian is in focus, the Cyrillic keyboard layout should be displayed. When selected, the <code>EditText</code> should pass some constant on to the IME, which the latter can use to decide whether to display in Latin or Cyrillic mode.</p><p>Ideally, one would simply specify some custom <code>InputType</code> for the <code>EditText</code> but that doesn't seem to be possible, does it? What is the correct approach here? </p>","236405","","119895","","2011-01-24 01:18:14","2011-01-24 01:44:58","Send info from EditText to IME","<android><keyboard-layout><android-softkeyboard>","1","0","","",""
"4776623","1","","","2011-01-23 21:26:38","0","1020","<p>my activity has a Button and an ImageView, originally set to invisible with android:visibility. I'd like to change ImageView's state to visible on button focus.</p><p>Right now I can get this done with imageview.setVisibility(View.VISIBLE); inside the onClick() listener of the Button. The problem is the visibility change comes <em>after</em> the pressed/focused states of the button.</p><p>Basically I'd like to tie the ImageView to the Button like so: 1) when the button is pressed/focused (orange highlight) the imageview becomes visible. 2) when the user lets go of the button, the imageview becomes invisible again. Sounds like I need to create a custom button and override some methods but I'm not sure what. Thanks for any tips</p>","586679","","","","","2011-01-23 22:00:10","Button state_pressed/state_focused to make an ImageView VISIBLE","<android>","1","0","","",""
"4776809","1","4776837","","2011-01-23 21:54:12","1","1333","<p>I am trying to create a simple webview and I am getting FC on each start.</p><p>Here is my MainActivity.java file:</p><pre><code>package com.jerdog.apps;import android.app.Activity;import android.os.Bundle;import android.webkit.WebView;public class MainActivity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        WebView myWebView = (WebView) findViewById(R.layout.main);        myWebView.loadUrl(""http://www.google.com"");    }}</code></pre><p>and here is my res/layout/main.xml file</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;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;&lt;/LinearLayout&gt;</code></pre><p>I am including my logcat from the moment I press Run in Eclipse at pastebin</p><p><a href=""http://pastebin.com/5trRw9Bd"" rel=""nofollow"">http://pastebin.com/5trRw9Bd</a></p>","561377","","488657","","2012-10-13 21:16:43","2012-10-13 21:16:43","Basic app with webview not working - FC on start","<android><webview>","1","0","","",""
"4776819","1","","","2011-01-23 21:56:47","0","1098","<p>I'm trying to compare the given pixel to <code>Color.BLACK</code>. But the problem is it yields false for all the images. (I made a black image and it also returned false!)</p><pre><code>public int isItBlackOrWhite(int x , int y){     int c = bimg.getPixel(x, y);        if(c == Color.BLACK)         {System.out.println(""Helooo"");return 0;}         else      return 1;}</code></pre><p>Also I tried to compare it with <code>Color.White</code> but the application quit and force closed!</p><pre><code>public int isItBlackOrWhite(int x , int y){     int c = bimg.getPixel(x, y);        if(c == Color.WHITE)         {System.out.println(""Helooo"");return 0;}         else      return 1;}</code></pre><p>NOTE: bimg is an Bitmap image taken from the camera.</p>","586720","","84237","","2011-01-23 22:16:13","2012-08-24 14:25:23","Compare two colors in image?","<java><android><image><colors>","6","1","","",""
"4776933","1","4776971","","2011-01-23 22:16:33","3","10904","<p>I've just spent numerous hours constructing an icon for an Android app I'm working on, but can't get it to show up for the app in the emulator.</p><p>I've put it in res/drawable-hdpi, res/drawable-mdpi, res/drawable-ldpi in the respective sizes as defined in <a href=""http://developer.android.com/guide/practices/ui_guidelines/icon_design_launcher.html"" rel=""nofollow"">http://developer.android.com/guide/practices/ui_guidelines/icon_design_launcher.html</a></p><p>The manifest contains the line:</p><pre><code> &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;</code></pre><p>Any ideas as to why it isn't showing up?</p>","586734","","","","","2012-06-27 22:14:04","Android application icon not showing up","<android><sdk><icons>","1","2","1","",""
"4776936","1","4776973","","2011-01-23 22:17:01","13","3113","<p>I'm working on a TV Guide app which uses a <code>ListActivity</code> showing the TV shows for one channel / one day at a time. I'm using a <code>RelativeLayout</code> for the <code>ListView</code> items and I want the <code>ListView</code> to look something like this:</p><pre><code>07:00 The Breakfast Show      Latest news and topical reports08:00 Tom and Jerry      More cat and mouse capers</code></pre><p>I get the data for the <code>ListView</code> items using the following code:</p><pre><code>Cursor cursor = db.rawQuery(SELECT blah,blah,blah);String[] columnNames = new String[]{""start_time"",""title"", ""subtitle""};int[] resIds = new int[]{R.id.start_time_short, R.id.title, R.id.subtitle};adapter = new SimpleCursorAdapter(this, R.layout.guide_list_item, cursor, columnNames, resIds);</code></pre><p>My problem is that the <code>start_time</code> field is a <code>datetime</code> with the following format:</p><pre><code>2011-01-23 07:00:00</code></pre><p>so what I get is this:</p><pre><code>2011-01-23 07:00:00 The Breakfast Show                    Latest news and topical reports2011-01-23 08:00:00 Tom and Jerry                    More cat and mouse capers</code></pre><p>What I'd like to do is format the above using <code>SimpleDateFormat</code>(<code>""HH:mm""</code>) so I only get the <code>hour:minute</code> part of the <code>start_time</code> field.</p><p>I've found the <code>SimpleCursor.ViewBinder</code> interface which suggests it may be what I want but I can't figure out how to use it. If I'm right about <code>ViewBinder</code>, I'd appreciate some pointers to sample code on how to use it. Otherwise, how else can I achieve changing the <code>start_time</code> field to simply show <code>HH:mm</code> format?</p>","488241","","493939","","2012-06-02 17:47:50","2012-06-02 17:47:50","Modifying SimpleCursorAdapter's data","<android><android-listview><simplecursoradapter><android-viewbinder>","1","0","5","",""
"4776938","1","4777249","","2011-01-23 22:17:10","2","1604","<p>I got that ""interesting"" exception in my in-the-wild server errorlog. My app posts exceptions and ""wtf""-errors to my central server, so I don't have much information what <em>exactly</em> happend. I just know THAT it happend, and I don't have any clue.</p><p>Stacktrace:</p><p><code>java.io.IOException: Math result not representable        at org.apache.harmony.luni.platform.OSFileSystem.writeImpl(Native Method)        at org.apache.harmony.luni.platform.OSFileSystem.write(OSFileSystem.java:129)        at java.io.FileOutputStream.write(FileOutputStream.java:297)        at net.jav.apps.romeolive.RomeoInterface.fetchBinaryToFile(RomeoInterface.java:299)        at net.jav.apps.romeolive.HeartBeatService$_fetchPic.run(HeartBeatService.java:327)        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)        at java.lang.Thread.run(Thread.java:1096)</code></p><p>The code in place of net.jav.apps.romeolive.RomeoInterface:</p><p><code></p><pre><code>    byte[] ret=fetchBinary(fullurl);    if (ret==null) return false;    try     {        FileOutputStream os=new FileOutputStream(getCacheFileName(type,fullurl));        os.write(ret, 0, ret.length);</code></pre><p></code></p><p>The ""failing"" line #299 is the os.write()</p><p>fetchBinary(url) fetches some binary file (thumbnail jpg) from a web server and returns it as a byte[], or NULL if not found/error.</p><p>getCacheFileName(type,fullurl) returns the cacheDir() plus type plus the sanitized fullurl (removing slashes, only use the localpart of the url).</p><p>So what exactly fails, is... Trying to write the existing thumbnail jpg byte[] to a perfectly crafted filename in cacheDir(). </p><p>The device where this exception showed up (ONCE only until now) is: GT-I9000@samsung/GT-I9000/GT-I9000/GT-I9000:2.2.1/FROYO/XXJPY:user/release-keys</p><p>Did anyone have this ""Math result not representable"" as IOException?I'd really like to nail down that thing ;) Google and Stackoverflow didn't show up anything helpful or even related.</p><p>Thanks a lot,Oliver</p>","586722","","","","","2011-01-23 23:21:18","Android FileOutputStream.write: got java.io.IOException: Math result not representable","<android><math><ioexception><result>","1","0","","",""
"4776968","1","","","2011-01-23 22:25:03","0","194","<p>I asked this question earlier, but I didn't really understand the only response I got. I'm having some problems writing a program that adds to a list dynamically at runtime. The program has some things above the list and the idea is that the user scrolls down to see the list that the program generates based on the user's input. However, when I use a list it is impossible for the user to see the lower parts of the list because the list takes up a set amount of space and if you try to scroll, the parent ScrollView takes over and assumes that you are trying to scroll the entire activity.</p><p>Is there a way to make the List height expand dynamically to wrap the children that are added so that the user can see all of the items in the list while using the Scrollview's scrolling ability? I have tried setting the height to wrap_content, but that did not work. Any help is appreciated. Thanks.</p>","583082","","","","","2011-01-23 22:31:29","Is there a way to define a list height as the height of all its items? (Android)","<android><listview><height><scroll><scrollview>","1","0","","",""
"4777003","1","4777271","","2011-01-23 22:31:01","1","5351","<p>I want to make it so that a user clicks a button to open a dialog, the user types in the name of an item, they click OK, and the item gets added to the ListView. So far, I've gotten to the point where the item gets added to the ListView, but there's no way to save the data. I have a helper called DataHelper that creates the SQLiteDatabase, but I can't figure out how to save it to the database. <strong>I will need a code example because I'm not that experienced.</strong></p><p>Here's my .java:</p><pre><code>package com.shoppinglist;import java.util.ArrayList;import android.app.Dialog;import android.app.ListActivity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.EditText;import android.widget.ListView;public class ShoppingList extends ListActivity {    /** Called when the activity is first created. */    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        ListView lv = (ListView) findViewById(android.R.id.list);        final ArrayList&lt;String&gt; items = new ArrayList&lt;String&gt;();        final ArrayAdapter&lt;String&gt; adapter;        adapter = new ArrayAdapter&lt;String&gt;(        this, android.R.layout.simple_list_item_1, items);        lv.setAdapter(adapter);        Button button1main = (Button) findViewById(R.id.add);        button1main.setOnClickListener(new OnClickListener()  {            @Override            public void onClick(View v)  {            final Dialog additem = new Dialog(ShoppingList.this);            additem.setContentView(R.layout.maindialog);            final EditText et = (EditText)additem.findViewById(R.id.edittext);            additem.setTitle(""Type your item"");            additem.setCancelable(true);            et.setHint(""Type the name of an item..."");            Button button = (Button) additem.findViewById(R.id.cancel);            button.setOnClickListener(new OnClickListener()  {                @Override                public void onClick(View v)  {                    additem.dismiss();                }            });            additem.show();            Button ok = (Button) additem.findViewById(R.id.ok);            ok.setOnClickListener(new OnClickListener() {                @Override                public void onClick(View v) {                    items.add(et.getText().toString());                    adapter.notifyDataSetChanged();                    additem.dismiss();                    et.setText("""");                }            });       }        });    }}</code></pre><p>My DataHelper class:</p><pre><code>package com.shoppinglist;import java.util.ArrayList;import java.util.List;import android.content.Context;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteStatement;import android.util.Log;public class DataHelper {    private static final String DATABASE_NAME = ""items.db"";    private static final int DATABASE_VERSION = 1;    private static final String TABLE_NAME = ""table1"";    private Context context;    private SQLiteDatabase db;    private SQLiteStatement insertStmt;    private static final String INSERT = ""insert into ""        + TABLE_NAME + ""(name) 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 name) {            this.insertStmt.bindString(1, name);            return this.insertStmt.executeInsert();        }        public void deleteAll() {            this.db.delete(TABLE_NAME, null, null);        }        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[] { ""name"" },                    null, null, null, null, ""name desc"");            if (cursor.moveToFirst()) {                do {                    list.add(cursor.getString(0));                } while (cursor.moveToNext());            }            if (cursor !=null &amp;&amp; !cursor.isClosed()) {                cursor.close();            }            return list;        }        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, name 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>My 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:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""#FF9900""    android:padding=""10dp""    android:orientation=""vertical""&gt;        &lt;Button            android:id=""@+id/add""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""Add item...""            android:layout_gravity=""center""/&gt;        &lt;ListView android:id=""@android:id/list""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:background=""#FFCC00""/&gt;  &lt;/LinearLayout&gt;</code></pre><p>And my maindialog.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:id=""@+id/layout_root""  android:orientation=""vertical""  android:background=""#FFFFFF""  android:minHeight=""100dp""  android:minWidth=""300dp""&gt;  &lt;EditText     android:id=""@+id/edittext""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""/&gt; &lt;LinearLayout    android:id=""@+id/button_layout""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""horizontal""    android:layout_gravity=""bottom""&gt;  &lt;Button    android:id=""@+id/ok""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Ok""/&gt;  &lt;Button    android:id=""@+id/cancel""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Cancel""/&gt;  &lt;/LinearLayout&gt;   &lt;/LinearLayout&gt;</code></pre><p>Thanks in advance!</p>","560096","","","","","2011-01-23 23:27:02","How do I load and save ListView items to an SQLiteDatabase?","<android><sqlite><listview>","1","0","1","",""
"4777042","1","4777309","","2011-01-23 22:38:28","16","47357","<p>I am using <code>tcpdump</code> to get HTTP data by executing the below command:   </p><pre><code>sudo tcpdump -A -s 1492 dst port 80</code></pre><p>The result of above command:  </p><ol><li>Headers, I think request and response headers.    </li><li>Unreadable data.   </li><li>The url <code>GET /modules/mod_news_pro_gk1/cache/stories.ilbalad.ajayeb.strange-tractor.jpg</code>.  </li></ol><p>I need a more clear result, for example, readable request > response header > response body etc.How can I filter my results?  </p>","315264","","779600","","2013-07-02 21:09:37","2014-02-02 16:01:11","Can I use tcpdump to get HTTP requests, response header and response body?","<android><http><tcp><tcpdump>","3","1","21","",""
"4777060","1","4907701","","2011-01-23 22:42:27","5","13054","<p>I was trying to get the amplitude level of a microphone on Android like so:</p><pre><code>MediaRecorder recorder = new MediaRecorder();recorder.setAudioSource(MediaRecorder.AudioSource.MIC);Timer timer = new Timer();timer.scheduleAtFixedRate(new RecorderTask(recorder), 0, 1000);private class RecorderTask extends TimerTask {    private MediaRecorder recorder;    public RecorderTask(MediaRecorder recorder) {        this.recorder = recorder;    }    public void run() {        Log.v(""MicInfoService"", ""amplitude: "" + recorder.getMaxAmplitude());    }}</code></pre><p>Unfortunately, this only returns 0 all the time.</p><p>It appears that for this to work I have to actually start recording. Is that correct?</p><p>If so, do I need to record for 500ms, get amplitude, stop recording and repeat?</p><p>Finally, do I have to record to a file? I do not need to save this audio file, can't I just get the current amplitude or highest amplitude since last call of the current live microphone input without recording?</p><p>Any help is appreciated, thanks.</p>","45974","","","","","2011-02-05 15:30:20","Android: sample microphone without recording to get live amplitude/level?","<java><android><media><record><microphone>","1","0","3","",""
"4777120","1","","","2011-01-23 22:54:04","0","2035","<pre><code>private float vertices[] = {  -1.0f,  1.0f, 0.0f,  // 0, Top Left  -1.0f, -1.0f, 0.0f,  // 1, Bottom Left   1.0f, -1.0f, 0.0f,  // 2, Bottom Right   1.0f,  1.0f, 0.0f,  // 3, Top Right }; private float textureCoords[] = {   0.0f, 0.0f, //  0.0f, 1.0f, //  1.0f, 1.0f, //  1.0f, 0.0f, // }; private short[] indices = { 0, 1, 2, 0, 2, 3 }; private FloatBuffer vertexBuffer; private ShortBuffer indexBuffer; private FloatBuffer mTextureBuffer; private int mTextureId = -1; private boolean mShouldLoadTexture=true; private Bitmap mBitmap; int mBitmapId; private int vBufferId; public Square() {  ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4);  vbb.order(ByteOrder.nativeOrder());  vertexBuffer = vbb.asFloatBuffer();  vertexBuffer.put(vertices);  vertexBuffer.position(0);  ByteBuffer ibb = ByteBuffer.allocateDirect(indices.length * 2);  ibb.order(ByteOrder.nativeOrder());  indexBuffer = ibb.asShortBuffer();  indexBuffer.put(indices);  indexBuffer.position(0);  ByteBuffer byteBuf = ByteBuffer.allocateDirect(textureCoords.length * 4);  byteBuf.order(ByteOrder.nativeOrder());  mTextureBuffer = byteBuf.asFloatBuffer();  mTextureBuffer.put(textureCoords);  mTextureBuffer.position(0); } //GL11 VBO-S     public static int genNewId(GL10 gl){       GL11 gl11 = (GL11)gl;       IntBuffer buffer = IntBuffer.allocate(1);       gl11.glGenBuffers(1, buffer);       return buffer.get(0);     }     public static void bufferData(GL10 gl, int id, FloatBuffer buffer){       GL11 gl11 = (GL11)gl;       gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, id);    final int vertexSize = buffer.capacity() * 4;       gl11.glBufferData(GL11.GL_ARRAY_BUFFER, vertexSize,  buffer, GL11.GL_STATIC_DRAW);     } public void selectTexture(GL10 gl) {  gl.glBindTexture(GL10.GL_TEXTURE_2D, mTextureId);  } public void draw(GL10 gl) {  gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);  if (!(gl instanceof GL11)) {   gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);  }   if (mShouldLoadTexture) {    loadGLTexture(gl);    mShouldLoadTexture = false;   }   if (mTextureId != -1 &amp;&amp; mTextureBuffer != null) {    gl.glEnable(GL10.GL_TEXTURE_2D);    gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);    gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, mTextureBuffer);   }   if (gl instanceof GL11) {       GL11 gl11 = (GL11)gl;       gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, this.vBufferId);       gl11.glVertexPointer(3, GL11.GL_FLOAT, 0, 0);       gl11.glDrawArrays(GL11.GL_TRIANGLE_FAN, 0, 4);   } else {    gl.glDrawArrays(GL10.GL_TRIANGLE_FAN, 0, 4);   }   if (mTextureId != -1 &amp;&amp; mTextureBuffer != null) {    gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);   }  gl.glDisableClientState(GL10.GL_VERTEX_ARRAY); } public void loadBitmap(Context context, int bitmapId) {  mBitmapId=bitmapId;    InputStream is = context.getResources().openRawResource(bitmapId);    try {        BitmapFactory.Options bitmapOptions = new BitmapFactory.Options();        bitmapOptions.inPreferredConfig = Bitmap.Config.RGB_565;  mBitmap = BitmapFactory.decodeStream(is, null, bitmapOptions);  mShouldLoadTexture = true;    } catch (Exception ex) {        Log.e(""bitmap loading exeption"", ex.getLocalizedMessage());    }} private void loadGLTexture(GL10 gl) {  if (gl instanceof GL11) {   vBufferId = genNewId(gl);   bufferData(gl, vBufferId, vertexBuffer);   Log.e(""GL11"", ""YEAH"");  }  ////////  int[] textures = new int[1];  gl.glGenTextures(1, textures, 0);  mTextureId = textures[0];  gl.glBindTexture(GL10.GL_TEXTURE_2D, mTextureId);  gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);  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_CLAMP_TO_EDGE);  gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);  GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, mBitmap, 0);  mBitmap.recycle(); }</code></pre><p>my OpenGLRenderer code:</p><pre><code>    public void onDrawFrame(GL10 gl) {        gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);        gl.glMatrixMode(GL10.GL_MODELVIEW);        gl.glLoadIdentity();        if (!bPause) {            if (mBG) {                //GROUND                gl.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);                    gl.glLoadIdentity();                    gl.glTranslatef(0+(xOffset*2), 0.0f, 2.8f-15);                    gl.glScalef(5.3f, 5.3f, 1.0f);                    ground.selectTexture(gl);                    ground.draw(gl);            }......alphablendEnableddraw other stuffs...alphablenddisabled...etc</code></pre><p>ground is a Square. with my old code: </p><pre><code>gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);</code></pre><p>it worked. but nothing happened in the VBO-s code. only black screen. I try it on a samsung galaxy s, and on a htc legend, the same way.. all supports Opengl 2.0.</p><p>trying to set a VBO, but the only thing is: black screen. why?</p>","472537","","472537","","2011-01-24 09:35:04","2011-01-24 09:35:04","Android OpenGL ES - trying VBO, but not working","<android><vbo>","0","4","","",""
"4777181","1","4779722","","2011-01-23 23:07:37","13","13821","<p>I'm trying to use the AudioRecord class to record a WAV file. The problem is that it only supplies the raw PCM data, and if I write it to a file, there is no header information, so it will not play in any media player. How can I create a WAV file from this raw data?</p><p>Or alternatively, is there any other way to record sound in Android to a WAV file (or, alternatively MP3)?</p><p>Oh, and I know that MediaRecorder can'y be used because it doesn't support either WAV or MP3 formats.</p>","496854","","149841","","2011-10-13 10:52:26","2014-01-15 03:22:17","Creating a WAV file from raw PCM data using the Android SDK","<android><audio><wav><pcm><audiorecord>","3","1","8","",""
"4777272","1","4777306","","2011-01-23 23:27:04","100","52709","<p>I am trying to determine the best way to have a single listview contains different rows styles. I know how to create a custom row + custom array adapter to support a custom row for the entire list view. But how can one listview support many different row styles?</p>","467569","","","","","2014-04-17 06:14:32","Android Listview with different layout for each row","<android><listview>","4","0","72","",""
"4777297","1","","","2011-01-23 23:31:16","8","2212","<p>I'm about to release an app I've written onto the market. I'm not a company, just written it in my spare time. However I am thinking of charging a small fee for it.</p><p>The docs suggest including an optional End User License Agreement. I was just wondering if this is something that's worth including, and if so can anyone give me some tips about writing one?</p><p>Thanks</p><p>Richard</p>","585573","","","","","2011-01-24 00:42:37","Android End User License Agreement","<android>","1","0","1","2011-01-24 21:05:58",""
"4777298","1","","","2011-01-23 23:31:26","0","2550","<p>I have a widget working with my app. When the app is first started I keep the context, and values so I can call my  UpdateWidget() from the app when things change. But if the app doesnt know what the context and AppID is I dont know how to get that information.   I think the way I tried to do this is wrong anyway, but not sure what else to try. </p><p>So basically the widget is already on the desktop.  I start up the app and make some changes and I need to send an update to the app with the new info. </p><p>I would have thought the app would get this connection to the widget when it starts up, but not the case. </p><pre><code>@Override    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {        Toast.makeText(context, ""onUpdate"", Toast.LENGTH_SHORT).show();        Ct = context;        ApMgr = appWidgetManager;        WidgetID = appWidgetIds;        WidgetOn = true;        UpdateWidget();    }</code></pre>","528130","","","","","2013-01-07 14:14:00","How to update a widget on app start","<android><widget>","3","0","","",""
"4777324","1","4777401","","2011-01-23 23:36:41","0","3129","<p>Okay, I was able to figure out a timer earlier, but now I'm having another problem</p><p>So, when I call this function called ""getNextQuote();"" the first time in onCreate() it updates and gets a random quote and displays it perfectly, however, when I try again, in onResume(), it doesn't refresh for some reason.</p><pre><code>public void getNextQuote(){    TextView tv = (TextView) findViewById(R.id.quote);//Text To be edited    Random QuoteNum = new Random();         int Quote = QuoteNum.nextInt(50);    android.util.Log.i(""DebugB"",""""+Quote);    String q = myString[Quote];//find which string is corresponding to the number    tv.setText(q);//Set the Text     android.util.Log.i(""DebugC"",q);}</code></pre><p>anything obvious I'm missing???In the log the new quotes are coming out like there supposed to, but they just arn't getting drawn to the actual emulator screen.</p>","586680","","244296","","2011-01-23 23:37:56","2011-01-23 23:52:14","Textview not updating?","<android><textview>","1","0","","",""
"4777438","1","4777506","","2011-01-24 00:02:26","2","706","<p>i have an app that registers for CREATE_SHORTCUT, and sets up an intent for the shortcut that targets one of my activities. as an extra. the intent contains one of my application objects ... that is, an object of a type defined in my application.</p><p>when i add the shortcut, i get the exception pasted in below. my guess here is that the problem is that the home screen app needs to deserialize that intent extra, and it has no visibility to that class. that would imply that any app extras for a shortcut intent must be standard Android SDK objects.</p><p>anything i'm missing?</p><pre><code>E/AndroidRuntime(  141): Caused by: java.lang.RuntimeException: Parcelable encounteredClassNotFoundException reading a Serializable object (name = org.jtb.nextvta.Route)E/AndroidRuntime(  141):        at android.os.Parcel.readSerializable(Parcel.java:1890)E/AndroidRuntime(  141):        at android.os.Parcel.readValue(Parcel.java:1761)E/AndroidRuntime(  141):        at android.os.Parcel.readMapInternal(Parcel.java:1947)E/AndroidRuntime(  141):        at android.os.Bundle.unparcel(Bundle.java:169)E/AndroidRuntime(  141):        at android.os.Bundle.keySet(Bundle.java:256)E/AndroidRuntime(  141):        at android.content.Intent.toUri(Intent.java:4868)E/AndroidRuntime(  141):        at com.android.launcher.ApplicationInfo.onAddToDatabase(ApplicationInfo.java:103)E/AndroidRuntime(  141):        at com.android.launcher.LauncherModel.addItemToDatabase(LauncherModel.java:1386)E/AndroidRuntime(  141):        at com.android.launcher.Launcher.addShortcut(Launcher.java:740)E/AndroidRuntime(  141):        at com.android.launcher.Launcher.completeAddShortcut(Launcher.java:670)E/AndroidRuntime(  141):        at com.android.launcher.Launcher.onActivityResult(Launcher.java:378)E/AndroidRuntime(  141):        at android.app.Activity.dispatchActivityResult(Activity.java:3625)E/AndroidRuntime(  141):        at android.app.ActivityThread.deliverResults(ActivityThread.java:3220)E/AndroidRuntime(  141):        ... 11 moreE/AndroidRuntime(  141): Caused by: java.lang.ClassNotFoundException: org.jtb.nextvta.RouteE/AndroidRuntime(  141):        at java.lang.Class.classForName(Native Method)E/AndroidRuntime(  141):        at java.lang.Class.forName(Class.java:237)E/AndroidRuntime(  141):        at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:2595)E/AndroidRuntime(  141):        at java.io.ObjectInputStream.readNewClassDesc(ObjectInputStream.java:1848)E/AndroidRuntime(  141):        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:852)E/AndroidRuntime(  141):        at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2006)E/AndroidRuntime(  141):        at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:956)E/AndroidRuntime(  141):        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2289)E/AndroidRuntime(  141):        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2243)E/AndroidRuntime(  141):        at android.os.Parcel.readSerializable(Parcel.java:1884)E/AndroidRuntime(  141):        ... 23 moreE/AndroidRuntime(  141): Caused by: java.lang.NoClassDefFoundError: org.jtb.nextvta.RouteE/AndroidRuntime(  141):        ... 33 moreE/AndroidRuntime(  141): Caused by: java.lang.ClassNotFoundException: org.jtb.nextvta.Route in loader dalvik.system.PathClassLoader@4376dac0E/AndroidRuntime(  141):        at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)E/AndroidRuntime(  141):        at java.lang.ClassLoader.loadClass(ClassLoader.java:573)E/AndroidRuntime(  141):        at java.lang.ClassLoader.loadClass(ClassLoader.java:532)E/AndroidRuntime(  141):        ... 33 more</code></pre>","337455","","","","","2011-01-24 00:18:21","android shortcut, can shortcut intent extra contain application objects?","<android><shortcut>","1","1","","",""
"4777455","1","4777690","","2011-01-24 00:07:00","0","580","<p>I am making an Android App that has an image on the Layout.</p><p>Does any one know how i can make it where the user can zoom in on the picture with the zoom control?</p>","583952","","390989","","2011-01-24 00:39:55","2011-01-24 01:00:39","How to make a zoom control on a Android App that has an image?","<android>","1","0","","",""
"4777512","1","4777686","","2011-01-24 00:19:34","0","556","<p>I am trying to geolocate a lat,long pair.  When there is no exception it works great.</p><p>Logcat:</p><pre><code>GLS Failed With Status 20</code></pre><p>The code follows:</p><pre><code>//TAG GEOCODING METHOD    public Address getAddressForLocation(Context context, Location location) throws IOException {     Address a = null;     try{        if (location == null) {            a=null;        }        double latitude = location.getLatitude();        double longitude = location.getLongitude();        int maxResults = 1;        Geocoder gc = new Geocoder(context, Locale.getDefault());        List&lt;Address&gt; addresses = gc.getFromLocation(latitude, longitude, maxResults);        if (addresses.size() == 1) {            a=addresses.get(0);        } else {            a=null;        }     }catch (Exception e){      Log.w(""EXCEPTON!"", ""Exception Caught in geocode"");      a=null;     }     return a;    }</code></pre><p>The call is also wrapped in a try/catch block.</p><pre><code> @Override//TAG On Location Changed    public void onLocationChanged(Location arg0) {//SET ALL VALUES            dlat = arg0.getLatitude();            dlon = arg0.getLongitude();            delev = arg0.getAltitude() * 3.2808399;            delev = round(delev, 2);//GET THE ADDRESS              try {                addy = getAddressForLocation(this,arg0);               } catch (Exception e) {                 // TODO Auto-generated catch block                 e.printStackTrace();                }                _lastaddy = _addy;                //DISPLAY ALL INFORMATION                 _addy = addy.getAddressLine(0);                      LONGBOX.setText(String.valueOf(dlon));                   LATBOX.setText(String.valueOf(dlat));if(_addy!=_lastaddy){                      ADDRESS.setText(_addy);}                  }</code></pre><p>The rest of the logcat is below.  Any help with this would be GREAT.  I can not catch this exception and have stared at this code so long and still dont know what I have done wrong.</p><p>LOGCAT:</p><pre><code>LocationMasfClient  reverseGeocode(): GLS failed with status 20AndroidRuntime      Shutting down VMdalvikvm            threadid=1: thread exiting with uncaught exception (group=0x400208b0)AndroidRunTime      FATAL EXCEPTION: mainAndroidRunTime      java.lang.NullPointerException</code></pre>","440968","","","","","2011-01-24 01:00:21","Can't catch Exception (GLS FAILED WITH STATUS 20)","<android><exception-handling><gps><reverse-geocoding>","1","0","","",""
"4777859","1","4777864","","2011-01-24 01:40:37","0","197","<p>So I have a scenario:</p><p>Using <code>System.currentTimeMillis()</code> I get the initial start time of my application.  Then, when I open it at another time, I get the time again.  Both of these times are saved as a <code>long</code> variable.</p><p>What I need to do is compare these two times, convert this difference to hours (x 600,000), and for every hour that has passed, subtract 5 from another integer variable.  I can find the difference in time, convert it to hours, but I can't figure out to subtract 5 for every hour that has passed.  Any help or pseudo code would be GREATLY appreciated.</p><p>-Nathan</p>","586859","","","","","2011-01-24 01:42:45","Comparing times and acting accordingly","<android>","1","0","","",""
"4777935","1","4777947","","2011-01-24 01:59:08","18","14534","<p>I would like to see a 'Hello world' program written in C/C++ but made to run on Android.</p><p>I know this is possible by using NDK and JNI calls. But not able to make it work. No guides online are helpful.</p><p>Need to know to to get started.</p><p>I am developing on Windows 7 machine and also using Eclipse for ease.</p><p>Android installation path: C:\Program Files\Android\android-sdk-windowsand NDK I have extracted to: C:\Program Files\Android\android-ndk-r5</p><ol><li>How do I import NDK to eclipse? </li><li>How to use C/C++ in Android?</li></ol><p>If I could get help running a simple 'hello world' I can design most of my sensitive code with C++.</p>","","user517400","244296","","2011-03-03 13:08:15","2014-02-27 20:23:31","How to use NDK? Starting with 'hello world' app","<c++><android><jni><android-ndk>","2","3","6","",""
"4777953","1","","","2011-01-24 02:03:37","0","1676","<p>I have an Android application that shows the location based on the area code of a caller.  For example, any phone number with the area code 212 is New York.  I would like to let users in India use the application.   </p><p>With some research it looks like one of the phone number format for India is:</p><p>(0)5555 + 6 digits</p><p>For Android users in India, what do numbers look like when you get an incoming call?</p>","289348","","","","","2011-01-24 03:21:57","What is the Phone Number format for incoming calls from India","<android><international>","1","0","","",""
"4777998","1","","","2011-01-24 02:11:03","4","817","<p>We are trying to use boost asio deadline_timers on an android device. we have a requirement where we need to fire a timer every 100 msec. I have used the code as follows. However, the timer seems to be fired every 1 second. What should we fine tune in the Android system for the boost asio deadline timer to work as expected? </p><p>Note: the following code works as expected on a plain linux system. What makes it work differently on an Andorid system?</p><p><strong>Code</strong>:</p><pre><code>void print(asio::deadline_timer* ptimer, const asio::error_code&amp; err){ struct timeval tval; if(0 == gettimeofday(&amp;tval, NULL)) {  std::cout &lt;&lt;"" Timer...  sec::microsec = ""&lt;&lt;tval.tv_sec&lt;&lt;""::""&lt;&lt;tval.tv_usec&lt;&lt; std::endl; } else {    std::cout &lt;&lt;"" Timer...  gettimeofday Error!"" &lt;&lt; std::endl; } ptimer-&gt;expires_from_now(boost::posix_time::milliseconds(100)); ptimer-&gt;async_wait(boost::bind(&amp;print, ptimer, asio::placeholders::error));}</code></pre><p><strong>Output on a Android device</strong></p><pre><code>Timer...  sec::microsec = 1298328679::39207Timer...  sec::microsec = 1298328680::46773Timer...  sec::microsec = 1298328681::54624Timer...  sec::microsec = 1298328682::63861Timer...  sec::microsec = 1298328683::65740Timer...  sec::microsec = 1298328684::69301Timer...  sec::microsec = 1298328685::76500Timer...  sec::microsec = 1298328686::85768</code></pre>","165887","","2228070","","2014-01-09 05:12:17","2014-01-09 05:12:17","Boost Asio deadline_timer on Android device does not get fired at the expiry time, but at a later point of time","<android><c++><boost><boost-asio>","1","1","1","",""
"4778106","1","","","2011-01-24 02:35:00","2","928","<p>Android cannot record mp3 audio using the MediaRecorder but it can record mp4a. I'm trying to figure out a way to convert mp4a audio into mp3 on my Android phone. I believe this means FFMPEG is not an option since it needs to be done on the phone. What are my options?</p>","160091","","","","","2011-01-24 02:49:01","Android: How to Convert MP4A audio into MP3 or Wav using Java","<java><android><audio><mp3>","1","1","1","",""
"4778113","1","6450971","","2011-01-24 02:36:12","137","106736","<p>I know this question has been asked before and I have seen a plethora of solutions out there, yet none seem to work for me.  I was able to build my apk without issues until this error started cropping up.  I have tried cleaning my project, removing it from the workspace and reimporting it, removing ""Java Builder"" from my Builders for the project, building the project manually, reordering my java build path.  I have no visible compiler issues and no problems exist in my workspace.  </p><p>I did experience this issue before and solved it once by removing the project form my workspace and re-importing it and another time I solved it by removing ""Java Builder"" from my java build path.  None seem to work this time.  I currently have most of the settings set back to default (i.e. java build is checked again).</p><p>I am running windows 7 (64 bit) and using jdk1.6.0_21 via Eclipse 3.6.  </p><p>Any suggestions would be greatly appreciated as I have lost loads of development time troubleshooting this already.</p><p>[Update] My locale is English &amp; I have tried removing the debug.keystore, United States as related to <a href=""http://code.google.com/p/android/issues/detail?id=834"">issue 834</a></p>","586907","","586907","","2011-01-24 03:04:52","2014-03-22 17:26:41","Android Eclipse - Could not find *.apk","<java><android><eclipse>","23","7","33","",""
"4778158","1","","","2011-01-24 02:49:52","0","314","<p>How can I have database connectivity for HTML5 for mobile applications to store data on a web server?</p><p>For now, I am trying for an <a href=""http://en.wikipedia.org/wiki/Android_%28operating_system%29"" rel=""nofollow"">Android</a> device, but I will also be using it for <a href=""http://en.wikipedia.org/wiki/IPhone"" rel=""nofollow"">iPhone</a>. I am using the <a href=""http://en.wikipedia.org/wiki/Eclipse_%28software%29"" rel=""nofollow"">Eclipse</a> editor.</p>","586914","","63550","","2013-01-06 10:32:07","2013-01-06 10:32:07","How can I have database connectivity for HTML5 for mobile applications to store data on a web server?","<android><html5><webserver><database-connectivity>","1","1","","",""
"4778170","1","4820047","","2011-01-24 02:51:54","0","563","<p>I'm working on web app (a C# MVC app) in which the view engine renders a different view page when it detects a mobile browser. In particular I'm targeting the Android web kit browser (on Froyo). Oddly the page <em>does</em> render correctly on the iPhone.</p><p>The problem is that when I test locally on the emulator it renders fine, and if I use Chrome on the desktop it renders fine... however, when I test on an actual phone (Nexus 1 and MyTouch) the markup is ignored and all text nodes are rendered as text.  This happens using the HTML5 DOCTYPE  (even using the simplest markup).  If I insert an xmlns attribute into the  tag (xmlns=""http://www.w3.org/1999/xhtml"") it will pay attention to the markup, but this come with it's own set of problems (most specifically it seems not to work with JQuery Moblie) and I'd much prefer to omit the namespace.</p><p>Also, just as a shot in the dark I explicitly set the content type to text/html to see if that would help, but no luck.  I'm sure you all figured it out when I said I was writing this in C#, but the web server is IIS.</p><p>Even this simple markup doesn't work:    </p><pre><code>&lt;html&gt;&lt;head&gt;&lt;title&gt;html5 test for android&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;h1&gt;h1 markup&lt;/h1&gt;&lt;h2&gt;h2 markup&lt;/h2&gt;&lt;p&gt;this is a paragraph of text&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</code></pre><p>I'm a newb in the mobile web dev arena - so I'm hoping this is such a simple and brainless issue it's something that everyone but me knows (which is why I'm not having any luck finding any direction on the web).</p><p>Thanks for any and all help!</p>","302877","","302877","","2011-01-25 11:27:48","2011-01-27 18:02:20","Mobile browser ignoring markup and script areas (Webkit, Android)","<android><html5><mobile><jquery-mobile>","2","3","","",""
"4778222","1","4778251","","2011-01-24 03:02:33","1","5768","<p>I'm retrieving a datetime from a SQLite DB which comes out in the format...</p><pre><code>2011-01-24 02:45:00</code></pre><p>In C# I can simply use <code>DateTime.Parse(""2011-01-24 02:45:00"").ToString(""HH:mm"")</code> in order to get the string <code>02:45</code></p><p>Is their a way I can I do this in Android/Java? My code in my Android app looks like this...</p><pre><code>// dateStr below is logging as correctly being yyyy-MM-dd HH:mm:ss formatString dateStr = cursor.getString(cursor.getColumnIndex(""start_time""));SimpleDateFormat sdf = new SimpleDateFormat(""HH:mm"");String shortTimeStr = sdf.format(dateStr); // &lt;-- throws IllegalArgumentException</code></pre><p><strong>EDIT:</strong> Thanks to both doc_180 and Konstantin Burov - the examples given have helped me sort out the problem. Part of the issue was that I was importing java.sql.Date instead of java.util.Date. I've changed things around and it's working perfectly for me now.</p>","488241","","488241","","2011-01-24 04:23:29","2012-09-06 02:00:19","Format a datetime string to time only","<java><android><date-format><simpledateformat>","2","3","","",""
"4778253","1","4778298","","2011-01-24 03:10:27","0","896","<p>I keep getting errors trying to implement a couple of OnLongClick buttons. Eclipse keeps telling me to ""add unimplemented methods"". I'm very new to developing and I'm asking for some help. :D What am I doing wrong here? This community helped me out before and as soon as I get to where I can give back I will. I thank you all for it. Here's my code for a simple app I'm working on.</p><pre><code>    package com.kc.eas;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.net.wifi.WifiManager;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.view.View.OnLongClickListener;import android.widget.ImageButton;import android.widget.RemoteViews.ActionException;import android.widget.Toast;import android.bluetooth.BluetoothAdapter;import android.bluetooth.BluetoothClass;import com.admob.android.ads.AdManager;import com.admob.android.ads.AdView;public class act2 extends Activity implements OnClickListener, OnLongClickListener {        /** Called when the activity is first created. */        @Override        public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        AdManager.setTestDevices(new String[] {                 AdManager.TEST_EMULATOR,                 ""HT089HL01612"",        });        AdView adView = (AdView)findViewById(R.id.ad);        adView.requestFreshAd();        ImageButton batteryhistory = (ImageButton) findViewById(R.id.battery_history);            manageservices.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {            Intent batteryhistoryintent = new Intent();             batteryhistoryintent.setAction(Intent.ACTION_MAIN);            batteryhistoryintent.setClassName(""com.android.settings"",""com.android.settings.battery_history.BatteryHistory"");            startActivity(batteryhistoryintent);        ImageButton batteryusage = (ImageButton) findViewById(R.id.battery_usage);            manageservices.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {            Intent batteryusageintent = new Intent();             batteryusageintent.setAction(Intent.ACTION_MAIN);            batteryusageintent.setClassName(""com.android.settings"",""com.android.settings.fuelgauge.PowerUsageSummary"");            startActivity(batteryusageintent);        ImageButton batteryinfo = (ImageButton) findViewById(R.id.battery_info);            batteryinfo.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {            Intent batteryinfointent = new Intent();             batteryinfointent.setAction(Intent.ACTION_MAIN);            batteryinfointent.setClassName(""com.android.settings"",""com.android.settings.BatteryInfo"");            startActivity(batteryinfointent);        ImageButton manageapps = (ImageButton) findViewById(R.id.manage_apps);            manageapps.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {            Intent manageappsintent = new Intent();             manageappsintent.setAction(Intent.ACTION_MAIN);            manageappsintent.setClassName(""com.android.settings"",""com.android.settings.ManageApplications"");            startActivity(manageappsintent);        ImageButton manageservices = (ImageButton) findViewById(R.id.manage_services);            manageservices.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {            Intent manageservicesintent = new Intent();             manageservicesintent.setAction(Intent.ACTION_MAIN);            manageservicesintent.setClassName(""com.android.settings"",""com.android.settings.RunningServices"");            startActivity(manageservicesintent);        ImageButton radioinfo = (ImageButton) findViewById(R.id.radio_info);            radioinfo.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {            Intent radioinfointent = new Intent();             radioinfointent.setAction(Intent.ACTION_MAIN);            radioinfointent.setClassName(""com.android.settings"",""com.android.settings.RadioInfo"");            startActivity(radioinfointent);        private WifiManager wifiManager;        ImageButton startwifiButton = (ImageButton) findViewById(R.id.wifi);            startwifiButton.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {            WifiManager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);            if(wifiManager.isWifiEnabled()){                WifiManager.setWifiEnabled(false);                Context context = getApplicationContext();                CharSequence text = ""Disabling WiFi"";                int duration = Toast.LENGTH_SHORT;                Toast toast = Toast.makeText(context, text, duration);                toast.show();            }else{                WifiManager.setWifiEnabled(true);                Context context = getApplicationContext();                CharSequence text = ""Enabling WiFi"";                int duration = Toast.LENGTH_SHORT;                Toast toast = Toast.makeText(context, text, duration);                toast.show();             }        private BluetoothAdapter bluetoothAdapter;        ImageButton bluetoothbutton = (ImageButton) findViewById(R.id.bluetooth);            bluetoothbutton.setOnClickListener(new View.OnClickListener(){            BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();            {            if (enabled) {                bluetoothAdapter.enable();            } else {                bluetoothAdapter.disable();            }            //OnLongClickButtons//        ImageButton bluetoothbutton = (ImageButton) findViewById(R.id.bluetooth);             bluetoothbutton.setOnLongClickListener(new View.OnLongClickListener(){            public void onLongClick(View v) {            Intent btintent = new Intent();             btintent.setAction(Intent.ACTION_MAIN);            btintent.setClassName(""com.android.settings"",""com.android.settings.bluetooth.BluetoothSettings"");            startActivity(btintent);        ImageButton wifisettings = (ImageButton) findViewById(R.id.wifi);            wifisettings.setOnLongClickListener(new View.OnLongClickListener() {            public void onLongClick(View v) {            Intent manageservicesintent = new Intent();             manageservicesintent.setAction(Intent.ACTION_MAIN);            manageservicesintent.setClassName(""com.android.settings"",""com.android.settings.wifi.WifiSettings"");            startActivity(manageservicesintent);                       }       });    }}        public boolean onLongClick(View v) {            // TODO Auto-generated method stub            return false;        }        public void onClick(View v) {            // TODO Auto-generated method stub        }</code></pre>","569503","","569503","","2011-01-24 03:14:56","2011-01-24 03:19:52","Errors in Eclipse and Android activity can't seem to figure it","<java><android><eclipse><compiler>","1","0","","",""
"4778283","1","","","2011-01-24 03:16:07","0","992","<p>Probably a very simple solution but I have very little experience thus far. How do I alter the following to work for both Android 2.2 (mnt/sdcard) and previous versions (/sdcard).</p><p>Thanks in advance!</p><pre><code>String path=""/sdcard/media/audio/notifications/"";      String filename=""sound1""+"".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, ""sound1 Notification"");         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, 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>//After user432209 comment I have this and it is working</p><p>File pathDir = Environment.getExternalStorageDirectory();</p><p>String path=pathDir+""/media/audio/notifications/"";String filename=""sound1""+"".ogg"";        </p>","585308","","585308","","2011-01-24 03:55:53","2011-01-24 03:55:53","Android: How to make Save to SD card function work for both pre and post Android 2.2","<java><android><sd-card><android-2.2-froyo>","1","0","","",""
"4778307","1","","","2011-01-24 03:22:25","0","667","<p>My application grabs a preview frame from the camera in YUV and sends it to a server.  I'm trying to change it so it will only send part of the image (a crop) to the server.  However I want to loop through the byte array and directly send the cropped image to the server, rather than creating a Bitmap class and cropping it that way.</p><p>My goal is to be as efficient as possible.</p><p>Does anyone have some pseudocode (or even better actual code) for cropping YUV images?</p><p>I'd like the code to work something like this:</p><pre><code>OutputStream out = clientSocket.getOutputStream();byte[] preview = getCameraPreview();//Crop half of the imageint x = (int)(getX()/2);int y = (int)(getY()/2);//Send the width, height, and image size to the serverout.write(intToByteArray(x));out.write(intToByteArray(y));out.write(intToByteArray((int)(x*y)));//Start sending the picture to the serverfor(int i = 0; i &lt; y; i++)    for(int j = 0; j &lt; x; j++)        out.write(preview[i+j]);</code></pre><p>I know that code doesn't work at all, but hopefully you get the idea of what I'm trying to do.</p><p>Any help will be appreciated.</p>","489481","","","","","2014-01-26 17:56:01","How to send part of a YUV image to a server?","<android>","2","1","","",""
"4778313","1","","","2011-01-24 03:23:30","1","425","<p>I want to know what is the Android program size limit:</p><ol><li>Memory size limit for one process?</li><li>Code size limit for one application?</li></ol>","505364","","488657","","2012-04-10 14:27:49","2012-04-10 14:27:49","What is the Android program size limit?","<android>","2","1","","",""
"4778329","1","","","2011-01-24 03:27:24","0","66","<p>How do I display 2 or 3 buttons in a menu bar on the bottom, right hand side of a layout? I want to display a separate panel or a menu bar for buttons on Android.</p>","564844","","16587","","2011-01-24 03:30:00","2011-01-24 03:30:00","How do I tweak the layout on Android?","<android>","0","3","","",""
"4778454","1","","","2011-01-24 03:51:47","2","56","<p>Is there a way to programmatically determine what applications are on my Droid phone?</p><p>Is there an API I can call? </p>","586966","","","","","2011-01-24 04:00:28","What applications are on my Droid phone?","<android>","1","0","","",""
"4778616","1","4778691","","2011-01-24 04:22:28","4","1381","<p>How do I create or download elegant/stylish buttons (Widgets) instead of using the simple buttons ? </p>","564844","","","","","2011-01-24 04:40:46","Creating elegant buttons","<android>","1","1","3","",""
"4778745","1","4778849","","2011-01-24 04:48:58","0","3286","<p>I followed <a href=""http://www.designerandroid.com/?p=8"" rel=""nofollow"">http://www.designerandroid.com/?p=8</a> this one to add the values in the spinner.In it while we select the ""clear spinner items"" the whole events are will be delete. But i need to  the selected particular item only want to delete.Any one can help me.. The sample code will help to me lot.</p>","565106","","","","","2013-02-10 08:34:19","how to delete the particular selected item from the list of items in spinner","<android><spinner>","2","0","1","",""
"4778754","1","4778845","","2011-01-24 04:50:19","13","41355","<p>Ok, I got an activity, that when it starts, it loads an image from the internet, and, trying to save memory, when the activity is left (the back button being pressed), I want the activity to dump (get rid of all the strings and images that are in it). So, I figure the best way to do this is to just kill the activity. Well, I cant seem to figure out the callback for when the backbutton is pressed, so I have been trying to use the onPause and onStop callbacks for the task, but botch ways force close my app. Im trying this</p><pre><code>public void onPause() {this.finish();}public void onStop() {finish();}</code></pre><p>Ive tried multiple variations of this, but none of them seem to work. Any ideas? </p>","587009","","345717","","2011-01-24 05:09:25","2012-05-08 03:35:26","Kill Activity on back button","<android><button><activity><kill><back>","5","1","4","",""
"4778781","1","4778850","","2011-01-24 04:54:55","4","1196","<p>I need to build two version of same android app and install both on same device, i can achieve this by keeping two different projects (different package name),but it's pain full to manage both, rather than keeping two projects is there any better way to achieve this.</p><p>Sam.</p>","322111","","","","","2011-07-03 16:18:30","build two version of same android app and install both on same device","<android>","1","2","2","",""
"4778811","1","","","2011-01-24 05:00:54","2","735","<p>Is the anti-aliasing during scrolling still implemented in the stock browser of Android 2.2? If yes, how can it be turned off programmatically?</p>","587027","","390989","","2011-01-24 05:20:31","2011-02-03 16:48:06","Anti-aliasing in Android 2.2 stock browser","<android><browser><antialiasing><android-2.2-froyo>","1","4","","",""
"4778834","1","4779032","","2011-01-24 05:04:27","25","6560","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4076946/parcelable-where-when-is-describecontents-used"">Parcelable where/when is describeContents() used?</a>  </p></blockquote><p>What is the purpose of implementing describeContents() function of Parcelable interface? Most of the framework code returns 0 as implementation. Documentation says ""a bitmask indicating the set of special object types marshalled by the Parcelable."" Could someone explain about this function.(probably with an example)</p>","110024","","114066","","2012-08-13 08:22:22","2012-08-13 08:22:22","Purpose of describeContents() of Parcelable interface","<android>","1","0","5","2012-10-05 19:37:49",""
"4778935","1","4779034","","2011-01-24 05:29:32","0","995","<p>I want to change the selected background color of my image on touch event.Should i need to draw that image on canvas or it can be done by imageview only?Please help me</p>","437833","","","","","2011-01-24 05:50:59","How to change selected background color of my image?","<android>","1","0","1","",""
"4778939","1","4778970","","2011-01-24 05:31:36","0","90","<p>I've created a SMS application. However, anyone can open my application. What I want to do is to prevent unauthorized access to my application. How could I add a secret function for the privacy of my application.</p><p>Thanks.</p>","516160","","","","","2011-01-24 06:38:34","How to add a secret function for application's privacy","<java><android><eclipse><privacy>","1","1","","",""
"4778972","1","4779885","","2011-01-24 05:37:23","2","8234","<p>How do i retrieve the error logs of my application from device (and send them over the internet to a server)?</p>","516985","","","","","2011-04-18 07:43:45","Android Error Logging","<android><logging>","2","2","1","",""
"4778974","1","4779499","","2011-01-24 05:37:59","1","94","<p>I was wondering if there was a recommended way to push new versions of an Android application to private testers, almost like the Android Market where the user would need a password to download it. It would be much easier than e-mailing apks.</p>","385051","","","","","2011-01-24 07:10:02","best way to push out test builds for testers","<android><testing>","1","0","","",""
"4779000","1","","","2011-01-24 05:43:06","5","7568","<p>For example, send a backsapce key to the edit text control to remove a charactor or send a char code like 112 to append a charactor in the edittext control programatically.</p><p>Actually I need a method like</p><pre><code>onKeyReceived(int keyCode){// EditText to append the keyCode, I know how to add a visible charator, but what about some special keys, like arrow key, backspace key.}</code></pre>","238061","","437703","","2011-02-07 11:26:03","2012-11-21 10:17:12","How to send key event to an edit text in android app","<java><android>","10","1","1","",""
"4779111","1","4779654","","2011-01-24 06:08:05","0","256","<p>My problem is my main menu has more than 40 items.  I'd like to show that in two screens like the home screen in Android.  How can i do that?  Does anyone have an example?</p>","537819","","1288","","2011-01-24 18:09:45","2011-01-24 18:09:45","How do I create an Android menu with two screens?","<android><android-layout>","3","0","0","",""
"4779142","1","","","2011-01-24 06:12:45","0","142","<p>I used a listview clist and used  clist.setOnItemClickListener(new AdapterView.OnItemClickListener() {Now i want to get the item which i clicked  on a sub activity which i called using an intent.How can i do this????Thanks in advance for those help me....</p>","579568","","750987","","2011-05-28 12:48:54","2011-05-28 12:48:54","How to pass a value from a main activity to a sub activity using intent?","<android><android-listview>","1","0","","",""
"4779162","1","","","2011-01-24 06:15:42","1","4861","<p>I set String myText=""\u2327\u2381\u2352\"";and try to display it  in a Textviewbut I just see 3 rectangular boxes in the android emulator.Even though android 2.3 release note says that hindi is supported I still do not see hindi character appearing in the emulator.</p>","587081","","527702","","2012-10-08 15:21:40","2012-11-08 13:49:16","Unable to see indian language characters even in android 2.3","<android><indic>","6","1","0","",""
"4779183","1","4779302","","2011-01-24 06:19:24","2","11426","<p>i have an imageview.</p><pre><code>  LoaderImageView image=new LoaderImageView(context,path1);</code></pre><p>in above statement it returns a imageview.So i want to convert it into a bitmap.so please tell me how to convert imageview into bitmap image.</p><pre><code>   ImageView i=new ImageView(context);   i.setImageBitmap(convertimagetobitmap);</code></pre><p>in above statement i have set a bitmap image(converted image) to another imageview.</p><p>Thanks in advance.</p><p>Best Regards</p>","745367","","745367","","2011-01-24 08:23:40","2013-10-20 20:08:46","how to convert a imageview to bitmap image in android","<android><image><bitmap>","4","6","","",""
"4779243","1","","","2011-01-24 06:27:45","0","1695","<p>Am working on auto provisioning in which I need to download a file.enc from the server.This I had done using cURL(other option is wget) to get it done.Now I need to compile the curl source code with agcc (ARM tool chain compile) and port the same on a Android device.Am clueless so any help is greatly appreciated.</p><p>Thanks in advance.</p>","587078","","","","","2011-02-23 06:30:05","Porting of HTTP client (cURL) library on android","<android><libcurl>","2","0","","",""
"4779253","1","4779344","","2011-01-24 06:29:17","0","664","<p>I have installed a video player in my Android box. Currently i am not able to play the you-tube videos in my browser. So i would like to open my player when the user clicks a you-tube link. Then the video will be played in my browser.  </p><p>Please guide me with some pointers on how i can do this?</p>","449378","","","","","2011-01-24 06:43:49","How to open my custom video player when i click a you-tube link in android?","<android><youtube><video-streaming>","1","0","","",""
"4779287","1","4780004","","2011-01-24 06:33:36","1","1869","<p>Alright, so I am working on creating an Android audio visualization app. The problem is, what I get form the method getFft() doesn't jive with what google says it should produce. I traced the source code all the way back to C++, but I am not familiar enough with C++ or FFT to actually understand what is happening.</p><p>I will try and include everything needed here:</p><p><a href=""http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/media/java/android/media/audiofx/Visualizer.java"" rel=""nofollow""><strong>(Java) Visualizer.getFft(byte[] fft)</strong></a></p><pre><code> /** * Returns a frequency capture of currently playing audio content. The capture is a 8-bit * magnitude FFT. Note that the size of the FFT is half of the specified capture size but both * sides of the spectrum are returned yielding in a number of bytes equal to the capture size. * {@see #getCaptureSize()}. * &lt;p&gt;This method must be called when the Visualizer is enabled. * @param fft array of bytes where the FFT should be returned * @return {@link #SUCCESS} in case of success, * {@link #ERROR_NO_MEMORY}, {@link #ERROR_INVALID_OPERATION} or {@link #ERROR_DEAD_OBJECT} * in case of failure. * @throws IllegalStateException */public int getFft(byte[] fft)throws IllegalStateException {    synchronized (mStateLock) {        if (mState != STATE_ENABLED) {            throw(new IllegalStateException(""getFft() called in wrong state: ""+mState));        }        return native_getFft(fft);    }}</code></pre><p><a href=""http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/media/libmedia/Visualizer.cpp"" rel=""nofollow""><strong>(C++) Visualizer.getFft(uint8_t *fft)</strong></a></p><pre><code>status_t Visualizer::getFft(uint8_t *fft){if (fft == NULL) {    return BAD_VALUE;}if (mCaptureSize == 0) {    return NO_INIT;}status_t status = NO_ERROR;if (mEnabled) {    uint8_t buf[mCaptureSize];    status = getWaveForm(buf);    if (status == NO_ERROR) {        status = doFft(fft, buf);    }} else {    memset(fft, 0, mCaptureSize);}return status;}</code></pre><p><a href=""http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/media/libmedia/Visualizer.cpp"" rel=""nofollow""><strong>(C++) Visualizer.doFft(uint8_t *fft, uint8_t *waveform)</strong></a></p><pre><code>status_t Visualizer::doFft(uint8_t *fft, uint8_t *waveform){int32_t workspace[mCaptureSize &gt;&gt; 1];int32_t nonzero = 0;for (uint32_t i = 0; i &lt; mCaptureSize; i += 2) {    workspace[i &gt;&gt; 1] = (waveform[i] ^ 0x80) &lt;&lt; 23;    workspace[i &gt;&gt; 1] |= (waveform[i + 1] ^ 0x80) &lt;&lt; 7;    nonzero |= workspace[i &gt;&gt; 1];}if (nonzero) {    fixed_fft_real(mCaptureSize &gt;&gt; 1, workspace);}for (uint32_t i = 0; i &lt; mCaptureSize; i += 2) {    fft[i] = workspace[i &gt;&gt; 1] &gt;&gt; 23;    fft[i + 1] = workspace[i &gt;&gt; 1] &gt;&gt; 7;}return NO_ERROR;}</code></pre><p><a href=""http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/media/libmedia/fixedfft.cpp"" rel=""nofollow""><strong>(C++) fixedfft.fixed_fft_real(int n, int32_t *v)</strong></a></p><pre><code>void fixed_fft_real(int n, int32_t *v){int scale = LOG_FFT_SIZE, m = n &gt;&gt; 1, i;fixed_fft(n, v);for (i = 1; i &lt;= n; i &lt;&lt;= 1, --scale);v[0] = mult(~v[0], 0x80008000);v[m] = half(v[m]);for (i = 1; i &lt; n &gt;&gt; 1; ++i) {    int32_t x = half(v[i]);    int32_t z = half(v[n - i]);    int32_t y = z - (x ^ 0xFFFF);    x = half(x + (z ^ 0xFFFF));    y = mult(y, twiddle[i &lt;&lt; scale]);    v[i] = x - y;    v[n - i] = (x + y) ^ 0xFFFF;}}</code></pre><p><a href=""http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/media/libmedia/fixedfft.cpp"" rel=""nofollow""><strong>(C++) fixedfft.fixed_fft(int n, int32_t *v)</strong></a></p><pre><code>void fixed_fft(int n, int32_t *v){int scale = LOG_FFT_SIZE, i, p, r;for (r = 0, i = 1; i &lt; n; ++i) {    for (p = n; !(p &amp; r); p &gt;&gt;= 1, r ^= p);    if (i &lt; r) {        int32_t t = v[i];        v[i] = v[r];        v[r] = t;    }}for (p = 1; p &lt; n; p &lt;&lt;= 1) {    --scale;    for (i = 0; i &lt; n; i += p &lt;&lt; 1) {        int32_t x = half(v[i]);        int32_t y = half(v[i + p]);        v[i] = x + y;        v[i + p] = x - y;    }    for (r = 1; r &lt; p; ++r) {        int32_t w = MAX_FFT_SIZE / 4 - (r &lt;&lt; scale);        i = w &gt;&gt; 31;        w = twiddle[(w ^ i) - i] ^ (i &lt;&lt; 16);        for (i = r; i &lt; n; i += p &lt;&lt; 1) {            int32_t x = half(v[i]);            int32_t y = mult(w, v[i + p]);            v[i] = x - y;            v[i + p] = x + y;        }    }}}</code></pre><p>If you made it through all that, you are awesome! So my issue, is when I call the java method getFft() I end up with negative values, which shouldn't exist if the returned array is meant to represent magnitude. So my question is, what do I need to do to make the array represent magnitude?</p><p><strong>EDIT:</strong> It appears my data may actually be the Fourier coefficients. I was poking around the web and found <a href=""http://www.mathcs.org/java/programs/FFT/"" rel=""nofollow"">this</a>. The applet ""Start Function FFT"" displays a graphed representation of coefficients and it is a spitting image of what happens when I graph the data from getFft(). So new question: <em>Is this what my data is? and if so, how do I go from the coefficients to a spectral analysis of it?</em></p>","579416","","579416","","2011-01-24 21:41:50","2011-03-19 04:20:41","What kind of output should I see from getFft?","<java><c++><android><android-ndk><fft>","3","3","","",""
"4779290","1","","","2011-01-24 06:33:59","1","1367","<p>After implementation of twitter in my app Now i try to implement Facebook for my app, and I found  <a href=""https://github.com/facebook/facebook-android-sdk"" rel=""nofollow""> Facebook SDK for android</a>I use that code for login, but problem is that I want to publish a msg on a buttons click without opening web-view. I found few links on this but no one works for me.I exactly want that same thing <a href=""http://stackoverflow.com/questions/4213767/how-to-post-on-facebook-wall-using-facebook-android-sdk-without-opening-dialog-b"">How to post on facebook wall using Facebook android SDK, without opening dialog box</a>I use the answer for but it five following error...Even I have allow application to use my information.</p><blockquote>  <p>Key description expected byte[] but value was a java.lang.String.  The default value  was returned.</p>    <p>01-24 10:37:33.567: DEBUG/Tests(479): got response: {""error"":{""type"":""OAuthException"",""message"":""(#200) The user hasn't authorized the application to perform this action""}}</p></blockquote>","587101","","","","","2012-08-25 14:19:47","How to post a Msg on Facebook using graph in android without web-view?","<android><facebook><facebook-graph-api><facebook-android-sdk>","4","0","","",""
"4779346","1","4779395","","2011-01-24 06:44:17","4","6553","<p>How can i customize the header of my app like the green stripe <a href=""http://www.google.hu/imgres?imgurl=http://downloadandroid.info/wp-content/uploads/2010/12/image15.png&amp;imgrefurl=http://downloadandroid.info/2010/12/android-app-download-col-reminder/&amp;usg=__mp3HGugwEy9FIAMS0Wgb9X0H7HQ=&amp;h=480&amp;w=320&amp;sz=19&amp;hl=hu&amp;start=0&amp;zoom=1&amp;tbnid=WpfmBClHTILYVM%3a&amp;tbnh=146&amp;tbnw=97&amp;ei=1B49TZ2yBcKCgAfG1fGdCA&amp;prev=/images%3Fq%3Dandroid%2Breminder%26um%3D1%26hl%3Dhu%26sa%3DN%26biw%3D1280%26bih%3D923%26tbs%3Disch:1&amp;um=1&amp;itbs=1&amp;iact=rc&amp;dur=187&amp;oei=1B49TZ2yBcKCgAfG1fGdCA&amp;esq=1&amp;page=1&amp;ndsp=46&amp;ved=1t:429,r:22,s:0&amp;tx=49&amp;ty=48"" rel=""nofollow"">here</a>?</p><p>When i start my app, its gray and slim.</p>","571648","","","","","2012-12-17 14:05:37","Android customize header of app","<android><header>","2","1","1","",""
"4779389","1","5025536","","2011-01-24 06:49:59","0","3327","<p>01-24 12:17:10.780: ERROR/Database(462): close() was never explicitly called on database '/data/data/com.test/databases/testdb7.db' </p><p>01-24 12:17:10.780: ERROR/Database(462): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here</p>","548218","","","","","2011-02-17 05:53:32","How to avoid DatabaseObjectNotClosedException?","<android>","2","0","","",""
"4779441","1","4779521","","2011-01-24 06:58:21","0","219","<p>I am new in Android . I need a little help.</p><p>I have created a sample chat application using socket. After launching application.</p><p>I am on the my application Activity. After some time I am back to Home Screen . And If </p><p>some times back some info or message come from my Server side How to invoke my chat application or How to inform the my application so that it relaunches..</p><p>Any idea please suggest me.</p><p>Thanks in Advance</p><p>Anshu </p>","587090","","","","","2011-01-24 07:14:11","How to invoke application after coming back on home Screen in Android?","<android>","1","1","","",""
"4779548","1","4779573","","2011-01-24 07:19:04","0","3976","<p>I want to know if there are some sounds in the android sdk that I could play in my app. I need something like the sound played when I receive a sms message or something like that (a ding).</p><p>If there is a sound, how can I get it?</p><p>I saw the fallbackring.ogg in the raw package from android sdk but I can't access it.</p><p>Thank you very much!</p>","449310","","","","","2011-01-24 07:23:11","android: play sound from sdk","<android><audio><playback>","1","0","0","",""
"4779631","1","","","2011-01-24 07:34:04","3","1000","<p><br> In my application during normal operation the onRestoreInstanceStatance function is executed and causes a null pointer exception in some listener, without invoking that listener. My app contains a lot of data that I write to a file in onPause and restore in onResume and onRestoreInstanceStatance. How can I make the app stable?</p>","487219","","535664","","2011-06-03 18:01:40","2011-06-03 18:01:40","Android onRestoreInstanceState(Bundle savedInstanceState)","<android>","1","2","","",""
"4779892","1","","","2011-01-24 08:15:15","1","688","<p>I am trying to implement an Android app. In that I am unable to detect the busy signal when I am dialing some number, so my call ends abruptly.</p><p>Is there anyway I can get to know that call is busy, other than using call duration to determine (as this will not work with different carrier)?</p>","368999","","3205","","2011-11-17 16:00:36","2011-11-17 16:00:36","How can I detect 'busy' signal when dialing in Android?","<android>","0","1","1","",""
"4779936","1","","","2011-01-24 08:23:00","0","1079","<p>I have an Android application where i want to receive Data SMS on specific port. MY BroadcastReceiver's OnReceive method gets called when the SMS is reaching my phone. When i print the Intent, Log.i(""SMS Receiver: Received intent"", intent.toString()); i can see that the Datamessage has received on particular port. But, when i use msgs[i].getMessageBody().toString() it retuns null. The actual message is not available. I have cross checked the sender and it is fine. When i uninstall my application on device and send a data sms to my phone, the SMS goes to the inbox and on the phone the message is shown as ""Unsupported content"". Is it something to do with the format of the Message i am sending? Below are the manifest entries used for receiving Data SMS</p><p>              <br>                 --> </p><pre><code>            &lt;action android:name = ""android.intent.action.DATA_SMS_RECEIVED""/&gt;               &lt;data  android:scheme=""sms""/&gt;                  &lt;data android:host=""localhost""/&gt;                 &lt;data android:port=""16000""/&gt;        &lt;/intent-filter&gt;     &lt;/receiver&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""4"" /&gt;</code></pre><p></p><p>Any help would be highly appreciated.</p>","543133","","","","","2011-02-02 02:45:18","Android: Message in Data SMS is returning null","<android>","1","2","","",""
"4779954","1","","","2011-01-24 08:26:45","87","80417","<p>How to disable back button in android while logging out the application?</p>","515810","","","","","2014-04-05 10:13:23","Disable back button in android","<android><button><back>","6","4","29","",""
"4779955","1","4780208","","2011-01-24 08:26:49","7","4030","<p>How do you access an Android asset, such as a .txt file, from C with the JNI?</p><p>I'm trying ""file:///android_asset/myFile.txt"", and locally ""myFile.txt"" with a duplicate of myFile.txt in the jni folder with the C implementation file.</p>","283311","","","","","2011-01-24 09:03:56","Android assets, C, JNI","<android><c><jni><asset>","1","1","2","",""
"4779963","1","4779992","","2011-01-24 08:27:52","63","58567","<p>Am able to access my laptop web server using the android emulator, am using 10.0.2.2:portnoworks well.</p><p>But when i connect my real android phone, the phone browser cannot connect to the same web server on my laptop. The phone is connected to the laptop using a USB cable. If i run the adb devices command, i can see my phone.</p><p>What am i missing?</p><p>Gath</p>","26143","","","","","2014-04-14 22:53:43","How can i access my localhost from my android device?","<android>","13","1","34","",""
"4779968","1","","","2011-01-24 08:29:06","3","572","<p>I want to write an viewer that can display text justified, and it should display the amount of text that it can show on one screen without scrolling. Let say if I use WebView for justifying text, how to calculate the size of the text to be set in the view, so that the view can display it properly with that font without scrolling.I hope you got my question, like ebook readers display text and then you have to swipe to load the next page, I want a similar functionality.</p>","61821","","1267661","","2012-10-23 03:27:03","2012-10-23 03:27:03","How to calculate the text that can fit in a WebView without scrolling","<android><webview><edittext><text-size>","1","1","3","",""
"4779996","1","4780054","","2011-01-24 08:35:56","12","177","<p>Is there a site that collects the various issues that exist in various Android devices that an Android developer should know about? Such as ""There is a problem with the vibrate feature on phone X. A workaround would be ..."".</p><p>If not, it would be great if someone sets this up, and allow us developers to add known problems that we experience with our applications on various Android devices.</p>","292263","","292263","","2011-12-13 07:43:08","2011-12-13 07:43:08","Known problems on various Android devices?","<android><devices>","2","2","3","",""
"4780197","1","4780232","","2011-01-24 09:02:44","4","3765","<p>I have a username and password field and now i need to check and redirect him to the next page in Android. </p><pre><code>    public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);            setContentView(R.layout.main);         final EditText loginText = (EditText) findViewById(R.id.widget44);         final EditText loginPassword = (EditText) findViewById(R.id.widget47);         final Button button = (Button) findViewById(R.id.widget48);            button.setOnClickListener(new View.OnClickListener() {                public void onClick(View view) {                 Intent myIntent = null;                 if(loginText.getText().equals(""admin"") &amp;&amp; loginPassword.getText().equals(""admin"")) {                  System.out.println(""Entering"");                  myIntent = new Intent(view.getContext(), Page1.class);                 } else {                 }                 startActivity(myIntent);                }            });        }</code></pre><p>Temp now i am checking by hardcoding the values, but this too does not work for me. Why? I usually check in <strong>Java</strong> like this, why does it not accept me the same way in Android</p>","548591","","","","","2013-02-10 10:51:03","Checking username and password in Android","<java><android>","3","0","1","",""
"4780304","1","4780388","","2011-01-24 09:16:31","3","8418","<p>I would like to overwrite the default android Widget.SeekBar style that looks like this:</p><pre><code>&lt;style name=""Widget.SeekBar""&gt;        &lt;item name=""android:indeterminateOnly""&gt;false&lt;/item&gt;        &lt;item name=""android:progressDrawable""&gt;@android:drawable/progress_horizontal&lt;/item&gt;        &lt;item name=""android:indeterminateDrawable""&gt;@android:drawable/progress_horizontal&lt;/item&gt;        &lt;item name=""android:minHeight""&gt;20dip&lt;/item&gt;        &lt;item name=""android:maxHeight""&gt;20dip&lt;/item&gt;        &lt;item name=""android:thumb""&gt;@android:drawable/seek_thumb&lt;/item&gt;        &lt;item name=""android:thumbOffset""&gt;8dip&lt;/item&gt;        &lt;item name=""android:focusable""&gt;true&lt;/item&gt;&lt;/style&gt;</code></pre><p>How can I do that? I have tried declaring the style again in the <code>manifest.xml</code> but that does not work.</p>","384598","","384598","","2011-01-24 09:23:44","2012-08-21 08:27:15","Overwrite android seekbar style","<android><android-widget><android-layout>","2","0","0","",""
"4780326","1","4780349","","2011-01-24 09:18:59","0","98","<p>Are there solutions for a .NET Framework developer that needs to write mobile applications in different platforms?</p><p>e.g. Can i use C# code to work in different platforms. What SDK's there are for these kind of works? In general, what is possible, so i wont start learn some other programming language?</p><p>Thank you.</p>","122769","","","","","2014-03-19 14:48:40",".NET Cross Platform Coding","<iphone><android><windows-mobile>","3","0","","",""
"4780367","1","","","2011-01-24 09:23:49","3","10348","<p>is there source code available for any drawing application(like paint) in android??Please provide some information on this</p><p>Thanks.</p>","587262","","","","","2011-11-16 16:25:59","is there source code available for any drawing application(like paint) in android?","<android><drawing><source>","2","0","3","",""
"4780369","1","","","2011-01-24 09:23:54","4","1884","<p>Does anyone know of any books or online resources (except the dev docs) that cover the <a href=""http://developer.android.com/training/sync-adapters"" rel=""nofollow"">Sync Adapter</a> and its usage?  Struggling to find any good material myself.</p><p>Or.. does anyone know of any alternative libraries for conducting remote sync services?</p><p>Thanks</p>","333276","","2117960","","2013-12-12 21:53:28","2013-12-12 21:53:28","Android Sync Adapter Resources","<android><synchronization><client-server>","4","1","1","",""
"4780540","1","","","2011-01-24 09:44:45","3","1523","<p>I'm trying to figure out for 4 days why my app is not functioning as I expect it to do.</p><p>My app wants to use OAuth with twitter (Is working) and on the call back it should enter the onNewIntent method. It's not doing that and I can't figure out why.</p><p>So clicking the twitterbutton opens a webpage where I can enter my credentials. Then I get a screen stating that it was successful and that I will be redirected back to my app. I do get back to my app but the onNewIntent method is never called. I have put a breakpoint at the start of the onNewIntend method and started the debugger. It does not stop on that method! It does stop in other methods so it can't be the debugger.</p><p>In my log file (included), third line from the bottom, you can see that it is starting a new intent. So..... what is going on here?</p><p>Can someone please explain? I am very confused.</p><p>This is my code that gets triggered when the twitterbutton is clicked:</p><pre><code>callBackURL = ""myapp://twitactivity"";httpOauthConsumer = new CommonsHttpOAuthConsumer(consKey, consSec);httpOauthProvider = new DefaultOAuthProvider(""http://twitter.com/oauth/request_token"",""http://twitter.com/oauth/access_token"", ""http://twitter.com/oauth/authorize"");String authUrl = httpOauthProvider.retrieveRequestToken(httpOauthConsumer, callBackURL);startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(authUrl)));</code></pre><p>This is the starting code of my onNewIntent method:</p><pre><code>public void onNewIntent(Intent intent) {    super.onNewIntent(intent);    Log.i(""onNewIntent"", ""Yep success."");    Uri uri = intent.getData();    if(uri != null &amp;&amp; uri.toString().startsWith(callBackURL)) {        String verifier = uri.getQueryParameter(oauth.signpost.OAuth.OAUTH_VERIFIER);    etc......</code></pre><p>I also have the following in my manifest file:</p><pre><code>&lt;activity android:name="".TwitterScreen""&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=""twitactivity"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>And this is what I see in my log file:</p><pre><code>01-24 10:23:36.064: INFO/ActivityManager(61): Displayed activity nl.gemoro.android.demo/.TwitterScreen: 6660 ms (total 6660 ms)01-24 10:23:38.614: INFO/global(348): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.01-24 10:23:44.025: INFO/ActivityManager(61): Starting activity: Intent { act=android.intent.action.VIEW dat=http://twitter.com/oauth/authorize?oauth_token=KjCUNMKg13OClyRjQff94QWKfoRBUpNLE2uF9cJkHA cmp=com.android.browser/.BrowserActivity }01-24 10:23:44.185: INFO/ActivityManager(61): Start proc com.android.browser for activity com.android.browser/.BrowserActivity: pid=355 uid=10034 gids={3003, 1015}01-24 10:23:44.724: INFO/ActivityThread(355): Publishing provider browser: com.android.browser.BrowserProvider01-24 10:23:46.704: INFO/ActivityManager(61): Displayed activity com.android.browser/.BrowserActivity: 2544 ms (total 2544 ms)01-24 10:23:53.624: WARN/KeyCharacterMap(355): No keyboard for id 001-24 10:23:53.624: WARN/KeyCharacterMap(355): Using default keymap: /system/usr/keychars/qwerty.kcm.bin01-24 10:23:54.574: DEBUG/dalvikvm(348): GC_EXPLICIT freed 3965 objects / 267064 bytes in 2364ms01-24 10:24:01.064: INFO/ActivityManager(61): Starting activity: Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=myapp://twitactivity?oauth_token=KjCUNMKg13OClyRjQff94QWKfoRBUpNLE2uF9cJkHA&amp;oauth_verifier=41owXswx5TsxHhRyiviFRkRvcpdekm7akRa2IFFM cmp=nl.gemoro.android.demo/.TwitterScreen }01-24 10:24:02.174: INFO/global(348): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.01-24 10:24:03.594: INFO/ActivityManager(61): Displayed activity nl.gemoro.android.demo/.TwitterScreen: 2412 ms (total 2412 ms)</code></pre>","587261","","446591","","2011-07-05 14:13:35","2013-01-08 15:34:16","android - twitter: callback is received but not shown","<android><twitter-oauth>","3","0","1","",""
"4780581","1","","","2011-01-24 09:48:19","0","150","<p>How to change colour of an the particular item in listview?</p>","550796","","1077754","","2013-10-07 11:12:36","2013-10-07 11:12:36","Listview item colour","<android>","1","2","","",""
"4780619","1","4780675","","2011-01-24 09:51:40","0","1079","<pre><code>public class Page1 extends Activity {    public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.welcome);         final Button button = (Button) findViewById(R.id.welcome);            button.setOnClickListener(new View.OnClickListener() {                public void onClick(View view) {                    Intent myIntent = null;                        myIntent = new Intent(view.getContext(), Page1.class);                    startActivity(myIntent);                }            });              }}</code></pre><p>I want to load contents from another XML file named welcome.xml, but i do get an error <code>welcome cannot be resolved or is not a field</code> </p><p>This Page1.java class is next screen of my Android Application.</p><p>My Welcome.xml </p><pre><code>&lt;Button android:text=""@+id/Button01"" android:id=""@+id/welcome"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;/Button&gt;</code></pre>","548591","","","","","2011-01-24 10:30:25","Layouts in Android [ id or field cannot be resolved]","<android>","6","0","","",""
"4780627","1","4780680","","2011-01-24 09:53:08","2","1541","<p>I am beginner in Android. I have downloaded the Android 2.3 windows installer and installed it on a PC. Next I have run the SDK Download Manager and installed all the components. I have run the main installer on another pc, and basic android 2.3 is installed there. Now I want to move the downloaded components to the second PC so that I won't have to download it twice. Will it work?</p><p>Also I have downloaded ADT plugin for eclipse into the first PC. Now I want to move the entire eclipse folder to the second PC. Will that work?</p>","245679","","","","","2011-03-01 15:44:55","Google Android and Eclipse with ADT: Moving installed component from one pc to another","<android><eclipse-plugin>","4","0","2","",""
"4780734","1","","","2011-01-24 10:03:43","1","113","<p>Im new to the development of apps and i've got some questions.</p><p>First let me tell you about the app i need to make.As an intern at a company i need to develop an iPhone and Android app, they want me to create an app that is based on a existing CRM database.I need to get data from the database and show it on the iPhone, this data should be edited and send back to the database.The company itself does not has experience in the development of mobile apps.</p><p>EDIT:The requirements i wrote above are the basic of the application, it will have alot more functionality implemented after the basic has been made. Something like an auto sync, either the database or phone will sync with each other once in a while. And when you are called on the phone it will also check the number in the database and if found the name is displayed instead of an unknow number. Just 2 things that should be implemented after the basic app</p><ul><li>Is such a thing possible with an iPhone/Android?</li></ul><p>As i have no experience with Objective-C, and little experience with java</p><ul><li><p>Is it easy to learn, i have good knowledge of C#</p></li><li><p>What platform could you suggest for me?</p></li></ul><p>As i need to develop for both iPhone and Android,</p><ul><li>What is the quickest way of developing for both at the same time?</li></ul><p>i've done research but as i do not have an mac at the moment i can't try stuff out for the iPhone.Titanium Appcelerator is something i liked, and since this works for both iPhone and Android i think this might be a good option. But as i do not have any experience i want some good advice from those who have experience before i start programming.</p><p>tnx in advance,~kamikze the rookie </p>","587303","","587303","","2011-01-24 11:09:35","2011-01-24 11:09:35","Help asked for iPhone and Android app","<iphone><android>","3","0","0","",""
"4780752","1","","","2011-01-24 10:06:03","0","3430","<p>I am trying to download the android sdk source.</p><p>Following are the steps I did for the same.</p><pre><code>curl http://android.git.kernel.org/repo &gt;~/bin/repochmod a+x ~/bin/repoPATH=$PATH:~/binexport PATHmkdir mydroidcd mydroidrepo init -u git://android.git.kernel.org/platform/manifest.git -b froyo</code></pre><p>I get the following message returned to me after I issues the repo init command in terminal -- ""revision froyo in manifests not found"" </p><p>I have been pulling out my hairs trying to find a solution for the  same. Experts , kindly help.</p><p>I am doing this from Ubuntu environment.</p><p>Experts please help with a solution.</p><p>Looking forward,Best Regards,Anees</p><p>Edit: I tired for master branch also and I got</p><pre><code>anees@Anees-desktop:~/mydroid1$ repo init -ugit://android.git.kernel.org/platform/manifest.git Traceback (most recent call last): File ""/home/anees/mydroid1/.repo/repo/main.py"", line 238, in &lt;module&gt;_Main(sys.argv[1:])File ""/home/anees/mydroid1/.repo/repo/main.py"", line 220, in _Mainrepo._Run(argv)File ""/home/anees/mydroid1/.repo/repo/main.py"", line 125, in _Runcmd.Execute(copts, cargs) File ""/home/anees/mydroid1/.repo/repo/subcmds/init.py"", line 231, in Executeself._SyncManifest(opt) File ""/home/anees/mydroid1/.repo/repo/subcmds/init.py"", line 119, in _SyncManifest m.PreSync() File ""/home/anees/mydroid1/.repo/repo/project.py"", line 1594, in PreSynccb = self.CurrentBranch File ""/home/anees/mydroid1/.repo/repo/project.py"", line 277, in CurrentBranchb = self.work_git.GetHead() File ""/home/anees/mydroid1/.repo/repo/project.py"", line 1380, in GetHead fd = open(path, 'rb')IOError: [Errno 2] No such file or directory:    '/home/anees/mydroid1/.repo/manifests/.git/HEAD'</code></pre>","264953","","1108213","","2012-02-16 09:27:27","2012-07-04 23:36:23","Issues in downloading android sdk source code","<android><git><ubuntu-10.04><android-source>","4","0","1","",""
"4780770","1","","","2011-01-24 10:09:22","1","2313","<p>This feels very much like another case of not seeing the forest for the trees.</p><p>I've written a small (non-extending) class for my app that, for now, only contains the one method to scrape a supplied URL and return a string. I was hoping to include the Device ID on the end of the query string, so added the following lines:</p><pre><code>import android.telephony.TelephonyManager;import android.content.Context;...TelephonyManager m_tmgr = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);</code></pre><p>However, the TELEPHONY_SERVICE constant ""cannot be resolved to a variable"", according to Eclipse. If I copy and paste these lines into another class in the package (all the other classes are activities, at the moment, which may have something to do with it?), it all works fine.</p><p>What's the massively obvious thing that I'm missing?</p>","587319","","","","","2011-01-24 10:15:45","TELEPHONY_SERVICE constant not recognised in one class, but is in another","<java><android>","4","0","","",""
"4780779","1","","","2011-01-24 10:09:58","0","712","<p>I have a view flipper where I slide from view 1 through to 3. Is there a way I can programatically hide the views that are not needed so that the user doesn't have a blank view to flip through?</p><p>My XML is:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical""&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout02"" android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;        &lt;ViewFlipper android:id=""@+id/ViewFlipper01"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;            &lt;!--adding views to ViewFlipper--&gt;            &lt;TableLayout android:id=""@+id/TableLayout01"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt;                &lt;TextView android:id=""@+id/TextView01"" android:layout_height=""wrap_content"" android:gravity=""top|center_horizontal"" android:layout_width=""wrap_content"" android:text=""View 1"" android:textSize=""25sp"" android:textColor=""@color/lightpurple""&gt;&lt;/TextView&gt;            &lt;/TableLayout&gt;            &lt;TableLayout android:id=""@+id/TableLayout01"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt;                &lt;TextView android:id=""@+id/TextView02"" android:layout_height=""wrap_content"" android:gravity=""top|center_horizontal"" android:layout_width=""wrap_content"" android:text=""View 2"" android:textSize=""25sp"" android:textColor=""@color/lightpurple""&gt;&lt;/TextView&gt;            &lt;/TableLayout&gt;            &lt;TableLayout android:id=""@+id/TableLayout01"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt;                &lt;TextView android:id=""@+id/TextView03"" android:layout_height=""wrap_content"" android:gravity=""top|center_horizontal"" android:layout_width=""wrap_content"" android:text=""View 3"" android:textSize=""25sp"" android:textColor=""@color/lightpurple""&gt;&lt;/TextView&gt;            &lt;/TableLayout&gt;        &lt;/ViewFlipper&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","330368","","","","","2011-01-24 10:21:58","Hiding ViewFlipper TableLayouts","<android>","2","0","","",""
"4780815","1","4780832","","2011-01-24 10:13:25","3","4307","<pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayoutandroid:id=""@+id/widget41""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TextViewandroid:id=""@+id/widget62""android:layout_width=""300px""android:layout_height=""292px""android:text=""Patient education is an integral part of health care delivery across medical centers in developed countries thus encouraging active patient participation and ensuring far better compliance and patient satisfaction.  It was this very dream that inspired Dr. Aniruddha and Dr. Anjali Malpani, who founded HELP in 1997, with a dream to make each and every individual in this country aware of his rights and responsibilities as a patient, of ways people could reduce the burden of health care expenses by planning and educating themselves ""before"" a serious medical problem could strike their family, and how doctors and patients could join hands to achieve health for all.  What started as a resource center eleven years back, with a modest collection of material on patient education, in their day care center at Om Chambers, has grown into India's only largest patient education center housing more than 11,000 authentic books on possibly every aspect of health and diseases, along with pamphlets, health care magazines, and an exhaustive audiovisual section too""android:layout_x=""10px""android:layout_y=""32px""&gt;&lt;/TextView&gt;&lt;Buttonandroid:id=""@+id/widget63""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Next""android:layout_x=""130px""android:layout_y=""352px""/&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>I am getting this error and what's wrong in this?</p><blockquote>  <p>Multiple annotations found at this  line:    - No grammar constraints (DTD or XML schema) detected    for the document.    - Element type ""TextView"" must be followed by either     attribute  specifications, "">"" or ""/>"".    - error: Error parsing XML: not well-formed (invalid token)</p></blockquote>","548591","","","","","2011-01-24 10:15:56","Xml error in Android","<android>","1","2","","",""
"4780826","1","","","2011-01-24 10:14:58","2","582","<p>i need to collect stats for my mobile apps.</p><p>I like flurry.com but i want to use my server and generate custom reports for my users.</p><p>Do you know if exists opensource api like flurry library?</p><p>Thank you.</p>","251434","","","","","2013-02-18 17:41:57","Mobile apps statistics API","<iphone><android><api><mobile><statistics>","3","0","1","",""
"4780835","1","","","2011-01-24 10:16:32","9","15039","<p>How can I pass <code>ArrayList</code> from one activity to other activity?</p>","579515","","207616","","2012-06-11 11:20:52","2012-12-06 13:38:50","pass arraylist from one activity to other","<android>","4","0","7","",""
"4780890","1","","","2011-01-24 10:22:24","0","287","<p>For google maps I need MD5 fingerprint to get my API Key for access the problem is that when I am writing this code in cmd.</p><pre><code>keytool -list -alias alias_name -keystore my-release-key.keystore</code></pre><p>it says that I need to enter a password but so I don't know what to do.</p>","587317","","119895","","2011-01-24 10:23:54","2013-04-22 16:28:44","API Key for access to google maps","<android>","3","0","","",""
"4780899","1","5181878","","2011-01-24 10:23:21","23","25150","<p>I have a WebView in my application in which some site is opened (always the same, it is my own page). The site has some JS code which loads some images from the remote host.</p><p>I want to intercept requests to such images (by URL pattern) and give back my own content (i.e. another image), or leave request untouched depending on internal application logic.</p><p>Is it possible to do that?</p><p><strong>EDIT</strong>: The current state of question...</p><p><code>WebView</code> has an ability to set  a <code>WebViewClient</code> (as noted by Axarydax). <code>WebViewClient</code> have two useful methods</p><ul><li><code>shouldOverrideUrlLoading</code></li><li><code>onLoadResource</code></li></ul><p><code>shouldOverrideUrlLoading</code> is able to intercept any url loading, if loading is triggered by page interaction (i.e. link on a page is clicked, WebView.loadURL("""") isn't triggering this method). It is also able to cancel URL loading by returning false. This approach isn't usable, cause' it is not able to intercept loading of page resources (and images, what i need to intercept, is such a page resource).</p><p><code>onLoadResource</code> is triggering every time that page resource (and images! thx to jessyjones) are loading, but there is no way to cancel that. That makes this method not suitable for my task also.</p>","296433","","1139383","","2013-02-12 16:03:31","2013-02-12 16:03:31","Intercept and override HTTP-requests from WebView","<android><webview><webviewclient>","6","0","18","",""
"4780909","1","4781174","","2011-01-24 10:25:00","2","762","<p>I have <strong>200 images on sdcard</strong> which represent a <strong>360 view</strong> of an object frame-by-frame.<br>I want to let the user 'rotate' the object by dragging the finger over the image.</p><p>I have no problem with implementing the drag event, the problem is with loading and switching between images. Caching all of the images before displaying the Activity is impossible due to <strong>limited VM memory</strong> (the images are quite big, resolution is over SVGA) for the process. Loading images on drag event is <strong>ineffective</strong> - far from even acceptable.  </p><p>Has anyone faced such a problem or similar?<br>Any help will be much appreciated.</p>","302317","","13793","","2012-04-30 23:32:31","2012-04-30 23:32:31","Effective image switching on drag motion","<android><image><drag>","3","0","","",""
"4780921","1","","","2011-01-24 10:26:09","1","786","<p><br>I am using MediaRecorder in my app for recording voice data. I want to implement pause as it is not available in SDK.<br>I am recording voice to temporary file. When user clicks pause button, I will append that recorded voice to a file, which is opened initially when app launches.<br>The things are not happening as expected. Can anyone help me?<br>Any help is appreciated.<br>Thanks</p><h2>Edit</h2>  <p>I have tried out with this code.<br><code>    recorder.stop();  </p><pre><code>    recorder.reset();    System.out.println(""recording stopped"");    File inFile = new File(recorderOutFile);    try {        FileInputStream fin = new FileInputStream(inFile);        recordFileStream = new FileOutputStream(recordingFile, true);        int size = fin.available();        byte buffer[] = new byte[size];        System.out.println(""Buffer size:"" + size + ""\td:""                + new String(buffer));        fin.read(buffer);        recordFileStream.write(buffer);        recordFileStream.flush();        recordFileStream.close();        fin.close();    } catch (FileNotFoundException e) {        e.printStackTrace();    } catch (IOException e) {        e.printStackTrace();    }  </code></pre><p></code></p>","296257","","296257","","2011-01-24 11:14:53","2011-01-24 11:14:53","Pause in android voice recorder","<android><voice-recording>","0","3","1","",""
"4780923","1","","","2011-01-24 10:26:13","0","329","<p>Hi can anyone please help me out to connect my web cam to android emulator?</p>","587338","","218589","","2011-01-24 10:27:30","2011-12-05 05:09:22","Android emulator cam","<android><android-emulator>","2","3","","",""
"4780952","1","","","2011-01-24 10:30:15","2","446","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3238388/android-out-of-memory-exception-in-gallery"">Android: out of memory exception in Gallery</a>  </p></blockquote><p>I am trying to display my device gallery in a grid view. Then on selecting a particular image from gallery grid view, I am uploading that image on server. There is no problem on uploading the image. But there is a problem on displaying the sd card images.My code is like below.</p><p>To display the gallery.. </p><pre><code>private void displayGallery() {  Uri uri = MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI; // Where images are stored  displaySdCard();  String[] projection = {    MediaStore.Images.ImageColumns._ID,      MediaStore.Images.ImageColumns.DATA, // The columns we want    MediaStore.Images.Thumbnails.IMAGE_ID,      MediaStore.Images.Thumbnails.KIND };  String selection = MediaStore.Images.Thumbnails.KIND + ""=""  + // Select only mini's  MediaStore.Images.Thumbnails.MINI_KIND;  mCursor = this.managedQuery(uri, projection, selection, null, null);   if (mCursor != null) {    mCursor.moveToFirst();   int size = mCursor.getCount();   Uri[] imgUri = new Uri[size];   for(int k = 0; k &lt; size; k++) {    mCursor.moveToPosition(k);       int id = mCursor.getInt(mCursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns._ID));       Uri img_uri = Uri.withAppendedPath(MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, """"+id);       imgUri[k] = img_uri;   }   GalleryImageAdapter galleryImageAdapter = new GalleryImageAdapter(this, imgUri); //(this, mCursor, size);   gotoPage(pageGallery);   grid_main.setAdapter(galleryImageAdapter);  } else    showToast(this, ""Gallery is empty.""); }</code></pre><p>The adapter..</p><pre><code>public class GalleryImageAdapter extends BaseAdapter{ Context mContext; public static final int ACTIVITY_CREATE = 10; int i = 0; private int mImg_uri; private Cursor mCursor; public GalleryImageAdapter(Context Cursor cursor, int img_uri){  mContext = c;  mCursor = cursor;  mImg_uri = img_uri } @Override public int getCount() {  // TODO Auto-generated method stub  return mUri.length; } public View getView(int position, View convertView, ViewGroup parent) {  // TODO Auto-generated method stub  View v;  if(convertView==null){   LayoutInflater li = (LayoutInflater)mContext.getSystemService(mContext.LAYOUT_INFLATER_SERVICE);   v = li.inflate(R.layout.album_img, null);   ImageView iv = (ImageView)v.findViewById(R.id.icon_image);   try {    mCursor.moveToPosition(position);       int id = mCursor.getInt(mCursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns._ID));       Uri img_uri = Uri.withAppendedPath(MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, """"+id);       iv.setImageURI(img_uri );   }   catch(Exception ex) {    ex.printStackTrace();   }  }  else  {   v = convertView;  }  return v; } @Override public Object getItem(int position) {  // TODO Auto-generated method stub  return null; } @Override public long getItemId(int position) {  // TODO Auto-generated method stub  return 0; }}</code></pre><p>First time the gallery is displaying properly. But from 2nd time onwards its giving the following error...</p><pre><code>01-24 15:42:24.788: ERROR/AndroidRuntime(8747): java.lang.OutOfMemoryError: bitmap size exceeds VM budget01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:375)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:212)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:663)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.graphics.drawable.Drawable.createFromStream(Drawable.java:641)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.ImageView.resolveUri(ImageView.java:491)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.ImageView.setImageURI(ImageView.java:287)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at com.mob.app.GalleryImageAdapter.getView(GalleryImageAdapter.java:71)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.AbsListView.obtainView(AbsListView.java:1269)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.GridView.makeAndAddView(GridView.java:1207)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.GridView.makeRow(GridView.java:263)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.GridView.fillDown(GridView.java:218)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.GridView.fillFromTop(GridView.java:334)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.GridView.layoutChildren(GridView.java:1104)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.AbsListView.onLayout(AbsListView.java:1113)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.view.View.layout(View.java:6133)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.view.View.layout(View.java:6133)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.view.View.layout(View.java:6133)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1108)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.LinearLayout.onLayout(LinearLayout.java:920)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.view.View.layout(View.java:6133)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.view.View.layout(View.java:6133)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.view.View.layout(View.java:6133)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.view.View.layout(View.java:6133)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.view.ViewRoot.performTraversals(ViewRoot.java:929)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1482)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.os.Handler.dispatchMessage(Handler.java:99)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.os.Looper.loop(Looper.java:123)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at android.app.ActivityThread.main(ActivityThread.java:3948)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at java.lang.reflect.Method.invokeNative(Native Method)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at java.lang.reflect.Method.invoke(Method.java:521)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)01-24 15:42:24.788: ERROR/AndroidRuntime(8747):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Please let me know if anyone has any solution.</p>","444277","","380579","","2011-01-24 10:34:27","2011-01-24 10:34:27","Android gallery displaying error","<android><gallery>","0","1","","2012-03-27 12:21:03",""
"4781039","1","","","2011-01-24 10:42:13","1","6788","<p><br>I want to develop an Android application in which I will display a menu for language selection, in which the user can select a languge . My application is supposed to be done for English and Arabic language. How to develop an application in a language other than english in Android. What are the steps I need to follow to develop an application in Arabic Language in Android. Can anyone help me in solving this issue?</p><p>Thanks in Advance,</p>","429501","","","","","2011-01-24 10:51:56","How to provide multilanguage support for an Android Application","<android>","2","0","2","",""
"4781087","1","4782772","","2011-01-24 10:48:50","3","1766","<p>I have made my first android app. It works fine locally. But when I upload it to the market, somehow people have problems with it. I cannot figure out what went wrong. Even when I have the stack trace:</p><pre><code>java.lang.RuntimeException: Unable to instantiate application com.jphellemons.koopzondag.Koopzondag: java.lang.ClassNotFoundException: com.jphellemons.koopzondag.Koopzondag in loader dalvik.system.PathClassLoader[/data/app/com.jphellemons.koopzondag-2.apk]at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:715)at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4615)at android.app.ActivityThread.access$3000(ActivityThread.java:136)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2223)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:143)at android.app.ActivityThread.main(ActivityThread.java:5068)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.ClassNotFoundException: com.jphellemons.koopzondag.Koopzondag in loader dalvik.system.PathClassLoader[/data/app/com.jphellemons.koopzondag-2.apk]at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)at java.lang.ClassLoader.loadClass(ClassLoader.java:573)at java.lang.ClassLoader.loadClass(ClassLoader.java:532)at android.app.Instrumentation.newApplication(Instrumentation.java:945)at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:706)</code></pre><p>Please let me know if i have to show the manifest and/or source code? I really have no ideaI will update this thread if I have the answer!</p><p>I have read about this issue here: <a href=""http://stackoverflow.com/questions/3781151/java-lang-classnotfoundexception-on-working-app/3781299#3781299"">java.lang.ClassNotFoundException on working app</a></p><p>So I guess that my fault is a setting in this window: can someone help me out with that?</p><p><img src=""http://i.stack.imgur.com/fTG69.jpg"" alt=""enter image description here""></p><p>Edit: I changed the first class from helloandroid.java to koopzondag.java and now i have the classcastexception. so I renamed the complete project. but now it can't launch the resource?</p><p><strong>edit2</strong> : Looks like this is the issue: but how do I resolve it? <a href=""http://androidforums.com/application-development/216707-classcastexception-starting-activity.html#post1905263"" rel=""nofollow"">http://androidforums.com/application-development/216707-classcastexception-starting-activity.html#post1905263</a></p>","169714","","169714","","2011-01-24 13:41:06","2011-01-26 08:27:58","Trouble debugging Android application: ClassNotFoundException","<java><android><debugging>","3","3","","",""
"4781098","1","4781517","","2011-01-24 10:49:53","2","4124","<p>i created a list with textview &amp; edittext using holder... it look like</p><h2>     Textview    Edittext</h2><h2>     Textview    Edittext</h2><h2>     Textview    Edittext</h2><pre><code>                       [button]</code></pre><p>but i cant get the data from each every Edittext &amp; whenever i add a data to any edittext data is swapped to other edittext automatically i can't control over it.My need is to transfer all the edittext data (which are given dynamically) to hash table or something while click a single button... can any one assist me.. hw to achieve it... assist with sample code...</p><p>this is my src file.... </p><pre><code>package org.me.androidapplication40;import android.app.Activity;import android.os.Bundle;import android.content.Context;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.EditText;import android.widget.ListView;import android.widget.TextView;public class customlistview extends Activity { private static class EfficientAdapter extends BaseAdapter { private LayoutInflater mInflater; public EfficientAdapter(Context context) { mInflater = LayoutInflater.from(context); } public int getCount() { return country.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.listview,parent,false); holder = new ViewHolder(); holder.text = (TextView) convertView.findViewById(R.id.TextView01); holder.text2 = (TextView) convertView.findViewById(R.id.TextView02); holder.txt=(EditText) convertView.findViewById(R.id.txtbox); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.text.setText(curr[position]); holder.text2.setText(country[position]);holder.txt.setText(""""); return convertView; } public class ViewHolder { TextView text; TextView text2; EditText txt; } } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ListView l1 = (ListView) findViewById(R.id.ListView01); l1.setAdapter(new EfficientAdapter(this)); } private static final String[] country = { ""item1"",""item2"",""item3"",""item4"",""item5"",""item6""}; private static final String[] curr = { ""1"",""2"",""3"",""4"",""5"",""6""};}</code></pre><hr><p>listview.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_height=""wrap_content"" android:gravity=""left|center"" android:layout_width=""wrap_content"" android:paddingBottom=""5px"" android:paddingTop=""5px"" android:paddingLeft=""5px""&gt; &lt;TextView android:id=""@+id/TextView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:gravity=""center"" android:background=""@drawable/bg"" android:textColor=""#FFFF00"" android:text=""hi""&gt;&lt;/TextView&gt; &lt;TextView android:text=""@+id/TextView02"" android:id=""@+id/TextView02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_marginLeft=""10px"" android:textColor=""#0099CC""&gt;&lt;/TextView&gt; &lt;EditTextandroid:id=""@+id/txtbox""android:layout_width=""63px""android:layout_height=""30px""android:textSize=""12sp""android:layout_x=""211px""android:layout_y=""13px""&gt;&lt;/EditText&gt;&lt;/LinearLayout&gt;</code></pre><hr><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/TextView01""android:layout_height=""wrap_content""android:text=""List of items""android:textStyle=""normal|bold""android:gravity=""center_vertical|center_horizontal""android:layout_width=""fill_parent""&gt;&lt;/TextView&gt; &lt;ListView android:id=""@+id/ListView01"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt; &lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre>","569553","","325992","","2011-01-24 11:07:53","2012-02-20 04:58:24","getting data from edittext placed in listview","<android>","2","2","","",""
"4781139","1","4781160","","2011-01-24 10:54:47","2","320","<p>I want to fetch the places of 20 meters using current latitude and longitude and display in list(without showing in google map).</p><p>Please help me.</p>","437833","","","","","2011-06-05 08:15:40","how to fetch nearby location?","<android>","2","0","","",""
"4781157","1","4781287","","2011-01-24 10:56:13","4","3654","<p>I want my database created once,and it will not changed,but i can't create data when i'm in onCreate()... </p><pre><code>public class EventsData extends SQLiteOpenHelper {       private static final String DATABASE_NAME = ""events.db"";       private static final int DATABASE_VERSION = 1;       public EventsData(Context ctx) {          super(ctx, DATABASE_NAME, null, DATABASE_VERSION);       }       @Override       public void onCreate(SQLiteDatabase db) {          db.execSQL(""CREATE TABLE "" + TABLE_NAME + "" ("" + _ID                + "" INTEGER PRIMARY KEY AUTOINCREMENT, "" + TIME                + "" TEXT NOT NULL,"" + TITLE + "" TEXT NOT NULL);"");    //This doesn't work..          db.execSQL(""INSERT INTO""+TABLE_NAME+""VALUES(null, 'hello', 'android');"");       }       @Override       public void onUpgrade(SQLiteDatabase db, int oldVersion,             int newVersion) {          db.execSQL(""DROP TABLE IF EXISTS "" + TABLE_NAME);          onCreate(db);       }    }</code></pre>","587377","","473070","","2011-01-24 11:03:22","2013-05-17 21:18:25","sqlite onCreate() problem I want my database created once,and it will not changed,but i can't create data when i'm in onCreate()","<android><sqlite><oncreate>","2","2","1","",""
"4781266","1","4781322","","2011-01-24 11:09:40","1","410","<p>I have three tab (TabA, TabB, TabC), By default TabA selected. In TabC I tooked a list and when user click on list_item (any), I want to show TabA with that data on user clicked. How can I do it? Thank you!</p>","550966","","","","","2011-01-24 11:36:15","Selecting a tab when clicking on list item of another tab","<android>","1","0","","",""
"4781310","1","4781375","","2011-01-24 11:13:58","6","16657","<p>Greetings,</p><p>I'm having trouble uploading a photo from my Android phone. Here is the code I'm using to prompt the user to select a photo:</p><pre><code>public class Uploader{        public void upload(){            Log.i(""EOH"",""hi..."");            Intent photoPickerIntent = new Intent(Intent.ACTION_GET_CONTENT);            photoPickerIntent.setType(""image/*"");            startActivityForResult(photoPickerIntent, 1);        }        protected void onActivityResult(int requestCode, int resultCode, Intent data)        {            if (resultCode == RESULT_OK)            {                Bundle extras = data.getExtras();                Bitmap b = (Bitmap) extras.get(""data"");                //what do do now with this Bitmap...                    //how do I upload it?            }        }    }</code></pre><p>So I have the Bitmap b, however I don't know what to do next?</p><p>I have the following code for sending POST requests:</p><pre><code>List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;(2);  params.add(new BasicNameValuePair(""someValA"", String.valueOf(lat)));  params.add(new BasicNameValuePair(""someValB"", String.valueOf(lng)));  new HttpConnection(handler).post(""http://myurl.com/upload.php"",params);</code></pre><p>How can I hook up a Bitmap image to this? I've searched google for ages and can't find a good way of doing it.</p><p>I hope someone can help.</p><p>Many thanks in advance,</p><hr><p>Ok I've tried chirag shah's suggestion. Here is my code:</p><pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data)        {            if (resultCode == RESULT_OK)            {                Uri imageUri=data.getData();                List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;(1);                params.add(new BasicNameValuePair(""image"", imageUri.getPath()));                post(""http://www.myurl.com/ajax/uploadPhoto.php"",params);            }        }</code></pre><p>where the post function (as recommended) is:</p><pre><code>public void post(String url, List&lt;NameValuePair&gt; nameValuePairs) {            HttpClient httpClient = new DefaultHttpClient();            HttpContext localContext = new BasicHttpContext();            HttpPost httpPost = new HttpPost(url);            try {                MultipartEntity entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);                for(int index=0; index &lt; nameValuePairs.size(); index++) {                    if(nameValuePairs.get(index).getName().equalsIgnoreCase(""image"")) {                        // If the key equals to ""image"", we use FileBody to transfer the data                        entity.addPart(nameValuePairs.get(index).getName(), new FileBody(new File (nameValuePairs.get(index).getValue())));                    }else{                        // Normal string data                        entity.addPart(nameValuePairs.get(index).getName(), new StringBody(nameValuePairs.get(index).getValue()));                    }                }                httpPost.setEntity(entity);                HttpResponse response = httpClient.execute(httpPost, localContext);                Log.i(""EOH"",response.toString());            } catch (IOException e) {                e.printStackTrace();            }    }</code></pre><p>However myurl.com/ajax/uploadPhoto.php is getting nothing. I've created a PHP log to log any activity on uploadPhoto.php, and nothing is showing up. It's worth noting that if I just type myurl.com/ajax/uploadPhoto.php straight into a web browser, it logs fine.</p><p>Any more suggestions?</p><p>Many thanks,</p>","395974","","395974","","2011-01-24 13:21:02","2013-11-15 00:25:24","Android: upload photos","<android><upload><photo>","2","1","4","",""
"4781337","1","","","2011-01-24 11:17:04","1","2633","<p>I am using below code. Its working fine for android 1.6 but its throwing below error for android 2.0 and above version. Please let me know the solution for it.</p><p><strong>Error:</strong></p><p>01-24 16:55:28.315: ERROR/ActivityThread(208): Failed to find provider info for calendar01-24 16:55:28.315: ERROR/error(208): Unknown URL content://calendar/events</p><p><strong>To read Event:</strong></p><pre><code>private void readContent(String uriString) {        Uri uri = Uri.parse(uriString);        Cursor cursor = getContentResolver().query(uri, null, null,                null, null);        if (cursor != null &amp;&amp; cursor.getCount() &gt; 0) {            cursor.moveToFirst();            String columnNames[] = cursor.getColumnNames();            String value = """";            String colNamesString = """";            do {                value = """";                for (String colName : columnNames) {                    value += colName + "" = "";                    value += cursor.getString(cursor.getColumnIndex(colName))                    + "" ||"";                }                Log.e(""INFO : "", value);            } while (cursor.moveToNext());        }    }</code></pre><p><strong>To Add event</strong></p><pre><code>private void addEvent(){    try {        ContentValues event = new ContentValues();        event.put(""calendar_id"", ""1"");        event.put(""title"", ""tet event"");        event.put(""description"", ""hello this is testing of event"");        event.put(""eventLocation"", ""Ahmedabad"");        Calendar c = Calendar.getInstance();        long date = c.getTimeInMillis();        event.put(""dtstart"", date);        event.put(""dtend"", date);        event.put(""allDay"", 1);        event.put(""eventStatus"", 1);        event.put(""hasAlarm"", 1);        Uri eventsUri = Uri.parse(""content://calendar/events"");        Uri url = getContentResolver().insert(eventsUri, event);        Log.e(""uri"", url.toString());    } catch (Exception e) {        Log.e(""error"", e.getMessage());        e.printStackTrace();    }}</code></pre><p>Thanks</p>","516061","","1175051","","2012-04-18 13:46:49","2013-11-21 14:43:00","Getting error in 2.0 and above OS when adding calendar event","<android><calendar>","1","1","1","",""
"4781356","1","4782228","","2011-01-24 11:20:00","0","474","<p>I need to start android application not with Activity^ but with some controller class that will start some activity</p><p>Is it possible?</p>","564272","","","","","2011-06-01 16:50:29","Android launcher","<android><activity><launch>","2","0","","",""
"4781369","1","13260405","","2011-01-24 11:21:13","6","1203","<p>OpenGL code that works on the Nexus One will not work properly on the Nexus S.Textures don't seem to render and I'm left with just black where textures should be.</p><p>Anyone got any ideas?</p>","498346","","498346","","2012-03-30 16:06:16","2012-11-06 22:24:06","OpenGL ES black texture on Nexus S","<android><opengl-es><opengl-es-2.0><nexus-s>","2","1","1","",""
"4781376","1","","","2011-01-24 11:22:22","0","1078","<p>hi in my application i have temp data , i need to keep the data only up to a particular condition , when app meet this condition,i don't need the data anymore. my problem how to keep the data,upon resuming the application</p>","487219","","","","","2011-01-24 20:41:27","android bestway to keep temp data","<android>","2","0","","",""
"4781448","1","","","2011-01-24 11:30:51","0","3090","<p><br>Me used <code>imageview</code> to display image.<br>I set the scale type as <code>ScaleType.MATRIX</code><br>There is option for <code>scaling</code> (<code>zooming</code>), <code>dragging</code> and all. All this are done by doing matrix manipulations mainly <code>postTranslate</code> and <code>postScale</code><br>My problem now it can be drag such that the image is not in the screen<br>So how we get how much it is dragged.<br><strong>In brief</strong><br>I have two matrix (<code>android.graphics.Matrix</code>) one the initial stage and the other that i got after drag and zoom. Now from this 2 matrices i want to calculate <strong>how much it moved in x-direction and y-direction?</strong><br>What matrix operation i need to do here.<br>Thank you</p>","477754","","","","","2012-05-18 22:15:53","Android imageview matrix operations","<android><matrix>","2","0","","",""
"4781486","1","","","2011-01-24 11:35:16","1","1759","<p>I need help using the facebook test users from android.I am using the facebook android sdk and i need to be able to login as a test user and do actions like publish to the stream. I do not want to use the developer account associated with this application since it is my personal account. I realize that test users can only be created using api calls and such a call returns the login url, i understand how to use this in a browser but how can i use it in my android application. Can i create a dummy account and work with that account or is this against facebook policy.</p>","259024","","","","","2012-03-11 19:20:05","How to use facebook test users from android","<android><facebook>","3","0","1","",""
"4781505","1","4781730","","2011-01-24 11:37:07","2","1485","<p>Could you please tell me how to do a spinner that look like a list item that can be expanded?I need something like shown in the figure given.<img src=""http://i.stack.imgur.com/QSKm4.png"" alt=""While clicking the arrow image the spinner pops up and the text is hide "">. I use the following code ` </p><p>spin.setOnItemSelectedListener(new OnItemSelectedListener() {<br>        public void onItemSelected(AdapterView parent, View view, int position, long id) {<br>            // hide selection text<br>             ((TextView)view).setText(null);<br>            // if you want you can change background here<br>        }<br>        public void onNothingSelected(AdapterView parent) {</p><pre><code>    }    });`</code></pre><p>But then also there is flashing of text above the arrow background image for a second. Any suggestion to avoid this?</p>","536091","","536091","","2011-01-25 04:35:26","2011-01-25 04:35:26","Android spinner - expand list view","<android><spinner>","2","1","","",""
"4781531","1","4781687","","2011-01-24 11:39:52","0","869","<p>I have a tabgroup having multiple activities. In one of the tabs i have two activities between whom i want to place a progress dialog.For this i am using Asynk Task. Following is my AsynkTask class which i have made an inner class for AboutUs activity:  </p><pre><code>private class TheTask extends AsyncTask&lt;Void, Void, Void&gt;{    @Override    protected void onPreExecute() {        progDialog = ProgressDialog.show(AboutUs.this.getParent(), ""Loading... "",                ""please wait...."", true);    }    @Override    protected Void doInBackground(Void... params) {        final Intent aboutusIntent = new Intent(getParent(), Departments.class);        final TabGroupActivity parentActivity = (TabGroupActivity)getParent();        parentActivity.startChildActivity(""Departments"", aboutusIntent);        return null;    }    @Override    protected void onPostExecute(Void result) {        if(progDialog.isShowing())        {        progDialog.dismiss();        }    }}  </code></pre><p>I am calling this class in my AboutUs activity :  </p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.aboutus);         .           .           .           .  /* Button for going to Departments */    Button ourdepbtn = (Button) findViewById(R.id.departmentsbutton);    ourdepbtn.setOnTouchListener(new OnTouchListener() {        @Override        public boolean onTouch(View v, MotionEvent event) {            // TODO Auto-generated method stub            //ourDepartments();            new TheTask().execute();            return false;        }    });}  </code></pre><p>However this does'nt start a new activity i.e. Departments. The progress dialog appears and then disappears but activity never loads.<br>Any suggestions..??  </p>","541786","","546999","","2011-01-24 11:42:31","2011-01-24 12:45:49","Asynk task android","<android><progressdialog>","2","0","0","",""
"4781539","1","","","2011-01-24 11:41:19","0","1396","<p>I added marquee tag but it not working....here is my coding..any one check and tell..why it is not working...</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/txt3""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:singleLine=""true""     android:ellipsize=""marquee""    android:marqueeRepeatLimit=""marquee_forever""    android:textColor=""#00FF00""    android:text=""News Blog""    /&gt;&lt;TextView     android:id=""@+id/txt1""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""Artical topic""    /&gt;     &lt;EditText android:id=""@+id/txtName1""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        /&gt;        &lt;TextView          android:id=""@+id/txt2""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""Artical""    /&gt;    &lt;EditText android:id=""@+id/txtName2""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        /&gt;     &lt;Button        android:id=""@+id/submit""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentRight=""true""        android:layout_marginLeft=""dip""        android:text=""Submit"" /&gt;    &lt;Button        android:id=""@+id/Cancel""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/submit""        android:layout_alignTop=""@id/submit""        android:text=""Cancel"" /&gt;&lt;/LinearLayout&gt;</code></pre>","587424","","118587","","2011-01-24 11:55:02","2013-02-22 07:59:08","marquee for TextView not working","<android><xml><layout>","2","2","","",""
"4781547","1","4782249","","2011-01-24 11:42:24","0","1776","<p>My app is working correctly with Gmail: on clicking preview for an attachment it will open with my app, but not in the Email app. What do I need to add to my manifest to integrate with the email app? Here's my current intent filter:</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=""audio/wav"" /&gt;         &lt;data android:mimeType=""audio/x-wav"" /&gt;         &lt;data android:mimeType=""audio/ogg"" /&gt;    &lt;/intent-filter&gt;</code></pre>","319618","","","","","2011-01-24 12:58:54","App not opening attachments in Android Email App","<android><email><intentfilter>","1","0","1","",""
"4781599","1","4781714","","2011-01-24 11:48:00","0","567","<p>I got one Alretdialog with an EditText and a Seekbar. By using the Seekbar, i want to change the background color of my edittext.<br>Changing the seekbar color works, but not changing the edittext background color.</p><pre><code>    EditText newSubjectEdit;    SeekBar colorSeeker;    Builder subjectAlert;    LinearLayout lg;private Builder getNewSubjectAlert() {            subjectAlert = new AlertDialog.Builder(this);            lg = new LinearLayout(getApplicationContext());            ...            newSubjectEdit = new EditText(getApplicationContext());            ...            lg.addView(newSubjectEdit);            colorSeeker = new SeekBar(getApplicationContext());colorSeeker.setOnSeekBarChangeListener(seekBarChangeListener);            ...            lg.addView(colorSeeker);            subjectAlert.setView(lg);                    // set ok and cancel ...</code></pre><p>the listener:  </p><pre><code>        SeekBar.OnSeekBarChangeListener seekBarChangeListener = new OnSeekBarChangeListener() {            @Override            public void onStopTrackingTouch(SeekBar seekBar) {                // TODO Auto-generated method stub            }            @Override            public void onStartTrackingTouch(SeekBar seekBar) {                // TODO Auto-generated method stub            }            @Override            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {                seekBar.setBackgroundColor(color);  // works !!                newSubjectEdit.setBackgroundColor(color);  // doesn't work            }        };</code></pre><p>hope you understand what i mean...</p>","570168","","508666","","2012-01-29 12:57:03","2012-01-29 12:57:03","Android: Alertbuilder change color on runtime","<android><colors><runtime><alert>","1","0","","",""
"4781601","1","","","2011-01-24 11:48:05","3","3920","<p>I currently have modified 'Google Map View' code (found below) but when the map loads and you click on the item on the map it returns an error.</p><p>I believe it has something to do with the null value for mContext but I'm not sure, I would really appreciate it if anyone could help me out with this: </p><pre><code>protected boolean onTap(int index) {OverlayItem item = mOverlays.get(index);Context mContext = null;AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);</code></pre><p>My Map class:</p><pre><code>package testing.map;import java.util.List;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;import android.content.Context;import android.graphics.drawable.Drawable;import android.os.Bundle;public class Mapview extends MapActivity {    /** Called when the activity is first created. */protected boolean isRouteDisplayed(){    return false;}    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.mapview);        MapView mapView = (MapView) findViewById(R.id.mapview);        mapView.setBuiltInZoomControls(true);        List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();        Drawable drawable = this.getResources().getDrawable(R.drawable.jd_sports_logo);        HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable);        //Declared longitude/latitude as doubles as GeoPoint only uses 'int' - converted to microdegrees        double latitude = 51.545538;        double longitude = -0.477247;        GeoPoint point = new GeoPoint((int)(latitude * 1e6), (int)(longitude * 1e6));        OverlayItem overlayitem = new OverlayItem(point, ""Hola, Mundo!"", ""I'm in Mexico City!"");        itemizedoverlay.addOverlay(overlayitem);        mapOverlays.add(itemizedoverlay);    }    }</code></pre><p>My HelloItemizedOverlay class:</p><pre><code>package testing.map;import java.util.ArrayList;import android.graphics.drawable.Drawable;import android.app.AlertDialog;import android.content.Context;import com.google.android.maps.ItemizedOverlay;import com.google.android.maps.OverlayItem;public class HelloItemizedOverlay extends ItemizedOverlay {    private ArrayList&lt;OverlayItem&gt; mOverlays = new ArrayList&lt;OverlayItem&gt;();    public HelloItemizedOverlay(Drawable defaultMarker) {        super(boundCenterBottom(defaultMarker));    }    public void addOverlay(OverlayItem overlay) {        mOverlays.add(overlay);        populate();    }    public HelloItemizedOverlay(Drawable defaultMarker, Context context) {          super(defaultMarker);          Context mContext = context;        }    @Override    protected OverlayItem createItem(int i) {        // TODO Auto-generated method stub        return mOverlays.get(i);    }    @Override    public int size() {        // TODO Auto-generated method stub        return mOverlays.size();    }    @Override    protected boolean onTap(int index) {      OverlayItem item = mOverlays.get(index);      Context mContext = null;      AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);      dialog.setTitle(item.getTitle());      dialog.setMessage(item.getSnippet());      dialog.show();      return true;    }}</code></pre>","587432","","1076164","","2011-12-21 14:45:15","2012-11-06 12:57:28","Android Google Map view returns error when onTap() is used - Alertdialog is supposed to be displayed","<android><google-maps><google-maps-markers>","4","0","2","",""
"4781659","1","","","2011-01-24 11:54:52","2","777","<p>Ok I can't find a sample anywhere.</p><p>I've done the notepad tutorial on Google's Android site, but I would like to know how to add more fields to the list, in columns. At the moment I can add the columns no problem, but they're not aligned like you would a normal table on the layout:</p><pre><code>john smithheinrich cillierswill peck</code></pre><p>I would like the first names and last names aligned proportionately, as you would in an html table.</p><p>It works if I use a constant value for the layout_width parameter (100dip etc), but I would prefer to use a relative percentage. However it's becoming clear that each row is on it's own, and does not know how to alighn itself with the row above.</p><p>Any pointers?</p><p>UPDATE: I've reached an experienced Android developer which advised me to use WeightSum, which brings me closer, but vertical alignment is stil not happening:</p><p><img src=""http://i.stack.imgur.com/z7nj9.jpg"" alt=""Alignment Screenshot""></p>","181098","","181098","","2011-01-25 08:04:13","2012-01-28 10:33:51","Android DB List Adapters: multiple columns, aligned?","<android>","1","0","2","",""
"4781680","1","","","2011-01-24 11:57:19","0","515","<p>I would like to know if Android 2.1 supports CE-HTML. If yes, please give me some pointers on how to use CE-HTML in Android.</p>","449378","","","","","2012-03-08 14:30:14","Does android support CE-HTML?","<android><html>","1","2","1","",""
"4781682","1","","","2011-01-24 11:57:30","0","671","<p>I have to animate an image as per (x,y) from one point to another point, then that point to another point and so on. I have around 300 points. For that I am using the following code.</p><pre><code>/** code starts **/public class CircleAnimation extends Activity implements OnPreparedListener {    /** Called when the activity is first created. */ ImageView imv1; int totalAnimTime = 0; double[][] points =  {{258.8505,143.2875,67},        {259.642, 143.3665,120},        {260.429, 142.992,240},             {259.257, 139.3575,180},        ......................                   ......................        {255.1335,146.8135,67},        {255.1395,146.794,67},        {255.0635,146.7785,67},        {254.9045,146.797,1200}         }; int j=0; double loc[] = new double[2]; double x1 = 0,y1 = 0,x2 = 0,y2 = 0,anim_end=0, xstart=258.8505, ystart=143.2875, xnow, ynow; protected boolean _active = true;    protected int _animTime = 66;      int k=1;    double xFactor = 1.779167, yFactor = 1.5;    private int displayWidth, displayHeight; @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);                imv1 = (ImageView)findViewById(R.id.imv1);        try{            LaunchInAnimation();        }catch(Exception e){         e.printStackTrace();        }    }    class LocalAnimationListener implements AnimationListener {  public void onAnimationEnd(Animation animation){   imv1.post(mLaunchSecondAnimation);       k = k ++;  }  public void onAnimationRepeat(Animation animation)  {  }  public void onAnimationStart(Animation animation)  {  } }; private Runnable mLaunchSecondAnimation = new Runnable(){  public void run(){   LaunchInAnimation();  } }; LocalAnimationListener MyAnimationListener = new LocalAnimationListener(); public void LaunchInAnimation() {  //animation  if(k&lt;points.length) {   if(k==0) {    x1 = xstart;          y1 = ystart;          anim_end=1;   } else {       x1 = points[k-1][0];          y1 = points[k-1][1];   }      x2 = points[k][0];      y2 = points[k][1];      _animTime = (int) (points[k][2]);      TranslateAnimation translateAnimation = new TranslateAnimation((float)x1, (float)x2, (float)y1, (float)y2);      translateAnimation.setDuration(_animTime);       translateAnimation.setFillBefore(true);      translateAnimation.setFillAfter(true);      translateAnimation.setAnimationListener(MyAnimationListener);      imv1.startAnimation(translateAnimation);      totalAnimTime +=  _animTime;  } }}/** code ends **/</code></pre><p>To complete all the animations it should take <em>totalAnimTime</em>, but it is taking less time to complete. Moreover this time is varying from one device to another device. For this, I facing problem to synchronize other event. What is the problem in this code? Is there any other better way to control this type animation.  </p>","525004","","525004","","2011-01-25 04:43:23","2011-09-23 09:36:36","Duration problem in a set of TranslateAnimation in Android","<android><animation><duration>","1","0","","",""
"4781719","1","","","2011-01-24 12:01:24","0","343","<p>I am wanting to put together a team to develop a TTS Speech Synthesizer for various phonetic Asian Languages. I have the language experts lined up. The final product will be 1. an android phone app, and 2. a web-based TTS service.</p><p>Languages in order of implementation:<br><em>Mien</em><br><em>Hmong</em><br><em>Lao</em></p><p>The first two have Latin based orthographies. </p><p><strong>My Question is:</strong>On the programming side, who do I need on my team? What skills/programming languages am I looking for?</p>","587418","","","","","2011-02-02 04:04:24","TTS Speech Synthesizer development for minority Asian languages","<java><android><speech-recognition><text-to-speech>","3","0","","",""
"4781728","1","","","2011-01-24 10:50:18","0","639","<p>How can I prompt user to login their twitter account and use that account for my application..?I am interested to do it with twitter4j..!I am developing an android app. for this...!Please help..!</p>","573700","rahul","","","","2011-01-24 12:02:49","Twitter login prompt","<android><twitter>","0","2","","",""
"4781738","1","4781874","","2011-01-24 12:03:37","2","6933","<p>How do I set some UI elements over (on top of) canvas?</p><p>I have a simple touch game that has its graphics placed on custom view with canvas. However as my full screen Panel is in the setContentView() I can't add any UI items like progressBar or logo. I would like to have whole canvas layer visible with some objects (progressBar, logo) ""floating"" over it.</p><p>Main class: </p><pre><code>public class GameClass extends Activity implements OnGestureListener {Panel panel;public void onCreate(Bundle savedInstance) {  super.onCreate(savedInstance);  panel = new Panel(this, 1, 2);  setContentView(Panel);  ...}</code></pre><p>Panel class:</p><pre><code>public class Panel extends View {     public Panel(Context context, int Var1, int Var2) {    super(context);    ...  }  @Override  protected void onDraw(Canvas canvas) {    super.onDraw(canvas);    ...  }}</code></pre><p>As code shows, touches are handled inside GameClass and the changes in animation are handled inside Panel.</p><p>Or maybe.. Would it be possible to start new transparent activity with progress bar and button so that both the button on overlay activity AND objects on underlying activity? And I could need a way to close all the layers (transparent activity, Panel, GameClass) with the button on transparent activity. Complicated? :D</p>","475861","","475861","","2011-01-24 13:32:28","2011-02-10 18:21:21","Android: UI elements over canvas layer","<android><layout><canvas><view>","1","0","","",""
"4781781","1","4782308","","2011-01-24 12:09:17","7","5214","<p>I am testing this on a Samsung Galaxy S i9000.</p><pre><code>int sampleRate = 44100;int bufferSize = AudioRecord.getMinBufferSize(sampleRate,     AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_8BIT);</code></pre><p>It returns -2 <code>ERROR_BAD_VALUE</code>.</p><p>The native sample rate is 44100Hz, as returned by </p><blockquote>  <p>AudioTrack.getNativeOutputSampleRate(AudioManager.STREAM_SYSTEM).</p></blockquote><p>I have tried setting sampleRate to 1000, 8000, 22100 and 44100. I have also tried changing <code>AudioFormat.CHANNEL_IN_MONO</code> to <code>AudioFormat.CHANNEL_CONFIGURATION_MONO</code>. I have also tried <code>STEREO</code> (both <code>IN_STEREO</code> and <code>CONFIGURATION_STEREO</code>). I have also tried 16 bit encoding instead of 8 bit.</p><p>Update: my Manifest has <code>AUDIO_RECORD</code> as permission.</p><p>I keep getting -2 as a result. Why is this happening?</p>","45974","","418183","","2011-01-24 12:51:19","2012-02-15 03:34:13","Why does AudioRecord.getMinBufferSize return ERROR_BAD_VALUE (-2)?","<android><audio-recording>","2","0","0","",""
"4781812","1","8134519","","2011-01-24 12:13:20","2","1227","<p>I have problem that how to change text inside the progressdialog (basically having STYLE_HORIZONTAL as in figure) (Using Android 1.6)</p><p><img src=""http://i.stack.imgur.com/BSu4y.png"" alt=""enter image description here""></p><p>to text shown in figure.</p><p><img src=""http://i.stack.imgur.com/I6mVh.jpg"" alt=""enter image description here""></p><p>Please help out in this case.My code about the progressdialog refers like this:-</p><pre><code> mProgressDialog = new ProgressDialog(PDFActivity.this);  mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);  mProgressDialog.setTitle(R.string.msgDownloadingWait);  mProgressDialog.setMessage(getResources().getString(    R.string.msgDownloading));  // User is not allowed to cancel the download operation.  mProgressDialog.setCancelable(false);  mProgressDialog.setMax(serverFileCount);  mProgressDialog.show(); </code></pre><p>Thanks in advance. </p>","536148","","24054","","2011-01-24 12:18:29","2011-11-15 10:02:09","Changing Text Alignment in ProgressDialog","<android><progressdialog><text-alignment>","1","3","","",""
"4781862","1","4781884","","2011-01-24 12:18:56","2","522","<p>I want to display a scrolling text in Android just like a marquee tag functionality in HTML. How can i display like that.</p>","448250","","596219","","2011-12-08 13:30:57","2011-12-08 13:30:57","I want to display a scrolling text in Android","<android>","2","0","","",""
"4781887","1","5788787","","2011-01-24 12:21:21","0","228","<p>I have done an anroid application for initiating a call to another number. </p><p>Steps</p><ol><li>User initiate a call using application. 3.Receiver accepts the call and conversation is in progress. 4.User tries to initiate a second call</li></ol><p>But the connection has gone and a message is displayed .Error message""Error!!Check Your Internet Connection"" is displayed now on trying to initate the second call..</p><p>GPRS/WIFI is gone when the call is intiated first</p><p>Pls Help</p><p>But in emulator its working fine... In android device the connection has gone</p>","548218","","","","","2011-04-26 10:07:20","Connecting failure while initiating a call in android device","<android>","2","0","","",""
"4781961","1","4835350","","2011-01-24 12:29:05","2","1588","<p>How to get log information to remote server while app running on device. Like how we get in log of java file using log4j?</p>","1746300","","213269","","2011-01-24 12:34:18","2011-12-25 22:52:14","How to get log information in android","<android><logging>","5","2","","",""
"4781989","1","","","2011-01-24 12:32:44","0","150","<p>i have a Listview with Textview &amp; Edittext widgets.. listview rows are sorting / rearranging automatically when ever i click the ""EditText"" of any row.. how can i overcome this problem.. kindly assist me to toggle that this sorting problem</p>","569553","","","","","2011-01-24 12:43:14","problem- Auto rearranging listview","<android>","1","0","","",""
"4782054","1","4782348","","2011-01-24 12:40:20","2","860","<p>My app sets an alarm.   While waiting for the alarm my phone closes the screen.   When the alarm sounds the screen is dark so I press the power key and the screen lights up but I now have to touch the Lock button to access the app interface.   I would prefer that the Lock has been disposed off when the user responds to the alarm so I tried to use the power manager.  The alarm receiver starts a new activity so I initialised the power manager in the onCreate for this activity.    However this causes a force close error.  I call the power manager as follows      </p><pre><code>   PowerManager pm = (PowerManager)cText.getSystemService(Context.POWER_SERVICE);   PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK , TAG);   wl.acquire();</code></pre><p>Any suggestions please.</p>","538847","","1279334","","2012-09-18 17:50:59","2012-09-18 17:50:59","Using Power Manager","<java><android>","3","0","","",""
"4782058","1","","","2011-01-24 12:40:37","0","711","<p>To explain my problem, I am going to start from a case study that is not what I have to do but which will give you a good idea of what I am talking about.</p><p>Imagine the map of the US in which you have the states / provinces. Each of these provinces has got a shape that is random (by random I mean it is not a rectangle, a triangle or a circle). I need to build these shapes independantly, size them correctly and put them at the correct place on the screen to represent the country. Finally, each of these province should be clickable.</p><p>To achieve that :</p><p>1) I don't want to use google map</p><p>2) I guess that I'll have to construct each provine using android path and android region ... can you confirm?</p><p>3) Is there a graphical tool for building these paths (photoshop import ?)</p><p>4) Assuming that I succeed to build the path, how can I put them at the correct place on the screen ?</p><p>5) How can I make these path clickable ?</p><p>Basically, I want to build an interactive map with clickable items that doesn't use Google map because it won't necessarly be a real map.</p><p>Thanks for your help,</p><p>R.</p>","473360","","","","","2011-01-25 23:00:55","How to buil a clickable custom map using path and region in Android","<android><path><map><shape><region>","1","0","","",""
"4782097","1","","","2011-01-24 12:43:42","5","2231","<p>I'm working on an Android application, and when I attempt to display large amounts of data in  a <code>listview</code>, I receive the following error:</p><pre><code>01-24 18:06:32.214: INFO/System.out(9244):   EX:Observer android.widget.AdapterView$AdapterDataSetObserver@43c9b200   was not registered.</code></pre>","533787","","54680","","2011-01-24 13:50:06","2013-05-20 16:56:31","""Observer ... was not registered"" error","<android>","3","1","0","",""
"4782281","1","","","2011-01-24 13:03:11","1","934","<p>I am new to Android and using Android 2.3 . There is sample Browser plugin in the source code I am trying to build it but unable to do so.</p><p>To compile plugin [ In README.txt ]</p><ol><li>run ""make SampleBrowserPlugin"" (compiles libsampleplugin.so andbuilds the apk)</li><li><p>the previous command produces an apk file so record its location.</p><p>Using the above steps I am unable to build it.</p><p>I have tried the following things :-<BR/><BR/>I thought to build the code in JNI folder first so as to get theplugin  "".so""  so that after getting the "".so"" would build the projectapk using the eclipse .<BR/>I tried building the code in the JNI folder using NDK build.The codewas not geting build it was giving ""undefined reference toJNIRegisterNativeMethod in JNIHelp.h ""</p><p>Can anyone tell me how to build the Sample plugin and install iton Emulator.</p></li></ol>","587507","","","","","2011-05-27 17:44:35","Plugin Development for Android 2.3","<android><android-browser><android-ndk-r5>","1","0","","",""
"4782422","1","4782470","","2011-01-24 13:18:06","0","366","<p>i want to know that how to create virtual host using wamp.</p><p>i have made webservice in php for androide application and hosted on local wamp server.</p><p>when i call webservice using application, it gives an error </p><blockquote>  <p>01-24 12:51:14.685:  WARN/System.err(476):  java.net.ConnectException:  localhost/127.0.0.1:80 - Connection  refused</p></blockquote><p>this is an error when i am calling webservice from my local wamp server.</p><p>Any help would be appriciated.</p><p>thanks in advance</p>","1026244","","","","","2011-01-24 13:22:45","services is not calling using local wamp in androide","<php><android><webservices-client>","2","0","","",""
"4782448","1","","","2011-01-24 13:20:19","0","355","<p>I want to include some apk's whenever Android Emulator starts or boots up an image. Because when I manually install using adb and close the emulator APK's which I have installed disappears after I start it again.</p><p>Please help! how to acheive this... OR how to make apk's always stay in emulator image? </p>","587540","","","","","2011-01-24 13:20:19","Auto install apk's when emulator starts","<android><android-emulator>","0","2","","",""
"4782471","1","","","2011-01-24 13:21:48","5","2008","<p>Google's official documentation mentions:</p><p>Escaping apostrophes and quotes</p><p>If you have an apostrophe or a quote in your string, you must either escape it or enclose the whole string in the other type of enclosing quotes. For example, here are some stings that do and don't work:</p><pre><code>&lt;string name=""good_example""&gt;""This'll work""&lt;/string&gt;&lt;string name=""good_example_2""&gt;This\'ll also work&lt;/string&gt;&lt;string name=""bad_example""&gt;This doesn't work&lt;/string&gt;&lt;string name=""bad_example_2""&gt;XML encodings don&amp;apos;t work&lt;/string&gt;</code></pre><p>My question is: Would unescaped quotes cause the application to crash or would it just have no effect and the quotes won't appear in the app UI? Would it crash on specific Android versions? I ask this because if I don't escape this symbol, Eclipse SDK gives me compilation errors but I came across a third-party app code which does not escape these characters, it crashes randomly and I'd like to confirm that this is/ is not one of the possible reasons for the crash.</p>","587553","","139010","","2011-04-25 04:05:30","2011-04-25 04:05:30","Can an unescaped apostrophe in a literal defined in strings.xml cause my app to crash?","<android>","1","3","1","",""
"4782490","1","","","2011-01-24 13:23:29","0","3749","<p>I simply want to return the string with intent from a another activity but not getting that string in parent activity...though no error is shown.for test purpose just want to show toast message on return of result..</p><p>here's the code of parent activity....</p><pre><code>public class Login2 extends Activity {     static final int REQ_CODE=0; /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.login);      Button startButton=(Button) findViewById(R.id.btn_login);        startButton.setOnClickListener(new View.OnClickListener()        {         public void onClick(View view)         {                    final TextView var=(TextView)findViewById(R.id.errmsg);          EditText usrnameobj = (EditText)findViewById(R.id.et_usename);          EditText usrpassobj = (EditText)findViewById(R.id.et_password);           String username = usrnameobj.getText().toString();           String password = usrpassobj.getText().toString();           Intent i=new Intent(getApplicationContext(),AndroidXmlResource.class);          i.putExtra(""entry"",username.toString() + password.toString());          startActivityForResult(i,REQ_CODE);         }           protected void onActivityResult(int requestCode, int resultCode, Intent data)            {          //if (resultCode == Activity.RESULT_OK &amp;&amp; requestCode == 0)            {                      //String res = data.getExtras().getString(""result"");                     // TextView var=(TextView)findViewById(R.id.errmsg);                     // var.setVisibility(0);                     // var.setText(res.toString());                     // var.setText(""called on act res"");                      Toast.makeText(Login2.this,""Hi! Bright Hub"", Toast.LENGTH_SHORT).show();                  }            }        });   </code></pre><p>And here's the child activity that returns a result....</p><pre><code>public class AndroidXmlResource extends Activity { //public String U=""sudeep1""; //public String P=""donotlock1""; public int Res; @Override protected void onCreate(Bundle bundle) {  // TODO Auto-generated method stub  super.onCreate(bundle);  //setContentView(R.layout.main);  Bundle extras = getIntent().getExtras();  if (extras == null) {   return;  }  String pass=extras.getString(""entry"");  //String result= new String();        //TextView myXmlContent = (TextView)findViewById(R.id.tv_test);  try {   String stringXmlContent = getEventsFromAnXML(this);   //myXmlContent.setText(pass.toString());   Intent returnIntent = new Intent();   if(stringXmlContent.equals(pass))   {    returnIntent.putExtra(""result"",""valid Login"");    setResult(RESULT_OK,returnIntent);          super.finish();   }   else   {    returnIntent.putExtra(""result"",""Invalid Login"");       setResult(RESULT_OK,returnIntent);          super.finish();   }  } catch (XmlPullParserException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  }    }    private String getEventsFromAnXML(Activity activity)    throws XmlPullParserException, IOException    {     StringBuffer stringBuffer = new StringBuffer();     Resources res = activity.getResources();     XmlResourceParser xpp = res.getXml(R.xml.myxml);     xpp.next();     int eventType = xpp.getEventType();     while (eventType != XmlPullParser.END_DOCUMENT)     {      int c=1;      if(eventType == XmlPullParser.START_DOCUMENT)      {       //stringBuffer.append(""--- Start XML ---"");      }      else if(eventType == XmlPullParser.START_TAG)      {       //stringBuffer.append(""\nSTART_TAG: ""+xpp.getName());      }      else if(eventType == XmlPullParser.END_TAG)      {       //stringBuffer.append(""\nEND_TAG: ""+xpp.getName());      }      else if(eventType == XmlPullParser.TEXT)      {       //stringBuffer.append(""\nTEXT: ""+xpp.getText());       //extra       { String t=xpp.getText().toString();         stringBuffer.append(t.toString());             }             }      eventType = xpp.next();     }     //stringBuffer.append(""\n--- End XML ---"");     return stringBuffer.toString();</code></pre>","587550","","244296","","2011-01-24 13:30:56","2013-05-31 15:02:00","onActivityResult not getting result","<android>","5","2","","",""
"4782508","1","4782561","","2011-01-24 13:25:13","1","5331","<p>I want to show text in dark color on a light background on alert dialog. But I can't figure out how to do this. Please help me.</p><p>Thanks.</p>","556702","","","","","2012-08-13 09:45:47","Customizing the Alert dialog in Android","<android><alertdialog>","2","1","1","",""
"4782543","1","4825803","","2011-01-24 13:29:23","69","55683","<p>I'm writing this in mere desperation :) I've been assigned to make a standalone barcode scanner (as a proof of concept) to an Android 1.6 phone.</p><p>For this i've discovered the ZXing library.</p><p>I've googled, read related topics here on StackOverflow used common sence and so forth. Nothing seemed to have helped, and i just can't punch a hole on this mentale blockade :/</p><p>I know it to be possible, to use the lib, and create your own standalone barcode scanner. I've read that using the ""Barcode Scanner"" provided by the Zxing folks, is by far the easiest solution (via Intent). Unfortunately this is not an option, and a standalone app is desired.</p><p>So to sum up my problem :</p><ol><li>How to integrate ZXing source lib into my Android Code project through Eclipse?</li><li>When integrated ... how to make use of the lib, to ""load"" the scanning function?</li><li>A step to step guide is almost prefered because i just started working in Eclipse.</li></ol><p>I've tried to make my code project dependant of the Android folder from the ZXing source folder. When i do so, a handfull errors emerge, mostly concerning 'org.apache' (??)</p><p>I just can't figure it out ... so a few hints would be most helpfull.</p><p>In advance, thank you :)</p>","587566","","69802","","2011-06-03 19:29:14","2013-09-26 11:16:13","Integration ZXing library directly into my Android application","<android><barcode><barcode-scanner><zxing>","6","5","65","",""
"4782548","1","4785811","","2011-01-24 13:29:32","8","8452","<p>I'm trying to make 4 buttons, evenly spaced in a portrait view on Android.</p><p>The space should scale up and down depending on the screen size, with an even amount of space between each button and the borders.</p><p>I tried using linear layout, weight and layout gravity but it seems that I cannot center the button vertically.</p><p>Is this a bug of Android layout? More probably is just me.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutandroid:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""&gt;&lt;LinearLayoutandroid:layout_width=""wrap_content""android:layout_height=""wrap_content""android:orientation=""vertical""android:layout_weight=""1""android:layout_gravity=""center""&gt;&lt;Buttonandroid:id=""@+id/btn_f""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""btn_f""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;&lt;LinearLayoutandroid:layout_width=""wrap_content""android:layout_height=""wrap_content""xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_weight=""1""android:layout_gravity=""center""&gt;&lt;Buttonandroid:id=""@+id/btn_b""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""btn_b""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;&lt;LinearLayoutandroid:layout_width=""wrap_content""android:layout_height=""wrap_content""android:orientation=""vertical""android:layout_weight=""1""android:layout_gravity=""center""&gt;&lt;Buttonandroid:id=""@+id/btn_a""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""btn_a""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;&lt;LinearLayoutandroid:layout_width=""wrap_content""android:layout_height=""wrap_content""android:orientation=""vertical""android:layout_weight=""1""android:layout_gravity=""center""&gt;&lt;Buttonandroid:id=""@+id/settings""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Settings""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","269931","","1288","","2012-07-19 15:48:14","2013-08-17 23:43:03","Evenly spaced button in Layout","<android><xml><layout><button>","3","0","2","",""
"4782573","1","4783120","","2011-01-24 13:32:23","0","454","<p>I am writting an application that display a listView (with an image and some texts). I wrote my adapter, I recyle view and use a viewholder, all is working nice (but not very smoothly).</p><p>But by just having the listview displayed I can see in LogCat  thousand and thousand of objects freed by the gc (~12000 every 3s )It doesn't seems very normal too me.</p><p><img src=""http://i.stack.imgur.com/sBAcG.png"" alt=""enter image description here""></p><p>Is there a way to know what is the class of the most gced object or some kind of logs (or stats) of the gc ? For me to understand why my application is spamming new objects that are immediately gced ?</p>","336657","","","","","2011-01-24 14:27:19","android garbage collector information","<android><listview><garbage-collection>","2","0","1","",""
"4782588","1","4782784","","2011-01-24 13:33:53","1","3117","<p>There is a dialog box with some buttons on top of my activity. When user presses a button, network request occurs, and a progress dialog supposed to be shown. So there must be at least two dialogs at a time, which is not possible (I guess).I see 2 possible solutions here:</p><ul><li>when a button is pressed, hide main dialog and show progress dialog</li><li>wrap everything that pops up in a single dialog and manage it by hand</li></ul><p>Is there any other option?</p>","467290","","","","","2011-01-24 15:21:40","Multiple dialogs at the same time","<android><dialog><popup>","2","0","","",""
"4782641","1","4782863","","2011-01-24 13:40:11","1","508","<p>Hy!!</p><p>I want to have a button at the button and centered on the view in a linearlayout.</p><p>non working example:</p><pre><code>&lt;Button android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_gravity=""bottom"" android:id=""@+id/login_btnew"" android:text=""Make a new Account""&gt;&lt;/Button&gt;</code></pre><p>Solution?</p><p>Thanks</p>","547995","","547995","","2011-01-24 13:53:22","2012-08-15 23:20:16","Draw Button at the buttom of the View","<android>","4","0","","",""
"4782646","1","4791638","","2011-01-24 13:40:30","2","1622","<p>I'm wondering if the following is possible:</p><p>I've an app (service) that stays in background, and gets triggered whenever the user</p><ul><li>Adds/deletes/updates a contact</li><li>Installs/uninstalls an app</li><li>Adds/deletes/renames a file on the FS</li></ul><p>Do you think this is possible guys? (in a proper way of course, if it's possible to do it by hacking and dirty stuff I'd pass)</p><p>I tried to look over the internet a bit but didn't find discussions related to this point.</p><p>What's your guess ?</p>","429059","","418183","","2011-02-08 16:35:47","2011-02-08 16:35:47","Hook some regular tasks?","<android><hook>","2","0","1","",""
"4782687","1","","","2011-01-24 13:43:58","0","1162","<p>I stuck with one problem. actually my screen consists of two tabs. under each tab i have 4-4 activity. i m displaying each activity with the help of activity group in single tab.</p><p>Suppose i m in 1st tab which is active. Under this tab i m on 2nd activity(e.g first activity is list activity and second activity gives the result from the first activity)</p><p><strong>I want when i click on 1st tab again it should show me the first activity again without using back button.?</strong> </p>","383597","","244296","","2011-01-24 13:55:10","2011-01-24 14:37:30","Android tabs event","<android>","2","0","1","",""
"4782707","1","4784283","","2011-01-24 13:46:08","0","892","<p>So im using the commonsware example of sectioned listviews,<a href=""https://github.com/commonsguy/cw-advandroid/blob/master/ListView/Sections/src/com/commonsware/android/listview/SectionedDemo.java"" rel=""nofollow"">here</a>, but i use the multiselection option. The problem is when i get the getCheckedItemPositions(), if i have selected from the second section or above the positions dont really match. Seems that the Section Headers count as a position, so im having a problem of getting the checked items from the second,third...sections.....</p>","382115","","","","","2011-01-24 16:18:50","Section ListView in DIalog with ""simple_list_item_multiple_choice""","<android><listview><dialog><sections>","1","0","","",""
"4782731","1","4787108","","2011-01-24 13:48:22","0","81","<p>I want to develop native mobile application in which user will send invitation to his friend to install another companion native application via a link to the application. But in order for this to work I need to pass a custom token or parameters in the link so that when the companion application is installed by the user's friend, this token is parsed by the companion application to display personalized message ( much like query string parameters are passed in the URL for normal web applications). Is this possible for iPhone and Android native applications?</p>","574122","","","","","2011-01-24 21:00:40","Customized installation of iPhone or Android application","<iphone><android>","1","0","","",""
"4782969","1","4783398","","2011-01-24 14:14:58","1","1144","<p>If I parse the tag that contains <code>&lt;p&gt;Some Text&lt;/p&gt;</code> tag, I get a null pointer exception. Please help me.</p><p>My RSS feed is as follows:</p><pre><code>&lt;quaddeals_conditions&gt;&lt;p&gt;Limit one QuadDeal&lt;/p&gt;&lt;/quaddeals_conditions&gt;</code></pre><p>My code is:</p><pre><code>if (name.equalsIgnoreCase(""quaddeals_conditions"")) {    property.normalize();    conditions = property.getFirstChild().getNodeValue();   }</code></pre>","555221","","1128737","","2012-01-12 10:59:36","2012-12-14 09:44:42","Dom parsing in Android","<android><dom><xml-parsing>","2","1","","",""
"4783002","1","4785607","","2011-01-24 14:18:08","8","3521","<p>I'm trying to programmatically set the ""android:checkMark"" attribute on CheckedTextView items I have in a ListView. When running my application I get the following exception:</p><pre><code>android.content.res.Resources$NotFoundException: Resource ID #0x101021a</code></pre><p>The resource with ID #0x101021a corresponds to <strong>android.R.attr.listChoiceIndicatorMultiple</strong>, which is exactly the value I am passing to my CheckedTextView:</p><pre><code>mCheckedTextView.setCheckMarkDrawable(android.R.attr.listChoiceIndicatorMultiple)</code></pre><p>Isn't this the way to do it from Java? I tried (and succeeded) to trigger the desired behaviour from XML layout:</p><pre><code>&lt;CheckedTextView    android:layout_width=""match_parent""    android:layout_height=""wrap_content""    android:checkMark=""?android:attr/listChoiceIndicatorMultiple""    android:id=""@android:id/text1"" /&gt;</code></pre><p>The thing is that I don't know at compile time if it should be</p><pre><code>android:checkMark=""?android:attr/listChoiceIndicatorMultiple""</code></pre><p>or</p><pre><code>android:checkMark=""?android:attr/listChoiceIndicatorSingle""</code></pre><p>Hence, I need to set these values at runtime.</p>","569885","","","","","2013-05-10 16:15:07","android.content.res.Resources$NotFoundException when programmatically setting android.R.attr.listChoiceIndicatorMultiple","<android><listviewitem><checkedtextview>","1","2","","",""
"4783018","1","","","2011-01-24 14:19:50","1","1361","<p>How can I get the pin for the twitter 4j ?</p><pre><code> accessToken = twitter.getOAuthAccessToken(requestToken, pin);</code></pre><p>please help..!</p>","583014","","","","","2011-02-06 16:14:39","pin in twitter4j","<android><twitter>","3","0","","",""
"4783023","1","4783296","","2011-01-24 14:19:58","1","2361","<p>i am working with TabHost , TabSpec .i want to do some actions(like onClick) when TabSpec is clicked. has anyone tried this i am able to go to another activity with ""home.setIndicator(""Home"")....""  is it possible</p>","413770","","","","","2011-01-24 15:57:17","TabHost , TabSpec - onclick implementation","<android>","2","3","","",""
"4783160","1","4783471","","2011-01-24 14:30:44","1","1280","<p>We've been asked to create a thin web client on Android for a company with an existing web site, existing users.</p><p>They want to send an mms to their users, giving each user their own download URL. This URL will point to an Android apk file that has been created specifically for that user - it will include that user's login, and password, to the website.</p><p><em>i.e. the APK file would have embedded login details.</em></p><p>This would be done in J2ME by storing info in the JDK file.</p><p>I can see a simlar question on <a href=""http://stackoverflow.com/questions/4434811/how-to-update-resources-file-in-apk"">How to update resources file in apk</a> - but not fully answered.</p><p>So:</p><ol><li><p>is there a way to store an ""asset"" in the apk file that will be a text file, and easily editable by unzipping, editing, rezipping the apk file? (looks like answer is no)</p></li><li><p>do you know of any similar problems, or have worked on similar apps? </p></li><li><p>is there advice on how best to accomplish this application? Any sort of embedding of customer info on an automated level would be of interest...</p></li><li><p>would the best option be to set the app to build with an Ant script, and have the client actually customize the source code and build a new app per user? (this has the con that the client gets the source code, which we'd rather not have)</p></li></ol><p>I have scanned apk tagged questions and can't seem to find a solution to this.</p><p>Many thanks,Richard</p>","383414","","383414","","2011-02-09 11:26:29","2011-02-09 11:26:29","Embed login details in APK file, different for each user (or other options?)","<android><apk>","2","3","","",""
"4783192","1","","","2011-01-24 14:34:04","0","616","<p>i try to build Froyo for a given dev board, but i don't know how to configure the source tree, especially where should put the board specific code and the board configuration mkf ile, either in vendor or device ?</p><p>I first put my board specific code and config file in the vendor folder as:</p><p><code>vendor\cpyname\the_product_1\</code>, with BoardConfig.mk that describe my board configuration.</p><p>I then have <code>vendor\cpyname\product\</code> with the_product_1.mk to start the source tree build.</p><p>can't build with tapas, when giving product name (the_product_1), i get an error</p><pre><code>build/core/product_configuration.mkthe_product_1 not found.</code></pre><p>I also try with the device folder, like:</p><pre><code>device\the_product_1\ with BoardConfig.mk, and device\the_product_1\product\ with the_product_1.mk </code></pre><p>tapas give the same result.</p><p>Note that first configuration can build and generate image with <code>make PRODUCT-the_product_1-eng</code></p><p>I also personally find the build process quite obscure and missing documentation.   Please help :)</p><p>Lionel</p>","136735","","","","","2011-11-17 15:30:33","Froyoporting, vendor & device folder, and build for a device with tapas","<android><android-build>","1","1","","",""
"4783255","1","","","2011-01-24 14:37:54","5","738","<p>I am trying to provide Arabic Language support for my Android app. Arabic Language support is provided by default by Android 2.3. So, I want to know  if there are any UI changes that I need to do while providing support for Arabic language in Android.<br>As the letters in Arabic were written from right to left, what are the constraints that I need to follow in Android UI layout design and also in coding?<br>Or else otherwise will Android itself take care of reading the data we entered, whether it is  typed from right to left.</p><p>Can anyone help me in sorting out this issue? <br></p>","429501","","469983","","2012-11-26 13:52:41","2012-11-26 13:52:41","UI design for Arabic Support apps in Android","<android>","2","3","1","",""
"4783304","1","","","2011-01-24 14:44:13","1","644","<p>Where can I get a definitive list of Android 2.2+ phones that don't support Flash?</p><p>I released an app that uses Flash for some features if installed on Android 2.2+ phones, but found out today from a user that the T-Mobile MyTouch 3G has 2.2 but can't get Flash.  At this point I'm going in and adding a check against the Build.MODEL for the MyTouch 3G but I'd like to know if there are other phones I should check for as well.</p>","13070","","","","","2011-01-24 14:56:11","Android 2.2 phones without Adobe Flash support","<android><flash><android-2.2-froyo>","1","0","1","",""
"4783391","1","4784180","","2011-01-24 14:52:37","0","1437","<p>First, sorry for my bad English.</p><p>My question should be quite simple I think, but I didn't find an understandable example on google.</p><p>I'm working on an Android app, which can display a route of several gps points.</p><p>I've succeeded with displaying a start and endneedle on the google maps map.</p><p>Now I would like to show the route as a line between the individual points as well and thats the point where I don't know how to do it. </p><p>I would be really happy if someone could show me a simple example of how I can create line Overlays in Google Maps.</p><p>Thanks for your answers.</p>","587658","","1977672","","2012-05-08 14:19:36","2012-05-08 14:19:36","Android Route Overlay","<android><gps><overlay>","1","0","","",""
"4783623","1","","","2011-01-24 15:17:54","1","1224","<p>I am trying to extend the TableLayout class, such that rows will be populated automatically by the class.  The issue I am having is the rows that I add inside the custom class do not display.</p><p>Ex. within the Activity:</p><pre><code>private TextView getTableCell(String text) {    TextView tv = new TextView(this);    tv.setText(text);    tv.setLayoutParams(new LayoutParams(            LayoutParams.FILL_PARENT,            LayoutParams.WRAP_CONTENT));    return tv;}@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    DatasetTableLayout table = (DatasetTableLayout) findViewById(R.id.table);    TableRow tr = new TableRow(this);    tr.addView(getTableCell(""activity1""));    tr.addView(getTableCell(""activity2""));    tr.addView(getTableCell(""activity3""));    table.addView(tr);</code></pre><p>This successfully adds a row to the table.  However, within my custom class:</p><pre><code>private TextView getTableCell(String text) {    TextView tv = new TextView(context);    tv.setText(text);    tv.setLayoutParams(new LayoutParams(        LayoutParams.WRAP_CONTENT,        LayoutParams.WRAP_CONTENT));    return tv;}private void update() {    TableRow tr = new TableRow(context);    tr.addView(getTableCell(""class1""));    tr.addView(getTableCell(""class2""));    tr.addView(getTableCell(""class3""));    addView(tr);}</code></pre><p><em>does not</em> successfully add a row.  Well, it does add a row, as getChildCount(), and getChildAt() do return this row - but it does not get displayed.</p><p>Am I missing something?</p>","534173","","","","","2011-01-25 08:38:38","Extending TableLayout class - adding rows","<android><android-widget><android-layout>","2","2","","",""
"4783706","1","4784334","","2011-01-24 15:26:29","0","432","<p>I am trying to use DB Visualizer to look at the contents of a SQLite DB.I can look at it via the adb, but the functionality is somewhat limited.I'm running the SDK under Eclipse Galileo version 3.5).Even though DB Visualizer doesn't officially support SQLite, it does work.I downloaded the jdbc driver.The problem I'm having is setting up the connection URL: it needs the location on my PC for the .db file, which is actually in theC:\Documents and Settings....android\avd\avdName\ directory.When the app is running, I can use the Eclipse Window / Show view / File explorerto see the /data/data/packageName/databases/mydb.db name,but the .db file doesn't acually exist in the PC file space.Has anyone had success using DB Visualizer to look at an Android SDK SQlite DB?</p>","523968","","","","","2011-01-24 16:23:44","How do you access an Android SDK DB via DB Visualizer?","<android>","1","1","","",""
"4783710","1","4783838","","2011-01-24 15:26:39","0","234","<p>Im making an app wich for now, parses an url and takes some info from it. I want to use this values to create objects, put them into an arraylist, and show them on screen with a ListView layout.</p><p>Problem comes when i want to asign drawables values fom the object. I want, depending on its values, asign a drawable or another. Heres the code:</p><pre><code>Retransmision retransmision = new Retransmision();retransmision.setIdioma(idioma);retransmision.setTipo(tipo);retransmision.setCalidad(calidad);retransmision.setLink(link);retransmision.setImagenLogo(tipo);retransmision.setImagenCalidad(calidad);retransmisionesDescargadas.add(retransmision);</code></pre><p>I just create the  object and assign some values with its methods. And heres the method wich is throwing nullPointerException:</p><p><pre><code>public void setImagenCalidad(int calidad) {    if (calidad == 0) {    imagenCalidad = context.getResources().getDrawable(R.drawable.desconocida);    } else if(calidad &lt;= 250) {    imagenCalidad = context.getResources().getDrawable(R.drawable.baja);    } else if(calidad &lt;= 500) {    imagenCalidad = context.getResources().getDrawable(R.drawable.media);    } else if(calidad &lt;= 750) {    imagenCalidad = context.getResources().getDrawable(R.drawable.alta);    } else if(calidad &lt;= 1000) {    imagenCalidad = context.getResources().getDrawable(R.drawable.muy_alta);    } else {    imagenCalidad = context.getResources().getDrawable(R.drawable.excelente);    }}</code></pre></p><p>Weird since i use a similar code for method setImagenLogo that seems to work well. And only difference is one gets a String parameter. And the other an int.</p><p>Ps: If it might help, this is the constructor of the retransmision object and its variables:</p><pre><code>Context context;    private String idioma;    private String tipo;    private int calidad;    private String link;    private Drawable imagenLogo;    private Drawable imagenIdioma;    private Drawable imagenCalidad;    public Retransmision() {        idioma = """";        tipo = """";        calidad = 0;        link = """";        imagenLogo = null;        imagenIdioma = null;        imagenCalidad = null;    }</code></pre>","568288","","","","","2011-01-24 15:39:45","Problem when creating an object and setting its variables","<android><object><nullpointerexception><drawable>","1","0","","",""
"4783714","1","4794762","","2011-01-24 15:26:59","2","2673","<p>I'm planning on doing an AR application that will just use GPS technology to get a location, and then use compass/gyroscope for tracking 6DOF viewfinder movements. Its a personal project for my own development, but I'm looking for starting places as its a new field to me so this might be a slightly open ended question with more than 1 right answer. By using GPS I am hoping to simply the development for my first AR application at the cost of its accuracy.</p><p>The idea for this AR is not to use any vision processing (relying on GPS only), and to display 3d models on the screen at roughly correct distances (up to a point) from where the user is standing. It sounds simple given games work in a 3D world with a view point and locations of faces/objects/models etc to draw. My target platform will be mobile devices &amp; tablets potentially running one of these OS's WM6, Phone7 or Android.</p><p>Most of the applications I have seen use markers and use AR-ToolKit or ARTag, and those that use GPS tend to just display a point of interest or a flat box on a screen to state your at a desired location.</p><p>I've done some very limited work with 3D graphics programming, but are there any libraries that you think may be able to get me started on this, rather than building everything from the bottom up. Ignoring the low accuracy of GPS (in regards to AR) I will have a defined point in a 3D space (constantly moving due to GPS fix), and then a defined point in which to render a 3D model in the same 3D space.</p><p>I've seen some examples of applications which are similar but nothing which I can expand on, so can anyone suggest places to start of libraries to use that might be suitable for my project.</p>","432997","","213269","","2011-01-24 15:48:29","2011-01-25 14:40:11","Augmented Reality - Using only GPS","<android><windows-mobile><gps><augmented-reality>","1","2","3","",""
"4783895","1","4784220","","2011-01-24 15:45:20","1","489","<p>I want to start multiple instances of the same <code>(ExpandbleList-)activity</code> using different parameters, so different data is loaded in the lists. These lists are in different tabs of a <code>TabActivity</code>.</p><p>So far it works, but when I update the information in one list, then return to the second list and click on one of the items (or change the screen orientation) this list is repopulated with data from the other list.</p><p>How can I start the activities so that they don't interfere with each others data?</p>","562365","","119895","","2011-01-24 16:19:31","2013-02-09 00:00:02","How to create multiple instances of an activity? - revisited","<android><activity><expandablelistview><multiple-instances><tabactivity>","2","1","","",""
"4783896","1","4783939","","2011-01-24 15:45:21","8","17621","<p>This is my layout:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/LinearLayout1""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical"" &gt;    &lt;LinearLayout        xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/LinearLayout2""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""horizontal"" &gt;        &lt;ImageView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_gravity=""left""            android:layout_marginLeft=""5dip"" /&gt;        &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_gravity=""center_horizontal""            android:textColor=""#ffffff"" &gt;        &lt;/TextView&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/LinearLayout3""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""horizontal"" &gt;        &lt;Button            android:id=""@+id/nazajGumb""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_gravity=""center""            android:text=""@string/roaming_backbtn"" &gt;        &lt;/Button&gt;        &lt;Button            android:id=""@+id/homeBtn""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_gravity=""right""            android:text=""@string/roaming_homebtn"" &gt;        &lt;/Button&gt;    &lt;/LinearLayout&gt;    &lt;Spinner        android:id=""@+id/spinner""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_gravity=""center_horizontal""        android:layout_marginTop=""15dip""        android:prompt=""@string/roaming_spinnerPrompt"" /&gt;    &lt;TextView        android:id=""@+id/tv1""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_gravity=""center_horizontal""        android:text=""Random text""        android:textColor=""#ffffcc"" /&gt;    &lt;Button        android:id=""@+id/testBtn""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_gravity=""center""        android:text=""test"" &gt;    &lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>The positioning of ImageView and TextView in LinearLayout2 and positiong of buttons in LinearLayout3 is not working (using layout gravity). </p><p>What am i missing here?</p>","324417","","1310566","","2013-01-18 13:02:43","2013-01-18 13:02:43","layout_gravity in linear layout","<android><layout><gravity>","2","3","7","",""
"4783960","1","","","2011-01-24 15:51:08","23","47074","<p>So I have this method in one of my Android Activities:</p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event){    if(keyCode == KeyEvent.KEYCODE_BACK)    {        Log.d(""Test"", ""Back button pressed!"");    }    else if(keyCode == KeyEvent.KEYCODE_HOME)    {        Log.d(""Test"", ""Home button pressed!"");    }    return super.onKeyDown(keyCode, event);}</code></pre><p>But, even though the KEYCODE_HOME is valid, the log method never fires. This works for the back button though. Does anyone know why this is and how to get this to work?</p><p>Thanks</p>","143979","","132735","","2012-08-20 19:55:18","2012-09-22 01:38:52","Call method when home button pressed on android","<android><button><menu><android-sdk-1.6>","8","1","10","2012-05-07 12:48:11",""
"4784169","1","4784331","","2011-01-24 16:08:47","5","11072","<p>How to create horizontal progessBar without XML or how to declare XML properties without XML contentView?</p><p>I have layout in .java file and I want to set progressBar to horizontal and set its width/location.</p><pre><code>RelativeLayout fv = new RelativeLayout(this);panel = new Panel(this);fv.addView(panel);ProgressBar pb = new ProgressBar(this);//pb.? - progress bar parametersfv.addView(pb);setContentView(fv);</code></pre><p>Oh, and it can't be a pop-up window. I need progressBar on top of touch-enabled canvas layer..</p>","475861","","","","","2011-01-25 10:24:14","Android - programmatically creating view progressBar","<java><android><layout><progress-bar>","2","2","","",""
"4784341","1","4788928","","2011-01-24 16:24:30","1","5416","<p>I have tried the navigate to the android tool folder and entering the  ""adb shell"" command but it doesn't seem to work.  My terminal seems only to recognize the adb part of the command and gives me an error message.  What am I doing wrong???</p>","497763","","278836","","2011-01-24 16:29:48","2011-01-25 00:51:36","How do you connect your terminal with the Android emulator","<android><connection><terminal><emulator>","1","2","1","",""
"4784420","1","4784496","","2011-01-24 16:32:03","0","767","<p>I have a method that returns a String(let's say the var sprite) and this string is the name of my bitmap img,and i want to use it with BitmapFactory.decodeResource() but i don't know how to combine this since it must be int R.drawable.sprite</p><p>Can this be done?</p>","587377","","","","","2011-01-24 16:37:05","can BitmapFactory.decodeResource(context,int) take context string","<android><image><resources><bitmapfactory>","1","0","","",""
"4784539","1","4784584","","2011-01-24 16:42:36","0","436","<p>Here is an example: </p><pre><code>public class Test extends Activity {    Button button;    public int i;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        button = (Button) findViewById(R.id.Button01);        button.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                i = 10; // How can this be possible?            }        });    }}</code></pre>","397991","","","","","2011-01-24 17:09:21","Why is it allowed to make a non-static reference from static object?","<java><android>","7","1","","",""
"4784608","1","4785091","","2011-01-24 16:48:45","2","429","<p>I'm really having a hard time trying to figure out what's going on here. I have this xml file describing a 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;SurfaceView android:id=""@+id/surface""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_gravity=""center""&gt;    &lt;/SurfaceView&gt;   &lt;TextView android:id=""@+id/text_kb_streamed""             android:layout_width=""fill_parent""              android:layout_height=""wrap_content""             android:textStyle=""bold""              android:text=""Streaming .mp3 Audio Tutorial"" /&gt;   &lt;ProgressBar android:id=""@+id/progress_bar""                android:layout_width=""200px""                 android:layout_height=""wrap_content""                android:layout_alignParentLeft=""true""                style=""?android:attr/progressBarStyleHorizontal""/&gt;   &lt;ImageButton android:id=""@+id/button_play""                android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:layout_marginTop=""5px""                 style=""?android:attr/buttonStyleSmall""                android:src=""@drawable/button_pause"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>But when it comes to get drawn, it just shows an empty black screen. I call setContentView in my activity. Actually, I've found out that if I remove the SurfaceView tag, it gets drawn correctly.</p><p>Can anyone help me out to know what's happening?Thanks</p><p>Edit: Thanks to the answers, I've found out that the SurfaceView is taking all the space so the buttons are not visible. Any ideas on how can I avoid that?Thanks</p>","483362","","483362","","2011-01-24 17:25:05","2011-01-24 17:35:04","XML layout does not show correctly","<android><android-layout><surfaceview>","2","4","","",""
"4784619","1","4784696","","2011-01-24 16:49:57","2","721","<p>I'm planning on developing an app for android that requires a back-end server to sync data with other users of the app. I'm planning on writing this server in standard java running on a unix server.</p><p>I once did this directly between two android devices, in that case I just serialized all the data needed to be sent on both ends.</p><p>However I suspect that the format that Dalvik serializes to and Java SE's format are not compatible. Is this the case? And if it is, what are my alternatives? One thing that popped into my mind was sending raw xml over a socket, but if there are better alternatives I'll be glad to hear them.</p><p>Thanks.</p>","242348","","463304","","2011-01-24 17:57:35","2011-01-24 17:57:35","Dalvik to Java SE communications","<java><android><serialization><dalvik>","6","0","","",""
"4784726","1","4785235","","2011-01-24 16:59:44","1","920","<p>I cannot get rid of the ImageView after setting it (img.setImageResource(R.drawable.xxx);)! I tried everything: </p><pre><code>img.setVisibility(View.INVISIBLE)</code></pre><p>and</p><pre><code>img.setVisibility(View.GONE)</code></pre><p>and</p><pre><code>LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);params.width=0;params.height=0;</code></pre><p>Also searched a lot about this.Can anyone help?</p>","380490","","","","","2011-01-24 17:48:30","Make ImageView disappear after setting it","<android><imageview>","2","1","","",""
"4784874","1","","","2011-01-24 17:13:26","17","26660","<blockquote>  <p><strong>Possible Duplicates:</strong><br>  <a href=""http://stackoverflow.com/questions/3408985/json-array-iteration-in-android-java"">JSON Array iteration in Android/Java</a><br>  <a href=""http://stackoverflow.com/questions/1568762/jsonarray-with-java"">JSONArray with Java</a>  </p></blockquote><p>Is it possible to iterate through JSONArray object using Iterator?</p>","397991","","397991","","2011-01-24 17:18:37","2011-01-24 17:21:49","Is it possible to iterate through JSONArray?","<java><android>","2","1","","2011-01-24 17:25:43",""
"4785012","1","","","2011-01-24 17:27:18","-1","153","<p>I'm not sure if this is too vague or not, but it's worth a shot.</p><p>I'm a third year Computer Science minor at school, and would love to start creating apps on the Android market to [hopefully] generate a small second income.</p><p>I've recently downloaded the SDK and everything for Android into Eclipse, and am ready to get started. However, I'm not sure what my first, second, or even third step should be.</p><p>I'd like to create a game (that of which I am not sure of yet, but by the time I figure out how to get started I will have thought of one). I'm not an experienced programmer -- I have taken two Java courses and one C++ data structures course, so I do have at least a brief background.</p><p>So, any help I could get would be very appreciated. Also, if there is a different place I should be going to for help like this, please, point me in the right direction.</p><p>Thanks!</p>","587862","","1228","","2013-08-13 14:31:55","2013-08-13 14:31:55","Would anyone be interested in walking me through developing an app from start to finish?","<android>","2","3","","2013-08-14 09:37:58",""
"4785014","1","","","2011-01-24 17:27:32","0","570","<p>I want add some drm protection (forward lock) to mp3 file to use it in android phone. </p><p>Can i encrypt my mp3 file with an application and push it in the android phone ?</p><p>OR </p><p>I need to implement the application to encrypt the file and after that push it in the andoird phone? (if i need to implement the encrypter - Wich library (API) i need to use ?)</p><p>Thank's a lot and excuz my english</p><hr><p>OK! more exemples.</p><p><em>case 1:</em>User get file from server (music file1.mp3) in android phone !User use it like ringtones but can't share it or download it in computer. </p><p><em>case 2:</em>User get file from server (picture file1.png) in android phone !User use it like wallpapers but can't share it or download it in computer. </p><p><strong>PROBLEM :how can i implement -> the user can't share the file or download it in computer ?</strong></p>","587853","","50049","","2011-08-14 01:40:59","2011-08-14 01:40:59","forward lock mp3 file in Android 2.x","<android>","1","0","","",""
"4785050","1","","","2011-01-24 17:30:54","1","2285","<p>I want to use speech to text but if the result is not good, I want to use save the audio? If the result is reasonably good then the user will select to save text notes if not they will will select to save original audio. I don't want users to rerecord. I want to use the audio from speech to text. Let me know if any of you know how I could achieve this?</p>","399473","","","","","2011-01-26 00:28:52","Android: record and convert speech to text","<android>","1","1","","",""
"4785182","1","4785972","","2011-01-24 17:43:45","2","1234","<p>I have a little issues with an GLSurfaceView, when I start my Activity I make the GLSurfaceView invisible with this line of code:</p><pre><code>glSurface.setVisibility(View.INVISIBLE);</code></pre><p>During this time I start an AsyncTask which downloads an Image from network, at this time, if I press the back button I meet this Exception:</p><pre><code>java.lang.NullPointerExceptionE/AndroidRuntime( 1847):    at android.opengl.GLSurfaceView.onDetachedFromWindow(GLSurfaceView.java:530)E/AndroidRuntime( 1847):    at android.view.View.dispatchDetachedFromWindow(View.java:6033)E/AndroidRuntime( 1847):    at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1156)E/AndroidRuntime( 1847):    at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1156)E/AndroidRuntime( 1847):    at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1156)E/AndroidRuntime( 1847):    at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1156)E/AndroidRuntime( 1847):    at android.view.ViewRoot.dispatchDetachedFromWindow(ViewRoot.java:1630)E/AndroidRuntime( 1847):    at android.view.ViewRoot.doDie(ViewRoot.java:2671)E/AndroidRuntime( 1847):    at android.view.ViewRoot.die(ViewRoot.java:2641)E/AndroidRuntime( 1847):    at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:218)E/AndroidRuntime( 1847):    at android.view.Window$LocalWindowManager.removeViewImmediate(Window.java:436)E/AndroidRuntime( 1847):    at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3684)E/AndroidRuntime( 1847):    at android.app.ActivityThread.access$2900(ActivityThread.java:125)E/AndroidRuntime( 1847):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)E/AndroidRuntime( 1847):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime( 1847):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 1847):    at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime( 1847):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 1847):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 1847):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime( 1847):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidR</code></pre><p>What's wrong?</p>","554892","","","","","2011-01-24 19:01:38","GLSurfaceView.onDetachedFromWindow","<android>","1","0","1","",""
"4785184","1","4785319","","2011-01-24 17:43:54","1","246","<p>I have this setup in an iPhone app:</p><p>There is always a MKMapView on screen &amp; a additional UI layer on top. The upper UI layer is managed by a simple state system. Each state is a UIViewController and has a .nib attached to it containing the layout.</p><p>I'm very new to Android development. What is the best way to build this on Android?</p><p>So far I see two options:<br>1. Have a single Activity &amp; insert/remove layouts as the states change.<br>2. Have multiple Activities and have a layout for each. Is there then a way to keep a single MapView around beneath, without having one per activity?  </p><p>Thanks.</p>","134595","","","","","2011-01-24 17:57:06","Porting iPhone UI with multiple screens over a map to Android. Use multiple Activities?","<iphone><android><android-layout>","1","0","","",""
"4785196","1","4785974","","2011-01-24 17:45:30","1","2809","<p>So I am trying to get a grip around this <code>OAuth</code> for twitter using the <code>Twitter4J</code> library.</p><p>I will give a little bit of background. </p><p>I set up my Twitter developer account using the Browser method and callbacks (that I have set up as an intent-filter) in my <code>AndroidManifest.xml</code>.</p><p>I have an activity that entirely handles my twitter authentication.</p><pre><code>@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //set up the datahelper    dh = new DataHelper(this, null);    tae = dh.GetAuthenticationObject();    setContentView(R.layout.main);}@Overrideprotected void onResume() {    super.onResume();    selectOption(getIntent());}public void selectOption(Intent intent) {    Uri uri = intent.getData();    if (uri != null &amp;&amp; uri.toString().startsWith(CALLBACKURL) &amp;&amp; tae.hasBeenAuthenticatedTwitter()) {                   completeAuth(intent);               } else {        doOauth();    }}private void doOauth() {    try {        consumer = new CommonsHttpOAuthConsumer(Enums.TWITTER_APPLICATION_KEY,                Enums.TWITTER_APPLICATION_SECTRET);        provider = new DefaultOAuthProvider(                Enums.TWITTER_REQUEST_TOKEN_URL,                Enums.TWITTER_ACCESS_TOKEN_URL,                Enums.TWITTER_AUTHORIZE_URL);        String authUrl = provider.retrieveRequestToken(                consumer, CALLBACKURL);        tae.TwitterToken =  consumer.getToken();        tae.TwitterTokenSecret = consumer.getTokenSecret();        dh.SaveAuthenticationObject(tae);        this.startActivity(new Intent(Intent.ACTION_VIEW, Uri                .parse(authUrl)));    } catch (Exception e) {        Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();    }}/** * After use authorizes this is the function where we get back callbac with * user specific token and secret token. You might want to store this token * for future use. */public void completeAuth(Intent intent) {    Uri uri = intent.getData();    if (uri != null &amp;&amp; uri.toString().startsWith(CALLBACKURL)) {        tae = dh.GetAuthenticationObject();        String verifier = uri                .getQueryParameter(oauth.signpost.OAuth.OAUTH_VERIFIER);        tae.TwitterVerifier = verifier;        dh.SaveAuthenticationObject(tae);       }    Intent settingsIntent = new Intent(this, com.undetowdevelopment.kontakt.Settings.class);    settingsIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);    settingsIntent.putExtra(""REQUEST_CODE"", Enums.REQUEST_CODE_TWITTER_LOGIN);    settingsIntent.putExtra(""RESULT_CODE"", Activity.RESULT_OK);    startActivity(settingsIntent);  }</code></pre><p>This class does exactly what I expect. It opens up the Twitter authentication page, returns to the activity and I save the <code>Token &amp; Secret</code> to my Shared Preferences.</p><p>My <code>AndroidManifest.xml</code> looks like: </p><pre><code>    &lt;activity android:name="".TwitterSuccess"" android:label=""@string/app_name"" android:launchMode=""singleTop""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW""&gt;&lt;/action&gt;            &lt;category android:name=""android.intent.category.DEFAULT""&gt;&lt;/category&gt;            &lt;category android:name=""android.intent.category.BROWSABLE""&gt;&lt;/category&gt;            &lt;data android:scheme=""myapp"" android:host=""mainactivity""/&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>When my application launches however, I would like to check if the person is authenticated and not have to ask the user to authenticate again all the time.</p><p>From all my activities, I have a method that returns a Twitter object that I would like to use to set the status or to get the friends of the user.</p><p>I use the following method to do this:</p><pre><code>public Twitter getTwitterObject(){    AuthenticationEntity ae = GetAuthenticationObject();    CommonsHttpOAuthConsumer consumer = new CommonsHttpOAuthConsumer(Enums.TWITTER_APPLICATION_KEY, Enums.TWITTER_APPLICATION_SECTRET);     //Set the requestToken and the tokenSecret that you got earlier by calling retrieveRequestToken.    consumer.setTokenWithSecret(ae.TwitterToken, ae.TwitterTokenSecret);    //The provider object is lost, too, so instantiate it again.    DefaultOAuthProvider provider = new DefaultOAuthProvider(            Enums.TWITTER_REQUEST_TOKEN_URL,            Enums.TWITTER_ACCESS_TOKEN_URL,            Enums.TWITTER_AUTHORIZE_URL);    //Now that's really important. Because you don't perform the retrieveRequestToken method at this moment, the OAuth method is not detected automatically (there is no communication with Twitter). So, the default is 1.0 which is wrong because the initial request was performed with 1.0a.    provider.setOAuth10a(true);    try {        provider.retrieveAccessToken(consumer, ae.TwitterVerifier);    } catch (Exception e) {        Toast.makeText(mContext, e.getMessage(), Toast.LENGTH_LONG).show();        e.printStackTrace();    }    Twitter twitter = new TwitterFactory().getInstance();    twitter.setOAuthConsumer(Enums.TWITTER_APPLICATION_KEY, Enums.TWITTER_APPLICATION_SECTRET);    twitter.setOAuthAccessToken(new AccessToken(consumer.getToken(), consumer.getTokenSecret()));    return twitter;}</code></pre><p>Now this works fine if the user has just logged in, but if I launch the application again (which should not matter because I use only data from my static variables and Shared Preferences), I cannot authenticate and I get the following exception:</p><pre><code>01-24 11:41:54.075: WARN/System.err(14612): oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: http://twitter.com/oauth/access_token01-24 11:41:54.075: WARN/System.err(14612):     at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:214)01-24 11:41:54.075: WARN/System.err(14612):     at oauth.signpost.AbstractOAuthProvider.retrieveAccessToken(AbstractOAuthProvider.java:97)01-24 11:41:54.075: WARN/System.err(14612):     at com.undetowdevelopment.kontakt.helpers.DataHelper.getTwitterObject(DataHelper.java:129)01-24 11:41:54.075: WARN/System.err(14612):     at com.undetowdevelopment.kontakt.Settings.checkTwitterStatus(Settings.java:118)01-24 11:41:54.075: WARN/System.err(14612):     at com.undetowdevelopment.kontakt.Settings.setUIComponents(Settings.java:60)01-24 11:41:54.075: WARN/System.err(14612):     at com.undetowdevelopment.kontakt.Settings.onCreate(Settings.java:39)01-24 11:41:54.075: WARN/System.err(14612):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069)01-24 11:41:54.085: WARN/System.err(14612):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2751)01-24 11:41:54.085: WARN/System.err(14612):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2803)01-24 11:41:54.085: WARN/System.err(14612):     at android.app.ActivityThread.access$2300(ActivityThread.java:135)01-24 11:41:54.085: WARN/System.err(14612):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)01-24 11:41:54.085: WARN/System.err(14612):     at android.os.Handler.dispatchMessage(Handler.java:99)01-24 11:41:54.085: WARN/System.err(14612):     at android.os.Looper.loop(Looper.java:144)01-24 11:41:54.085: WARN/System.err(14612):     at android.app.ActivityThread.main(ActivityThread.java:4937)01-24 11:41:54.085: WARN/System.err(14612):     at java.lang.reflect.Method.invokeNative(Native Method)01-24 11:41:54.085: WARN/System.err(14612):     at java.lang.reflect.Method.invoke(Method.java:521)01-24 11:41:54.085: WARN/System.err(14612):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-24 11:41:54.085: WARN/System.err(14612):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-24 11:41:54.085: WARN/System.err(14612):     at dalvik.system.NativeStart.main(Native Method)01-24 11:41:54.085: WARN/System.err(14612): Caused by: java.io.FileNotFoundException: http://twitter.com/oauth/access_token01-24 11:41:54.085: WARN/System.err(14612):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1162)01-24 11:41:54.085: WARN/System.err(14612):     at oauth.signpost.basic.HttpURLConnectionResponseAdapter.getContent(HttpURLConnectionResponseAdapter.java:18)01-24 11:41:54.085: WARN/System.err(14612):     at oauth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvider.java:228)01-24 11:41:54.085: WARN/System.err(14612):     at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:189)01-24 11:41:54.085: WARN/System.err(14612):     ... 18 more01-24 11:41:54.885: WARN/System.err(14612): http://api.twitter.com/1/account/verify_credentials.json?include_entities=falseRelevant discussions can be on the Internet at:01-24 11:41:54.885: WARN/System.err(14612):     http://www.google.co.jp/search?q=2486d84d or01-24 11:41:54.885: WARN/System.err(14612):     http://www.google.co.jp/search?q=0d00203c01-24 11:41:54.885: WARN/System.err(14612): TwitterException{exceptionCode=[2486d84d-0d00203c 175a68e8-9303e317], statusCode=-1, retryAfter=0, rateLimitStatus=null, version=2.1.12-SNAPSHOT(build: e7bec3eec13cedc774926ee24f4c5368d218c9d4)}01-24 11:41:54.885: WARN/System.err(14612):     at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:214)01-24 11:41:54.885: WARN/System.err(14612):     at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:75)01-24 11:41:54.885: WARN/System.err(14612):     at twitter4j.internal.http.HttpClientWrapper.get(HttpClientWrapper.java:103)01-24 11:41:54.885: WARN/System.err(14612):     at twitter4j.Twitter.verifyCredentials(Twitter.java:1397)01-24 11:41:54.885: WARN/System.err(14612):     at twitter4j.Twitter.getScreenName(Twitter.java:191)01-24 11:41:54.885: WARN/System.err(14612):     at com.undetowdevelopment.kontakt.Settings.checkTwitterStatus(Settings.java:120)01-24 11:41:54.885: WARN/System.err(14612):     at com.undetowdevelopment.kontakt.Settings.setUIComponents(Settings.java:60)01-24 11:41:54.885: WARN/System.err(14612):     at com.undetowdevelopment.kontakt.Settings.onCreate(Settings.java:39)01-24 11:41:54.885: WARN/System.err(14612):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069)01-24 11:41:54.885: WARN/System.err(14612):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2751)01-24 11:41:54.885: WARN/System.err(14612):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2803)01-24 11:41:54.885: WARN/System.err(14612):     at android.app.ActivityThread.access$2300(ActivityThread.java:135)01-24 11:41:54.885: WARN/System.err(14612):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)01-24 11:41:54.885: WARN/System.err(14612):     at android.os.Handler.dispatchMessage(Handler.java:99)01-24 11:41:54.885: WARN/System.err(14612):     at android.os.Looper.loop(Looper.java:144)01-24 11:41:54.885: WARN/System.err(14612):     at android.app.ActivityThread.main(ActivityThread.java:4937)01-24 11:41:54.885: WARN/System.err(14612):     at java.lang.reflect.Method.invokeNative(Native Method)01-24 11:41:54.885: WARN/System.err(14612):     at java.lang.reflect.Method.invoke(Method.java:521)01-24 11:41:54.885: WARN/System.err(14612):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-24 11:41:54.885: WARN/System.err(14612):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-24 11:41:54.885: WARN/System.err(14612):     at dalvik.system.NativeStart.main(Native Method)01-24 11:41:54.885: WARN/System.err(14612): Caused by: java.io.FileNotFoundException: http://api.twitter.com/1/account/verify_credentials.json?include_entities=false01-24 11:41:54.885: WARN/System.err(14612):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1162)01-24 11:41:54.885: WARN/System.err(14612):     at twitter4j.internal.http.HttpResponseImpl.&lt;init&gt;(HttpResponseImpl.java:47)01-24 11:41:54.895: WARN/System.err(14612):     at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:178)01-24 11:41:54.895: WARN/System.err(14612):     ... 20 more01-24 11:41:54.995: WARN/InputManagerService(99): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@46113ee8 (uid=10060 pid=14093)</code></pre><p>Like I mentioned, when I have just completed authentication, everything works fine, but If I launch my application again, I get this message.</p><p>I am using an <code>HTC Incredible</code>, running Android 2.2. The application is being developed for Android 1.6+.</p><p>Any comments or help will be greatly appreciated!</p><p>Best,</p><p>Ignus</p>","575820","","670834","","2011-07-21 11:00:24","2011-07-21 11:00:24","Persistent OAuth using Android and Twitter4J","<android><twitter-oauth>","1","0","1","",""
"4785261","1","","","2011-01-24 17:50:49","0","273","<p>I want to display editext which is slightly inclined not completely horizontal. Does anyone know how can I do that?</p>","445541","","","","","2011-01-24 18:10:08","Inclined EditText in Android?","<android><edittext>","1","1","","",""
"4785273","1","","","2011-01-24 17:52:31","3","568","<p>I want to know how to disable and enable forward menu button as in android's private browser.I am writing an app where I am displaying 3 webviews and I want to incorporate the basic functionality of android's own browser options.Everything is working fine as of now w.r.t functionality. Only thing is 'forward'menu item is always enabled.I have mentioned conditoin too for if canGoFwd then goFwd. Thing is, I have defined menu items separately and wrote forward function separately, problem is dynamically changing states for 'forward' button</p>","466590","","","","","2013-03-02 12:28:42","android webview forward button","<android><webview><forward>","1","0","","",""
"4785452","1","4785576","","2011-01-24 18:08:16","7","927","<p>I will try to keep this short, but I need some advice.</p><p>I work on a team that is developing applications for android, iphone, and wp7 in parallel.We have a design team that comes up with a single design for all three platforms.</p><p>The latest application’s design is more marketing than productivity.  The original POC for this app was done on the iphone.  The design is very animation centric and most state changes are seamless (things will animate on and off the screen during state transitions).</p><p>If I keep developing against this design it means I will have to have everything in a single activity.  So far, this has been a major headache.  To my knowledge, dividing your application into activities is almost required.  I could try to dynamically load and unload views as I change states but this doesn’t seem right.</p><p>I see where the design team is coming from where they want all these state changes to be seamless, but I don’t think this is right for android.</p><p>I would like to know what makes most sense.  Should the design change to incorporate multiple activities or would it be worth trying to make this work.</p>","495079","","","","","2012-08-22 04:24:35","Single Activity Application","<android>","4","1","","",""
"4785524","1","4786624","","2011-01-24 18:16:48","1","221","<p>The description of Android Bundle says:</p><blockquote>  <p>Bundles are Android's way of maintaining and passing program state. The system is constructed around the assumption that any program (characterized by a collection of activities) may be preempted at any time, and if the system resources are low, may be subsequently killed. To handle this difficulty, a Bundle called an icicle is saved whenever the activity is preempted.</p>    <p>Like with a hash table or dictionary, items added to the Bundle are given a key which is later used to retrieve the data (using data-type specific methods like getCharacter(String key) and getParcelable(String key)). When you are creating activities, be sure to save any important state information into the icicle given to onFreeze so that you can restore your program in onCreate if it is killed while suspended. </p></blockquote><p>Is Bundle the same as Session[] in .NET?</p>","437039","","","","","2012-01-03 18:45:31","Android Bundle = .NET Session[]?","<android><bundle>","1","0","1","",""
"4785525","1","","","2011-01-24 18:16:51","0","1918","<p>Is it possible to enable or disable the GPS from the Android command line/terminal (<strong>not</strong> from Java source).   Im ok with the solution requiring root privs, as I understand there are security issues with random apps enabling the GPS against the user's wishes. I see a ""run-as"" command on my EVO, but can't find much about the command to see if that would be useful.</p><p>Edit:  I guess a more ""generic"" form of the question is this:  Can I run a particular app (davlik vm ) as any particular user if I have root privs?  The system included widget to switch on/off GPS works because it runs as the same user as the system. Could I have my own app run as the system user in some way?</p>","574682","","574682","","2011-01-24 20:38:08","2011-01-24 20:38:08","Enable/Disable GPS from Android CLI","<android>","2","1","","",""
"4785544","1","4785877","","2011-01-24 18:18:16","10","15125","<p>How do i make a image clickable? I have tried some ways, but without success. Here's the last code i tried (it's clickable but gets error):</p><pre><code>    ImageView btnNew = (ImageView) findViewById(R.id.newbutton);    btnNew.setOnClickListener(new View.OnClickListener() {          @Override          public void onClick(View v) {            // do stuff          }        });      </code></pre><p>and here's the part from xml:</p><pre><code>    &lt;ImageView     android:src=""@drawable/tbnewbutton""     android:text=""@string/hello""    android:layout_width=""wrap_content""    android:layout_alignParentRight=""true""    android:id=""@+id/newbutton""    android:clickable=""true""    android:onClick=""clickImage""    android:layout_height=""wrap_content""    android:layout_alignParentTop=""true"" /&gt;</code></pre><p>When running this code, and clicking the image i get this error:</p><blockquote>  <p>01-24 19:14:09.534: ERROR/AndroidRuntime(1461): java.lang.IllegalStateException: Could not find a method clickImage(View) in the activity</p></blockquote><p><strong>HERE'S THE SOLUTION:</strong></p><p>The XML:</p><pre><code>    &lt;ImageButton    android:src=""@drawable/tbnewbutton""     android:text=""@string/hello""    android:layout_width=""wrap_content""    android:layout_alignParentRight=""true""    android:id=""@+id/newbutton""    android:clickable=""true""    android:onClick=""clickNew""    android:layout_height=""wrap_content""    android:layout_alignParentTop=""true""    android:background=""@null"" /&gt;</code></pre><p>The code :</p><pre><code>    public void clickNew(View v){    Toast.makeText(this, ""Show some text on the screen."", Toast.LENGTH_LONG).show();}</code></pre>","484146","","484146","","2011-01-24 19:13:49","2011-01-24 19:13:49","Clickable image - android","<android><image><click><clickable-image>","5","0","3","",""
"4785571","1","","","2011-01-24 18:21:11","4","1862","<p>For a custom AlertDialog, can I override the positive button to NOT close the dialog? instead I want to run some edit checks and keep the dialog open if my checks fail.</p><pre><code>protected Dialog onCreateDialog(int id) {  Dialog alertDialog = null;  builder = new AlertDialog.Builder(this);  switch(id) {    case LOGIN_USERID_BLANK:      builder.setMessage((String)getString(R.string.username_not_blank));      builder.setPositiveButton((String)getString(R.string.ok), new DialogInterface.OnClickListener() {      public void onClick(DialogInterface dialog, int whichButton) {      // Can I do something here so that the dialog does not close?}});</code></pre><p>break;</p>","524140","","","","","2013-07-21 14:00:55","AlertDialog - how can I run checks when user hits 'OK'","<android><alertdialog>","4","0","1","",""
"4785628","1","4785692","","2011-01-24 18:27:18","8","905","<p>I am programing an Android app, and would like my program to read a random line of a file. How would I go about doing that?</p>","551878","","","","","2011-01-24 18:43:29","Java - Random line read","<java><android><file-io>","4","0","1","",""
"4785694","1","6117469","","2011-01-24 18:33:56","0","717","<p>I have the following situation with my Android application:</p><p>Any time I open up a new activity with a MapView, runOnFirstFix() will execute and my location will be shown on the map.  This is good.  I have another situation, however, when I will search for an address on another activity.  The search will then open up a new instance of the MapView activity, and runOnFirstFix() will run, immediately following with onLocationChanged() which will query the searched location.</p><p>Usually, this works fine.  There are some times when the onLoationChanged() will run BEFORE the runOnFirstFix(), and the result will show my location instead of the searched location.</p><p>It seems like there are two threads competing with each other.  Does anyone have any recommendations on how to handle this?</p><p>Thanks!</p>","123891","","569101","","2013-09-09 09:19:28","2013-09-09 09:19:28","Android help with MapView and runOnFirstFix()","<android><multithreading><google-maps>","1","0","","",""
"4785732","1","4785954","","2011-01-24 18:36:51","1","1272","<p>I have a web page that displays on the Android and I would like to make the android not recreate the 1000+ pixel wide layout that is typical My layout will work well with only 300px or less. How can I tell this to the Android Browser?</p>","463304","","","","","2011-01-24 19:00:16","Android browser: Is it possible to have a custom zoom level for my web page?","<android><browser><zoom>","1","0","","",""
"4785895","1","","","2011-01-24 18:53:50","3","1069","<p>How much text can be set in the textview for a particular text string with a particular font and size, so that the textview doesn't need to scroll. I mean how much text can be fit inside an TextView, without the need for scrolling.This is similar to <a href=""http://stackoverflow.com/questions/3409271/how-do-i-determine-how-much-text-will-fit-in-a-textview-in-android"">http://stackoverflow.com/questions/3409271/how-do-i-determine-how-much-text-will-fit-in-a-textview-in-android</a>, but I am not able to find a working solution. Please help.</p>","61821","","21234","","2011-01-25 11:11:47","2011-02-02 15:01:09","How much text can be set in the TextView, so that it doen't need to scroll","<android><layout><textview>","4","0","1","",""
"4785936","1","","","2011-01-24 18:58:30","2","3330","<p>Im trying to get the example from <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ExpandableList1.html"" rel=""nofollow"">Android developer</a> up and running. Im using the second example class. </p><p>From the line:</p><pre><code>       TextView textView = new TextView(ExpandableList1.this);</code></pre><p>im getting the following error in eclipse: </p><pre><code>       ExpandableList01 cannot be resolved to a type</code></pre><p>Im really a beginner and have been struggeling really hard to manage to make a supersimple expandable listview, but im not getting anywhere. Anyone?</p><p>Code block causing error:</p><pre><code>   public TextView getGenericView() {        // Layout parameters for the ExpandableListView        AbsListView.LayoutParams lp = new AbsListView.LayoutParams(                ViewGroup.LayoutParams.MATCH_PARENT, 64);        TextView textView = new TextView(ExpandableList1.this);        textView.setLayoutParams(lp);        // Center the text vertically        textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);        // Set the text starting position        textView.setPadding(36, 0, 0, 0);        return textView;    }</code></pre><p>Edit, more code..</p><p>ExpandableList1.java: </p><pre><code>package com.test.exlist;import android.app.ExpandableListActivity;import android.os.Bundle;import android.view.ContextMenu;import android.view.MenuItem;import android.view.View;import android.view.ContextMenu.ContextMenuInfo;import android.widget.BaseExpandableListAdapter;import android.widget.ExpandableListAdapter;import android.widget.ExpandableListView;import android.widget.TextView;import android.widget.Toast;import android.widget.ExpandableListView.ExpandableListContextMenuInfo;//import com.example.android.apis.R;public class ExpandableList1 extends ExpandableListActivity {    ExpandableListAdapter mAdapter;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        // Set up our adapter        mAdapter = new MyExpandableListAdapter();        setListAdapter(mAdapter);        registerForContextMenu(getExpandableListView());    }    @Override    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {        menu.setHeaderTitle(""Sample menu"");        menu.add(0, 0, 0, R.string.expandable_list_sample_action);    }    @Override    public boolean onContextItemSelected(MenuItem item) {        ExpandableListContextMenuInfo info = (ExpandableListContextMenuInfo) item.getMenuInfo();        String title = ((TextView) info.targetView).getText().toString();        int type = ExpandableListView.getPackedPositionType(info.packedPosition);        if (type == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {            int groupPos = ExpandableListView.getPackedPositionGroup(info.packedPosition);             int childPos = ExpandableListView.getPackedPositionChild(info.packedPosition);             Toast.makeText(this, title + "": Child "" + childPos + "" clicked in group "" + groupPos,                    Toast.LENGTH_SHORT).show();            return true;        } else if (type == ExpandableListView.PACKED_POSITION_TYPE_GROUP) {            int groupPos = ExpandableListView.getPackedPositionGroup(info.packedPosition);             Toast.makeText(this, title + "": Group "" + groupPos + "" clicked"", Toast.LENGTH_SHORT).show();            return true;        }        return false;    }}</code></pre><hr><p>MyExpandableListAdapter.java:</p><pre><code>package com.test.exlist;    import android.view.Gravity;import android.view.View;import android.view.ViewGroup;import android.widget.AbsListView;import android.widget.BaseExpandableListAdapter;import android.widget.TextView;import com.test.exlist.ExpandableList1;public class MyExpandableListAdapter extends BaseExpandableListAdapter {        // Sample data set.  children[i] contains the children (String[]) for groups[i].        private String[] groups = { ""People Names"", ""Dog Names"", ""Cat Names"", ""Fish Names"" };        private String[][] children = {                { ""Arnold"", ""Barry"", ""Chuck"", ""David"" },                { ""Ace"", ""Bandit"", ""Cha-Cha"", ""Deuce"" },                { ""Fluffy"", ""Snuggles"" },                { ""Goldy"", ""Bubbles"" }        };        public Object getChild(int groupPosition, int childPosition) {            return children[groupPosition][childPosition];        }        public long getChildId(int groupPosition, int childPosition) {            return childPosition;        }        public int getChildrenCount(int groupPosition) {            return children[groupPosition].length;        }        public TextView getGenericView() {            // Layout parameters for the ExpandableListView            AbsListView.LayoutParams lp = new AbsListView.LayoutParams(                    ViewGroup.LayoutParams.MATCH_PARENT, 64);            TextView textView = new TextView(ExpandableList1.this);            textView.setLayoutParams(lp);            // Center the text vertically            textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);            // Set the text starting position            textView.setPadding(36, 0, 0, 0);            return textView;        }        public View getChildView(int groupPosition, int childPosition, boolean isLastChild,                View convertView, ViewGroup parent) {            TextView textView = getGenericView();            textView.setText(getChild(groupPosition, childPosition).toString());            return textView;        }        public Object getGroup(int groupPosition) {            return groups[groupPosition];        }        public int getGroupCount() {            return groups.length;        }        public long getGroupId(int groupPosition) {            return groupPosition;        }        public View getGroupView(int groupPosition, boolean isExpanded, View convertView,                ViewGroup parent) {            TextView textView = getGenericView();            textView.setText(getGroup(groupPosition).toString());            return textView;        }        public boolean isChildSelectable(int groupPosition, int childPosition) {            return true;        }        public boolean hasStableIds() {            return true;        }</code></pre><p>}</p>","580657","","580657","","2011-01-24 22:01:08","2011-01-24 22:29:04","Android expandablelist, example, error","<android><expandablelistview>","2","2","","",""
"4785938","1","4786176","","2011-01-24 18:58:45","2","200","<p>First some background info and parameters of what I am looking for.</p><ul><li>The application has several activities that need access to a single list.  I am using the <a href=""http://developer.android.com/reference/android/app/Application.html"" rel=""nofollow"">Application</a> class in order to maintain this list across all of the activities.</li><li>The list is a list of a custom object.</li><li>There is one activity that has a ListView to show the items in this list.</li><li>There are other activities that need to be able to access this list, but do not show a ListView.</li><li>The list may be sorted or filtered.</li><li>The list can be updated (add, remove, update content) from a background thread at any time and those changes should be reflected immediately when viewing the list.</li></ul><p>So far my approach is to have the list managed via methods in the Application, including managing any updates to the list.  If the user is currently in the Activity with the ListView in it, it is listening for updates to the list.  When it hears an update it copies the list from the Application and sends it to the ListViews custom ArrayAdapter.  The ArrayAdapter takes this list copy and replaces the base list, calls the current sort and filter on it and then replaces the list that is actually displayed in the list and calls <code>notifyDataSetChanged()</code>.  This is all to avoid any issues the Adapter will have if the list changes from off the UI Thread or without having <code>notifyDataSetChanged()</code> called.</p><p>This all works just fine, the problem is that with this approach there are multiple copies of the same list which decreases the usability of this list in other places and creates unneeded memory use.  It also can create a lot of copying if a lot of updates come in a certain interval.</p><p>So I am looking to see if anyone else has any approaches that would allow the ListView to reference the main list source directly but still avoid issues with updating from off the UI thread?</p><p>Thanks</p>","445348","","","","","2011-01-24 19:26:14","What is a good approach for a ListView that is updated regularly from a background thread and maintained across several activities?","<android><listview><android-arrayadapter>","1","0","1","",""
"4785948","1","","","2011-01-24 18:59:34","0","130","<p>I have two Textviews (A and B) that display HTML text. They have the same text, but different text size.Can I do the following:Scroll textview A, and when it stops, texview B will show the same paragraph?In same context - can I use HTML bookmarks (IDs)?</p><p>P.S. I do not want to use Webviews!</p><p>Thanks in advance</p>","380490","","546999","","2011-01-24 19:23:07","2011-01-24 19:23:07","Sync between two TextViews","<android><html><textview>","1","0","","",""
"4786044","1","","","2011-01-24 19:09:29","0","539","<p>I have extend a View and wrote lot's of code inside,in there i've handle the results from the database!my problem is that i get an error from eclipse when i try to use startManagingCursor(cursor) and tells me to create a method with this name!</p><p>I think that i must be in a ListActivity to use it but i'm not sure...Can i use it and in a custom View?and how?</p>","587377","","","","","2011-01-24 19:09:29","startManagingCursor() problem in a custom View","<android><sqlite><view>","0","2","","",""
"4786059","1","4786093","","2011-01-24 19:11:51","0","1089","<p>I want to change the origin of my OpenGL origin. Pictures will explain:</p><p>This is how it is now:</p><p><img src=""http://i.stack.imgur.com/KUi78.png"" alt=""As now""></p><p><strong>This is how I want it:</strong></p><p><img src=""http://i.stack.imgur.com/rRevs.png"" alt=""enter image description here""></p><p>Current code</p><pre><code>gl.glViewport(0, 0, width, height); gl.glMatrixMode(GL10.GL_PROJECTION);gl.glLoadIdentity(); GLU.gluPerspective(gl, 45.0f,    (float)width / (float)height, 0.1f, 100.0f); gl.glMatrixMode(GL10.GL_MODELVIEW); gl.glLoadIdentity();</code></pre>","386562","","44729","","2011-01-24 19:46:48","2011-01-24 19:46:48","Change OpenGL origin","<java><android><opengl-es>","1","0","","",""
"4786077","1","4787537","","2011-01-24 19:05:18","6","8704","<p>I am currently writing an App for Android and I would like to know if AdMob pay per click or per impression? It looks like Adsense from Microsoft pays per click an impression. Does anybody have experience with that?</p><p>Thanks!</p>","42024","Martin","","","","2011-01-24 21:46:30","Does AdMob pay per click or per impression?","<android><admob>","1","0","","2011-01-25 14:01:49",""
"4786214","1","4787027","","2011-01-24 19:29:55","0","963","<p>Is there any game SDK for android games like Corona which can be used to release applications on android phones and iphones at same time?</p>","203018","","","","","2011-03-21 20:41:28","Game SDK for android phones","<iphone><android>","1","1","","",""
"4786224","1","","","2011-01-24 19:31:34","2","343","<p>I'm trying to use the Android-ui-utils Android Asset Studio with the Pencil GUI prototyping tool.</p><p>Everything is working great, and I think this tool will be very helpful. However, I'm having some trouble importing icons from the Asset Studio into the Pencil GUI program. </p><p>I've watched the video demo of the program, and cant figure out how they were able to bring the .PNG of the icon from the Asset studio into the Pencil GUI program. </p><p>Whenever I try to do so, it either A) wont let me, since its not in .zip format, or in .epc format. But, whenever I try to download the .zip of the icons from the Asset Studio and import it into the Pencil GUI, it says an error occured, and it wasnt able to import it.</p><p>Does anyone have any idea what I can do to get these icons into the Pencil GUI program? I'd really love to use this as a way to prototype the layout and look of my application. </p><p>Any help would be much appreciated!</p>","588012","","","","","2011-01-24 19:31:34","Android-ui-utils Help","<android><gui><icons>","0","1","1","",""
"4786260","1","4786399","","2011-01-24 19:35:29","1","123","<p>I am implementing a Tabbed Layout in an application where vertical screen real estate is of the utmost importance, and so I have resized the height of the tabs in the XML layout.  The tabs do not have an icon drawable resource, they have basic text labels.  I am using the <code>setIndicator(CharSequence)</code> method when setting the TabSpec programatically, but it would seem that even when using this method the Android OS reserves the top of the tab for an icon and it also seems to resize the tabs from the bottom up.  As a result my tabs are so short that the text label on the tab is not visible.</p><p>From what I've gathered through my Googling and also from other Stack Overflow questions, the best way to address this issue is to use a TextView instead of a CharSequence for the Indicator.  So, I have tried programatically declaring a new TextView, and then passing it in to the setIndicator method.  The text label is now visible, but, the tab has absolutely no visual styling/state drawables what so ever.  Further, if that tab is active, the text itself is no longer visible due to the lack of state drawables.  This is obviously also a problem.</p><p>I would like to post the code I am using, but the nature of the project prevents me from sharing any source.  I can however say the following:</p><ul><li>In programatically creating the TextView, I have tried doing as little work as simply setting the text, through to as much as using the <code>LayoutParams(int, int)</code> and <code>setBackgroundColor</code> and many other properties.  I have tried using completely transparent values for the backgroundColor.  No avail.</li><li>I have not tried creating the TextView as an XML resource and bringing using it in that fashion, though I don't see how that would change the outcome.</li></ul><p>And so my question is the following:</p><p>Is there any way to achieve short tabs that have only a text label without having to go through the process of extending classes or creating sets of state drawable resources?  While these are mostly simple tasks, the nature of this app is that it is on an extremely short turn-around time and presentation/user chrome is of the utmost non-importance; currently functionality is priority number one and if I can save time by using the provided UI elements then that is the route I would prefer to take since I don't really have the ability to download a bunch of graphic editing software on my workstation without headaches and I'm also the only one working on the project, further, the only one here who is permitted to work on the project.  My apologies for the nebulousness of this whole affair.</p><p>Thanks in advance.</p>","411216","","","","","2011-01-24 19:49:08","Is there a workaround to the loss of the state drawables when passing a TextView to the setIndicator method of a TabSpec?","<android>","1","0","","",""
"4786303","1","4786787","","2011-01-24 19:39:44","1","1676","<p>I believe I'm doing this correctly, in my activity class I'm calling execute the alert dialog appears and then the data load but the alert dialog never goes away. Here is my AsyncTask code:</p><p>Followed by my activity code.</p><pre><code>public class Worker extends AsyncTask&lt;URL, Integer, Long&gt;{private Activity ne;private ProgressDialog progressDialog;private Handler handler;public Worker(Handler handler, Activity ne){this.handler = handler;this.ne = ne;}protected void onPreExecute() {    progressDialog = ProgressDialog.show(ne,"""", ""Retrieving News Events"", true);}protected void onProgressUpdate(Void... progress) {}protected void onPostExecute(Void result) {    progressDialog.dismiss();}/* (non-Javadoc) * @see android.os.AsyncTask#doInBackground(Params[]) */@Overrideprotected Long doInBackground(URL... urls) {HttpClient client = new DefaultHttpClient();HttpGet get;    try {            get = new HttpGet(urls[0].toURI());        ResponseHandler&lt;String&gt; response = new BasicResponseHandler();        String responseBody = client.execute(get, response);        String page = responseBody;        Bundle data = new Bundle();        data.putString(""page"",page);        Message msg = new Message();        msg.setData(data);        handler.sendMessage(msg);    }    catch (Throwable t) {        Log.d(""UpdateNews"", ""PROBLEMS"");    }return null;}</code></pre><p>}</p><pre><code>public class NewsEvents extends ListActivity{private URL JSONNewsEvents;private ArrayList&lt;NewsEvent&gt; neList;private ArrayList&lt;String&gt; keyWordList;private Worker worker;private TextView selection;private ProgressDialog progressDialog;static final int PROGRESS_DIALOG = 0;public static final String KEYWORDS = ""keywords"";private NewsEvents ne;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.newsevents);    ne = this;    neList = new ArrayList&lt;NewsEvent&gt;();selection=(TextView)findViewById(R.id.selection);    try {    JSONNewsEvents = new URL(getString(R.string.jsonnewsevents));} catch (MalformedURLException e) {    // TODO Auto-generated catch block    e.printStackTrace();}    worker = new Worker(handler, this);    setListAdapter(new IconicAdapter());    getKeywords();     worker.execute(JSONNewsEvents);}/** * @return */public ArrayList&lt;String&gt; getKeywords(){try {    InputStream fi = openFileInput(KEYWORDS);    if (fi!=null) {        ObjectInputStream in = new ObjectInputStream(fi);                keyWordList = (ArrayList&lt;String&gt;) in.readObject();                in.close();    }}catch (java.io.FileNotFoundException e) {    // that's OK, we probably haven't created it yet}catch (Throwable t) {    Toast        .makeText(this, ""Exception: ""+t.toString(), Toast.LENGTH_LONG)        .show();}if(keyWordList == null){    keyWordList = new ArrayList&lt;String&gt;();    return keyWordList;}return keyWordList;}public void onListItemClick(ListView parent, View v,    int position, long id) {startFullNewsEvent(neList.get(position));}/** * @param newsEvent */public void startFullNewsEvent(NewsEvent ne) {Intent intent = new Intent(this, FullNewsEvent.class);intent.putExtra(""ne"", ne);this.startActivity(intent);finish();}private Handler handler = new Handler(){    @Override    public void handleMessage(Message msg) {        String page = msg.getData().getString(""page"");        try {             JSONArray parseArray = new JSONArray(page);             for (int i = 0; i &lt; parseArray.length(); i++) {                 JSONObject jo = parseArray.getJSONObject(i);                 String title = jo.getString(""title"");                 String body =jo.getString(""body"");               String pd = jo.getString(""postDate"");                 String id = jo.getString(""id"");               NewsEvent ne = new NewsEvent(title, pd , body, id);               boolean unique = true;               for(NewsEvent ne0 : neList){               if(ne.getId().equals(ne0.getId())){                  unique = false;               }else{                   unique = true;               }               }               if(unique == true){               neList.add(ne);               }           }            } catch (JSONException e) {             // TODO Auto-generated catch block             e.printStackTrace();            }          ne.setListAdapter(new IconicAdapter());    }};public class IconicAdapter extends ArrayAdapter&lt;NewsEvent&gt; {IconicAdapter() {    super(NewsEvents.this, R.layout.rownews, neList);}public View getView(int position, View convertView,ViewGroup parent) {    LayoutInflater inflater=getLayoutInflater();    View row=inflater.inflate(R.layout.rownews, parent, false);    TextView label=(TextView)row.findViewById(R.id.label);    ImageView image= (ImageView)row.findViewById(R.id.icon);    String body = neList.get(position).getBody();    body.replaceAll(""\\&lt;.*?&gt;"", """");    String title = neList.get(position).getTitle();    for(String s : keyWordList){        if(body.contains(s) || body.contains(s.toLowerCase()) ||            title.contains(s) || title.contains(s.toLowerCase())){        neList.get(position).setInterested(true);        }    }    if(neList.get(position).isInterested() == true){        image.setImageResource(R.drawable.star);    }    label.setText(neList.get(position).getTitle());    return(row);}}</code></pre><p>}</p>","180825","","180825","","2011-01-24 20:14:48","2011-01-24 20:31:49","How can I remove an alert dialog after a AsyncTask has done it's work","<android>","2","0","","",""
"4786318","1","8353574","","2011-01-24 19:41:09","1","1733","<p>How can I draw an arc using a Shader such as SweepGradient?</p><p>The examples I have all take a Paint object:</p><pre><code>Paint lightRed = new Paint();lightRed.setAntiAlias(true);lightRed.setStyle(Style.STROKE);lightRed.setStrokeWidth(12);lightRed.setColor(0xFFCC0000);...canvas.drawArc(rectf, -90, 360, false, lightRed);</code></pre><p>Don't think it makes a difference, but I'm using it to draw to a homescreen widget</p>","30911","","30911","","2011-01-24 20:03:06","2011-12-02 08:41:50","Draw an arc with a SweepGradient in Android","<android><android-widget>","1","0","","",""
"4786402","1","","","2011-01-24 19:49:28","1","201","<p>I'm trying to make a bluetooth socket and the connection is being established. I wonder if they do not get root access to prevent something ?????</p>","588045","","","","","2011-01-24 19:49:28","Root access to bluetooth","<android><bluetooth>","0","1","","",""
"4786420","1","4951002","","2011-01-24 19:50:51","1","2983","<p>So, I'm trying to get the ADT's built-in proguard implementation working for my app. Unfortunately, it seems to be choking on various classes in third-party libraries I references.I've tried various, if not all, the combinations of -libraryjars and -keep public class lines I can think of, but it's all to no good. I'm not that experienced with Proguard, so honestly, I don't know where I'm going wrong. I've tried google, but most of the information relates to Ant scripts.</p><p>Some of the things I've tried:</p><ul><li><p>Lines like -libraryjars C:\Users\Dave\workspace\Dropbox_Sync_for_Tasker_and_Locale\lib\apache-mime4j-0.6.jar at the top or bottom of the file</p></li><li><p>Lines attempting to make paths to jars like that relatively, to no success at all.</p></li><li><p>Lines like -keep public class org.apache.commons.logging.LogFactory</p></li><li><p>Line that refer to the other part of the error lines, like -keep public class org.apache.james.mime4j.field.MailboxListField</p></li></ul><p>Anyway, the error log is a huge wall of text, so I've put it on a pastebin <a href=""http://pastebin.com/26s3RNEV"" rel=""nofollow"">here</a>.</p>","368918","","","","","2012-01-11 21:34:00","Issues with Android ADT, Proguard and External Jars","<android><eclipse><adt><proguard>","3","4","2","",""
"4786462","1","4786699","","2011-01-24 19:54:40","1","3544","<p>I guess this is just a simple question (I’m such a noob…)I have this custom dialog box that has 3 buttons in it.</p><p>Now I want to call an activity from one of the buttons soI tried this:</p><pre><code>public class picturedialog extends Dialog implements OnClickListener {    Button Camera;    public picturedialog (Context context){        super (context);        setContentView(R.layout.picturedialog);        Camera = (Button) this.findViewById(R.id.pdButton1);        Camera.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                dismiss();                Intent myIntent = new Intent(view.getContext(), CameraActivity.class);                startActivity(myIntent);            }        });...}</code></pre><p>Then the red squiggly line appears on startActivity(myIntent).Upon hovering on it, eclipse tells me this: “The method startActivity(Intent) is undefined for the type new View.OnClickListener(){}”Ehhh? Please orient me on how to do this properly.Any help would be appreciated.</p>","588051","","","","","2011-01-24 20:17:06","Calling an activity from a custom dialog","<android><activity><customdialog>","2","0","","",""
"4786656","1","4787034","","2011-01-24 20:13:16","1","216","<p>I am totally new to Android development. I'm not looking for code but what I am looking for is suggestions for how I could approach a problem. Essentially I am looking for suggestions for how I could have a predefined square (consisting of 4 gps points) representing a square. When the app user physically moves (with their phone) outside of the grid area, a message is displayed onscreen telling them that they're outside the area. </p><p>I envisage having to use gps coordinates to determine if a user moves outside the area. However I'm looking for advice on how to tackle the problem of the user moving around with the phone in their hand. I imagine that the GPS would have to constantly poll the GPS service to determine the coordinates of the user as they move (on demand) in order to determine if the user is outside the area. However, I'm sure that this is inefficient due to battery exhaustion and also having to constantly poll the GPS service to get the current coordinates of the user as they are walking. Is there perhaps some sort of app for the android that can dynamically determine a user's coordinates within a predefined area locally without having to constantly poll GPS for coordinates? I'm shooting in the dark here. Any suggestions appreciated!</p><p>Thanks again</p>","543220","","","","","2011-01-24 20:51:01","AR on Android - movement within an area","<android>","1","0","","",""
"4786849","1","4787268","","2011-01-24 20:32:04","3","4885","<p>In my App I have a broadcast receiver that upon receiving a keyword in an SMS message, it starts a service that tracks the GPS location of the phone. I do this using -</p><pre><code>context.startService(new Intent(context,TrackGPS.class));</code></pre><p>I also need to be able to stop the service upon receiving another keyword in an SMS message, I have tried to do this but the GPS sensor still tracks the location and GPS icon flashes at the top of the screen. I tried to do this using -  </p><pre><code>context.stopService(new Intent(context, TrackGPS.class));</code></pre><p>I figure this might be because the GPS listener needs to be unregistered. Can anyone help me in getting this service to stop + stop the GPS tracking upon  receipt of a text? Thanks in advance.  </p><p><strong>Solution</strong>  </p><pre><code>@Overridepublic int onStartCommand(Intent GPSService, int flags, int startId) {    boolean startListening = GPSService.getExtras().getBoolean(""IsStartTracking"");    if (startListening == true){        lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);    }    else {        lm.removeUpdates(this);         stopSelf();    }    return 1;}</code></pre>","506929","","506929","","2011-01-25 18:19:29","2011-01-25 18:19:29","How to unregister Listener & stop service from within broadcastreceiver","<android><service><gps><listener><broadcastreceiver>","2","0","","",""
"4786856","1","","","2011-01-24 20:32:25","0","446","<p>I'm writing an app which calls barcode scanner via intents, and right now... I'm trying to figure out where in the ZXing codebase they parse HTML.  Basically, I want to know where the product result UI is drawn and where they get the avg price for an item.</p><p>If anyone can point me in the right direction, I'd be very grateful.  Thanks in advance.</p>","588095","","","","","2011-12-29 04:09:42","Android - Where does barcode scanner (zxing) parse HTML","<android><zxing>","1","0","","",""
"4786892","1","","","2011-01-24 20:37:15","0","636","<p>For example: let's say an AdMob fails, or more likely, the user is using an AdBlocker to block the ads.  </p><p>Is there any way to detect this so I can show an in-house ad instead of nothing?  The in-house ad would just tell the user to purchase the premium version to remove ads.</p>","396","","","","","2011-01-24 20:42:06","Is it possible to detect wether an AdMob ad was displayed?","<android><admob>","1","0","","",""
"4787008","1","","","2011-01-24 20:47:47","10","5744","<p>Refer to the doc: <a href=""http://developer.android.com/resources/articles/layout-tricks-reuse.html"">http://developer.android.com/resources/articles/layout-tricks-reuse.html</a></p><p>I have a button inside the included layout, how can I access the button? I don't know the id! How can I define the OnClickListener...?</p><p>Please help...</p>","573528","","","","","2013-12-15 19:09:18","How to access Button inside ""include"" layout","<android><layout><include><onclick>","4","1","2","",""
"4787031","1","4815233","","2011-01-24 20:49:55","6","3793","<p>All,</p><p>I have searched for an answer to this, but I'm not getting anything exact... It's my first time writing an Android app, so please be gentle :)</p><p>I'm pretty bummed about the minimal headset support in Android - unlike e.g. iPhone, it only natively seems to support a single button, so no volume control on headset compatibility. Additionally, if I'm listening to music and a call comes in, the OS pauses the music automatically, but the headset button still functions ONLY as a media button - I can't use it to answer/end the call. If I answer the call via the screen and press the headset button, the music starts again, but the call continues...</p><p>I'd like to create a 'middleman' app that can pick up that the headset button has been pressed (via Keyevent.KEYCODE_HEADSETHOOK) and can then determine whether to perform the default ACTION_MEDIA_BUTTON action (toggle play/pause in my chosen media player) or, if there is an incoming call, pause the music and answer the phone (and then, when pressed again, end the call and restart the media player). Perhaps even check for ACTION_MULTIPLE on the headset button to assign different options (ACTION_MEDIA_NEXT, ACTION_MEDIA_PREVIOUS etc.). Perhaps also be able to determine whether different buttons on the headset have been pressed (if the headset is e.g. a fancy iPhone headset) and 'translate' those button presses into the appropriate ACTION_MEDIA_*). This might not be possible if the OS can't tell the difference between different buttons, obviously.</p><p>Obviously such an app would have to receive the intent with a high enough priority that it would be able to abort the broadcast before the current media player gets it.</p><p>I've been tinkering with creating assorted BroadcastReceiver classes and intent filters etc., but part of the problem is that the bult-in Android emulator that comes with Eclipse doesn't seem to have the ability to simulate a user plugging in the headset and/or subsequently clicking the headset button. Therefore, every time I get somethign that looks promising, I have to put it onto my actual phone and try it out - time-consuming and a hassle.</p><p>3 questions then:</p><ol><li><p>Am I missing somethign obvious - is this a real problem and if so, has it already been solved?</p></li><li><p>If it IS a problem, is it possible to write such a middleman app?</p></li><li>Are there any other Android emulators that can check for headset-related activities?</li></ol><p>Thanks,</p><p>Rory</p>","279782","","","","","2012-01-07 00:28:48","Creating 'middleman' headset button controller in Android","<android><android-emulator>","1","3","1","",""
"4787139","1","","","2011-01-24 21:03:50","0","622","<p>Ok, so I'm editing this to include the whole class with some new code I added over the past couple of hours. Basically, I'm looking to populate a Google Map with markers that represent a Facebook user's checkins. Unfortunately, my code has not been cooperating - I've tried reviewing the documentation that Facebook provides and searching the web for answers without coming up with anything useful. So far all I've been able to get the app to do is validate the app's permissions with Facebook and display the map, though I had tested the ability to add markers with dummy values in an earlier version of the app and that worked fine.</p><p>My earlier question dealt with why my calls to the Graph API weren't displaying anything - I had made the same call as listed in the AuthorizeListener sub-class, but was merely attempting to output the raw JSON string in a log entry instead of manipulating it. I think that whatever was the cause of that problem is probably the same cause of my current problem.</p><p>Anyway, how do I get my app to display markers for locations a user has checked in to? I think my code gets me off to a pretty good start, but there are obviously issues in my AuthorizeListener sub-class. What do you guys think?</p><pre><code>public class FBCTActivity extends MapActivity {public static Context mContext;List&lt;Overlay&gt; mapOverlays;FBCTMarkerOverlay markerLayer;ArrayList&lt;OverlayItem&gt; overlays = new ArrayList&lt;OverlayItem&gt;();// Facebook Application IDprivate static final String APP_ID = """";Facebook mFacebook = new Facebook(APP_ID);/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    mContext = this;    setContentView(R.layout.main);    // Set up Facebook stuff    mFacebook.authorize(this, new String[]{""user_checkins"", ""offline_access""}, new AuthorizeListener());    // Set up map stuff    MapView mMapView = (MapView)findViewById(R.id.map);    mMapView.setSatellite(true);    MapController mMapController = mMapView.getController();    mMapController.animateTo(getCurrentLocation());    mMapController.setZoom(3);    // Set up overlay stuff    mapOverlays = mMapView.getOverlays();    Drawable drawable = this.getResources().getDrawable(R.drawable.icon);    markerLayer = new FBCTMarkerOverlay(drawable);    // markerLayer is populated in the AuthorizeListener sub-class    mapOverlays.add(markerLayer);}/** * Determines the device's current location, but does not display it. * Used for centering the view on the device's location. * @return A GeoPoint object that contains the lat/long coordinates for the device's location. */private GeoPoint getCurrentLocation() {    LocationManager mLocationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);    Criteria mCriteria = new Criteria();    mCriteria.setAccuracy(Criteria.ACCURACY_COARSE);    mCriteria.setPowerRequirement(Criteria.POWER_LOW);    String mLocationProvider = mLocationManager.getBestProvider(mCriteria, true);    Location mLocation = mLocationManager.getLastKnownLocation(mLocationProvider);    int mLat = (int)(mLocation.getLatitude()*1E6);    int mLong = (int)(mLocation.getLongitude()*1E6);    return new GeoPoint(mLat, mLong);}@Overrideprotected boolean isRouteDisplayed() {    // TODO Auto-generated method stub    return false;}private class AuthorizeListener implements DialogListener {    public void onComplete(Bundle values) {        new Thread() {            @Override            public void run() {                try {                    String response = mFacebook.request(""me/checkins""); // The JSON to get                                            JSONObject jObject = Util.parseJson(response);                    JSONArray jArray = jObject.getJSONArray(""data""); // Read the JSON array returned by the request                    for (int i = 0; i &lt; jArray.length(); i++) { // Iterate through the array                        JSONObject outerPlace = jArray.getJSONObject(i); // The outer JSON object                        JSONObject place = outerPlace.getJSONObject(""place""); // Second-tier JSON object that contains id, name, and location values for the ""place""                        String placeName = place.getString(""name""); // The place's name                        JSONObject placeLocation = place.getJSONObject(""location""); // Third-tier JSON object that contains latitude and longitude coordinates for the place's ""location""                        int lat = (int) (placeLocation.getDouble(""latitude"")*1E6); // The place's latitude                        int lon = (int) (placeLocation.getDouble(""longitude"")*1E6); // The place's longitude                        String date = outerPlace.getString(""created_time""); // Timestamp of the checkin                        overlays.add(new OverlayItem(new GeoPoint(lat, lon), placeName, ""Checked in on: "" + date)); // Add the place's details to our ArrayList of OverlayItems                    }                    mFacebook.logout(mContext); // Logout of Facebook                    for (int i = 0; i &lt; overlays.size(); i++) {                        markerLayer.addOverlayItem(overlays.get(i));                    }                } catch(IOException e) {                    Log.v(""FBCTActivity"", e.getMessage());                } catch(JSONException e) {                    Log.v(""FBCTActivity"", e.getMessage());                }            }        }.start();    }    public void onFacebookError(FacebookError e) {        Log.w(""FBCTActivity"", e.getMessage());        // TODO: Add more graceful error handling    }    public void onError(DialogError e) {        Log.w(""FBCTActivity"", e.getMessage());    }    public void onCancel() {        // TODO Auto-generated method stub    }}</code></pre><p>}</p>","585454","","585454","","2011-01-25 04:13:22","2011-03-12 06:14:04","Why doesn't my call to the Facebook Graph API display anything?","<java><android><facebook-graph-api><facebook-android-sdk>","1","2","1","",""
"4787170","1","","","2011-01-24 21:06:54","0","937","<p>just like Google gives a small info dialog box right above the marker in maps, i am trying to do something similar. Can anybody help?</p>","484691","","","","","2011-01-24 21:14:53","How to add a dialog box in mapview in android","<android><dialog><android-mapview>","1","0","","",""
"4787249","1","4787666","","2011-01-24 21:15:19","17","17269","<p>I want to pass a new, but different, Intent to an Activity. How do you differentiate between the new Intent and previous Intents? What kind of code goes into onNewIntent()? An example will be very helpful.</p>","588132","","651104","","2012-06-17 06:02:15","2014-01-21 14:55:50","How to capture the new Intent in onNewIntent()?","<android><android-intent>","5","0","4","",""
"4787357","1","4787424","","2011-01-24 21:26:40","3","6329","<p>Here's the long and short of it. Short first:</p><ol><li>I had an X Window System crash, which resulted in Eclipse existing uncleanly (ie, it was probably force-killed without warning.)</li><li>When restarting eclipse, it would hang indefinitely on ""Loading Workbench"".</li><li>Deleting the *.snap files in workspace/.metadata works, but then IDE fails to work properly after lunch, persumably because these files are missing.</li><li>Deleting my workspace/.metadata lets eclipse launch and run mostly normally, but...</li><li>When I try to save a Java file (any file), it hangs indefinitely on ""User Operation is Waiting"" -- ""Building workspace""</li></ol><p>So the gist is that somewhere, after the crash, there is a file or files that are causing Eclipse to hang when trying to either restore files I was editing, or deal in other ways with my workspace. Here are some relevant exceptions from my .log file:</p><p>From bullet point #2:</p><pre><code>!ENTRY org.eclipse.core.resources 2 10035 2011-01-24 11:21:33.870!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.!ENTRY org.eclipse.core.resources 8 2 2011-01-24 11:21:35.040!MESSAGE Problems occurred when invoking code from plug-in: ""org.eclipse.core.resources"".!STACK 1org.eclipse.core.runtime.CoreException: SDK is not loaded yet        at com.android.ide.eclipse.adt.internal.build.builders.BaseBuilder.stopBuild(Unknown Source)        at com.android.ide.eclipse.adt.internal.build.builders.BaseBuilder.abortOnBadSetup(Unknown Source)        at com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.build(Unknown Source)        at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)        at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)        at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)        at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)        at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)        at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)</code></pre><p>From bullet point #5:</p><pre><code>!ENTRY org.eclipse.core.resources 8 2 2011-01-24 14:14:47.331!MESSAGE Problems occurred when invoking code from plug-in: ""org.eclipse.core.resources"".!STACK 1org.eclipse.core.runtime.CoreException: Project target not loaded yet.        at com.android.ide.eclipse.adt.internal.build.builders.BaseBuilder.stopBuild(Unknown Source)        at com.android.ide.eclipse.adt.internal.build.builders.BaseBuilder.abortOnBadSetup(Unknown Source)        at com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.build(Unknown Source)        at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)        at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)        at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)        at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)        at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)        at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)!SUBENTRY 1 com.android.ide.eclipse.adt 8 0 2011-01-24 14:14:47.331!MESSAGE Project target not loaded yet.!SUBENTRY 1 com.android.ide.eclipse.adt 8 0 2011-01-24 14:14:47.331!MESSAGE Project target not loaded yet.</code></pre><p>At this point, all I really want is to be able to use Eclipse in a state where it isn't crashing. Any advice short of totally deleting my entire ~/.eclipse directory, my workspace, and reinstalling Eclipse from scratch?</p>","170431","","","","","2012-10-23 12:18:27","How do I deal with a persistent problem of Eclipse hanging on my workspace?","<android><eclipse>","7","0","","",""
"4787506","1","4787597","","2011-01-24 21:43:42","0","2968","<p>I know this is the basic stuff but I couldn't figure it out. Here is my code:</p><pre><code>public class test extends Activity{     private static final String TAG = ""test"";     private Button Test;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Log.v(TAG,""onCreate is called."");        this.setContentView(R.layout.main);        Test= (Button)this.findViewById(R.id.Test);        Test.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                Log.v(TAG, ""onClick Entered."");                // Perform action on click            }        });        setContentView(R.layout.main);    }}</code></pre><p>I can see the first log ""OnCreate"" but the button click event listener doesn't seem to work because I can't see ""OnClick Entered"". Where did I do wrong?</p><p>Thanks</p>","195678","","195678","","2011-01-24 21:46:21","2011-01-24 21:57:36","android button event listener does not work","<android>","3","0","","",""
"4787565","1","4796124","","2011-01-24 21:48:26","9","4836","<p>I'm trying to read an AttributeSet from an XML resource file. The relevant code is the following:</p><pre><code>//This happens inside an Activity        Resources r = getResources();        XmlResourceParser parser = r.getXml(R.layout.testcameraoverlay);        AttributeSet as = Xml.asAttributeSet(parser);        int count = as.getAttributeCount(); //count is 0!!??</code></pre><p>count == 0, so Android is not reading any attributes at all!</p><p>The XML file(R.layout.testcameraoverlay):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView    xmlns:android=""http://schemas.android.com/apk/res/android""     android:text=""@string/app_name"" android:id=""@+id/TextView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;</code></pre><p>Why can't I read the attributes?</p>","480894","","","","","2011-01-25 16:29:08","I cannot read the AttributeSet from my XML resources","<android><android-layout>","2","1","4","",""
"4787612","1","5009990","","2011-01-24 21:53:09","1","468","<p>In my C++ code, I create an instance of a Java class through JNI. That Java class's job is to create a WebView dynamically that should go on top of the application's views. </p><p>My current strategy is to retrieve the application's main activity, dynamically create a WebView and attach it to the main activity's list of views. Is this possible? Is it better to create an activity? </p><p>This functionality is meant for a standalone library that clients can use. So unfortunately it can't be part of the main application's activity. </p><p>At minimum, is it possible to retrieve the application's main activity from an unrelated Java class?</p>","93802","","","","","2011-02-15 21:55:19","Dynamically Creating WebView From C++ Through JNI","<c++><android><jni><webview>","1","0","","",""
"4787736","1","","","2011-01-24 22:04:02","1","1613","<p>How can I count the number of lines in an EditText?Basically in my app I have line numbers and I wanted to make them update on textchange (I already have the textchangelistener set up).Is this possible? :(</p><p>Thanks,Alex!</p>","427234","","","","","2011-01-31 12:35:51","Android Development: Count EditText Lines on textChanged?","<android><count><edittext><lines>","2","0","1","",""
"4787785","1","4787881","","2011-01-24 22:08:57","8","5420","<p>As I checked in APIs description for getSharedPreferences(String, int),Second attribute is defining accessibility mode and can take 0 or MODE_PRIVATE for the default operation, MODE_WORLD_READABLE and MODE_WORLD_WRITEABLE to control permissions.</p><p>But there is this small note in API description:</p><blockquote>  <p>Note: currently this class  (android.content.SharedPreferences)  does not support use across multiple  processes. This will be added later.</p></blockquote><p>Moreover in Mark L. Murphy book ""beginning Android 2"" he mentioned: </p><blockquote>  <p>(Eventually, preferences might be  shareable across applications, but  that is not supported as of the time  of this writing)</p></blockquote><p>Im so confused! does this mean that MODE_WORLD_READABLE and MODE_WORLD_WRITEABLE of getSharedPrefrences is there but NOT SUPPORTED YET in latest API level???</p><p>Thanks!Migan</p>","588211","","234039","","2011-01-24 22:11:38","2011-01-24 22:21:05","Can SharedPreferences be shared among different Android applications?","<android><preferences>","1","0","3","",""
"4787905","1","4788064","","2011-01-24 22:22:33","12","13775","<p>I was wanting to know if Android had a similar feature to the iPhone in that you can use an html A tag to send an SMS by setting the HREF attribute to the phone number you want to send the message to and prefixing it with ""SMS:"", i.e. href=""SMS:02313213"" </p><p>I've had a look around and can't seem to find anything that suggests it is available on Android.</p>","345546","","139010","","2011-01-24 23:18:35","2012-10-28 00:18:10","SMS URL on Android","<android><sms>","5","1","3","",""
"4787921","1","4788059","","2011-01-24 22:24:07","3","2160","<p>I hope someone can help me with this one.</p><p>I'm have been developing for the iPhone for a long time, and I'm used to set a preprocessor macro so I can use #ifdef in code to do different things with different targets.</p><p>How do I do something like that with Android? As far as I know Java does not support preprocessors. How can I have a different behavior with different run configurations in Eclipse?</p><p>Thank you!</p>","370128","","","","","2011-01-24 22:40:57","Android preprocessor macros with 2 targets","<android><eclipse><preprocessor><target>","1","0","1","",""
"4788086","1","4788117","","2011-01-24 22:44:57","1","5922","<p>This is what I have so far.. it just starts when the application is opened:</p><pre><code>package com.android.countdown;import android.app.Activity;import android.os.Bundle;import android.os.CountDownTimer;import android.widget.TextView;public class countdown extends Activity {    TextView mTextField;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mTextField = (TextView) findViewById(R.id.timer1);        new CountDownTimer(100000, 1000) {            public void onTick(long millisUntilFinished) {                mTextField.setText(""Seconds remaining: "" + millisUntilFinished / 1000);            }            public void onFinish() {                mTextField.setText(""Finished"");            }        }.start();    }}</code></pre><p>I know that I need to call <code>start()</code> inside a button procedure. However, if I move the <code>.start()</code> from where it's at the <code>new CountDownTimer(100000 , 1000) {</code> gets an error.</p>","533049","","438992","","2011-10-25 04:07:00","2013-01-25 08:17:05","How can I start and stop my countdowntimer via a button?","<android><eclipse>","1","0","1","",""
"4788132","1","","","2011-01-24 22:50:34","1","396","<p>I have a program collecting wifi, acceleration, scan bluetooth and sometimes communicate with server. Does anybody know how to get power usage(voltage, current and power) of each component and the power usage of overall system?</p>","582327","","","","","2011-01-24 22:56:27","How to get power usage for an app?","<java><android>","1","0","","",""
"4788162","1","4788483","","2011-01-24 22:55:22","0","166","<p>I'm working on an app that deals with contacts, and I am looking for ContactsContract compatible equivalents to both of these constants:</p><pre><code>Contacts.Groups.GROUP_MY_CONTACTSContacts.Groups.GROUP_ANDROID_STARRED</code></pre><p>I find it hard to believe that these constants no longer apply in ContactsContract. Am I missing something?</p>","588252","","","","","2011-01-24 23:39:40","Where did Contacts.Groups.GROUP_MY_CONTACTS go?","<android><contactscontract><android-contacts>","1","0","","",""
"4788211","1","4956872","","2011-01-24 23:00:56","2","2816","<p>I'm trying to work out how to create the layout for a gridview for my game. I have a gridview which will be the level selector. At the moment I have each gridview item as a TextView, just showing the Level Number (1, 2, 3, etc).</p><p>I would like to add 3 imageviews over the top of the textview and be able to manipulate the image shown in the views. The 3 image views are stars, showing what difficulty the level was completed on.</p><p>I figure I need to write my own Adapter and inflate the XML layout when creating the views for the grid items but I'm stuck with how to create the actual layout for this, the overlapping part has me scratching my head?</p><p>Here's a mockup of what I've tried to describe, and what I want to create:<img src=""http://i.stack.imgur.com/ho9S3.png"" alt=""enter image description here""></p><p>PS. I know I could use 4 images and set the textview background to one of those images but I wondered if there was a more technical way of creating the layout.</p>","563718","","","","","2011-02-10 12:08:16","Android custom gridview layout (textview with imageview on top)","<android><gridview><layout>","2","0","1","",""
"4788331","1","4792556","","2011-01-24 23:18:47","1","3957","<p>I am using a Custom CursorAdapter that overrides newView() and bindView() to show a custom ListView.</p><p>I am inflating the row layout xml file and binding a OnClickListener to the view passed as argument to bindView():</p><pre><code>public void bindView(View view, Context context, Cursor cursor) {view.setOnClickListener(new OnClickListener() { }...}</code></pre><p>I am also using a relative layout in the row 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=""fill_parent""      android:paddingTop=""10px""    android:paddingBottom=""10px""    android:paddingLeft=""10px""    android:paddingRight=""10px""    android:clickable=""true""    android:focusable=""true""    android:focusableInTouchMode=""true""  &gt;    &lt;TextView android:id=""@+id/episode_title_text"" xmlns:android=""http://schemas.android.com/apk/res/android""      android:layout_width=""wrap_content""      android:layout_height=""fill_parent""    android:textSize=""20px""    android:layout_weight=""1""     /&gt;&lt;/RelativeLayout&gt;</code></pre><p>My problem is when I click the items in the list, nothing happens, OnClickListener.onClick() is never called.</p><p>Any ideas on what the problem might be?</p><p>Thank you.</p>","87191","","","","","2013-08-25 12:37:23","Make a ListView row clickable using a custom CursorAdapter","<android><listview><layout>","3","0","0","",""
"4788362","1","4789436","","2011-01-24 23:24:14","0","1409","<p>Guys sorry if sounds a little bit naive...In an activity I have one button and 4 textViews.</p><p>According to this post <a href=""http://stackoverflow.com/questions/4003225/onconfigurationchanged-its-still-showing-the-first-layout"">here</a> , I've changed the manifest file and overridden onConfigurationChanged(). I get the desired layout. BUT the button looses its onClickListener and also textViews change their text to what I set in xml initially. </p><p>How can I assign onClickListener to the button as it is set to the button in onCreate().Also setText(""anything"") is called inside onCreate() for each textView.What is the correct way of using onConfigurationChanged()? because it seems that I have to initiate everything again? </p><p>thanks in advance.</p>","536853","","","","","2011-01-25 02:30:31","changing orientation through onConfigurationChanged()?","<android><screen-orientation>","1","0","","",""
"4788364","1","4788466","","2011-01-24 23:24:20","0","321","<p>This is my code for my splash screen:</p><pre><code>package com.unicorn.test.whee;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.animation.Animation;import android.view.animation.Animation.AnimationListener;import android.view.animation.AnimationUtils;import android.widget.ImageView;public class SplashScreenPear extends Activity {/** Called when the activity is first created. */public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.pear);    startAnimating();}private void startAnimating(){  ImageView pearfade = (ImageView) findViewById(R.id.pearish);  Animation pearfadeact = AnimationUtils.loadAnimation(this, R.anim.fadein); pearfade.startAnimation(pearfadeact);} @Override protected void onPause() {  super.onPause();   ImageView pearfade = (ImageView) findViewById(R.id.pearish);  pearfade.clearAnimation();   Animation pearfadeact = AnimationUtils.loadAnimation(this, R.anim.fadein);  pearfadeact.setAnimationListener(new AnimationListener() {         public void onAnimationEnd(Animation animation) {                 // The animation has ended, transition to the Main Menu screen                 startActivity(new Intent(SplashScreenPear.this, Unicorn.class));                 SplashScreenPear.this.finish();             }             public void onAnimationRepeat(Animation animation) {             }             public void onAnimationStart(Animation animation) {             }         });         }     @Override     protected void onResume() {         super.onResume();                      startAnimating();     }</code></pre><p>Sorry about that. As you can see, this code contains unicorns, BUT ALSO BUGS! I think.Well anyway, this code won't run, and I don't see why not. Do you think you can help point out the probably n00bish errors in this? Or give a possible explanation why it wouldnt work? I'm confuzzled.... I can post other code if you like...</p>","394842","","244296","","2011-01-24 23:27:34","2011-01-24 23:52:57","Android: App won't open!","<java><android><animation><emulator>","1","3","","",""
"4788435","1","4969069","","2011-01-24 23:33:32","0","967","<p>I developing an Android App to solve the ""Rubiks Cube"". First the Cube will be scanned from each side of the Cube. After color recognition a new activity starts and show the result in a 2D-model. This is realized in much GridViews. For each side i have one GridView.</p><p>Now my problem: I've set each Gridview clickable but only three of them are clickable.The Grids wich works are the first with the white facelet in the middle, the Grid with the blue facelet in the middle and the Grid with the yellow facelet in the middle. All the other Grids are not clickable, but why? I need it to implement the OnItemClickListeners for each GridView so if necessary to correct a color.</p><p>My XML File looks like this:</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=""wrap_content""android:layout_height=""wrap_content""&gt;     &lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/gridviewU""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:numColumns=""auto_fit""     android:verticalSpacing=""5dp""     android:horizontalSpacing=""1dp""     android:columnWidth=""28dp""     android:gravity=""center""     /&gt;     &lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/gridviewF""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:numColumns=""auto_fit""     android:verticalSpacing=""5dp""     android:horizontalSpacing=""1dp""     android:columnWidth=""28dp""     android:focusable=""true""     android:gravity=""center""     android:layout_below=""@id/gridviewU""     /&gt;     &lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/gridviewD""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:numColumns=""auto_fit""     android:verticalSpacing=""5dp""     android:horizontalSpacing=""1dp""     android:columnWidth=""28dp""     android:gravity=""center""     android:layout_below=""@id/gridviewF""     /&gt;     &lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/gridviewB""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:numColumns=""auto_fit""     android:verticalSpacing=""5dp""     android:horizontalSpacing=""1dp""     android:columnWidth=""28dp""     android:gravity=""center""     android:layout_below=""@id/gridviewU""     /&gt;      &lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/gridviewL""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:numColumns=""auto_fit""     android:verticalSpacing=""5dp""     android:horizontalSpacing=""1dp""     android:columnWidth=""28dp""     android:gravity=""center""     android:layout_below=""@id/gridviewU""     /&gt;     &lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/gridviewR""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:numColumns=""auto_fit""    android:verticalSpacing=""5dp""    android:horizontalSpacing=""1dp""    android:columnWidth=""28dp""    android:gravity=""center""    android:layout_below=""@id/gridviewU""    /&gt;     &lt;/RelativeLayout&gt;</code></pre><p><br/><br/>Can anyone help me? Thanks...</p><p>[EDIT]I've solved my problem. Now i use an AbsoluteLayout with fix coordinates for each GridView.</p>","588275","","757667","","2011-07-13 09:46:12","2011-07-13 09:46:12","Much GridViews together in a RelativeLayout","<android><gridview><android-layout><relativelayout>","1","0","","",""
"4788461","1","4788521","","2011-01-24 23:36:32","14","19492","<p>I have my <code>WebView</code> loading all links inside the webview - but when I select an email link it tries to load it in the webview instead of launching an email app on the phone.  How do I resolve that?  the links are mailto://someone@somewhere.com</p><p>Here is my code - the <code>WebView</code> itself works right and everything loads inside the webview, including mailto:, etc.  Need the mailto links to load elsewhere</p><pre><code>package com.apps.jerdog.crcc;import android.app.Activity;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.view.KeyEvent;import android.webkit.WebView;import android.webkit.WebViewClient;@SuppressWarnings(""unused"")public class mainActivity extends Activity {    /** Called when the activity is first created. */    /**@Override */    WebView webview;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        webview = (WebView) findViewById(R.id.webview);        webview.getSettings().setJavaScriptEnabled(true);        webview.getSettings().setSupportZoom(true);        webview.getSettings().setBuiltInZoomControls(true);        webview.setWebViewClient(new WebViewClient());        webview.loadUrl(""http://www.cedarridge.cc"");        }    @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);    }    private class myWebViewClient extends WebViewClient {        public boolean shouldOverrideUrlLoading(WebView view, String url)         {            if (url.startsWith(""mailto:"") || url.startsWith(""tel:"")) {                     Intent intent = new Intent(Intent.ACTION_VIEW,                            Uri.parse(url));                     startActivity(intent);                     }             view.loadUrl(url);            return true;        }    }}</code></pre>","561377","","2345913","","2013-09-30 07:28:48","2013-09-30 07:28:48","handling links in a webview","<android><android-webview>","1","1","7","",""
"4788529","1","","","2011-01-24 23:47:06","1","696","<p>How can one get information on the status of items such as LED?  I know how to set LED via notifications, but what I need to know is how to determine if it is on/off etc before making any adjustments.  What I am looking for is a simple request or API that will tell me if the LED is on/off.</p><p>Thanks</p>","588296","","","","","2011-06-30 10:12:38","Android Getting Status on LED","<android><android-widget><notifications><status><led>","1","0","","",""
"4788537","1","","","2011-01-24 23:48:24","-1","641","<p>I'm trying to add some control overlays to an activity as such:</p><pre><code>----------|overlay |----------|        ||activity||        |----------| overlay|----------</code></pre><p>i want the overlay portions to handle clicks, but i want the center portion to be transparent and have the activity receive touch events and whatnot. </p><p>is there a way to specify that a certain region of the layout is clipped?</p><p>obviously, i could add each item of the overlay to the underlying activity, in which this wouldn't be an issue, but i'd like to bundle both overlay portions into one control. and add the control as a single item. </p><p>is this possible?</p>","339448","","","","","2011-01-24 23:58:09","Android - Control Overlay question","<android><controls>","1","0","","",""
"4788576","1","4789050","","2011-01-24 23:54:56","4","5396","<p>Does jFreeChart compile and run in Android 2.2 or above?   I tried to run it and received missing swing class errors.  There does not seem to be any definitive answer on the web.   The answer to this question is either 1) Yes,  I use it all the time, here are the steps or 2) No,  It doesn't work because <strong>_</strong>.  </p><p>I just want to put this issue to rest and get a definitive answer.  So please don't suggest other chart packages.</p><p>Thanks</p><p>Fish</p>","321747","","","","","2011-04-06 02:37:13","Does jFreeChart work/comple in Android 2.x","<java><android><jfreechart>","3","0","","",""
"4788668","1","4810335","","2011-01-25 00:06:27","1","276","<p>Hallo,</p><p>I'm having trouble writing a function:</p><pre><code>float turnToRequestedHeading(float initialHeading, float requiredHeading, float turnRate)</code></pre><p>I keep thinking there must be a clever way to do it, but it escapes me.</p><p>All values are in Radians, Headings between -PI and +PI, and turnRate between -0.5 and +0.5.</p><p>If the requiredHeading is less than the turnRate away from the initialHeading then it should return requiredHeading</p><p>Otherwise it should return initialHeading + or - turnRate, whichever gets closer to the requiredHeading.</p><p>Any ideas? I get stuck when the headings are either side of straight down, e.g. -3 and +3.</p><p>UPDATE: Here is some test code and test data (see my answer for my code below):</p><pre><code>private void turnToRequestedHeadingTest(float initialHeading, float requiredHeading, float turnRate, float expectedResult) {    if (Math.round(turnToRequestedHeading(initialHeading*PIf/180, requiredHeading*PIf/180, turnRate*PIf/180)*180/PIf) != expectedResult) {        /*DEBUG*/Log.i(this.getClass().getName(), ""test(initial=""+initialHeading+"", required=""+requiredHeading+"", rate=""+turnRate+"") Expected ""+expectedResult+"", Returns ""+(Math.round(turnToRequestedHeading(initialHeading*PIf/180, requiredHeading*PIf/180, turnRate*PIf/180)*180/PIf)));    }}    /*DEBUG*/Log.i(this.getClass().getName(), ""turnToRequestedHeading tests:"");    turnToRequestedHeadingTest(   0,   0,  0,   0);    turnToRequestedHeadingTest(   0,   0, 25,   0);    turnToRequestedHeadingTest(  10,  15, 25,  15);    turnToRequestedHeadingTest(  20,  55, 25,  45);    turnToRequestedHeadingTest(  85,  95, 25,  95);    turnToRequestedHeadingTest( 150,-170, 25, 175);    turnToRequestedHeadingTest( 170, 177, 25, 177);    turnToRequestedHeadingTest( 170,-175, 25,-175);    turnToRequestedHeadingTest( 175,-100, 25,-160);    turnToRequestedHeadingTest( 175,   0, 25, 150);    turnToRequestedHeadingTest( 180,   0, 25, 155);    turnToRequestedHeadingTest(-170,-100, 25,-145);    turnToRequestedHeadingTest(-100, -80, 25, -80);    turnToRequestedHeadingTest( -30, -15, 25, -15);    turnToRequestedHeadingTest( -30,  15, 25,  -5);    turnToRequestedHeadingTest( -20,  -5, 25,  -5);    turnToRequestedHeadingTest( -20,   5, 25,   5);    turnToRequestedHeadingTest( -20,  15, 25,   5);    turnToRequestedHeadingTest(  10, 180, 25,  35);    turnToRequestedHeadingTest(  10,-160, 25, -15);    turnToRequestedHeadingTest( 170,   0, 25, 145);    turnToRequestedHeadingTest( 170, -15, 25,-165);    turnToRequestedHeadingTest(-170,   5, 25,-145);    turnToRequestedHeadingTest( -10, 160, 25,  15);    turnToRequestedHeadingTest( -10,-150, 25, -35);    turnToRequestedHeadingTest(  10,-170, 25, -15);    turnToRequestedHeadingTest(   0, 180, 25,  25);    turnToRequestedHeadingTest( -10, -15, 25, -15);    turnToRequestedHeadingTest( -20, -55, 25, -45);    turnToRequestedHeadingTest( -85, -95, 25, -95);    turnToRequestedHeadingTest(-150, 170, 25,-175);    turnToRequestedHeadingTest(-170,-177, 25,-177);    turnToRequestedHeadingTest(-170, 175, 25, 175);    turnToRequestedHeadingTest(-175, 100, 25, 160);    turnToRequestedHeadingTest(-175,   0, 25,-150);    turnToRequestedHeadingTest( 170, 100, 25, 145);    turnToRequestedHeadingTest( 100,  80, 25,  80);    turnToRequestedHeadingTest(  30,  15, 25,  15);    turnToRequestedHeadingTest(  30, -15, 25,   5);    turnToRequestedHeadingTest(  20,   5, 25,   5);    turnToRequestedHeadingTest(  20,  -5, 25,  -5);    turnToRequestedHeadingTest(  20, -15, 25,  -5);    turnToRequestedHeadingTest( -10,-180, 25, -35);    turnToRequestedHeadingTest( -10, 160, 25,  15);    turnToRequestedHeadingTest(-170,   0, 25,-145);    turnToRequestedHeadingTest(-170,  15, 25, 165);    turnToRequestedHeadingTest( 170,  -5, 25, 145);    turnToRequestedHeadingTest(  10,-160, 25, -15);    turnToRequestedHeadingTest(  10, 150, 25,  35);    turnToRequestedHeadingTest( -10, 170, 25,  15);    // More tests    turnToRequestedHeadingTest(   0,  15, 25,  15);    turnToRequestedHeadingTest(   0,  60, 25,  25);    turnToRequestedHeadingTest(   0, -15, 25, -15);    turnToRequestedHeadingTest(   0, -60, 25, -25);    turnToRequestedHeadingTest( 180, 165, 25, 165);    turnToRequestedHeadingTest( 180, 100, 25, 155);    turnToRequestedHeadingTest( 180,-165, 25,-165);    turnToRequestedHeadingTest( 180,-100, 25,-155);    turnToRequestedHeadingTest(-180, 165, 25, 165);    turnToRequestedHeadingTest(-180, 100, 25, 155);    turnToRequestedHeadingTest(-180,-165, 25,-165);    turnToRequestedHeadingTest(-180,-100, 25,-155);    turnToRequestedHeadingTest(  25,   0, 25,   0);    turnToRequestedHeadingTest(  25, -25, 25,   0);    turnToRequestedHeadingTest( -25,   0, 25,   0);    turnToRequestedHeadingTest( -25,  25, 25,   0);    turnToRequestedHeadingTest( 155, 180, 25, 180);    turnToRequestedHeadingTest( 155,-155, 25, 180);    turnToRequestedHeadingTest(-155, 180, 25,-180);    turnToRequestedHeadingTest(-155, 155, 25,-180);    turnToRequestedHeadingTest( 155,-180, 25,-180);    turnToRequestedHeadingTest(-155,-180, 25,-180);</code></pre><p>I think my test data covers all cases now...</p><p>-Frink</p>","131209","","131209","","2011-01-29 12:44:15","2011-01-29 12:44:15","Stuck on some angular arithmetic","<java><android><wolfram-mathematica><trigonometry><angles>","3","2","","",""
"4788713","1","","","2011-01-25 00:14:20","6","1515","<p>I'm trying to create a preferences screen with a dynamic list of entries, and when clicking each of them, I have another screen of preferences.As an example, think of a list of mail accounts and each one having their account settings available.</p><p>While I can create the nesting I want using just <code>PreferenceScreens</code>, this can't easily be scaled to multiple entries without creating the sub preferences structure in code for each one.</p><p>I see several different variations throughout the Android UI.</p><p>Is there a recomended way to create such a structure as this?</p><p>Possibilites include:</p><ol><li><p>Separate, independant activities<br>Works but is messy in my opinion</p></li><li><p>Nested, code created PreferenceScreens<br>Pain in the ass for maintainence and it means the preferences are no longer stored as XML fragments</p></li><li><p>Nested, inflated PreferenceScreens<br>I can't find a way to expand another XML file into a sub tree</p></li><li><p>One ""sub"" PreferenceScreen that is shown using setPreferenceScreen() for each one<br>I can't find a way to hide the ""template"" PreferenceScreen and it breaks the navigation.</p></li></ol><p>Sample XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""    android:title=""@string/prefs_title""&gt;    &lt;EditTextPreference android:key=""add_console""        android:title=""@string/prefs_add_console""&gt;&lt;/EditTextPreference&gt;    &lt;PreferenceCategory android:title=""@string/prefs_consoles_title""        android:key=""list""&gt;        &lt;PreferenceScreen android:summary=""http://cctv.icode.co.uk/""            android:title=""iCode Console""&gt;        &lt;/PreferenceScreen&gt;        &lt;PreferenceScreen android:summary=""http://test.icode.co.uk/""            android:title=""Test Console""&gt;        &lt;/PreferenceScreen&gt;    &lt;/PreferenceCategory&gt;    &lt;PreferenceScreen android:title=""Console (template)""        android:key=""console""&gt;        &lt;EditTextPreference android:title=""@string/prefs_console_host""            android:summary=""@string/prefs_not_set"" android:key=""host""&gt;&lt;/EditTextPreference&gt;        &lt;CheckBoxPreference android:title=""@string/prefs_console_auth""            android:summary=""@string/prefs_console_auth_summary"" android:key=""auth""&gt;&lt;/CheckBoxPreference&gt;        &lt;EditTextPreference android:shouldDisableView=""true""            android:title=""@string/prefs_console_authuser"" android:key=""authuser""            android:dependency=""auth"" android:summary=""@string/prefs_not_set""&gt;&lt;/EditTextPreference&gt;        &lt;EditTextPreference android:title=""@string/prefs_console_authpass""            android:key=""authpass"" android:dependency=""auth"" android:summary=""@string/prefs_not_set""&gt;&lt;/EditTextPreference&gt;        &lt;CheckBoxPreference android:title=""@string/prefs_console_pair""            android:summary=""@string/prefs_console_pair_summary"" android:key=""pair""&gt;&lt;/CheckBoxPreference&gt;    &lt;/PreferenceScreen&gt;&lt;/PreferenceScreen&gt;</code></pre><p>I want the entries under <code>list</code> to be dynamic and show the <code>console</code> preferences under each.</p><p>All other ideas welcome.</p><p>Thanks </p>","588306","","588306","","2013-05-10 15:24:45","2013-05-14 12:30:00","Nested PreferenceScreens under a dynamic list of preferences on Android","<android><preferences>","1","4","3","",""
"4788716","1","","","2011-01-25 00:15:29","1","2683","<p>I am building an app and I'd like to override the idle timeout of the app. I'd like it to never timeout, similar to most games. Does anyone know how you'd do this. I've been trolling the internet for a while now and I'm not sure.</p><p>iPhone is idleTimeout = NO;</p><p>Super easy, is there any global setting like that I can hit in Android? I'm not seeing anything on android developers, or in any of the web pages I've looked at.</p><p>Thanks a ton!</p><p>I have a second piggy back question. I also have a memory leak. Here's the code[code]package fourguys.testing.IntentTest;</p><p>import android.app.Activity;import android.media.MediaPlayer;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.media.MediaPlayer;import android.media.AudioManager;import android.content.Context;</p><p>public class CanvasDrawingActivity extends  Activity   {</p><pre><code>private static final int FIRE = 0;private int initVolume = 0;private Handler handler;private MyCanvas v;private MediaPlayer mp;private AudioManager am;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    am = (AudioManager)this.getSystemService(Context.AUDIO_SERVICE);        // this method gets the current volume setting for music        initVolume = am.getStreamVolume(AudioManager.STREAM_MUSIC);        am.setStreamVolume(AudioManager.STREAM_MUSIC,100,AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE);    mp = MediaPlayer.create(this, R.raw.test);    makeHandler();    v =new MyCanvas(this);    new Thread(new Runnable(){        @Override        public void run() {            while(true)                handler.sendEmptyMessage(FIRE);         }}).start();    setContentView(v);    mp.setLooping(true);    mp.start();}private void makeHandler(){    handler  = new Handler(){        @Override        public void handleMessage(Message msg) {            switch(msg.what)            {            case FIRE:            {                v.invalidate();                break;            }            }        }    };}protected void onPause() {    super.onPause();    mp.stop();}protected void onFinish() {    mp.stop();}}</code></pre><p>[/code]</p><p>and this:</p><p>[code]package fourguys.testing.IntentTest;</p><p>import android.app.Activity;import android.content.Intent;import android.media.MediaPlayer;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.view.WindowManager;</p><p>public class IntentTest extends Activity {    /** Called when the activity is first created. */</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);    //reciever intentReceiver = new reciever();   // IntentFilter intentFilter = new IntentFilter(""com.app.REC"");    //registerReceiver(intentReceiver, intentFilter);     Button b = (Button)this.findViewById(R.id.endButton);    b.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            Intent i = new Intent(IntentTest.this,CanvasDrawingActivity.class);            startActivity(i);        }     }); }// the onPause method get called when the app is either being hidden or being closed so this the place where we would want to clean anything up like stoping the media player.@Overrideprotected void onPause(){    super.onPause();}}</code></pre><p>[/code]</p><p>I run the app and it gets wonky on exit. It locks the handset and causes the battery to run hot. I need to pull the battery physically to reboot. Any thoughts as to why that might be? It runs fantastically on the emulator. Should I be using onFinish instead, or am I not cleaning something up and I'm missing it?</p>","571866","","571866","","2011-01-25 05:24:58","2011-01-25 05:24:58","Overriding the idle timeout in android","<android>","2","0","","",""
"4788752","1","4788783","","2011-01-25 00:22:51","0","3242","<p><strong>I will need a code example; I'm not very experienced.</strong></p><p>I need a ListView to reflect an SQLiteDatabase using a cursor. Here's my main.java:</p><pre><code>package com.shoppinglist;import android.app.Dialog;import android.app.ListActivity;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;public class ShoppingList extends ListActivity {    private SQLiteDatabase db;    /** Called when the activity is first created. */    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button button1main = (Button) findViewById(R.id.add);        button1main.setOnClickListener(new OnClickListener()  {            @Override            public void onClick(View v)  {            final Dialog additem = new Dialog(ShoppingList.this);            additem.setContentView(R.layout.maindialog);            final EditText et = (EditText)additem.findViewById(R.id.edittext);            additem.setTitle(""Type your item"");            additem.setCancelable(true);            et.setHint(""Type the name of an item..."");            Button button = (Button) additem.findViewById(R.id.cancel);            button.setOnClickListener(new OnClickListener()  {                @Override                public void onClick(View v)  {                    additem.dismiss();                }            });            additem.show();            Button ok = (Button) additem.findViewById(R.id.ok);            ok.setOnClickListener(new OnClickListener() {                @Override                public void onClick(View v) {                    final String text = et.getText().toString();                    additem.dismiss();                    et.setText("""");                }            });       }        });    }}</code></pre><p>My DataHelper.java:</p><pre><code>package com.shoppinglist;import java.util.ArrayList;import java.util.List;import android.content.Context;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteStatement;import android.util.Log;public class DataHelper {    private static final String DATABASE_NAME = ""items.db"";    private static final int DATABASE_VERSION = 1;    private static final String TABLE_NAME = ""table1"";    private Context context;    private SQLiteDatabase db;    private SQLiteStatement insertStmt;    private static final String INSERT = ""insert into ""        + TABLE_NAME + ""(name) 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 name) {            this.insertStmt.bindString(1, name);            return this.insertStmt.executeInsert();        }        public void deleteAll() {            this.db.delete(TABLE_NAME, null, null);        }        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[] { ""name"" },                    null, null, null, null, ""name desc"");            if (cursor.moveToFirst()) {                do {                    list.add(cursor.getString(0));                } while (cursor.moveToNext());            }            if (cursor !=null &amp;&amp; !cursor.isClosed()) {                cursor.close();            }            return list;        }        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, name 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);            }            @SuppressWarnings(""unused"")            public void doInsert(String name) {                final SQLiteDatabase db = getWritableDatabase();                SQLiteStatement insert_stmt = null;                try {                    insert_stmt = db.compileStatement(INSERT);                    insert_stmt.bindString(0, name);                    insert_stmt.executeInsert();                }                finally {                    if (insert_stmt !=null) insert_stmt.close();                }            }        }}</code></pre>","560096","","","","","2011-01-25 00:27:24","How to setup a ListView to reflect an SQLiteDatabase using a cursor (will need code example)","<android><sqlite><listview><cursor>","1","0","","",""
"4788822","1","12871387","","2011-01-25 00:32:07","2","1156","<p>I have downloaded the android SDK 8 for linux and following the tutorial typed:</p><pre><code>#tools/android update sdkbash: tools/android: Permission denied</code></pre><p>So I tried:</p><pre><code>#sudo tools/android update sdksudo: unable to execute tools/android: Permission denied</code></pre>","557697","","142162","","2011-01-25 00:35:30","2012-10-13 08:33:51","update android sdk permission error","<android><permissions><sdk>","1","3","0","",""
"4789122","1","4789237","","2011-01-25 01:29:17","4","5655","<p>Hey all, I'm trying to get my CountDownTimer to autoreset back to it's original time after the time reaches zero. Like an infinite loop. Here is the code I have so far (there are 3 timers in total):</p><pre><code>package com.android.countdown;import android.app.Activity;import android.os.Bundle;import android.os.CountDownTimer;import android.view.View;import android.widget.Button;import android.widget.TextView;import android.view.View.OnClickListener;public class countdown extends Activity {    public String formatTime(long millis) {          String output = ""00:00"";          long seconds = millis / 1000;          long minutes = seconds / 60;          seconds = seconds % 60;          minutes = minutes % 60;          String secondsD = String.valueOf(seconds);          String minutesD = String.valueOf(minutes);          if (seconds &lt; 10)            secondsD = ""0"" + seconds;          if (minutes &lt; 10)            minutesD = ""0"" + minutes;          output = minutesD + "" : "" + secondsD;          return output;        }   @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);//Declare Start/Stop buttonButton btnstart = (Button)findViewById(R.id.btnstart);Button btnstop = (Button)findViewById(R.id.btnstop);//Declare Text fields to show time leftfinal TextView mCounter1TextField=(TextView)findViewById(R.id.counter1);final TextView mCounter2TextField = (TextView)findViewById(R.id.counter2);final TextView mCounter3TextField=(TextView)findViewById(R.id.counter3);//Counter 1final CountDownTimer Counter1 = new CountDownTimer(120000 , 1000) {public void onTick(long millisUntilFinished) {    mCounter1TextField.setText(""Seconds left: "" + formatTime(millisUntilFinished));}public void onFinish() {    mCounter1TextField.setText(""Finished!"");}};//Counter 2final CountDownTimer Counter2 = new CountDownTimer(80000 , 1000) { public void onTick(long millisUntilFinished) {     mCounter2TextField.setText(""Seconds left: "" + formatTime(millisUntilFinished)); } public void onFinish() {     mCounter2TextField.setText(""Finished!""); } };//Counter 3final CountDownTimer Counter3 = new CountDownTimer(10000 , 1000) {  public void onTick(long millisUntilFinished) {      mCounter3TextField.setText(""Seconds left: "" + formatTime(millisUntilFinished));  }  public void onFinish() {      mCounter3TextField.setText(""Finished!"");  }  };//Start Buttonbtnstart.setOnClickListener(new OnClickListener() { public void onClick(View v) {  Counter1.start();  Counter2.start();  Counter3.start();   }});//Stop Buttonbtnstop.setOnClickListener(new OnClickListener() { public void onClick(View v) {  Counter1.cancel();  Counter2.cancel();  Counter3.cancel();    }});}}</code></pre><p>I can't figure what to put inside onFinish()</p>","533049","","","","","2011-01-25 01:50:26","How can I allow my CountDownTimer to reset after the countdown is finished?","<android><eclipse>","1","0","","",""
"4789155","1","4789243","","2011-01-25 01:36:31","12","9360","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3304304/android-how-to-get-the-sender-of-an-intent"">Android: How to get the sender of an Intent?</a>  </p></blockquote><p><strong>Is there a way in android to find the source activity which fires a INTENT (in the destination activity)?</strong></p><p>The scenario is I have two activities A and B. Both fire an intent to call activity C. Activity C displays extra information based on its source. Eg. If call comes from A then C displays only 2 textviews whereas in the case of intent fired by B the activity C displays 3 textviews (basically more information based on who is the caller).</p><p>To establish this I <strong>need to know who fired the intent calling C</strong>. How do I do this?</p>","324446","","","","","2012-10-27 00:57:08","How to find Intent source in Android?","<android><android-intent><resolution>","4","2","3","2012-10-19 18:47:31",""
"4789187","1","","","2011-01-25 01:42:54","11","808","<p>Is it possible to ignore files from being packaged into the Android APK? For instance, I have my .psd files in the same folder as their .png counterparts, and all the .psd files get packaged up.</p><p>I know I can move them outside of the folder, but I like having them in all together and would prefer not to if possible</p>","577032","","","","","2013-07-04 15:01:15","Ignoring files from Android APK","<java><android><apk>","5","0","2","",""
"4789300","1","4789781","","2011-01-25 02:03:07","2","1331","<p>Is there any way to tell whether an Activity is being resumed (i.e. onResume is called) from the home screen/launcher?  </p><p>For example, if I have an Application with two activities, A and B. </p><p><strong>Scenario 1:</strong>Some user action on Activity A will invoke Activity B, bringing it into the foreground - moving Activity A into the background. As Activity A moves into the background, it goes through onPause() and onStop(). The user (now on Activity B) either finishes the Activity or hits the ""back"" button, bringing Activity A back to the foreground, causing an onRestart(), onStart(), onResume() sequence.</p><p><strong>Scenario 2:</strong>If the user hits the ""home"" button while Activity A is in the foreground and then re-invokes the Application from the launcher, it goes through the same lifecycle as in Scenario 1. I.e. User hits the ""home"" button. Activity goes through onPause() and onStop(). User launches the application again, causing Activity A go come back into the foreground, again going through the same onRestart(), onStart(), onResume() sequence as in Scenario 1.</p><p>As far as I can tell, the Activity has no way of knowing how it was resumed, it just knows it is being brought back into view. In fact, I have a feeling that there isn't really as much of a concept of an ""Application"" in Android - in the sense of something that has a single entry and exit point.</p>","481069","","","","","2013-02-01 09:38:30","Is there any way to distinguish between an Android Activity onResume from the home screen?","<android>","3","4","","",""
"4789325","1","4789699","","2011-01-25 02:08:39","18","53001","<p>I'm doing:</p><p><code>FileReader fin = new FileReader(""file:///android_asset/myFile.txt"");</code></p><p>in an Android project and many variations. At runtime I get a file not found exception. The file is present and correct in the assets folder, so my path must be wrong.</p><p>What is the absolute path I need here?</p>","283311","","283311","","2011-09-17 10:59:11","2012-03-03 07:01:38","Android path to asset txt file","<android><file><path><asset>","6","1","3","",""
"4789418","1","","","2011-01-25 02:27:38","2","1916","<p>I recieved an error log for my app in the android market developer console. It is reporting a freeze with the cause of ""ANR keyDispatchingTimedOut"" I traced it back to a line of code after the user accepts the image when the camera gets released. Here is the code for the button press to accept the image:</p><pre><code>case R.id.ib_good: // good picture, exit        //create a new intent...        Intent i = new Intent();        i.putExtra(""bitmap"",path); // path to the temp image we saved        setResult(RESULT_OK,i); // good job!        // close the activity        if (mCamera != null) {            cv.setCamera(null);            mCamera.release(); // this is the line that is causing the crash (EDIT: Line 115 in CameraActivity)            mCamera = null;        }        finish();        break</code></pre><p>Here is the full stack trace I get in the developer console:</p><pre><code>   DALVIK THREADS:""main"" prio=5 tid=1 NATIVE  | group=""main"" sCount=1 dsCount=0 s=N obj=0x4001d8c0 self=0xccc8  | sysTid=20802 nice=0 sched=0/0 cgrp=default handle=-1345017816  | schedstat=( 1781707766 981567374 1514 )  at android.hardware.Camera.native_release(Native Method)  at android.hardware.Camera.release(Camera.java:127)  at com.rdesigns.targetCalc.CameraActivity.onClick(CameraActivity.java:115)  at android.view.View.performClick(View.java:2405)  at android.view.View$PerformClick.run(View.java:8813)  at android.os.Handler.handleCallback(Handler.java:587)  at android.os.Handler.dispatchMessage(Handler.java:92)  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)""Binder Thread #3"" prio=5 tid=7 NATIVE  | group=""main"" sCount=1 dsCount=0 s=N obj=0x44d361c8 self=0x21ef38  | sysTid=20808 nice=0 sched=0/0 cgrp=default handle=2265664  | schedstat=( 6805422 24505615 31 )  at dalvik.system.NativeStart.run(Native Method)""Binder Thread #2"" prio=5 tid=6 NATIVE  | group=""main"" sCount=1 dsCount=0 s=N obj=0x44d1b600 self=0x11eef0  | sysTid=20807 nice=0 sched=0/0 cgrp=default handle=1156104  | schedstat=( 56304928 87432866 67 )  at dalvik.system.NativeStart.run(Native Method)""Binder Thread #1"" prio=5 tid=5 NATIVE  | group=""main"" sCount=1 dsCount=0 s=N obj=0x44d1a520 self=0x11f8c0  | sysTid=20806 nice=0 sched=0/0 cgrp=default handle=1177728  | schedstat=( 9429930 47668459 39 )  at dalvik.system.NativeStart.run(Native Method)""Compiler"" daemon prio=5 tid=4 VMWAIT  | group=""system"" sCount=1 dsCount=0 s=N obj=0x44d152a0 self=0x11fca0  | sysTid=20805 nice=0 sched=0/0 cgrp=default handle=1179728  | schedstat=( 99487306 115570068 507 )  at dalvik.system.NativeStart.run(Native Method)""Signal Catcher"" daemon prio=5 tid=3 RUNNABLE  | group=""system"" sCount=0 dsCount=0 s=N obj=0x44d151e8 self=0x11fee0  | sysTid=20804 nice=0 sched=0/0 cgrp=default handle=1190192  | schedstat=( 9216308 11657716 15 )  at dalvik.system.NativeStart.run(Native Method)""HeapWorker"" daemon prio=5 tid=2 VMWAIT  | group=""system"" sCount=1 dsCount=0 s=N obj=0x43769de8 self=0x1227f0  | sysTid=20803 nice=0 sched=0/0 cgrp=default handle=1255400  | schedstat=( 55267334 21697997 41 )  at dalvik.system.NativeStart.run(Native Method)</code></pre><p>I have no idea what I should do to fix this problem... Any advice is appreciated!</p>","368845","","","","","2011-01-25 13:42:54","App freeze on Camera.Release()","<android><camera><freeze>","1","0","","",""
"4789437","1","","","2011-01-25 02:30:42","6","5987","<p>Android Developer has a nice discussion on writing your own View subclasses:   <a href=""http://developer.android.com/guide/topics/ui/custom-components.html"">http://developer.android.com/guide/topics/ui/custom-components.html</a></p><p>But I want to write my own ViewGroup <em>subclass</em> with my own child positioning policy.  Where is there a minimal example of this kind of thing? (This is a Java <em>coding</em> question not an XML one)</p><p>Specifically I want a horizontal layout that (like LinearLayout) fills in children from the left - <em>but</em> once the horizontal space is consumed, shifts the children to the left so that the <strong>last child</strong> appears aligned to the <strong>right end</strong> of the layout.  The children are button-like and so a HorzontalScrollView does not work since the scrolling gesture clicks the buttons instead of moving them.</p><p>If LinearLayout has an option to do this, I could not find it.</p>","588409","","","","","2012-11-02 13:54:10","Design Custom Android ViewGroup Subclasses","<android><design><layout>","1","0","3","",""
"4789478","1","4789510","","2011-01-25 02:39:01","0","265","<p>How to give click-able effect for the buttons whose background is an image ? Though it functions correctly but its just looking like an image. Any help would be appreciated.</p>","564844","","","","","2012-06-04 01:11:45","Clickable effect for ImageButtons","<android>","2","0","","",""
"4789482","1","","","2011-01-25 02:39:39","2","596","<p>I'm really struggling with something...  I have a couple of sentences that I want to read, both verbally through tts speek function, and via text on screen, one sentence at a time.</p><p>I have the textview area ready, but putting it together is what I'm not getting.  Either it will read all the sentences and only show the last one, or it will show and read only the first sentence.</p><p>Anyone know i how I can accomplish this goal?</p>","588415","","","","","2014-01-18 11:16:34","Android: waiting until tts speak is finished, then continue","<android>","2","0","","",""
"4789550","1","4789724","","2011-01-25 02:54:27","20","10448","<p>I want to let it looks like this:</p><pre><code>|    two    ||   lines   |</code></pre><p>Here is the current layout, not working at all.</p><pre><code>&lt;RelativeLayout    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:gravity=""center_vertical""&gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""two\nlines""        android:layout_gravity=""center_vertical""        android:layout_centerInParent=""true""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>Any idea?Thanks!</p>","428022","","74815","","2011-05-13 21:51:06","2013-08-14 12:19:16","How to center a two-line text in a TextView on Android?","<android><text><textview><multiline><text-alignment>","3","0","","",""
"4789663","1","4789766","","2011-01-25 03:20:51","2","2142","<p>I have basic question regarding when to <code>unregisterListener</code> for sensor manager. Should it be done in <code>onStop()</code> or <code>onDestroy()</code>.</p><p>Usecase :</p><p>I want to record <code>accelorometer</code> on click of start button and stop when user clicks stop button. the frequency of data is every minute. So I have started a <code>timer</code>.</p><p>But the issue is every time the <code>orientation</code> changes as per Android architecture, <code>onStop()</code> gets called. In <code>onStop()</code> I am cancelling the timer and unregistering the listener.</p><p>SO again if I start timer/register listener in <code>onResume()</code> the frequency won't remain 1 minute and also the data gets recorded without user pressing the start button.</p><p>Can someone help me resolve this issue.</p><p>Thanks.</p>","511280","","1570662","","2014-04-07 23:30:03","2014-04-07 23:30:07","Android : when to unregister the listener - onStop() or onDestroy()","<android>","2","0","1","",""
"4789761","1","","","2011-01-25 03:43:00","0","1563","<p>I’m trying to learn how <code>Preferences</code> work by writing a short program to store <code>ted</code> in the key <code>board</code> and then load the value in <code>boardstr</code>.When I use <code>getString</code> to load the value, the value of <code>boardstr</code> does not change.</p><pre><code>boardstr= new String();      boardstr=""fred"";// set the prefrence to tedthis.getPreferences(MODE_PRIVATE).edit().putString(""board"",""ted"");// kload the prfrence in boardstrthis.getPreferences(MODE_PRIVATE).getString(""board"",boardstr);// boardstr stil equals fred, not ted </code></pre>","564653","","306651","","2011-11-21 12:58:03","2011-11-21 12:58:03","Android trying to use Preferences to save data","<android><saving><android-preferences>","1","0","","",""
"4789806","1","4791443","","2011-01-25 03:52:33","11","2975","<p>What unit of measure does Paint.setStrokeWidth() use and do I need to scale this value based on the current screen density?</p><p>It's a float value so I know it's not a number of pixels. It must be relative to something.</p><p>This is all the documentation says as of this writing:</p><blockquote>  <p>Set the width for stroking. Pass 0 to stroke in hairline mode. Hairlines always draws a single pixel independent of the canva's matrix.</p></blockquote>","213138","","","","","2011-01-25 08:48:03","What unit of measure does Paint.setStrokeWidth() use?","<android>","1","0","","",""
"4789822","1","","","2011-01-25 03:55:49","0","130","<p>I use startService() to start a new service. It will take some time before the service is ready. If I call ServiceManager.getService() immediately, it will return null. I didn't find any blocking function about this. How to know when the service is ready? Is there any blocking functions or any system message to tell me that?</p><p>The other way is put ServiceManager.getService() in a while loop, but I don't think it is good, because it will lock UI.</p>","588461","","759866","","2014-01-07 14:10:42","2014-01-07 14:10:42","How to know when a new service is ready in Android?","<android><service>","1","0","","",""
"4789949","1","4790044","","2011-01-25 04:21:45","1","580","<p>I want to display list of check boxes with one <code>ImageView</code> and <code>TextView</code> in it. </p><pre><code>+-----------+----------+----------+| CHECK_BOX | ImageVew | TextView |+-----------+----------+----------+</code></pre><p>This list should be multiple selectable.<br>How to prepare This list?<br>How to get all selected check boxes and corresponding TextView value?    </p><p>Can some one please provide sample code for this.   </p><p>Thanks,<br>PP.</p>","314247","","","","","2011-01-25 04:38:38","How to display list of check box with icon and name (android)","<android>","2","0","","",""
"4790011","1","4790136","","2011-01-25 04:32:48","1","683","<p>can we track a call in progress , means a user is in call while starting an application.. can we trace that in android device.. Please help</p>","548218","","","","","2011-01-25 04:56:19","Track a call in progress while starting an application","<android>","1","0","","",""
"4790109","1","4790346","","2011-01-25 04:51:09","0","1682","<p>My progressDialog doesn't appear immediately when I start a new activity. I am using AsyncTask for the same. I am loading data from web service in next activity. Following is my async class : </p><pre><code>private class TheTask extends AsyncTask&lt;Void, Void, Void&gt;{    Context con;     Intent aboutusIntent;     TabGroupActivity parentActivity;    private TheTask(Context context)    {        this.con=context;    }    @Override    protected void onPreExecute() {        progDialog = ProgressDialog.show(con, ""Loading... "",                ""please wait...."", true);    }    @Override    protected Void doInBackground(Void... params) {         aboutusIntent = new Intent(con, Departments.class);          parentActivity = (TabGroupActivity)getParent();        //progDialog.show();        return null;    }    @Override    protected void onPostExecute(Void result) {        parentActivity.startChildActivity(""Departments"", aboutusIntent);        if(progDialog.isShowing())        {        progDialog.dismiss();        }    }}  </code></pre><p>I am creating instance of this class onClick of button :  </p><pre><code>ourdepbtn.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            // TODO Auto-generated method stub            new TheTask(AboutUs.this.getParent()).execute();        }    });  </code></pre><p>Any suggestions?</p>","541786","","6391","","2011-01-25 06:21:24","2011-10-18 16:25:57","Progress Dialog doesn't appear immediately","<android><progressdialog>","4","0","","",""
"4790114","1","","","2011-01-25 04:52:27","0","756","<p>Having problems to set ClickListener from Layout</p><p>Inside my layout:</p><pre><code>&lt;ImageButton     android:id=""@+id/VimeoButton""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:src=""@drawable/vimeo_icon""    android:onClick=""OpenVimeo""&gt;</code></pre><p>And in the main class (an activity):</p><pre><code>public void OpenVimeo(View v)    {        Intent myIntent;        Log.i(tag,""Inside"");        myIntent=new Intent (AndroidRSS.this,Video.class);        startActivity(myIntent);    }</code></pre><p>But seems not to handle click events.</p>","557518","","244296","","2011-01-25 04:57:11","2011-01-25 11:09:23","Setting ClickListener from the Layout","<android><android-layout><clicklistener>","3","2","","",""
"4790131","1","","","2011-01-25 04:55:28","0","1597","<p>I am developing android app on windows xp and have vodafone 845 phone. I can run my app on emulator in Eclipse.My problem is that I can't get adb to detect the real device. I found below link but it was for linux.</p><p><a href=""http://www.newtondev.com/2011/01/21/getting-adb-to-list-your-android-vodafone-845-huawei-u8120-and-get-debugging-working/"" rel=""nofollow"">http://www.newtondev.com/2011/01/21/getting-adb-to-list-your-android-vodafone-845-huawei-u8120-and-get-debugging-working/</a></p><p>Did anyone had luck on windows xp with this phone?</p><p>ThanksBob</p>","588521","","","","","2011-01-25 05:15:03","adb doesn't detect android device - vodafone 845","<android><adb>","1","1","1","",""
"4790193","1","","","2011-01-25 05:09:33","0","425","<p>Is there any publicly available code for the Nintendo emulator? I would like to create an emulator like SNesoid for Android. Where should I start? Does this involve the NDK?</p>","421372","","","","","2012-12-26 15:36:33","Super Nintendo Emulator for Android","<android><emulator><nintendo>","2","1","","",""
"4790234","1","","","2011-01-25 05:15:31","1","2498","<p>I am trying to make an application that will act as a sextant (to find the height of an object). Is it possible to use the data from the accelerometer to find the angle the phone is pointing? Ideally, the user will hold their phone in the landscape position and look along the edge of it to sight the angle.</p>","483790","","","","","2013-04-02 06:10:10","Find angle of phone from the accelerometer?","<java><android><accelerometer><angle>","4","0","2","",""
"4790341","1","","","2011-01-25 05:35:10","0","769","<p>hello every one    i am trying to use AccessibilityService.but it not work.can somebody help me to point my mistake? thanks.</p><p>MyAccessibilityService.java</p><pre><code> public class MyAccessbilityService extends AccessibilityService { @Override    public void onAccessibilityEvent(AccessibilityEvent event) {    // TODO Auto-generated method stub      switch(event.getEventType()){        case AccessibilityEvent.TYPE_VIEW_CLICKED:          Toast.makeText(getApplicationContext(),""Click"", Toast.LENGTH_SHORT).show();          break;        case AccessibilityEvent.TYPE_VIEW_LONG_CLICKED:          Toast.makeText(getApplicationContext(),""Long click"", Toast.LENGTH_SHORT).show();          break;        case AccessibilityEvent.TYPE_VIEW_FOCUSED:           Toast.makeText(getApplicationContext(),""Focuse change"", Toast.LENGTH_SHORT).show();           break;        case AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED:           Toast.makeText(getApplicationContext(),""Text change"", Toast.LENGTH_SHORT).show();           break;         }       }         @Override         public void onInterrupt() {          // TODO Auto-generated method stub         }         @Override         protected void onServiceConnected() {          // TODO Auto-generated method stub          super.onServiceConnected();          AccessibilityServiceInfo info = new AccessibilityServiceInfo();          info.feedbackType = AccessibilityServiceInfo.DEFAULT;          setServiceInfo(info);         }        }</code></pre><p>the mainfest.xml like this</p>","576459","","516286","","2011-04-14 17:11:39","2011-06-15 07:14:09","About android,how to use the AccessibilityService","<android>","1","0","","",""
"4790355","1","4790388","","2011-01-25 05:37:09","0","333","<p>My emulator and SDK package were working fine literally one hour ago. I try to edit the code in the manifest file and BAM! All of a sudden, when I run my applications, the emulator freezes, sometimes needing Ctrl + Alt+ Delete, and when it unfreezes itself, the application doesn't even show up. The console log seems fine but I am getting some WIERD readings from the Logcat... not sure if they're normal or not. Help me out?</p><p>Actually, scratch that... wierd things are happening in the console log too...</p><pre><code>[2011-01-24 23:25:44 - UnicornTest] ------------------------------[2011-01-24 23:25:44 - UnicornTest] Android Launch![2011-01-24 23:25:44 - UnicornTest] adb is running normally.[2011-01-24 23:25:44 - UnicornTest] No Launcher activity found![2011-01-24 23:25:44 - UnicornTest] The launch will only sync the application package on the device![2011-01-24 23:25:44 - UnicornTest] Performing sync[2011-01-24 23:25:44 - UnicornTest] Automatic Target Mode: Preferred AVD 'Koneko' is available on emulator 'emulator-5554'[2011-01-24 23:25:44 - UnicornTest] WARNING: Application does not specify an API level requirement![2011-01-24 23:25:44 - UnicornTest] Device API version is 9 (Android 2.3)[2011-01-24 23:25:46 - UnicornTest] Application already deployed. No need to reinstall.[2011-01-24 23:25:46 - UnicornTest] \UnicornTest\bin\UnicornTest.apk installed on   device[2011-01-24 23:25:46 - UnicornTest] Done!</code></pre><p>Android 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.unicorn.test.whee""  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:enabled=""true""      android:name=""SplashScreenPear""&gt;    &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre><p>I feel as if there is some totally, blatant error somewhere I just can't see... I know GIMP does somthing like this freeze if you have a virus but I just did a scan and nothing came up... Sorry in advance.</p>","394842","","","","","2011-01-25 05:43:16","Android: SDK and Emulator totally bugged... What could be the problem?","<android><eclipse><emulator><manifest><freeze>","1","0","","",""
"4790391","1","5251463","","2011-01-25 05:43:38","1","768","<p>Currently using the following xml code as a background for a button in a program I am making. However, I would like to dynamically alter the background gradient within my code.   </p><p></p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/buttonshape"" android:shape=""rectangle""&gt; &lt;gradient android:startColor=""#F0F0F0"" android:endColor=""#A0A0A0""  android:angle=""270"" android:id=""@+id/buttonGradient""/&gt; &lt;corners  android:topLeftRadius=""7dp""  android:topRightRadius=""7dp"" /&gt;&lt;/shape&gt;</code></pre><p>At first, I decided the xml should go, and I would just create my own class to handle this. However, I realized there was no good class to extend from. GradientDrawable doesn't have any apparent methods do round the corners. RoundRectShape doesn't have any method to give me a gradient. However, I also don't know of any accessors to gradients/corners within shapedrawable. I think what it comes down to is the fact that I don't understand exactly how this shape is being defined (I pulled it off an example used elsewhere). Every xml view that I define has all of its properties enclosed within the &lt; /> tags. This is different. What are &lt; gradient > and &lt; corners >? I can't find them anywhere in the API/developer tools. And how can I dynamically alter them in my code?</p>","544007","","","","","2011-03-09 20:01:34","dynamically alter attributes of shape defined in xml?","<android><xml>","2","0","","",""
"4790560","1","","","2011-01-25 06:19:31","0","1014","<p>I have a memory leak. Here's the code </p><pre><code>package fourguys.testing.IntentTest;import android.app.Activity; import android.media.MediaPlayer; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.media.MediaPlayer; import android.media.AudioManager; import android.content.Context;public class CanvasDrawingActivity extends Activity {    private static final int FIRE = 0;    private int initVolume = 0;    private Handler handler;    private MyCanvas v;    private MediaPlayer mp;    private AudioManager am;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        am = (AudioManager)this.getSystemService(Context.AUDIO_SERVICE);        // this method gets the current volume setting for music        initVolume = am.getStreamVolume(AudioManager.STREAM_MUSIC);        am.setStreamVolume(AudioManager.STREAM_MUSIC,100,AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE);        mp = MediaPlayer.create(this, R.raw.test);        makeHandler();        v =new MyCanvas(this);        new Thread(new Runnable(){            @Override            public void run() {                while(true)                handler.sendEmptyMessage(FIRE);        }}).start();        setContentView(v);        mp.setLooping(true);        mp.start();    }    private void makeHandler()    {        handler  = new Handler(){            @Override            public void handleMessage(Message msg) {                switch(msg.what)                {                    case FIRE:                    {                        v.invalidate();                        break;                    }                }            }        };    }    protected void onPause() {        super.onPause();        mp.stop();    }    protected void onFinish() {        mp.stop();    }}</code></pre><p>and this:</p><pre><code>package fourguys.testing.IntentTest;import android.app.Activity; import android.content.Intent; import android.media.MediaPlayer; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.view.WindowManager;public class IntentTest extends Activity { /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);        //reciever intentReceiver = new reciever();        // IntentFilter intentFilter = new IntentFilter(""com.app.REC"");        //registerReceiver(intentReceiver, intentFilter);        Button b = (Button)this.findViewById(R.id.endButton);        b.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                Intent i = new Intent(IntentTest.this,CanvasDrawingActivity.class);                startActivity(i);            }        });    }    // the onPause method get called when the app is either being hidden or being closed so this the place where we would want to clean anything up like stoping the media player.    @Override    protected void onPause()    {        super.onPause();    }}</code></pre><p>I run the app and it gets wonky on exit. It locks the handset and causes the battery to run hot. I need to pull the battery physically to reboot. Any thoughts as to why that might be? It runs fantastically on the emulator. Should I be using onFinish instead, or am I not cleaning something up and I'm missing it?</p>","571866","","6391","","2011-01-25 06:26:02","2011-01-25 06:31:59","Possible memory leak in android. Might be using the wrong cleanup method, or missing something","<android>","1","1","1","",""
"4790585","1","","","2011-01-25 06:24:15","1","1362","<p>I have a edittext depending on the number given in edit text i have to create a radiobutton but im getting error this is my code</p><pre><code>public void onCreate(Bundle icicle) {        super.onCreate(icicle);        // ToDo add your GUI initialization code here        setContentView(R.layout.main);        go=(Button)findViewById(R.id.go);        no=(EditText)findViewById(R.id.noofradio);        err=(TextView)findViewById(R.id.err);        go.setOnClickListener(new OnClickListener() {            public void onClick(View arg0) {               try               {                   int a = Integer.parseInt(no.getText().toString());                   RadioGroup radiogroup = new RadioGroup(MainActivity.this);                   LinearLayout.LayoutParams rg = new RadioGroup.LayoutParams(                           RadioGroup.LayoutParams.WRAP_CONTENT,                           RadioGroup.LayoutParams.WRAP_CONTENT);                  for (int i = 0; i &lt; a; i++) {                       radiobutton = new RadioButton(MainActivity.this);                       radiobutton.setText(i);                       radiobutton.setId(i);                       radiogroup.addView(radiobutton, rg);                   }               }               catch(Exception ex)               {                   err.setText(ex.toString());               }            }        });    }}</code></pre><p>this is my xml </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=""RadioButtons""        android:id=""@+id/err""/&gt;      &lt;EditText           android:layout_width=""fill_parent""           android:layout_height=""wrap_content""           android:text=""""           android:id=""@+id/noofradio""&gt;       &lt;/EditText&gt;       &lt;Button            android:id=""@+id/go""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""Buttons""&gt;        &lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre>","579515","","375874","","2011-01-25 06:57:29","2013-03-20 03:19:48","Radiobutton dynamically","<android>","2","3","","",""
"4790620","1","4790669","","2011-01-25 06:31:02","0","142","<p>below is my code for customlist.</p><pre><code>package com.demo.list;import java.util.ArrayList;import android.app.ListActivity;import android.app.ProgressDialog;import android.content.Context;import android.os.Bundle;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.ArrayAdapter;import android.widget.BaseAdapter;import android.widget.ImageView;import android.widget.TextView;public class MyCustomListView extends ListActivity {    private ArrayList&lt;String&gt; m_orders=null;    private OrderAdapter m_adapter;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        m_orders = new ArrayList&lt;String&gt;();        for(int i=0;i&lt;10;i++)        {            m_orders.add(""Android List"");        }        this.m_adapter = new OrderAdapter(this, R.layout.row, m_orders);                setListAdapter(this.m_adapter);    }    private class OrderAdapter extends BaseAdapter    {        private ArrayList&lt;String&gt; items;        public OrderAdapter(Context context,int id,ArrayList&lt;String&gt; items)        {            super();            this.items=items;        }        public View getView(int position,View convertView,ViewGroup parent)        {            View view=convertView;            if(view==null)            {                LayoutInflater inflater=(LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);                view=inflater.inflate(R.layout.row,null);            }            String string=items.get(position);            if(string!=null)            {                TextView t1=(TextView)findViewById(R.id.toptext);                TextView t2=(TextView)findViewById(R.id.bottomtext);                ImageView imageview=(ImageView)findViewById(R.id.image);                if(t1!=null)                {                    t1.setText(""Name:-""+string.toString());                }                if(t2!=null)                {                    t2.setText(""Status:-""+string.toString());                }            if(imageview!=null)                {                    imageview.setImageResource(R.drawable.icon);                }            }            return view;        }        @Override        public int getCount() {            // TODO Auto-generated method stub            return 10;        }        @Override        public Object getItem(int position) {            // TODO Auto-generated method stub            return position;        }        @Override        public long getItemId(int position) {            // TODO Auto-generated method stub            return position;        }    }}</code></pre><p>and here is my 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:layout_width=""fill_parent"" android:layout_height=""?android:attr/listPreferredItemHeight""&gt;    &lt;ImageView android:id=""@+id/image"" android:layout_width=""wrap_content""        android:layout_height=""fill_parent"" android:layout_marginRight=""6dip""&gt;    &lt;/ImageView&gt;    &lt;LinearLayout android:orientation=""vertical""        android:layout_width=""0dip"" android:layout_height=""fill_parent""        android:layout_weight=""1""&gt;        &lt;TextView android:id=""@+id/toptext""                  android:layout_width=""fill_parent""                  android:layout_height=""0dip""                  android:layout_weight=""1""                  android:gravity=""center_vertical""/&gt;        &lt;TextView android:id=""@+id/bottomtext""                  android:layout_width=""fill_parent""                  android:layout_height=""0dip""                  android:layout_weight=""1""                  android:singleLine=""true""                  android:ellipsize=""marquee""/&gt;        &lt;/LinearLayout&gt;&lt;/LinearLayout</code></pre><p>My problem is that i am only getting first element of the list though i have added 10 elements to arraylist.can anyone tell me what is the wrong with this code.</p>","411359","","","","","2011-01-25 06:53:28","problem with customlist view?","<android><android-layout>","1","0","","",""
"4790624","1","4790687","","2011-01-25 06:31:37","1","686","<p>I'm a little confused... After the animation, the splash screen is supposed to start an intent function to operate the next .java activity file... but when it runs after the splash screen in the emulator, it wont work. I opened Logcat and it said something to an extent of a java.lang.nullpointer and runtime exception running at the Pause feature... can anyone explain this to me? Thanks.</p><pre><code>package com.unicorn.test.whee;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.animation.Animation;import android.view.animation.Animation.AnimationListener;import android.view.animation.AnimationUtils;import android.widget.ImageView;public class SplashScreenPear extends Activity {ImageView pearfade;/** Called when the activity is first created. */public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.pear); }private void startAnimating(){  Animation pearfadeact = AnimationUtils.loadAnimation(this, R.anim.fadein);  ImageView pearfade = (ImageView) findViewById(R.id.pearish);pearfadeact.setAnimationListener(new AnimationListener(){    public void onAnimationEnd(Animation animation) {        // The animation has ended, transition to the Main Menu screen        startActivity(new Intent(SplashScreenPear.this, Unicorn.class));        SplashScreenPear.this.finish(); }        public void onAnimationRepeat(Animation animation) {        }        public void onAnimationStart(Animation animation) {        }    });pearfade.startAnimation(pearfadeact); } @Override protected void onPause() {     super.onPause();     pearfade.clearAnimation();   }     @Override     protected void onResume() {     super.onResume();     startAnimating();     } }</code></pre><p>Logcat:</p><pre><code>01-24 23:54:22.040: INFO/ActivityManager(74): Displayed com.unicorn.test.whee/.SplashScreenPear: +2s317ms (total +2m20s769ms)01-24 23:54:25.790: INFO/ActivityManager(74): Starting: Intent { cmp=com.unicorn.test.whee/.Unicorn } from pid 57901-24 23:54:25.790: DEBUG/AndroidRuntime(579): Shutting down VM01-24 23:54:25.790: WARN/dalvikvm(579): threadid=1: thread exiting with uncaught    exception (group=0x40015560)01-24 23:54:25.790: ERROR/AndroidRuntime(579): FATAL EXCEPTION: main01-24 23:54:25.790: ERROR/AndroidRuntime(579): java.lang.RuntimeException: Unable to pause activity {com.unicorn.test.whee/com.unicorn.test.whee.SplashScreenPear}: java.lang.NullPointerException01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2329)01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2286)01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2266)01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at android.app.ActivityThread.access$1700(ActivityThread.java:117)01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at android.os.Handler.dispatchMessage(Handler.java:99)01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at android.os.Looper.loop(Looper.java:123)01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at android.app.ActivityThread.main(ActivityThread.java:3647)01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at java.lang.reflect.Method.invokeNative(Native Method)01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at java.lang.reflect.Method.invoke(Method.java:507)  01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at dalvik.system.NativeStart.main(Native Method)01-24 23:54:25.790: ERROR/AndroidRuntime(579): Caused by: java.lang.NullPointerException 01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at com.unicorn.test.whee.SplashScreenPear.onPause(SplashScreenPear.java:50) 01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at android.app.Activity.performPause(Activity.java:3853) 01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1190)01-24 23:54:25.790: ERROR/AndroidRuntime(579):     at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2316)01-24 23:54:25.790: ERROR/AndroidRuntime(579):     ... 12 more01-24 23:54:26.339: WARN/ActivityManager(74): Activity pause timeout for HistoryRecord{4067cb18 com.unicorn.test.whee/.SplashScreenPear} 01-24 23:54:28.169: INFO/Process(579): Sending signal. PID: 579 SIG: 901-24 23:54:28.210: INFO/ActivityManager(74): Process com.unicorn.test.whee (pid 579) has died.01-24 23:54:28.230: ERROR/InputDispatcher(74): channel '405fa740 com.unicorn.test.whee/com.unicorn.test.whee.SplashScreenPear (server)' ~ Consumer closed input channel or an error occurred.  events=0x801-24 23:54:28.230: ERROR/InputDispatcher(74): channel '405fa740 com.unicorn.test.whee/com.unicorn.test.whee.SplashScreenPear (server)' ~ Channel is unrecoverably broken and will be disposed!</code></pre>","394842","","394842","","2011-01-25 06:40:54","2011-01-25 06:50:18","Android: Issues transitioning to the next .java?","<android><eclipse><animation><emulator><transition>","4","2","","",""
"4790746","1","4790977","","2011-01-25 06:54:59","20","25456","<p>I need to put a link in a <code>TextView</code>, I have a string that contains the tag <code>&lt;a href=""link""&gt;Text for link&lt;/a&gt;</code> and some other text.The problem is that if I run the project I can see the text but it's not clickable. I tried with the <code>&lt;b&gt;</code> tag too to see if that works and it seems that it doesn't work too.</p><p>How can I make this to work without the <a href=""http://developer.android.com/reference/android/text/util/Linkify.html""><code>Linkify</code></a> usage?  </p>","449310","","648313","","2012-01-20 14:19:48","2013-07-12 08:01:58","Links in TextView","<android><textview><links>","6","3","3","",""
"4790812","1","","","2011-01-25 07:03:38","1","145","<p>I am trying to implement thread in my application. I am working with web service and fetching it to show some results. For the time being i am showing a progress dialog for which i am using thread. Following is the thread implementation :    </p><pre><code>final Handler handler=new Handler();      progDialog = ProgressDialog.show(Departments.this.getParent(), ""Loading... "",""please wait...."", true);      new Thread(new Runnable() {     @Override     public void run() {      // TODO Auto-generated method stub      suid = DownloadData();  struid = suid.struid;dep = Download(struid);departments = dep.departments;depid = dep.depid;handler.post(new Runnable() { @Override public void run() {  // TODO Auto-generated method stub  progDialog.dismiss(); }});   }    }).start();  </code></pre><p>When i debug the application everything seems to be fine and results are shown accordingly. However when i run the application, progress dialog is seen but results are not displayed.<br>Is there something i am missing?</p>","541786","","541786","","2011-05-19 09:34:27","2011-05-19 09:34:27","Android thread showing result on debugging but not on running","<android>","0","2","1","",""
"4790843","1","","","2011-01-25 07:08:23","0","217","<p>hi    i dont know how to set the title of axis as bold in a graph using android.Anyone please help me</p>","588627","","","","","2011-01-25 07:08:23","set axis title as bold in a graph in android","<android><graph><tags><axis><bold>","0","7","","",""
"4790932","1","","","2011-01-25 07:23:34","0","2272","<p>I have created a custom dialog class(extended it with Dialog) with 3 buttons, and each button must call a different activity. I seem to be having problems with calling the activity onClick.</p><pre><code>private class OKListener implements android.view.View.OnClickListener {    @Override    public void onClick(View v) {        dismiss();        Intent myintent = new Intent(myapp.this,nextAct.class)        startActivity(myintent);        }    }}</code></pre><p>What am I missing?Can you give me specific examples on how to call an activity from a custom Dialog class? I would really appreciate it much! I am already desperate after going through the whole night without much sleep. </p><p>I followed this tutorial by the way: <a href=""http://www.androidpeople.com/android-custom-dialog-example/"" rel=""nofollow"">How to display custom dialog in Android</a> </p><p>~Ciao</p>","588644","","","","","2011-01-25 08:36:33","How to get data from custom dialog?","<android><dialog>","2","1","","",""
"4790978","1","","","2011-01-25 07:31:37","0","2010","<p>I am starting gallery through intent otherwise its giving problem to display gallery in grid view. But i want the actual sd card path of the image i am selection from the gallery, opened by intent. </p><p>here is the code..</p><pre><code>    Intent photoPickerIntent = new Intent(Intent.ACTION_GET_CONTENT);    photoPickerIntent.setType(""image/jpg"");    photoPickerIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(""file:///sdcard/Pictures/image.jpg""));    startActivityForResult(photoPickerIntent, 1);protected void onActivityResult(int requestCode, int resultCode, Intent intent)      {   super.onActivityResult(requestCode, resultCode, intent);          if (resultCode == RESULT_CANCELED) {           showToast(this,""Activity cancelled"");           return;          }           else if(resultCode == RESULT_OK) {             System.out.println(""requestCode--""+requestCode);             System.out.println(""resultCode--""+resultCode);             System.out.println(""data--""+intent.getData());             Uri uri = intent.getData();             String data = uri.getPath();             System.out.println(""uri.getPath()--""+uri.getPath());             System.out.println(""type--""+intent.getType());             System.out.println(""path--""+Environment.getExternalStorageState());                return;              }             switch (requestCode) {                 case CAMERA_ACTIVITY:                      Bundle b = intent.getExtras();                     Bitmap bm = (Bitmap) b.get(""data"");              //       mImageView.setImageBitmap(bm); // Display image in the View                     // large image?                       if (b.containsKey(MediaStore.EXTRA_OUTPUT)) { // large image?                       Log.i(TAG, ""This is a large image"");                          showToast(this,""Large image"");                       // Should have to do nothing for big images -- should already saved in MediaStore ... but                           MediaStore.Images.Media.insertImage(getContentResolver(), bm, null, null);                           }                             else {                               Log.i(TAG, ""This is a small image"");                               showToast(this,""Small image"");                              MediaStore.Images.Media.insertImage(getContentResolver(), bm, null, null);                           }                          break;                         }                  }                }</code></pre><p>I am getting all data from intent object. But i want the sd card path for the image what i am selecting to upload that image in server..</p><p>how do i get that?</p>","444277","","750987","","2011-05-28 11:02:25","2013-12-05 10:06:35","Image sd card path from intent gallery","<android><image><android-intent><gallery><sd-card>","2","0","","",""
"4791055","1","","","2011-01-25 07:46:51","0","63","<p>Whether It is possible to set User busy when call comes from particular number in Android mobiles 2.1 version</p>","558304","","","","","2011-01-25 08:29:17","Android Mobile Calls","<android>","1","1","","",""
"4791097","1","","","2011-01-25 07:54:39","2","1105","<p>I'm having a terrible time trying to view a JPG file that I've downloaded using ACTION_VIEW in my Android App.  I can verify that the file is present and that it is the correct size.  I can pull the file from the emulator and open it on my computer, so I know the JPG is not corrupt.  I've also tried the code in <a href=""http://stackoverflow.com/questions/1740654/view-image-in-action-view-intent"">View image in ACTION_VIEW intent?</a>.</p><p>My code is as follows:</p><pre><code>// start intent to view the file  String filename = ""test.jpg""String downloadsDirectoryPath = getFilesDir().getPath() + ""/downloads"";  File file = new File(downloadsDirectoryPath + ""/"" + filename);Intent i = new Intent();  i.setAction(Intent.ACTION_VIEW);  i.setDataAndType(Uri.fromFile(file), ""image/*"");    startActivity(i);</code></pre><p>This seems like it should be straight forward, but whenever I run the above code, I get </p><pre><code>ERROR/UriImage(336): got exception decoding bitmap  ERROR/UriImage(336): java.lang.NullPointerExceptionERROR/UriImage(336):     at com.android.camera.Util.makeInputStream(Util.java:336)ERROR/UriImage(336):     at com.android.camera.Util.makeBitmap(Util.java:307)ERROR/UriImage(336):     at com.android.camera.Util.makeBitmap(Util.java:299)ERROR/UriImage(336):     at com.android.camera.gallery.UriImage.fullSizeBitmap(UriImage.java:94)ERROR/UriImage(336):     at com.android.camera.gallery.UriImage.fullSizeBitmap(UriImage.java:86)ERROR/UriImage(336):     at com.android.camera.gallery.UriImage.thumbBitmap(UriImage.java:120)ERROR/UriImage(336):     at com.android.camera.ImageGetter$ImageGetterRunnable.executeRequest(ImageGetter.java:173)ERROR/UriImage(336):     at com.android.camera.ImageGetter$ImageGetterRunnable.run(ImageGetter.java:149)ERROR/UriImage(336):     at java.lang.Thread.run(Thread.java:1096)</code></pre><p>Any ideas about what's going on here?</p>","588599","","","","","2011-07-07 20:49:52","Can I use ACTION_VIEW to view a JPG I've downloaded?","<android>","2","2","","",""
"4791228","1","","","2011-01-25 08:18:50","2","1860","<p>I am working on a program that takes address as an input from user and navigates the google map to that particular location,i have used getFromLocationName() method of geocoder but not getting the output, I am little afraid because i am not able to understand  the meaning of the below phrase given in the android site</p><blockquote>  <p>""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. Use the  isPresent() method to determine""</p></blockquote><p>if that back end service is not present then how to get it..</p><p>but even when i try to use <code>isPresent()</code> method it is giving me compilation error,</p><p>plz suggest me, response will be very much appreciated </p>","505580","","881286","","2013-08-18 01:40:57","2013-08-18 01:40:57","Geocoder is not working in android","<android><google-api>","0","6","","",""
"4791254","1","","","2011-01-25 08:23:26","0","477","<p>have a facebook page that has public info that can be accessed without logging in.However, when I access it through touch.facebook.com, it demands a login. </p><p>The page is : <a href=""http://www.facebook.com/soho.sushi.bar"" rel=""nofollow"">http://www.facebook.com/soho.sushi.bar</a>and the touch : <a href=""http://touch.facebook.com/soho.sushi.bar"" rel=""nofollow"">http://touch.facebook.com/soho.sushi.bar</a></p>","170030","","","","","2011-01-27 21:12:06","are there Different permissions with touch.facebook.com and www.facebook.com?","<iphone><android><facebook><mobile><touch>","1","0","","",""
"4791310","1","4791384","","2011-01-25 08:31:16","0","428","<p>Hy!</p><p>I have 2 classes:</p><p>Main:</p><pre><code>    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);       startActivityForResult(new Intent(Main.this, Login.class), 1);    }}</code></pre><p>LogIn:</p><pre><code>public class Login extends Activity{    ProgressDialog pd = null;    @Override    protected void onCreate(Bundle savedInstanceState) {        // TODO Auto-generated method stub        super.onCreate(savedInstanceState);        setContentView(R.layout.login);        final EditText user = (EditText)findViewById(R.id.login_etuser);        final EditText pw = (EditText)findViewById(R.id.login_etpw);        Button btlogin = (Button)findViewById(R.id.login_btlog);        final Thread thread = new Thread (){            public void run() {                try                {                String result = """";                result = postData(user.getText().toString(),pw.getText().toString());                final JSONObject jObject = new JSONObject(result);                JSONObject menuObject = jObject.getJSONObject(""responseData"");                Log.e(""XXX"", menuObject.getString(""session_id""));                //pd.dismiss();                }                catch (Exception e)                {                    Log.e(""XXX"", e.getMessage());                }            };        };        btlogin.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                if (!user.getText().toString().equals("""") &amp;&amp; !pw.getText().toString().equals(""""))                {                    thread.run();                }            }        });    }    public String postData(final String user, final String pw) {        // Create a new HttpClient and Post Header        HttpClient httpclient = new DefaultHttpClient();        HttpPost httppost = new HttpPost(""http://surfkid.redio.de/login"");        String result;        BufferedReader in = null;        try {            // Add your data            List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);            nameValuePairs.add(new BasicNameValuePair(""username"", user));            nameValuePairs.add(new BasicNameValuePair(""password"", md5(pw)));            httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));            // Execute HTTP Post Request            HttpResponse response = httpclient.execute(httppost);            if(response != null){                in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));                StringBuffer sb = new StringBuffer("""");                String line = """";                String NL = System.getProperty(""line.separator"");                while ((line = in.readLine()) != null) {                    sb.append(line + NL);                }                in.close();                result = sb.toString();                return result;              }        } catch (ClientProtocolException e) {             Log.e(""xxx"", e.getMessage());        } catch (IOException e) {            Log.e(""xxx"", e.getMessage());        }        return null;    }     private String md5(String in) {            MessageDigest digest;            try {                digest = MessageDigest.getInstance(""MD5"");                digest.reset();                        digest.update(in.getBytes());                byte[] a = digest.digest();                int len = a.length;                StringBuilder sb = new StringBuilder(len &lt;&lt; 1);                for (int i = 0; i &lt; len; i++) {                    sb.append(Character.forDigit((a[i] &amp; 0xf0) &gt;&gt; 4, 16));                    sb.append(Character.forDigit(a[i] &amp; 0x0f, 16));                }                return sb.toString();            } catch (NoSuchAlgorithmException e) { e.printStackTrace(); }            return null;        }}</code></pre><p>Logcat:</p><pre><code>01-25 09:24:57.641: ERROR/AndroidRuntime(31148): FATAL EXCEPTION: main01-25 09:24:57.641: ERROR/AndroidRuntime(31148): java.lang.NullPointerException: println needs a message01-25 09:24:57.641: ERROR/AndroidRuntime(31148):     at android.util.Log.println_native(Native Method)01-25 09:24:57.641: ERROR/AndroidRuntime(31148):     at android.util.Log.e(Log.java:215)01-25 09:24:57.641: ERROR/AndroidRuntime(31148):     at android.skiptvad.Login$1.run(Login.java:59)01-25 09:24:57.641: ERROR/AndroidRuntime(31148):     at android.skiptvad.Login$2.onClick(Login.java:75)01-25 09:24:57.641: ERROR/AndroidRuntime(31148):     at android.view.View.performClick(View.java:2461)01-25 09:24:57.641: ERROR/AndroidRuntime(31148):     at android.view.View$PerformClick.run(View.java:8888)01-25 09:24:57.641: ERROR/AndroidRuntime(31148):     at android.os.Handler.handleCallback(Handler.java:587)01-25 09:24:57.641: ERROR/AndroidRuntime(31148):     at android.os.Handler.dispatchMessage(Handler.java:92)01-25 09:24:57.641: ERROR/AndroidRuntime(31148):     at android.os.Looper.loop(Looper.java:123)01-25 09:24:57.641: ERROR/AndroidRuntime(31148):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-25 09:24:57.641: ERROR/AndroidRuntime(31148):     at java.lang.reflect.Method.invokeNative(Native Method)01-25 09:24:57.641: ERROR/AndroidRuntime(31148):     at java.lang.reflect.Method.invoke(Method.java:521)01-25 09:24:57.641: ERROR/AndroidRuntime(31148):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)01-25 09:24:57.641: ERROR/AndroidRuntime(31148):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)01-25 09:24:57.641: ERROR/AndroidRuntime(31148):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Please Help!!!</p><p>What is wrong with the Thread.start in the Button on Click?</p>","547995","","","","","2011-01-25 08:45:13","App Freez and UI Blocking","<android>","1","0","","",""
"4791314","1","","","2011-01-25 08:31:31","0","2466","<p>I have worked some in Android and got to do some small apps in android. Now I am newly working in titanium. <strong>I am stuck on how to do push notification in titanium for android?</strong> The problem is even a little worse. I need to do push notification for all versions of android. As google is providing c2dm but it is only for v2.2 and above. I got to know something about urban airship but not sure that it could be used in titanium. Also to use urban airship we need to install a seperate app which is not fully recommended. Any support will be highly welcomed. Please response as quickly as possible. Thanks in advance.</p>","588706","","","","","2014-04-10 07:15:23","How to use push notification in titanium for Android","<android><notifications><push><titanium>","1","0","1","",""
"4791316","1","","","2011-01-25 08:31:43","0","344","<p>I am developing an android application which involves google map activity.I have done all the coding part.Now want to generate the google api key for my system.Can anybody help in this regard.Thanks in advanceTushar Sahni</p>","475349","","","","","2013-12-09 16:01:15","generating google api key in android","<android>","2","0","","",""
"4791373","1","","","2011-01-25 08:39:45","0","457","<p>I am very new to Android and would like to know the libraries / classes / API, if any, which can be used to stream audio to the caller without using the phone's speaker.</p><p>Thanks in advance.</p>","562073","","","","","2011-07-05 02:38:17","How to ""push"" audio stream through the phone to the caller without using the phone's speaker","<android><audio-streaming>","1","2","0","",""
"4791379","1","4791640","","2011-01-25 08:40:30","1","3527","<p>in my app I've a service that register a BroadcastReceiver into <code>onStart()</code> method:</p><pre><code>public void onStart() {    if(something....) {        IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);        filter.addAction(Intent.ACTION_SCREEN_OFF);        screenReceiver = new ScreenReceiver();        registerReceiver(screenReceiver, filter);    } else {        if(screenReceiver != null) {            unregisterReceiver(screenReceiver);        }    }}</code></pre><p>and it works correctly.But I would unregister this BroadcastReceiver within <code>else</code> and I receive this error:</p><pre><code>01-25 09:30:03.730: ERROR/AndroidRuntime(11748): FATAL EXCEPTION: main01-25 09:30:03.730: ERROR/AndroidRuntime(11748): java.lang.RuntimeException: Unable to start service com.myservice.Service@460ce7d8 with Intent { cmp=com.myservice/.Service (has extras) }: java.lang.IllegalArgumentException: Receiver not registered: com.myreceiver.ScreenReceiver@4607937001-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3063)01-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at android.app.ActivityThread.access$3600(ActivityThread.java:125)01-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2096)01-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at android.os.Handler.dispatchMessage(Handler.java:99)01-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at android.os.Looper.loop(Looper.java:123)01-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at java.lang.reflect.Method.invokeNative(Native Method)01-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at java.lang.reflect.Method.invoke(Method.java:521)01-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at dalvik.system.NativeStart.main(Native Method)01-25 09:30:03.730: ERROR/AndroidRuntime(11748): Caused by: java.lang.IllegalArgumentException: Receiver not registered: com.myreceiver.ScreenReceiver@4607937001-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at android.app.ActivityThread$PackageInfo.forgetReceiverDispatcher(ActivityThread.java:793)01-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:814)01-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:331)01-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at com.myservice.Service.onStart(Service.java:291)01-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at android.app.Service.onStartCommand(Service.java:420)01-25 09:30:03.730: ERROR/AndroidRuntime(11748):     at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3053)01-25 09:30:03.730: ERROR/AndroidRuntime(11748):     ... 10 more</code></pre><p>Can you help me?</p>","353030","","17279","","2011-01-25 08:51:46","2011-01-25 09:11:46","Problem with unregister BroadcastReceiver","<android><service><broadcastreceiver><receiver><onstart>","1","0","1","",""
"4791405","1","4791520","","2011-01-25 08:44:26","2","501","<p>I would like to monetize my free mobile application with help of ads.</p><p>What mobile ad solutions are available on the market?Do they have dedicated SDK for Android or iPhone?</p><p>Only solution that I know is AdMob.</p><p>Are there any solutions dedicated for Central European market? </p>","361832","","","","","2011-01-25 09:29:19","Ads providers for mobile application","<iphone><android><ios><admob><ads>","1","1","","2011-01-25 09:42:23",""
"4791437","1","","","2011-01-25 08:47:49","2","205","<p>I'm trying to start the GroomDroid web server in Android but when it starts, a black window is shown. </p><p><img src=""http://i.stack.imgur.com/0B23j.png"" alt=""enter image description here""></p><p>I'd like to start this app in the background without that screen being shown.</p><p>I'm starting this app in the following way:</p><pre><code>Intent webServer = new Intent();webServer.setClassName(""net.allory.groom"",""net.allory.groom.GroomDroid"");startActivity(webServer);</code></pre><p>I also tried with <code>startService(webServer);</code> but it doesn't seem to work.</p><p>Can anybody help me with that ? </p>","588729","","418183","","2011-01-25 08:57:10","2011-04-12 09:55:56","Run application in the background","<java><android>","2","1","1","",""
"4791511","1","","","2011-01-25 08:56:49","4","14336","<p>In my android application I have a <code>TextView</code> and a <code>SeekBar</code>. Both the values are used for calculating result on a button click.</p><p>The problem is how to capture the <code>SeekBar</code> value and convert it into String for the calculation.</p><p>The code is below:</p><pre><code>class clicker implements Button.OnClickListener {    public void onClick(View v) {        String a,b;        Integer vis;        a = txtbox3.getText().toString();        b = slider1.getContext().toString();        vis = (Integer.parseInt(a)*Integer.parseInt(b))/100;        tv.setText(vis.toString());    }}</code></pre><p>Please Help. Thanks in advance. </p>","582760","","418183","","2011-01-25 09:02:33","2012-07-25 00:24:30","Capture SeekBar values","<android><seekbar>","2","0","2","",""
"4791569","1","4791618","","2011-01-25 09:03:00","0","920","<p>How would i go on connecting my Android application with my local database?</p>","548591","","","","","2011-01-25 09:22:55","Connecting Android Application with any Database","<android>","1","0","","",""
"4791574","1","","","2011-01-25 09:04:00","2","1626","<p>My application is a chat application, and its UI is: </p><p>Header of the app<br>List View<br>Chat message, input box, and send button</p><p>But the problem is when I click the edit text, the soft keyboard comes and pushes everything up, but I need the header to stay on the screen. I've attached the simplified problem images and UI code <a href=""http://picasaweb.google.com/tozoysa/Android#"" rel=""nofollow"">here</a>. (I can't post multiple links or images in this post because I'm new to Stack Overflow.)</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;TextView android:text=""Header contents"" android:layout_width=""fill_parent""        android:textSize=""20sp"" android:gravity=""center_horizontal""        android:layout_height=""wrap_content"" /&gt;    &lt;ListView android:id=""@android:id/list"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_weight=""1"" /&gt;    &lt;EditText android:text="""" android:layout_gravity=""bottom""        android:id=""@+id/EditText01"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;/LinearLayout&gt;</code></pre><p>Android has this requirement in the default messaging app. </p><p>Does anyone have any ideas?</p>","588742","","865899","","2011-08-03 19:55:51","2014-04-03 10:34:02","How to keep some of the components fixed when the soft keyboard comes in?","<android><layout>","3","0","","",""
"4791588","1","4791963","","2011-01-25 09:05:35","3","195","<p>what is unit testing in this framework Android ,iPhone, Symbian, WP7?Can you please just give some path to get solution, to implement the unit testing?</p>","504130","","1104926","","2011-12-19 13:54:06","2011-12-19 13:54:06","What is Unit testing in Android , iPhone , Symbian and windows phone?","<iphone><android><windows-phone-7><symbian>","3","0","3","",""
"4791619","1","4791703","","2011-01-25 09:08:17","4","4869","<p>I have main.xml and is a very large file, i want to split some of the components(some layouts) to other xml so that i can link from main.xml itself. is this possible from android ?</p>","487604","","","","","2013-01-22 11:42:20","how to split main.xml to other xmls?","<android>","2","1","3","",""
"4791720","1","4791767","","2011-01-25 09:23:47","6","1411","<p>I am trying to make my app rotation friendly, but I am having some problems saving the cursor.</p><p>The cursor holds about 13k+ rows of data displayed in a <code>ListView</code>, and thus would take quite a while if I would do a requery every time the configuration changes.  In my <code>onRetainNonConfigurationInstance()</code>, I am returning my Cursor and then retrieving it through <code>getLastNonConfigurationInstance()</code>.</p><p>However, my retrieved cursor seems to be closed already, and thus my adapter cannot render the list anymore.  From what I understand, the cursor was closed since <code>onDestroy()</code> automatically closes all cursors.</p><p>I save the Cursor like this:</p><pre><code>@Overridepublic Object onRetainNonConfigurationInstance() {    return myCursor;}</code></pre><p>And retrieve it like this:</p><pre><code>myCursor = (Cursor)getLastNonConfigurationInstance();if (myCursor == null) {    // Do some stuff here (access DB, etc)} else { // we are returning from configuration change    // Feed the cursor to the adapter}</code></pre><p>I am pasting the stack trace if someone wants to look at it:   </p><pre><code>01-25 16:57:45.637: ERROR/AndroidRuntime(12976): android.database.StaleDataException: Access closed cursor    01-25 16:57:45.637: ERROR/AndroidRuntime(12976):     at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:217)    01-25 16:57:45.637: ERROR/AndroidRuntime(12976):     at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:41)    01-25 16:57:45.637: ERROR/AndroidRuntime(12976):     at com.test.sample.helper.DictionaryAdapter.bindView(DictionaryAdapter.java:35)[........More ListView-related errors here..........]</code></pre><p>I stepped through the code and I found out that as far as <code>onRetainNonConfigurationInstance()</code>, the cursor is still open, but after getting it through <code>getLastNonConfigurationInstance()</code> it is already closed.</p><p>How can I make my Cursor survive the orientation change?  Thank you for the help!</p><p><strong>EDIT:</strong>Based on Romain's answer, I commented out all my <code>startManagingCursor()</code>s. I should have connected the dots and thought about it! Anyway, my app now survives one rotation, but flipping it back to the original orientation still crashes it. Continuing my debugging and will let you know what I find out.</p><p><strong>EDIT2:</strong>I think I may have found what is causing the new errors. I have implemented a <code>FilterQueryProvider</code> which returns a new Cursor.  What I did was assign the results of that filter to my original Cursor.  Seems to work so far.</p>","395576","","395576","","2011-01-26 02:39:47","2011-01-26 02:39:47","How can I make my Cursor survive an orientation change?","<android><configuration><cursor><rotation>","2","0","1","",""
"4791790","1","4791996","","2011-01-25 09:31:58","1","814","<p>I would like to call power off,reboot, etc.. dialog as same as default android dialog when push power button long from my application.<br>I no need to call directly reboot,power off, etc... from my application.<br>Just would like to call that dialog.<br>How to call it ? or How to send power button key on application ?<br>Thanks in advance.</p>","137869","","","","","2011-01-25 09:51:55","How to call power off,reboot dialog from application?","<java><android><keycode><android-softkeyboard>","2","0","","",""
"4791808","1","","","2011-01-25 09:33:59","1","926","<p>I have created Broadcast Receiver for my app which involves bluetooth communication. That receiver gets called everytime the connection is made or lost. Then in that receiver there is a callback method which passes the appropriate message to the Activity which registered with it. </p><p>Whichever is the current activity registers the receiver and then in onDestroy I want that receiver should be unregistered. But I always keep getting ""Receiver not registered"" exception.</p><p>Also, I do not know if I need to mention receiver in the manifest or not. Currently, if I do not mention the receiver in the manifest then Broadcast Receiver do not get called. And if I mention it in the manifest then I am able to register it and receives proper alerts on connection and connection lost but the only problem is on unregistering it. So, the receiver is mentioned in the manifest and also its registered by registerReceiver(btconn, intentfilter) method.</p><p>What may be the issue?</p>","261566","","881229","","2014-04-01 19:55:48","2014-04-01 19:55:48","Receiver not registered exception in android?","<android><broadcastreceiver>","0","1","","",""
"4791822","1","4791881","","2011-01-25 09:35:57","10","16610","<p>how to add one layout in another layout.I created this layout in tblrow.XML.so i want to add this rows in menu.XML.i want to add this rows depending upon the no of rows.How can i do that.If i add it how can i identify each row.Please help me.I need solution in java not in XML.My Code is</p><pre><code>&lt;TableRow android:id=""@+id/tblRowMovies"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:background=""@drawable/btn_backgrnd""  android:clickable=""true"" android:focusable = ""true"" android:layout_weight=""1.0""&gt;&lt;ImageView android:layout_width=""wrap_content"" android:layout_height=""fill_parent"" android:src=""@drawable/movie"" android:layout_gravity=""center_vertical|center_horizontal""/&gt;&lt;TextView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""MOVIES"" android:layout_gravity=""center_vertical"" android:paddingLeft=""20dp"" android:textColor=""@android:color/white"" android:textSize=""20sp"" android:textStyle=""bold""&gt;&lt;/TextView&gt;        </code></pre><p>.</p>","537819","","537819","","2011-01-25 09:53:40","2013-02-27 07:36:52","adding a layout in another layout","<android><android-layout>","3","0","1","",""
"4791826","1","4792749","","2011-01-25 09:36:26","2","739","<p>How can I call an external application from my application</p><p>Eg: I need to call Sazham (application) from my app.. I can see the package name of the application in logcat, will that be useful for any purpose?</p>","362088","","","","","2011-01-25 11:08:04","calling an extrenal application","<android><android-intent><shazam>","2","0","","",""
"4791865","1","4792403","","2011-01-25 09:39:12","0","227","<p>checked lots of other questions and websites, couldn't really find what I was looking for. I'm making a contact list for practice... what I'm trying to do is give the user the ability to update the contact's info. When they click on a contact, the fields should be filled in as they already are, not be blank with a Hint. Problem now is that the fields aren't populated, everything else works just fine but all the fields just have hints instead of the text the user filled in for the contact upon creation. Here is the code:</p><p>ContacList.class's code...</p><pre><code>@Override    protected void onListItemClick(ListView l, View v, int position, long id) {        super.onListItemClick(l, v, position, id);        mDbAdapter = new TagDBAdapter(this);        mDbAdapter.open();        Cursor cursor = mCursor;        cursor.moveToPosition(position);        Intent intent = new Intent(this, AddEditContact.class);        intent.putExtra(TagDBAdapter.KEY_ROWID, id);        startActivityForResult(intent, ACTIVITY_EDIT);    }</code></pre><p>Code for the AddEditContact.class</p><pre><code>@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        this.initLayout();        mDbAdapter = new TagDBAdapter(this);        mDbAdapter.open();        Bundle extras = getIntent().getExtras();        mRowId = extras.getLong(TagDBAdapter.KEY_ROWID);        if(mRowId != null) {            mContact = mDbAdapter.fetchContact(mRowId);            m_firstNameEditE.setText(mContact.getFirstName());            m_lastNameEditE.setText(mContact.getLastName());            m_phoneNumberEdit.setText(mContact.getPhoneNumber());            m_emailEditE.setText(mContact.getEmail());            m_homePhoneEditE.setText(mContact.getHomePhone());            m_workPhoneEditE.setText(mContact.getWorkPhone());        }    }</code></pre><p>Fetch contact code</p><p>Here is the code for fetchContact()</p><pre><code>public Contact fetchContact(long rowId) throws SQLException {        Contact contact = new Contact();        Cursor mCursor =             mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID, KEY_FIRSTNAME, KEY_LASTNAME, KEY_NAME, KEY_NUMBER,                     KEY_EMAIL, KEY_HOMEPHONE, KEY_WORKPHONE}, KEY_ROWID + ""="" + rowId, null, null, null, null, null);        if(mCursor != null) {            mCursor.moveToFirst();        }        while(mCursor.moveToNext()) {            contact.setFirstName(mCursor.getString(mCursor.getColumnIndexOrThrow(KEY_FIRSTNAME)));            contact.setLastName(mCursor.getString(mCursor.getColumnIndexOrThrow(KEY_LASTNAME)));            contact.setName(mCursor.getString(mCursor.getColumnIndexOrThrow(KEY_NAME)));            contact.setPhoneNumber(mCursor.getString(mCursor.getColumnIndexOrThrow(KEY_NUMBER)));            contact.setEmail(mCursor.getString(mCursor.getColumnIndexOrThrow(KEY_EMAIL)));            contact.setHomePhone(mCursor.getString(mCursor.getColumnIndexOrThrow(KEY_HOMEPHONE)));            contact.setWorkPhone(mCursor.getString(mCursor.getColumnIndexOrThrow(KEY_WORKPHONE)));        }        return contact;    }</code></pre><p>So I'm getting the extras from the intent and getting the KEY_ROWID, and if it isn't null, setting the text of the EditTexts to the getters for the contact object I got from the fetchContact(long rowId) class, which returns a Contact object. Then I set all the EditTexts to their respective getters. But when in action, like I said, it just leaves all the fields blank, with just a Hint there.</p><p>Is there something I'm missing here? Thanks a lot.</p><p>One potential problem I thought of was that I have two intents which ask for a result from this activity, one for ACTIVITY_CREATE and one for ACTIVITY_EDIT. Maybe its getting the wrong intent.</p>","588758","","588758","","2011-01-25 10:51:20","2011-01-25 10:51:20","Grabbing information from an SQLite Database: Filling in already filled fields and updating row","<android><sqlite><android-intent>","1","0","0","",""
"4791888","1","4792413","","2011-01-25 09:40:52","1","1179","<p>I am using location listener to get long &amp; lat for my android application.</p><p>I am working with the following code:</p><pre><code>public Location getLastKnownLocation(){ Location location=null; try { // Get the location manager mLocMgr = (LocationManager) ctx.getSystemService(Context.LOCATION_SERVICE); // List all providers: // List&lt;String&gt; providers = mLocMgr.getAllProviders(); Criteria criteria = new Criteria(); bestProvider = mLocMgr.getBestProvider(criteria, false); location = mLocMgr.getLastKnownLocation(bestProvider); if(location==null) {  Thread.sleep(5000);  location=mLocMgr.getLastKnownLocation(bestProvider); } } catch(Exception e) {  Log.i(""program"", e.getMessage()); } return location;}public Location updateCurrentLocation(){ Location mLoc=null; try { mLoc=getLastKnownLocation(); mlocListener = new LocListener();  mLocMgr.requestLocationUpdates(bestProvider, 0, 0, mlocListener); mLoc=getLastKnownLocation(); } catch(Exception e) {  Log.e(""program"", e.getMessage()); } return mLoc;}</code></pre><p>It is working absolutely fine. But facing the problem when we switched off the device and start it again. Then I am getting the location null.However after starting the google map, it starts working again. So Could you please guys help me out on this because I don't want start the google map before starting my application. Thanking you for support! </p>","579936","","21234","","2011-01-25 09:51:32","2012-12-13 11:20:08","location listener","<android><listener><latitude-longitude>","2","0","","",""
"4791943","1","","","2011-01-25 09:46:43","4","5326","<p>We're trying to emulate devices with the new density of 320 dpi in Android 2.3 -such as Archos 101,and we can't seem to be able to define an emulator with such density, even after downloading the latest 2.3 sdk.</p><p>I would really appreciate some ideas on this one :)</p><p>Many thanks!</p>","588793","","1140748","","2012-05-06 16:06:58","2012-09-03 16:08:35","Emulating density of 320 dpi on android emulator","<android><emulator><archos>","3","0","1","",""
"4791988","1","","","2011-01-25 09:50:52","0","3251","<p>I had been working on android since a little long. Now I am wondering about titanium. Is it possible to write android (java) code in titanium app since the app is build in titanium? If yes then how? Actually I am having problem dealing with push notification for android in titanium. So I got a solution to build complete app in titanium and then if possible use android code in app to deal with push notification. How? Please do response as quickly as possible. Thanks in advance.</p>","588706","","418183","","2011-01-25 09:55:26","2011-01-26 18:05:04","How to write android code in titanium","<android><push-notification><titanium>","3","0","","",""
"4792157","1","4792858","","2011-01-25 10:09:07","1","587","<p>This is a noob question but I have to ask it anyway because I think I'll go crazy soon.</p><p>What I want to achieve is a <code>ListView</code> that populates by twitter and this I have implemented, the two <code>ListArray</code>s gets populated by the tweet and the picture URL.This is successful, but when I refresh twitter the new pile of twitter gets below the old ones.</p><p>I could simply clear the ListArrays but then all the twitter disappears in the list which is not desirable, I simply want to add only the new tweets, and make the new tweets get on top of the list.</p><p>So I guess this is a two fold question</p><ol><li>How do I make the list only to addwhich is not there?, and</li><li>How do I make the latest tweetappear on top?</li></ol><p>Could really use some great input, the code below is the most essential part of the (messy) code, which is the refresh method. </p><pre><code>public void updateTwitter(){        twitter = new TwitterFactory().getInstance();        try {            QueryResult result = twitter.search(new Query(TWEETQUERY));            tweets = result.getTweets();            for (Tweet tweet : tweets) {                String tweetProfile = tweet.getProfileImageUrl();                String twwwwww = tweet.getText();                for(String tww : tweetString){                    if(tww.equals(twwwwww)){                        System.out.println(""Not added"");                    } else {                        tweetString.add(twwwwww);                        urlArray.add(tweetProfile);                    }                }            }            if(adapter != null) {                tweetList.setAdapter(adapter);                System.out.println(""adapter sets, not created"");            } else {                adapter = new LazyAdapter(this, urlArray, tweetString);                tweetList.setAdapter(adapter);            }        } catch (TwitterException te) {            te.printStackTrace();            System.out.println(""Failed to search tweets: "" + te.getMessage());        }    }</code></pre>","525016","","418183","","2011-01-25 10:13:57","2011-01-26 23:24:32","For-loop inside a For-loop - ListArrays - Android, Java!","<java><android><listview>","3","0","1","",""
"4792241","1","","","2011-01-25 10:16:35","0","3474","<p>I have a TCP Client in Android (Java program in Eclipse). The server was another Java app running in Eclipse. Everything works fine in this situation.</p><p>When I tried to receive message from my colleague's app (developed in Rhapsody and I think C++), I receive the message only after his app is closed and not while his app is running and sending messages. Do you have any idea why this happens?</p><p>Thank you for the time and effort on this.</p><p>Cheers,Madhu</p><p>The java server is like this: </p><pre><code>public class TCPSendServer implements Runnable{    public static final String SERVERIP = ""192.168.178.24"";    public static final int SERVERPORT = 1200;    //static Category cat = Category.getInstance(TCPSendServer.class.getName());    //cat.debug(""Start of main()"");    public void run() {         try {             System.out.println(""S: Connecting..."");                          ServerSocket serverSocket = new ServerSocket(SERVERPORT);             String msg = ""&lt;MSG&gt;&lt;N&gt;shiftDirection&lt;/N&gt;&lt;V&gt;1&lt;/V&gt;&lt;/MSG&gt;"";             String msg1 = ""&lt;MSG&gt;&lt;N&gt;vehicleSpeed&lt;/N&gt;&lt;V&gt;120&lt;/V&gt;&lt;/MSG&gt;"";             String msg2 = ""SD&lt;!N&gt;&lt;V&gt;0&lt;!V&gt;&lt;!MSG&gt;"";             //while (true) {                 Socket client = serverSocket.accept();                  try {                      System.out.println(""S: Sending: '"" + msg + ""'"");                      PrintWriter out = new PrintWriter( new BufferedWriter( new OutputStreamWriter(client.getOutputStream())),true);                                          Thread.sleep (5000);                      out.println(msg);                      Thread.sleep (5000);                      //out.println(msg2);                      Thread.sleep (5000);                      out.println(msg1);                      //out.flush();                      System.out.println(""S: Sent."");                      System.out.println(""S: Done."");                    } catch(Exception e) {                        System.out.println(""S: Error"");                        e.printStackTrace();                    } //finally {                      //    client.close();                                            //}               //}         } catch (Exception e) {             System.out.println(""S: First try error"");             e.printStackTrace();         }    }    public static void main (String a[]) {        Thread desktopServerThread = new Thread(new TCPSendServer());        desktopServerThread.start();    }}</code></pre><p>The Android client code:Main activity:</p><pre><code>public class TCPListen extends Activity implements TCPListener {    private TextView mTitle;    public String data[] = new String[2];    /** Called when the activity is first created. */     @Override           public void onCreate(Bundle savedInstanceState) {               super.onCreate(savedInstanceState);               //setContentView(R.layout.main);                      // Set up the window layout             requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);             setContentView(R.layout.main);             getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);             // Set up the custom title             mTitle = (TextView) findViewById(R.id.title_left_text);             mTitle.setText(R.string.app_name);             mTitle = (TextView) findViewById(R.id.title_right_text);             //TcpServiceHandler handler=new TcpServiceHandler(this);               //handler.execute(""192.168.178.24"");               TcpServiceHandler handler = new TcpServiceHandler(this,this);               Thread th = new Thread(handler);               th.start();                      }                   public String[] callCompleted(String source){                 Log.d(""TCP"", ""Std parser "" + source);                mTitle.setText(source);                //String data[] = new String[2];                 //if (source.matches(""&lt;MSG&gt;&lt;N&gt;.*&lt;/N&gt;&lt;V&gt;.*&lt;/V&gt;&lt;/MSG&gt;""))  {                               Document doc = null;                      try{                       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();                         DocumentBuilder db = dbf.newDocumentBuilder();                         doc = (Document) db.parse(new ByteArrayInputStream(source.getBytes()));                         NodeList n = doc.getElementsByTagName(""N"");                         Node nd = n.item(0);                         String msgName = nd.getFirstChild().getNodeValue();                         NodeList n1 = doc.getElementsByTagName(""V"");                         Node nd1 = n1.item(0);                         String tmpVal = nd1.getFirstChild().getNodeValue();                         data[0] = msgName;                         data[1] = tmpVal;                        Log.d(""TCP"", ""Inside Std parser "" + data[0] + "" "" + data[1]);                       //actionOnData(data[0], data[1]);                      }                      catch(Exception e){                      e.printStackTrace();                  }                Log.d(""TCP"", ""Just outside Std parser "" + data[0] + "" "" + data[1]);                return data;                //} else Log.d(""TCP"", ""Message in wrong format "" + source);                //mTitle.setText(""Message in wrong format "" + source);                //return data;            }</code></pre><p>Interface:</p><pre><code>public interface TCPListener {    public String[] callCompleted(String msg);}</code></pre><p>TCPServiceHandler:</p><pre><code>public class TcpServiceHandler implements Runnable {       TCPListener _listener;                 private Activity _act;       public TcpServiceHandler(TCPListener listener, Activity act){             _listener = listener;           _act = act;       }             public synchronized void run() {           // TODO Auto-generated method stub                    //if(socket==null){                 try {                   InetAddress serverAddr = InetAddress.getByName(""192.168.178.25"");                   Socket socket = new Socket(serverAddr, 1200);           //                   while(true){                    try {                                                    BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));                           final String str = in.readLine();                           this._act.runOnUiThread(new Runnable(){                           public void run() {                               _listener.callCompleted(str);                               }                                                         });                                                                    }                    catch(Exception e){                        e.printStackTrace();                    }                   }               } catch (UnknownHostException e) {                   // TODO Auto-generated catch block                   e.printStackTrace();               } catch (IOException e) {                   // TODO Auto-generated catch block                   e.printStackTrace();               }       }     }</code></pre>","487851","","","","","2013-06-09 05:59:38","Android TCP Client in phone has problems in communicating with external server","<android><sockets><communication><external><tcpclient>","2","0","","",""
"4792260","1","","","2011-01-25 10:17:50","87","63675","<p>How do you change text/font settings in an Android TextView?  For example, how do you make text bold?</p>","588823","","1765573","","2013-07-21 08:19:43","2014-04-05 09:15:47","How do you change text to bold in Android?","<android><text><android-textview>","8","1","9","",""
"4792265","1","","","2011-01-25 10:18:29","3","1329","<p>I understand this topic has been covered a few times, and often the proposed solution to having 'multiple' MapActivity classes is to run one in a different processes. I don't want to do this, I've got 3.</p><p>I've instead refactored one MapActivity Subclass to operate in 3 different modes.</p><pre><code>package com.rossgreenhalf.maptest.activity;import android.os.Bundle;import com.google.android.maps.MapActivity;public class MyMapActivity extends MapActivity {    @Override    protected void onCreate(Bundle icicle) {    super.onCreate(icicle);    /* Inflate xml view, Set Zoom etc */    }    @Override    protected void onResume() {        super.onResume();        int mode = getIntent().getExtras().getInt(""MAP_MODE"");        switch(mode){        case 1:            /* Some markers to show */            break;        case 2:            /* Just one Marker */            break;        case 3:             /* Only showing my location */            break;        }    }    @Override    protected boolean isRouteDisplayed() {    return false;    }}</code></pre><p>I'm allowing multiple instances of the MapActivity to reside within the task stack, as it's launch mode is still set as 'Standard'. This approach seems to work ok, and I'm not getting the Connection Pool Shutdown message that some seem to get, I'm a little confused as to whether multiple MapActivity instances actually exist or whether android is reusing one automatically?</p><p>I am however getting this error, which I don't know how serious it is:</p><pre><code>01-25 10:14:54.433: ERROR/ActivityThread(5620): Activity com.rossgreenhalf.maptest.activity.MyMapActivity has leaked IntentReceiver com.google.android.maps.NetworkConnectivityListener$ConnectivityBroadcastReceiver@44981cf0 that was originally registered here. Are you missing a call to unregisterReceiver()?01-25 10:14:54.433: ERROR/ActivityThread(5620): android.app.IntentReceiverLeaked: Activity com.rossgreenhalf.maptest.activity.MyMapActivity has leaked IntentReceiver com.google.android.maps.NetworkConnectivityListener$ConnectivityBroadcastReceiver@44981cf0 that was originally registered here. Are you missing a call to unregisterReceiver()?01-25 10:14:54.433: ERROR/ActivityThread(5620):     at android.app.ActivityThread$PackageInfo$ReceiverDispatcher.(ActivityThread.java:968)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at android.app.ActivityThread$PackageInfo.getReceiverDispatcher(ActivityThread.java:753)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:799)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at android.app.ContextImpl.registerReceiver(ContextImpl.java:786)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at android.app.ContextImpl.registerReceiver(ContextImpl.java:780)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:318)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at com.google.android.maps.NetworkConnectivityListener.startListening(MapActivity.java:163)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at com.google.android.maps.MapActivity.onResume(MapActivity.java:431)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at com.rossgreenhalf.maptest.activity.MyMapActivity.onResume(MyMapActivity.java:166)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1237)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at android.app.Activity.performResume(Activity.java:3864)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3315)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3340)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2158)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at android.os.Handler.dispatchMessage(Handler.java:99)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at android.os.Looper.loop(Looper.java:143)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at android.app.ActivityThread.main(ActivityThread.java:4914)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at java.lang.reflect.Method.invokeNative(Native Method)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at java.lang.reflect.Method.invoke(Method.java:521)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)01-25 10:14:54.433: ERROR/ActivityThread(5620):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Am I taking the correct approach to this? Should I be concerned with that error?</p>","468184","","","","","2011-12-15 11:36:08","Multiple MapActivitys in the stack","<android><google-maps>","1","7","2","",""
"4792295","1","","","2011-01-25 10:21:02","1","684","<p>i have an AIR android app which i am running on an android device ( samsung TAB ).i want the app to get laid out in landscape mode when the user starts the app holding the device in landscape ( same goes with portrait ). </p><p>but the AIR app always gets started in portrait mode irrespective of the way the device is held.</p><p>i tried the following ways -  </p><ol><li><p>use stage.deviceorientation  (but when the app starts (after the applicationComplete notification )  the value is UNKNOWN)</p></li><li><p>use stage resize event. (this gets triggered at start itself, a manual resize is not required - the values are based on portrait mode though - the width is 600 and height is 1024 (should have been otherway) )</p></li></ol><p>i get correct values when i try changing the orientation of device, only at the startup i see problem with the required values.</p><p>could you please advice on this problem ?</p><p>thanks</p>","41432","","","","","2013-07-31 18:55:39","air android app always launches in portrait mode irrespective of the way the android device is held ( landscape/portrait)","<android><flash><actionscript-3><actionscript><air>","2","0","1","",""
"4792356","1","4792531","","2011-01-25 10:28:01","1","3354","<pre><code>import org.apache.http.message.BasicNameValuePair;private String getServerData(String returnString) {               InputStream is = null;String result = """";//the year data to sendArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();nameValuePairs.add(new BasicNameValuePair(""year"",""1970""));//http posttry{       HttpClient httpclient = new DefaultHttpClient();       HttpPost httppost = new HttpPost(KEY_121);       httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));       HttpResponse response = httpclient.execute(httppost);       HttpEntity entity = response.getEntity();       is = entity.getContent();}catch(Exception e){       Log.e(""log_tag"", ""Error in http connection ""+e.toString());}}</code></pre><p>My Questions... </p><p>What does BasicNameValuePair class does?</p><p>What does this piece of line do </p><pre><code>httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));</code></pre><p>What does <code>is = entity.getContent();</code> do? and can i pass more than one value in BasicNameValuePair class. Can i entirely pass a VO instead of this.</p><p>Like the below ... </p><pre><code>nameValuePairs.add(new BasicNameValuePair(""year"",""1970"",""sas"",""saassa"",""sas"",""asas""));</code></pre>","548591","","548591","","2011-01-25 10:51:37","2013-08-24 05:16:13","Can anyone explain me this code?","<android>","2","0","2","",""
"4792495","1","","","2011-01-25 10:42:32","0","2526","<p>I am developing an application in android.Which involves sending data to url/server in android from application...Can someone tell me how to pursue with this....Thanks in advanceTushar</p>","475349","","488433","","2011-01-25 10:45:06","2011-01-25 10:52:07","http post connection in android","<android><http-post>","3","0","","",""
"4792619","1","","","2011-01-25 10:56:03","0","754","<p>I have an app that contains several custom views that extend View. Each custom view loads up a bunch of images (~20) and scales them down:</p><pre><code>mBmp[img1] = BitmapFactory.decodeStream(context.getAssets().open(""img01.png""));mBmp[img2] = BitmapFactory.decodeStream(context.getAssets().open(""img02.png""));mBmp[img3] = BitmapFactory.decodeStream(context.getAssets().open(""img03.png""));        ...mBmp[img20] = BitmapFactory.decodeStream(context.getAssets().open(""img20.png""));</code></pre><p>This is all within a try - catch block.</p><p>This part does not cause any problem. However, once I reach the point of scaling the images and I call my scale method which uses createScaledBitmap: </p><pre><code>protected void scaleImages(float mWidth, float mHeight)    {        float mXRat = mWidth/1024;        float mYRat = mHeight/600;        for (int i = 0; i &lt; mBmp.length; i++)        {            float oldX = mBmp[i].getWidth();            float oldY = mBmp[i].getHeight();            double newX = (mXRat * oldX);            double newY = (mYRat * oldY);            Bitmap newBmp = Bitmap.createScaledBitmap(mBmp[i], (int) newX, (int) newY, true);            mBmp[i] = newBmp;        }    }</code></pre><p>I get an error that I am trying to allocate too much memory. </p><pre><code>01-25 10:16:44.227: ERROR/dalvikvm-heap(14548): 1497600-byte external allocation too large for this process.01-25 10:16:44.227: ERROR/dalvikvm(14548): Out of memory: Heap Size=4871KB, Allocated=2544KB, Bitmap Size=18683KB01-25 10:16:44.227: ERROR/GraphicsJNI(14548): VM won't let us allocate 1497600 bytes</code></pre><p>No single image of mine should take this kind of memory when expanded into RAM, so why is it running out when trying to resize them?</p>","353674","","","","","2011-01-25 10:57:47","Android, image loading and memory allocations","<android><image><memory>","1","0","","",""
"4792626","1","","","2011-01-25 10:56:47","2","813","<p>I'm trying to get my api key on my development mac pc.In my terminal I use the following code:</p><p><strong>keytool -list -alias androiddebugkey -storepass android -keypass android -keystore debug.keystore</strong></p><p>But unfortunately I get the following error back:</p><p>device-fdearf:~ mymac$ keytool -list -alias androiddebugkey -storepass android -keypass android -keyIllegal option:  -keyTry keytool -helpdevice-fdeur6f:~ mymac$ store debug.keystore</p><p>How can I fix this?</p><p>This what I actually need:Once you hit the enter key, you'll see something like this (the actual MD5 that we're interested in is the last line):androiddebugkey, Mar 10, 2009, PrivateKeyEntry,Certificate fingerprint (MD5): D1:16:4A:BD:73:73:A4:56:9D:CD:9A:44:A2:6C:11:AC</p><p>Many Thanks! </p>","468003","","12030","","2011-01-26 01:09:45","2012-09-02 05:07:48","Android: SetUp API Key for Google Maps","<java><android><xml><maps>","1","1","","",""
"4792642","1","","","2011-01-25 10:59:01","1","1808","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3862409/horizontal-scrolling-text-in-android"">Horizontal scrolling text in Android</a>  </p></blockquote><pre><code>&lt;TextView   android:id=""@+id/dtitle""  android:layout_marginLeft=""100dp""  android:text=""Title""   android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:scrollHorizontally=""true"" /&gt;</code></pre><p>This is my code in xml file </p>","509370","","","","","2011-01-25 11:04:38","How to scroll text Horizontally in textview in android","<android>","1","0","","2011-06-30 21:00:31",""
"4792686","1","4792734","","2011-01-25 11:03:13","0","1583","<p>Can any one tell me how to apply theme and style in android.</p>","588763","","546999","","2011-01-25 11:05:38","2013-06-12 19:52:48","Theme and Style in Android","<android>","1","0","2","",""
"4792695","1","4802650","","2011-01-25 11:03:51","0","1080","<p>I'm using Android to construct a video player using the <em>VideoView</em>.I've managed to get a video player running and now I'm setting a counter using <em>chronometer</em> that starts ticking when I select the file.<br>However, the video clip takes a few seconds to start running while the timer has already begun counting a few seconds when the clip starts.</p><p>How can I code to sync the counter with the media file?<br>I've checked around but can't seem to find an answer.</p><pre><code>    video = (VideoView) findViewById(R.id.video);    play = (Button) findViewById(R.id.play);    pause = (Button) findViewById(R.id.pause);    stop = (Button) findViewById(R.id.stop);    reset = (Button) findViewById(R.id.reset);    Chronometer counter = (Chronometer) findViewById(R.id.chrono);    startTime = SystemClock.elapsedRealtime();    time = (TextView) findViewById(R.id.time);        try {        video.setVideoPath(link);        video.start();        video.requestFocus();    } catch (IllegalArgumentException e) {        e.printStackTrace();    } catch (IllegalStateException e) {        e.printStackTrace();    }    play.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            video.start();            video.requestFocus();        }    });    pause.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            video.pause();        }    });    stop.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            try {                video.stopPlayback();                video.setVideoPath(link);            } catch (IllegalStateException e) {                e.printStackTrace();            }        }    });    reset.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            try {                video.seekTo(0);                video.start();                video.requestFocus();            } catch (IllegalStateException e) {                e.printStackTrace();            }        }    });counter.setOnChronometerTickListener(new OnChronometerTickListener(){        public void onChronometerTick(Chronometer arg0) {            countUp = (SystemClock.elapsedRealtime() - arg0.getBase()) / 1000;            duration = video.getDuration();            if (countUp % 60 &lt;= 9) {                countText = (countUp / 60) + "":0"" + (countUp % 60);            } else {                countText = (countUp / 60) + "":"" + (countUp % 60);                       }             if (duration % 60000 &lt;= 9) {                durationText = (duration / 60000) + "":0"" + (duration % 60000);            } else {                durationText = (duration / 60000) + "":"" + (duration % 60000);                       }            time.setText(countText + "" / "" + durationText);        }    });    counter.start();</code></pre>","529436","","","","","2013-09-02 05:57:21","Android Sync video with timer","<android><timer><sync><videoview><chronometer>","2","0","","",""
"4792748","1","","","2011-01-25 11:07:58","0","199","<p>I'm making my first app here, I use both GPS and Network (for when GPS is not available) to update location. I'm now testing how the network location works alone, but i find that sometimes it takes a bit of time to retrieve the real location, even with the &lt; 1500m accuracy. (I take google maps as example) I notice that i'm off the accuracy circle and takes a while to update, and when i say ""a while"" could be more than 30 secs or a minute.</p><p>So my question is, is there a way of forcing a Location update using the Network provider?</p>","588871","","","","","2011-01-25 11:19:30","Is there a way of forcing a Network Fix location?","<android>","1","0","","",""
"4792765","1","","","2011-01-25 11:09:31","0","154","<p>I have a layout which has two <code>TextView</code>s and an <code>ArrayList</code> to fill those <code>TextView</code>s. I just want to open a new child activity when an item is clicked to show detailed view about this item. But I couldn't find a way to do that. Here is my part of code : </p><pre><code>String[] columns = new String[] { ""name"", ""distance"" };int[] renderTo = new int[] { R.id.name, R.id.distance}; ListAdapter listAdapter = new SimpleAdapter(this, list,         R.layout.textview_list, columns, renderTo);setListAdapter(listAdapter);</code></pre>","581323","","418183","","2011-01-25 11:13:09","2011-05-15 02:42:21","How to get clicked layout items in listactivity?","<java><android><textview><listactivity>","2","0","","",""
"4792789","1","4792933","","2011-01-25 11:12:43","2","498","<p>i have one question about the textviews..</p><p>i have one table row in code, which includes one image view and two textviews..|_| textview1 textview2.</p><p>the image view has android:layout_alignParentLeft=""true""and the second textview has android:layout_alignParentRight=""true""</p><p>the problem is when i write a big text in the first text view then it goes over the second textview..I don't want to put one particular number as the width for the first textview.Any idea how can i write big text in first textview and don't overlay the second textview??Something like priority against textviews?</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:layout_width=""match_parent""    android:layout_height=""wrap_content""    android:padding=""5dip"" &gt;    &lt;ImageView      android:id=""@+id/icon""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:src=""@drawable/icon_code_contact""       android:layout_marginRight=""5dip""      android:layout_alignParentLeft=""true"" /&gt;    &lt;RelativeLayout     android:id=""@+id/secondlayout""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/icon"" &gt;  &lt;TextView      android:id=""@+id/title""      android:layout_width=""match_parent""      android:layout_height=""wrap_content""      android:textStyle=""bold""      android:singleLine=""true"" /&gt; &lt;/RelativeLayout&gt;  &lt;RelativeLayout     android:id=""@+id/thirdlayout""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""   android:layout_alignParentRight=""true""   android:layout_marginRight=""25dip"" &gt;          &lt;TextView      android:id=""@+id/stamp""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""   android:layout_alignParentRight=""true""   android:singleLine=""true"" /&gt;   &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","579981","","213269","","2011-01-25 11:14:10","2011-01-25 12:39:24","priority in textviews inside a table row","<android><textview><relativelayout>","2","1","","",""
"4792803","1","4792904","","2011-01-25 11:13:37","4","4784","<p>I want to delete (e.g. mobile number) from android database. For that I am passing query as follow</p><pre><code>public class ContactDemo extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        String number = ""2222"";        Long id = getID(number);        int i = getContentResolver().delete(RawContacts.CONTENT_URI, RawContacts._ID+""=?"", new String[]{id.toString()});       System.out.println(""Deleted""+i);    }    public Long getID(String number){               Uri uri =  Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));        Cursor c =  getContentResolver().query(uri, new String[]{PhoneLookup._ID}, null, null, null);        while(c.moveToNext()){            return c.getLong(c.getColumnIndex(PhoneLookup._ID));        }        return null;    }    }</code></pre><p>but it is deleting entire contact.</p><p>What should I use to delete only that phone number (not entire contact)?</p>","484073","","484073","","2011-04-12 08:08:07","2011-05-07 22:01:41","How to Delete phone number from contact in android?","<android><cursor><contacts>","1","0","1","",""
"4792809","1","4793134","","2011-01-25 11:14:15","14","33325","<p>I want to make a QR code reader for android app.if you all have any information to create it please share with me. </p>","584040","","405861","","2011-01-25 11:42:04","2011-12-08 18:41:42","How to make a QR code reader","<android><qr-code>","1","0","8","2011-12-08 18:49:00",""
"4792815","1","","","2011-01-25 11:15:10","0","397","<p>I have created my own account (with a custom account type as well) to use in combination with my application but when I want to insert or edit a contact through the Address Book application on this account, it does not trigger the native activity but a custom one with just name fields...</p><p>Do you know how I can trigger the full native one instead?</p>","570202","","","","","2011-12-13 09:13:36","Call native contact insertion activity with a custom Android Account","<android><activity><contact><account>","1","0","","",""
"4792829","1","4792854","","2011-01-25 11:16:15","5","19621","<p>I have two activities such as <code>Activity</code> A and B and I'm trying to pass two different strings from A to B using <code>Bundle</code> and <code>startActivity(intent)</code>.</p><p>Like that:</p><pre><code>Intent intent = new Intent(A.this, B.class);Bundle bundle = new Bundle();bundle.putString(""vidoedetails"", filedetails);//bundle.putString(""videoname"", filename);intent.putExtras(bundle);//intent.putExtra(""videofilename"", filename);//intent.putExtra(""vidoefiledetails"", filedetails);startActivity(intent);</code></pre><p>And in class B I'm using two <code>TextView</code>s to display the strings from class A seperately.</p><p>Like that:</p><pre><code>Intent i = getIntent();Bundle extras = i.getExtras();filedetails = extras.getString(""videodetails"");filename = extras.getString(""videoname"");</code></pre><p>The problem is <code>filedetils</code> get printed in class B but not the file name.</p><p>Any solution for this?</p>","588901","","418183","","2011-01-25 11:21:09","2013-04-12 19:50:46","How to get data from other activity in android?","<android><android-intent>","5","0","3","",""
"4792873","1","","","2011-01-25 11:21:32","4","1637","<p>I got a transparant 9patch image which has the 9patch lines showing trough.</p><p>This is the output:<img src=""http://i.stack.imgur.com/Du8Mq.png"" alt=""enter image description here""></p><p>Obviously I don't want the horizontal lines to be visible.</p><p>This is how I created the 9patch:</p><p><img src=""http://i.stack.imgur.com/Zli7o.png"" alt=""enter image description here""></p><p>This is the final image that is used in the application:<img src=""http://i.stack.imgur.com/IwOAw.png"" alt=""enter image description here""></p><p>AFAIK the 9patch is correct. What do I need to change in order for the horizontal lines to disappear?</p>","123048","","3333","","2011-05-11 22:57:47","2012-05-29 12:11:08","Transparent 9patch image: line showing through","<android><nine-patch>","2","2","0","",""
"4792880","1","4792920","","2011-01-25 11:22:04","7","9524","<p>HelloI am writing an android application, but as I do run this application, the following application generates and application doesn't appear on the windows,please help .. !!!!I will appreciate if I get right solution ,,,,,,</p>","576792","","","","","2011-01-25 11:24:56","how to resolve ""WARNING: Application does not specify an API level requirement""?","<android><eclipse>","1","0","","",""
"4792881","1","4792966","","2011-01-25 11:22:05","1","520","<p>I want to fetch news from web in android. I searched for some sample example in google but I am not able to find any source code.</p><p>Can any one explain the logic beyond the fetching news in android?</p>","366916","","569101","","2012-08-13 07:23:51","2012-08-13 07:23:51","Fetching news in android","<android>","3","1","1","",""
"4792940","1","","","2011-01-25 11:27:44","0","721","<p>i have created a database in my android app:</p><pre><code>Context context = this.getApplicationContext();SQLiteDatabase db;String path = ""cultura.db"";db = context.openOrCreateDatabase(path, Context.MODE_WORLD_WRITEABLE, null);</code></pre><p>ok if my app is killed by task manager or the phone is restarted the database is empty. does anyone have a solution????</p>","433618","","","","","2011-07-08 04:40:57","android: sqlite database empty after phone restart or kill per taskmanager","<android><sqlite>","1","0","","",""
"4792942","1","4792967","","2011-01-25 11:28:06","0","834","<p>I have an array of radio button from where i am creating radio buttons dynamically in my layout. Here what i want, when i check one radio button then other radio buttons should be unchecked. How to manipulate this using radio button array? Please some body help!</p><p>Here is the image. Radio Buttons does not unchecked automatically.</p><p><img src=""http://i.stack.imgur.com/aeZcq.png"" alt=""enter image description here""></p>","489762","","1471203","","2013-01-09 10:15:39","2013-01-09 10:15:39","Radio button in android","<android><radio-button>","3","0","","",""
"4792992","1","","","2011-01-25 11:32:55","1","2280","<p>Hi friendscan anybody tell how to update UI using ASyncTask give example</p><p>I am getting the value from two webservices. From two webservices I am getting value in two arraylist on post method will not return value it will rounding in loop how to return from onPostExecuteMethod</p><p>this is my async class:</p><pre><code>public class HomeTask extends AsyncTask&lt;Void,Void,Bundle&gt;  {         private Context ctx;         public HomeTask(Context context) {             ctx = context;         }         @Override         protected void onPreExecute() {             //super.onPreExecute();         //setContentView(R.layout.splash);           dlg = new ProgressDialog(getDialogContext());             dlg.setMessage(""Loading...."");             dlg.show();            //setContentView(R.layout.splash);        }         @Override        protected Bundle doInBackground(Void... params) {               Bundle b=new Bundle();            // TODO Auto-generated method stub            try            {                   WebService tableservice=new WebService();                tableservicevalue=tableservice.callTableServer(SOAP_ACTION,"""",strUsername,strPassWord,questGroupId,URL);                  tableservicevalue=decodeXMLData(tableservicevalue);                  DomTableParser parser=new DomTableParser();                 parser.setTableservicevalue(tableservicevalue);                 parsedValue=parser.parseXmlFile(tableservicevalue);                 Log.d(""1234%%%%$$$$$$$parsed value$$$$$"", parsedValue.toString());                  WebService service=new WebService();                  webservicevalue=service.callHomeServer(SOAP_ACTION,"""",strUsername,strPassWord,questGroupId,URL);                   webservicevalue=decodeXMLData(webservicevalue);                    ArticleParser articleParser=new ArticleParser();               articleParsedValue=articleParser.parseXmlArticle(webservicevalue);                //b.putStringArrayList(""articleParsedValue"", articleParsedValue);                Log.d(""(((((((parsed value is"",parsedValue.toString());               b.putStringArrayList(""parsedValue"", parsedValue);               b.putStringArrayList(""articleParsedValue"", articleParsedValue);               Log.d(""(((((((parsed value is"",articleParsedValue.toString());             }            catch (Exception e) {            // TODO: handle exception                e.printStackTrace();        }       return b;        }              @Override             protected void onPostExecute(Bundle b) {               Log.d(""vijay checking"",""checking&amp;&amp;&amp;&amp;"");                              Log.d(""****"",""*********"");                              Log.d(""calling"",""handler"");                              Log.d(""****"",""*********"");                 parsedValue1=b.getStringArrayList(""parsedValue"");                 articleParsedValue1=b.getStringArrayList(""articleParsedValue"");                                } </code></pre><p>onupdating user interface</p><pre><code>new HomeTask(HomeActivity2.this).execute(null); for(int i=0;i&lt;parsedValue1.size();i++)             {                DomParserTableDataSet dataSet=(DomParserTableDataSet)parsedValue1.get(i);                  if(i==0)                {                    Log.d(""&amp;&amp;&amp;&amp;&amp;&amp;index name is"", dataSet.getIndexName());                    Log.d(""&amp;&amp;&amp;&amp;&amp;&amp;index name is"", dataSet.getLastValue());                    Log.d(""&amp;&amp;&amp;&amp;&amp;&amp;index name is"",dataSet.getChangePercentage() );                 txtindex0.setText(dataSet.getIndexName());                 txtlast0.setText(dataSet.getLastValue());                 txtchange0.setText(dataSet.getChangePercentage());                }                if(i==1)                {                    Log.d(""&amp;&amp;&amp;&amp;&amp;&amp;index name is"", dataSet.getIndexName());                    Log.d(""&amp;&amp;&amp;&amp;&amp;&amp;index name is"", dataSet.getLastValue());                    Log.d(""&amp;&amp;&amp;&amp;&amp;&amp;index name is"",dataSet.getChangePercentage() );                    txtindex1.setText(dataSet.getIndexName());                     txtlast1.setText(dataSet.getLastValue());                    txtchange1.setText(dataSet.getChangePercentage());                   }               if(i==2)                {                Log.d(""&amp;&amp;&amp;&amp;&amp;&amp;index name is"", dataSet.getIndexName());                Log.d(""&amp;&amp;&amp;&amp;&amp;&amp;index name is"", dataSet.getLastValue());                Log.d(""&amp;&amp;&amp;&amp;&amp;&amp;index name is"",dataSet.getChangePercentage() );                 txtindex2.setText(dataSet.getIndexName());                 txtlast2.setText(dataSet.getLastValue());                 txtchange2.setText(dataSet.getChangePercentage());                 }            if(i==3)            {                Log.d(""&amp;&amp;&amp;&amp;&amp;&amp;index name is"", dataSet.getIndexName());                Log.d(""&amp;&amp;&amp;&amp;&amp;&amp;index name is"", dataSet.getLastValue());                Log.d(""&amp;&amp;&amp;&amp;&amp;&amp;index name is"",dataSet.getChangePercentage() );             txtindex3.setText(dataSet.getIndexName());                 txtlast3.setText(dataSet.getLastValue());                 txtchange3.setText(dataSet.getChangePercentage());             }          }        //      for(int i=0;i&lt;articleParsedValue1.size();i++)       {           System.out.println(""for loop checking i is""+i);                ArticleDataSet articleDataset=(ArticleDataSet)articleParsedValue1.get(i);           System.out.println(""articleDataset.getArticle_title()""+articleDataset.getArticle_title());                       HashMap&lt;String, String&gt; mapValue=new HashMap&lt;String, String&gt;();                     WebView webviewcontent=new WebView(HomeActivity2.this);             if(articleDataset.getArticle_summary().length()&gt;75)               {                  summary=articleDataset.getArticle_summary().substring(0,75)+""..."";             }             else             {                 summary=articleDataset.getArticle_summary();             }               String html =""&lt;html&gt;&lt;body&gt;&lt;div&gt;&lt;label&gt; &lt;font face=\""verdana\""  color=\""#C1002B\"" size=\""4\""&gt;&lt;b&gt;""+articleDataset.getArticle_title()+""&lt;/b&gt; &lt;/font&gt; &lt;/label&gt;""+ ""&lt;label&gt; &lt;font color=\""#000000\"" size=\""2\"" face=\""verdana\""&gt;""+""|""+""&lt;/font&gt;&lt;/label&gt; ""+""&lt;label&gt; &lt;font color=\""#AAAAAA\"" face=\""verdana\"" size=\""2\""&gt;""+articleDataset.getArticle_date()+"" &lt;/font&gt;&lt;/label&gt;&lt;/div&gt;"";          html=html+""&lt;div&gt;&lt;label&gt; &lt;font color=\""#000000\"" face=\""verdana\"" size=\""2\""&gt;""+summary+"" &lt;/font&gt;&lt;/label&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;"" ;             webviewcontent.getSettings().setJavaScriptEnabled(true);          webviewcontent.clearCache(true);          final Activity activity = HomeActivity2.this;          webviewcontent.loadData(html, ""text/html"", ""utf-8"");           if(i==articleParsedValue1.size()-1)                      {          webviewcontent.setWebViewClient(new WebViewClient()           {              public boolean shouldOverrideUrlLoading(WebView view, String url)               {                                view.loadUrl(url);                  return true;              }              public void onPageFinished(WebView view, String url)              {                 // setContentView(R.layout.home);                   if (dlg.isShowing())                  {                   dlg.dismiss();                   dlg = null;                  }                splash.setVisibility(View.GONE);               // setContentView(repl);              }           });           }           mainlinear4.addView(webviewcontent);             //webviewcontent.setOnTouchListener(HomeActivity2.this);        }            }</code></pre>","426344","","72746","","2011-01-25 12:30:13","2011-12-14 11:26:22","How to implement ASyncTask in Android","<android><android-asynctask>","1","1","1","",""
"4793001","1","","","2011-01-25 11:33:59","10","4306","<p>I would like to let user pick directory and save downloaded file (my app downloads file).  I know that some tools (for example, ES File Explorer) provide such intent-filters.see <a href=""http://www.estrongs.com/en/support/developers.html"">http://www.estrongs.com/en/support/developers.html</a>. I start activity for result and then get selected folder as a result.</p><p>Also, I know that there are no ""select folder"" intent standards (I can't use the same intent with other tools). Do you know other tools to support such functionality ? I would like to let user use his tool, not ES File Manager.</p><p>Also, does Astro provide such intent filters? I can't find this info on their page. (I think astro is the most used file manager for android)</p>","295524","","","","","2011-03-23 19:42:49","Choose folder on Android device","<android><android-intent><file-manager>","1","8","3","",""
"4793069","1","4794526","","2011-01-25 11:41:28","4","2075","<p>i have an app that query a db and get a recordset, on the display, i need to present these data with a row that is a complex layout. Each row contain some ImageView, many TextView etc...</p><p>It's realy difficult to create the row layout programmaticaly, is there any way to get the entire row layout (container and childs of the row layout) from an xml, edit some of the properties (like the TextViews of the row layout) and add the result to a LinearLayout?</p><p>thanks for your help!</p>","561438","","11296","","2011-01-25 14:33:38","2011-01-25 14:33:38","Android - Repeat a complex Layout for each record","<android><xml><layout>","3","0","1","",""
"4793094","1","5316034","","2011-01-25 11:44:14","0","1203","<p>I am implementing an application in Android that needs to access the Location object.I am running all the logistics for this object in an object. </p><p>Afterwards I am binding my Activity to that Service, ServiceGPS.java, the service and Location update seems to works ok, but the problem is that I cant not access to the Location object inside the ServiceGPS.</p><p>The connection to the service is defined as I update a global variable in my Activity class</p><pre><code>    private ServiceConnection mConnection = new ServiceConnection() {           @Override    public void onServiceConnected(ComponentName className, IBinder service) {        @SuppressWarnings(""unchecked"")        ServiceGPS mService = ((LocalBinder&lt;ServiceGPS&gt;)service).getService();        // Get hold of your resource, db etc and pass it through to a object that will use it        mLocationManager = mService.getmLocation();             }    @Override    public void onServiceDisconnected(ComponentName arg0) {        // TODO Auto-generated method stub              }   };  </code></pre><p>If i debug the code, mLocationManager recibes the correct values. But I want to access mService.getmLocation() in my activity, but i cant.</p><p>As i cant declare mService as a class member.</p><p>Any suggestions?</p><p>Thanks a lot for your priceless help.</p><p>BR,David.</p>","588925","","","","","2011-03-15 18:05:46","Android - Service variable access","<android><service>","1","0","","",""
"4793185","1","","","2011-01-25 11:54:56","0","531","<p>I am using Android toolchain. </p><p>I have to make some changes to a stack that has lot of static libraries and finally make it all into a shared library. I am able to compile my changes as .o file (using GCC). Now when I am trying to create the shared library linking this with the existing static libraries, I am getting an error saying that 'linker input file unused because linking not done'. </p><p>I am compiling files using <code>-fPIC</code>, and I am using <code>-shared</code> for linking but still am getting this error. Let me know if there is anybody who has faced a similar problem or if you can suggest some solution.</p>","350167","","612606","","2011-05-16 13:04:28","2011-05-16 13:04:28","Problem in creating a shared library for Android platform","<android><linker><shared-libraries>","1","0","","",""
"4793220","1","4944708","","2011-01-25 11:59:26","5","13360","<p><strong>Update</strong>: This is an old post, and references below to broken <code>aapt</code> versions will be out of date.</p><hr><p>Based on previous feedback, I am storing custom text fields in the assets directory of my app.</p><p>I will write the app, using default user details in an asset file, and the client would like to rebuild the app for each user, including that user's details in the asset file.</p><p>(I am aware this is method has some serious shortcomings, but the client is still keen to do it in this way - see <a href=""http://stackoverflow.com/questions/4783160/embed-login-details-in-apk-file-different-for-each-user-or-other-options"">Embed login details in APK file, different for each user (or other options?)</a>)</p><p>This question relates to troubles I am having with rebuilding the APK file, once I have unzipped it, and updated the custom asset file. I am quite convinced I am missing something small, however, the documentation and posts I have found on these methods are not helpful enough for a newcomer.</p><ol><li><p>aapt - Android sdk tool: Unfortunately the android docs on ""Using aapt"" on the android docs [link 2 below] are very limited. The console command -help shows a bit more info. When trying to use it to just add a file to the test.apk, it ends up deleting the original, and creating a new file test.apk.zip containing only the file I tried to add. I have not been able to find the correct command line combination to take an unzipped apk and repackage it - that would be my first prize.</p></li><li><p>apkbuilder - Android sdk tool: Firstly this tool is deprecated, which is a negative point for it. I also can't get it to work with what I have in that unzipped folder. I think I'm missing a pre-apkbuilder step because apkbuilder asks for a resource zip archive, and I have a resource folder.</p></li><li><p>ant - build tool: Other similar posts say to build with ant, rather than using the android tools. I am having trouble getting ant to work. One particular link to Getting Ant to Work with Android [link 3 below] looks promising but looks like it is for a different android sdk (my build.xml that is generated by android looks different to his). Unfortunately I know little about ant, and am having trouble becoming expert enough to solve my current issue.<br>Further to NickT's solution below - running the ant script gives me the error<br><em>taskdef class com.android.ant.SetupTask cannot be found using the classloader AntClassLoader[]</em>.<br>I have found some references online to this error, have confirmed that local.properties has an sdk.dir setting that is pointing to my android sdk install folder (sdk.dir=/Applications/android-sdk-mac_86).</p></li><li><p>?????: There might be some other option that I have not listed / discovered, which I would be interested in hearing about. </p></li></ol><p>I realize that delving into the gears that are normally covered up by my ide can lead to diffuculties. But I know that a lot of the SO users can do many of these things, and I hope I get the interest of some of them. Thanks for any help.</p><p>(Eclipse 3.6 on Mac Snow Leopard 10.6 64 bit)</p><p>PS, I am not able to post more than 1 hyperlink yet, so I have included these addresses to show more info to my question.</p><p>(1): stackoverflow.com/questions/4783160/embed-login-details-in-apk-file-different-for-each-user-or-other-options</p><p>(2): developer.android.com/guide/developing/tools/aapt.html</p><p>(3): www.disgruntledrats.com/?p=27</p>","383414","","383414","","2013-06-12 15:14:23","2013-06-12 15:14:23","Repackage APK file to contain custom assets - what build tool to use?","<android><ant><apk><aapt>","4","1","6","",""
"4793244","1","","","2011-01-25 12:02:29","0","303","<p>I am developing an android application which involves camera like  user clicks on click button, automatically image is saved in sd card.. I have googled it,, Can anybody tell me how to pursue it....Thanks in advance Tushar</p>","475349","","","","","2011-01-25 12:24:41","saving the image on click of button in android","<android>","1","0","","",""
"4793265","1","","","2011-01-25 12:06:09","1","998","<p>I am doing a webservice based app in android. I need to use Captcha Image in Register Page.I get Captcha Image in String Format by webservie. Now i don know how to parse that string to get the corresponding captcha image? I have no any idea about this? Please Guide me...</p><p>Thank You:)</p>","376035","","","","","2011-01-25 12:06:09","How to get retreive Captcha Image from Captcha Image String android?","<android><string><image><captcha>","0","3","","",""
"4793290","1","4793327","","2011-01-25 12:09:23","2","2165","<p>I have on my server map tiles sorted on a folder structure like OpenStreetMap (OSM) uses. I need to be able to display these tiles, zoom in/out, pan and rotate the map. I wouldn't start from the scratch to create a new control. I've seen OsmDroid but I didn't find a way to set my own non vectorized tile source.</p><p>I am open to any suggestions.</p>","379865","","21234","","2011-01-25 12:20:57","2011-01-25 12:20:57","Android custom control to display map tiles","<android><android-mapview><tiles><openstreetmap>","1","0","2","2012-02-28 16:57:05",""
"4793339","1","4793413","","2011-01-25 12:14:54","2","5329","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4545079/lock-the-android-device-programatically"">Lock the android device programatically</a>  </p></blockquote><p>I want to be able to lock the Android phone with a password when I run a method.Does anyone have a reference or sample code for me to refer. Thanks</p><p><strong>EDIT</strong>I have tried using </p><pre><code>KeyguardManager mgr = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE); KeyguardLock lock = mgr.newKeyguardLock(KEYGUARD_SERVICE); lock.reenableKeyguard();</code></pre><p>as said by the answer below, but I'm still trying to get it to add a password that I have specifically entered into the database at my server side, so the only way to unlock his phone is to enter the password that i set</p><p><strong>EDIT</strong></p><p><a href=""http://developer.android.com/reference/android/app/admin/DevicePolicyManager.html"" rel=""nofollow"">http://developer.android.com/reference/android/app/admin/DevicePolicyManager.html</a></p><p>been trying to work on it ^</p><p><strong>EDIT</strong></p><p>I have seen that</p><pre><code>device_admin_sample.xml</code></pre><p>with the contents</p><pre><code>&lt;device-admin xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;uses-policies&gt;    &lt;limit-password /&gt;    &lt;watch-login /&gt;    &lt;reset-password /&gt;    &lt;force-lock /&gt;    &lt;wipe-data /&gt;  &lt;/uses-policies&gt;&lt;/device-admin&gt;</code></pre><p>But where do I put this xml file at.. it seems to have an error wherever i put</p><p><strong>EDIT</strong></p><p>Now, I have implemented it halfway and put this on hold upon seeing the comment below that I cannot lock the phone with a password. But seeing the API documentation, there's a function to reset password with a new password.</p><pre><code>resetPassword(String password, int flags)</code></pre><p>So what is it? Can I implement password lock on the phone? or is the idea of locking the phone until a new password given by the server is entered, unable to be done? </p>","575349","","19750","","2011-06-22 03:34:53","2011-06-22 03:34:53","Lock an Android Phone","<java><android><locking><device-admin>","1","4","2","2011-09-29 09:48:30",""
"4793467","1","4793551","","2011-01-25 12:27:41","2","1986","<p>Been trying to draw onto an android view outside the onDraw(Canvas canvas) method.</p><pre><code>@Overridespublic void onDraw(Canvas canvas) {    c = canvas;    canvas.drawLine(0, 50, 100, 50, paint);    invalidate();}</code></pre><p>I want to keep the above displayed, while drawing another character onto the screen - depending on xPosition and yPosition.</p><pre><code>public void drawPlayer(int x, int y){        c.drawCircle(x, y, 5, paint);    }</code></pre><p>I'm pretty new to 2d graphics in java &amp; android.</p><p>Thanks in advance</p>","425226","","","","","2011-01-25 12:34:58","Android, Java & 2d Drawing","<java><android><graphics><2d>","1","0","","",""
"4793505","1","","","2011-01-25 12:31:05","0","1074","<p>I have the following requirement.</p><p>1> I need to start at the same time ,  multiple countdown timers &amp; display on the same screen , one after the another.</p><p>How can I proceed implementing the same . Will using Threads help</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2011-01-26 11:34:20","Need to start & handle multiple CountDown Timers in Android","<android>","1","3","0","",""
"4793520","1","","","2011-01-25 12:32:26","0","592","<p>In my application I have an activity class A that has a listview with a cursor adapter. From A I can go to the activity B, by pressing a button. From B I can go back to A by pressing a button (not by pressing the BACK button). This means that a new instance of the A activity is created. </p><p>From this point, if I press the BACK key, the current A activity is destroyed and B is popped. And if I press BACk again the initial A activity is popped. I hope it is clear.</p><p>My problem is that when the second A activity is destroyed, the database connection is reseted, in a static manner. So in the end, when the initial A activity is displayed, the listview will be empty.</p><p>My question is: should I try to have a single instance for the A activities, or shoud I change the database connection (to link it with the activity instance)?</p><p>Thanks a lotGratzi</p>","460611","","","","","2013-08-02 09:02:56","Multiple activity instances problem","<android>","3","0","1","",""
"4793526","1","4793605","","2011-01-25 12:33:08","0","581","<p>I am using this code of snippet to download mp4 files from server. Normally file get download properly, but sometime my downloading process stops downloading automatically. Progress bar stop incrementing. Is there any kernel process that stop download.   </p><pre><code>//+++++++++= FUnction Call ++++++++++++++++DOWNLOAD_FILE_NAME = ""demo.mp4"";grabURL(""mp4 file server url"");  //+++++++++++++++++++++++++++++++++++++++++public void grabURL(String url) {            new GrabURL().execute(url);     }private class GrabURL extends AsyncTask&lt;String, Void, Void&gt; {                    private final HttpClient Client = new DefaultHttpClient();                    private String Content;                    private String Error = null;                    private ProgressDialog Dialog = new ProgressDialog(SlideShow.this);                    protected void onPreExecute() {                     showDialog(DIALOG_PROGRESS);               mProgressDialog.setProgress(0);                  }            protected Void doInBackground(String... url) {                int count;              try {                  URL url2 = new URL(url[0]);                  URLConnection conexion = url2.openConnection();                  conexion.setUseCaches(true);                  conexion.connect();                  // this will be useful so that you can show a tipical 0-100% progress bar                  int lenghtOfFile = conexion.getContentLength();                  mProgressDialog.setMax(lenghtOfFile);                  // downlod the file                  InputStream input = new BufferedInputStream(url2.openStream());                  OutputStream output = new FileOutputStream(DOWNLOAD_FILE_NAME);                  byte data[] = new byte[1024];                  while ((count = input.read(data)) != -1) {                      mProgressDialog.incrementProgressBy(data.length);                          output.write(data, 0, count);                  }                  output.close();                  input.close();              } catch (Exception e) {}              return null;          }  </code></pre>","477301","","546999","","2011-01-25 12:41:46","2011-01-25 12:41:46","Problem in File Downloading from server in android application","<android>","1","0","1","",""
"4793531","1","4793544","","2011-01-25 12:33:26","2","3740","<p>Can I use dll files (commonly used in windows Application) in android application?</p>","242079","","437039","","2011-01-25 13:05:08","2014-01-24 00:40:08","Use dll files in android Application","<android><dll>","3","0","","",""
"4793545","1","","","2011-01-25 12:34:46","1","728","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4791314/how-to-use-push-notification-in-titanium-for-android"">How to use push notification in titanium for Android</a>  </p></blockquote><p>Hello Guys!</p><p>I am new to titanium. I want to know how to do push notification in titanium for android/iPhone particularly for android. I got some links to get info to do in i Phone but donot know that it will work on android or not. Secondly I want to know that in titanium for android do we need c2dm or urban airship. If we need to use urban airship then sither we need to install seperate app of urban airship for push notification? Please do response as quickly as possible. Thanks in advance.</p>","588706","","","","","2011-01-25 12:34:46","How to do push notification in titanium","<android><notifications><push><titanium>","0","1","","2011-01-25 13:44:02",""
"4793641","1","","","2011-01-25 12:43:10","1","1444","<p>Strange thing happens - at least I don't get it.</p><p>I have an image (w: 120px, h: 63px) which is presented on one ImageButton. The only variant of that image that I have is placed in drawable-hdpi (and there is no other drawable directory).Everything is ok with this image and every resolution (density), Android takes care of it very nicely.</p><p>But, trouble is when I take a photo from an album (some very big photo, for example), scale it to dimensions of a button (previously mentioned, w: 120px h: 63px) and set that small image as ImageButton background.</p><p>In case when I am testing on emulator with medium density (160) it is ok, but when testing on device with high density button gets resized since scaled image appears smaller.</p><p>Does anyone has an idea what is happening and why is size of image changed once more after I scaled it?</p><p>Any clue will be highly appreciated.</p><p>Here is the code I use for resizing the image:</p><pre><code>public static void resizeAndSaveImage(String pathToResize, int newWidth, int newHeight, FileOutputStream output) {try {    BitmapFactory.Options options = new BitmapFactory.Options();    options.inSampleSize = 8;    Bitmap bitmap = BitmapFactory.decodeStream(new FileInputStream(pathToResize), null, options);    if (bitmap != null) {        int width = bitmap.getWidth();        int height = bitmap.getHeight();        float scaleWidth = ((float) newWidth) / width;        float scaleHeight = ((float) newHeight) / height;        Matrix matrix = new Matrix();        matrix.postScale(scaleWidth, scaleHeight);        Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true);        resizedBitmap.compress(Bitmap.CompressFormat.PNG, 100, output);        output.close();    }} catch (Exception e) {    // ...}</code></pre><p>Dimension parameters are passed in as follows: newWidth = 120, newHeight = 63.</p>","551014","","551014","","2011-01-25 14:13:53","2011-01-25 14:13:53","Android - scaling image after I did it programmatically","<android><background><imagebutton><image-scaling>","1","1","","",""
"4794086","1","","","2011-01-25 13:32:08","0","1089","<p>On loading the image from the url in <code>WebView</code> I want to store but it doesn't store.</p><p>This is my code.</p><pre><code>Uri uri=""http://202.87.34.17/MobileDetect/Wallpaper/Wallpaper_01.jpg"";widget29=(WebView)findViewById(R.id.widget29);widget29.loadUrl(IMAGE);save();try{    String path = Environment.getExternalStorageDirectory().toString();    OutputStream fOut = null;    File file = new File(path, ""/sdcard""+IMAGE_FILENAME+"".jpg"");    fOut = new FileOutputStream(file);    Bitmap mBitmap = null;    mBitmap.compress(Bitmap.CompressFormat.JPEG, 85, fOut);    fOut.flush();    fOut.close();    MediaStore.Images.Media.insertImage(getContentResolver(),            file.getAbsolutePath(), file.getName(),file.getName());} catch (Exception e) {    e.printStackTrace();}</code></pre>","589056","","418183","","2011-01-25 13:39:49","2011-01-25 13:57:33","How to save Images that are dowloaded WebView in android","<android><webview>","1","3","","",""
"4794278","1","4794385","","2011-01-25 13:51:55","3","3331","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/78811/is-there-an-effective-tool-to-convert-c-to-java"">is there an effective tool to convert c# to java?</a>  </p></blockquote><p>I'm not very experienced with Java and have a lot of C# that I would like to translate into Java syntax so it would become compilable.</p><p>Reason: Android and Google Cloud </p><p>I know the API/Platforms have different structures, but lets say we dont need a 100% compability, but just to get ""core functionalitet"" translated. The GUI itself is one story of its own, as I've learned. But instead of rewriting every SWITCH-CASE, rebuild every Class etc. it would be nice to ""map"" the objects to Java equals and then do a recompile on the Android/Google platform.</p><p>I am sure there would be something that cant be translated as its a ""C# only thing"" - but just like every language is possible to generate .NET/MONO I thought there might be a Java -> .Net available too and therefore also a decompiler kinda thing?</p><p>So are there any easy ways to overcome this translation by Frameworks, SDK or other similar methods that will take 80-95% of the task automatically?</p>","108056","","","","","2011-01-25 14:06:15","convert c# to pure java?","<c#><java><.net><android><cross-platform>","3","2","2","2011-01-25 14:04:40",""
"4794343","1","","","2011-01-25 13:59:35","0","783","<p>I am developing a small application in Android 2.3 using Eclipse 3.4 IDE, I wish to store more than 200 mp3 files in the res/raw folder of my project.But Wen I started the Android Emulator,it stop working by showing this message in console: </p><p>""INSTALL_FAILED_INSUFFICIENT_STORAGE""</p><p>Please tell me a way out from this problem</p>","589088","","","","","2011-02-15 09:17:41","How to store around 12MB of MP3 files in res/raw folder of my Android 2.3 Project?","<android>","4","0","1","",""
"4794366","1","","","2011-01-25 14:02:02","0","537","<p>When i send a data SMS to Android pones, the message body is not received. It is trigerring onReceived method of BroadcastListner and i am able to get senders address but the message body is not received. It just returns null. Does anybody faced similar issues?</p><p>my manifest file includes all the entries fro receiving Data SMS.                </p><pre><code>            &lt;action android:name = ""android.intent.action.DATA_SMS_RECEIVED""/&gt;               &lt;data  android:scheme=""sms""/&gt;                  &lt;data android:host=""localhost""/&gt;                 &lt;data android:port=""16000""/&gt;        &lt;/intent-filter&gt;     &lt;/receiver&gt;</code></pre><p>Does anyone know what might be the problem?</p>","543133","","","","","2011-03-04 10:24:01","Data SMS Message body not received in Android phones","<android>","1","0","","",""
"4794423","1","4799213","","2011-01-25 14:08:16","1","1100","<p>I need to redesign the old site and was thinking what would be the best Web markup language to use. Here are my two questions. Please help me to find the right answer to both or any of them:</p><ol><li><p>What's the optimal Web standard for desktop users? HTML? XHTML? Anything else? What version of it (e.g. ""XHTML 1.0 Transitional"")?</p></li><li><p>What is the optimal markup language for mobile users? The site I'm going to redesign is about applications for mobile devices. So, naturally I have a lot of mobile visitors. Most of the devices are Android-based, iOS-based as well as some BlackBerries, Palm OS and Symbian devices. Which markup language should I stick to when I'll be developing mobile version of the site?</p></li></ol><p>Thanks as always for the great answers! </p>","508019","","1","","2011-01-25 19:35:15","2012-06-29 17:53:46","Which markup language to use for the new Web site? (Desktop & Mobile)","<android><html><ios><xhtml><mobile-website>","4","0","0","",""
"4794426","1","7992713","","2011-01-25 14:08:20","0","813","<p>I want to post image to the Facebook in which i am having my JSON string,I have included static image in the string, and its works fine, if i want to add dynamic image what can i do for if??</p><p>Here is my code:</p><p>parameters.putString(    ""attachment"",  ""{\""name\"":\""""  + b.getString(""title"")  + ""\"",\""href\"":\""""  + b.getString(""cmpWeb"")  + ""\"",\""description\"":\""""  + desc + ""\"",\""media\"":[{\""type\"":\""image\"",\""src\"":\""http://184.106.227.45/quaddeals/img/small_thumb/Deal/692.e6b86fa39f3ba25e29f0351140b57a94.jpg\"",\""href\"":\""http://alumni.brown.edu/\""}]}"");</p><p>This value is <a href=""http://184.106.227.45/quaddeals/img/small_thumb/Deal/692.e6b86fa39f3ba25e29f0351140b57a94.jpg"" rel=""nofollow"">http://184.106.227.45/quaddeals/img/small_thumb/Deal/692.e6b86fa39f3ba25e29f0351140b57a94.jpg</a>\""  static value i want to include dynamic content that i got from previous page by using intent,say(b.getString(""url""))..Also i want to show the web link if user click the link it should shows the Web View ist also static ""http://alumni.brown.edu"" i want to include dynamic data..</p><p>Pls help me thanks in Advance...</p>","555221","","21234","","2011-01-25 14:20:11","2011-11-03 09:37:27","Post image to Facebook in JSON format in Android","<android><json>","1","0","","",""
"4794428","1","","","2011-01-25 14:08:30","4","5404","<p>I'm having one of my apps output to a text file for saves. To do this I'm just using some code I've used before--a FileWriter that outputs String + ""|"" + String + ""\n"".</p><p>Everything works fine except for the newline char, ""\n""--it's just skip and the program moves on to the next string without starting a new lin. I've tried doing html (<code>&lt;br /&gt;</code>) instead, but that just prints out <code>&lt;br /&gt;</code>. What am I missing?</p>","589101","","321697","","2011-01-25 14:12:40","2011-01-25 14:44:09","Android Java newline not working","<android><text><newline>","3","5","1","",""
"4794484","1","","","2011-01-25 14:15:10","5","11244","<p>I have a text that should be set to TextView with specified width. It needs to calculate the text size to fit it into TextView.</p><p>In other words: Is there a way to fit text into TextView area, like the ImageView scale type feature?</p>","82045","","","","","2013-09-23 11:52:54","Calculate text size according to width of text area","<android><textview>","2","1","7","",""
"4794517","1","","","2011-01-25 14:19:23","4","1202","<p>Is there any way how to distinguish whether <code>onDestroy()</code> will be called after <code>onPause()</code>? In may activity I need to do different action when Activity lost focus and when Activity is going down, but even when activity is going down <code>onPause()</code> is called before <code>onDestroy()</code> I want to do different action in <code>onPause()</code> when activity lost focus and when is going down and <code>onDestroy()</code> is gonna be called.</p>","553379","","560297","","2011-05-13 13:20:17","2011-05-13 13:20:17","How to distinguish whether onDestroy will be called after onPause","<android><activity><call><lifecycle><ondestroy>","1","1","","",""
"4794535","1","4794697","","2011-01-25 14:21:01","4","5498","<p>I want to get the telephone Number.I used this sample code..</p><pre><code>TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);String strphonenumber = tm.getLine1Number();</code></pre><p>And I used the permission- READ_PHONE_STATE.</p><p>But its returning null.</p>","399046","","","","","2011-01-25 14:33:44","How to get Telephone Number In Android","<android>","1","1","1","",""
"4794590","1","4795056","","2011-01-25 14:25:02","0","288","<p>In my game, I'd like to have a kind of ""message of the day"" feature. Basically, when the user taps the ""message of the day"" button in the main menu, it would open up a browser view in-game. When the user is done, he taps a ""close"" button and the view disappears, returning him to the game menu.</p><p>So, is it possible to create a browser view dynamically? If yes, how? </p>","93802","","","","","2011-01-25 15:06:35","Creating An In-Game Web Browser on Android","<java><android><webview>","3","0","","",""
"4794621","1","4803425","","2011-01-25 14:27:14","7","2692","<p>I am trying to clear a multiline EditText field inside the OnEditorActionListener.onEditorAction method. </p><p>But using any of the obvious ways i.e.</p><pre><code>((EditText) view).getEditableText().clear();((EditText) view).getEditableText().clearSpans(); ((EditText) view).setText("""");</code></pre><p>only clears the visible characters - leaving the the newlines in the field (which then have to be manually deleted).</p><p>Is there way to 'completely' clear a multiline EditText field ? (or at least - does anybody know why the above don't work ?)</p>","35439","","","","","2011-02-18 13:14:08","Clearing a multiline EditText","<android><edittext>","5","3","0","",""
"4794638","1","4794845","","2011-01-25 14:29:20","0","2918","<p>Here is my code that i am trying to add one layout at runtime on ontouch event.package DesingTesting.com;</p><pre><code>import android.app.Activity;import android.content.Context;import android.media.AudioManager;import android.os.Bundle;import android.util.Log;import android.view.KeyEvent;import android.view.LayoutInflater;import android.view.MotionEvent;import android.view.View;import android.view.Window;import android.widget.FrameLayout;import android.widget.ImageButton;import android.widget.ImageView;import android.widget.LinearLayout;import android.widget.SeekBar;public class DesingTesting extends Activity {    FrameLayout albumframe;    LinearLayout extraview;    LinearLayout mainchield;    boolean flag = true;    LayoutInflater inflater;    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setVolumeControlStream(AudioManager.STREAM_MUSIC);        setContentView(R.layout.main);        albumframe = (FrameLayout)findViewById(R.id.llAlbumview);        extraview = (LinearLayout)findViewById(R.id.extraview);        inflater=(LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        mainchield=(LinearLayout)findViewById(R.id.mainchield);        albumframe.setOnTouchListener(new View.OnTouchListener() {            public boolean onTouch(View v, MotionEvent event) {                if(flag)                {                    inflater.inflate(R.id.mainchield,extraview);                    extraview.addView(mainchield);                flag = false;                }                else                {                    flag = true;                }                return false;            }        });    }   }</code></pre><p>and below is my 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""    android:id = ""@+id/mainlinear""&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""horizontal"" android:layout_width=""fill_parent""        android:layout_height=""50dp"" android:background=""@drawable/header_bg""&gt;        &lt;LinearLayout android:orientation=""horizontal""            android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;            &lt;ImageButton android:id=""@+id/btnBack""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                android:layout_gravity=""left"" android:layout_marginLeft=""10dp""                android:background=""@android:color/transparent"" android:paddingTop=""10dp""                android:src=""@drawable/back"" /&gt;            &lt;LinearLayout android:layout_height=""fill_parent""                android:layout_width=""wrap_content"" android:layout_weight=""1""                android:gravity=""center"" android:orientation=""vertical""&gt;                &lt;TextView android:layout_width=""wrap_content""                    android:layout_height=""wrap_content"" android:text=""CMX""                    android:textColor=""#919191"" android:textSize=""12sp""                    android:textStyle=""bold"" android:singleLine=""true"" /&gt;                &lt;TextView android:layout_width=""wrap_content""                    android:layout_height=""wrap_content"" android:text=""Quanta""                    android:textColor=""#ffffff"" android:textSize=""12sp""                    android:textStyle=""bold"" android:singleLine=""true"" /&gt;                &lt;TextView android:layout_width=""wrap_content""                    android:layout_height=""wrap_content"" android:text=""Talvikuningas""                    android:textColor=""#919191"" android:textSize=""12sp""                    android:textStyle=""bold"" android:singleLine=""true"" /&gt;            &lt;/LinearLayout&gt;            &lt;ImageButton android:id=""@+id/btnMore""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                android:layout_gravity=""right"" android:src=""@drawable/more""                android:paddingLeft=""4dp"" android:paddingTop=""10dp""                android:paddingRight=""10dp"" android:background=""@android:color/transparent"" /&gt;        &lt;/LinearLayout&gt;    &lt;/LinearLayout&gt;    &lt;FrameLayout android:id=""@+id/llAlbumview""        android:layout_width=""fill_parent""         android:layout_height=""360dp""        android:background=""@drawable/chalte""         android:gravity=""center""        &gt;        &lt;LinearLayout android:id=""@+id/extraview""        android:orientation=""horizontal""         android:layout_width=""fill_parent""        android:layout_height=""100dp""        android:background=""@android:color/transparent""&gt;        &lt;/LinearLayout&gt;        &lt;RelativeLayout android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" android:paddingTop=""315dp""            android:background=""@android:color/transparent""&gt;            &lt;LinearLayout android:orientation=""horizontal""                android:layout_height=""wrap_content"" android:layout_width=""fill_parent""                android:layout_gravity=""bottom"" android:id=""@+id/l_playercntrl""                android:background=""@drawable/player_control_bg""&gt;                &lt;ImageButton android:id=""@+id/imgprevious"" android:src=""@drawable/previous""                    android:background=""@android:color/transparent""                    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                    android:layout_marginLeft=""30dp"" android:layout_marginRight=""37dp"" /&gt;                &lt;ImageButton android:id=""@+id/imgpause""                    android:background=""@android:color/transparent""                    android:layout_height=""wrap_content"" android:layout_width=""wrap_content""                    android:layout_marginRight=""35dp"" android:src=""@drawable/play"" /&gt;                &lt;ImageButton android:id=""@+id/imgnext"" android:src=""@drawable/next""                    android:background=""@android:color/transparent""                    android:layout_marginLeft=""2dp"" android:layout_height=""wrap_content""                    android:layout_width=""wrap_content"" /&gt;            &lt;/LinearLayout&gt;        &lt;/RelativeLayout&gt;    &lt;/FrameLayout&gt;    &lt;LinearLayout android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:gravity=""center|bottom""        android:paddingBottom=""4dp""&gt;        &lt;SeekBar android:id=""@+id/sbVolume"" android:padding=""4dip""            android:progressDrawable=""@drawable/skbar"" android:maxHeight=""9dp""            android:thumb=""@drawable/circle"" android:thumbOffset=""2dp""            android:layout_width=""300dp"" android:layout_height=""wrap_content"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;and here is childview.xml&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:gravity=""center|top"" android:paddingBottom=""4dp""    android:background=""@drawable/process_bg""    android:orientation=""vertical""    android:id=""@+id/mainchield""&gt;    &lt;TextView android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:text=""3 of 25""        android:textColor=""#919191"" android:textSize=""12sp"" android:textStyle=""bold""        android:singleLine=""true"" /&gt;    &lt;SeekBar android:id=""@+id/sbVolume"" android:padding=""4dip""        android:progressDrawable=""@drawable/skbar"" android:maxHeight=""9dp""        android:thumb=""@drawable/circle"" android:thumbOffset=""2dp""        android:layout_width=""300dp"" android:layout_height=""wrap_content"" /&gt;        &lt;LinearLayout android:orientation=""horizontal""                android:layout_height=""wrap_content""                 android:layout_width=""fill_parent""                android:layout_gravity=""bottom""                 android:id=""@+id/more""                &gt;                &lt;ImageButton android:id=""@+id/imgprevious"" android:src=""@drawable/repite""                    android:background=""@android:color/transparent""                    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                    android:layout_marginLeft=""30dp""                     android:layout_marginTop=""5dp""                    android:layout_marginRight=""90dp"" /&gt;                &lt;ImageButton android:id=""@+id/imgpause""                    android:background=""@android:color/transparent""                    android:layout_height=""wrap_content"" android:layout_width=""wrap_content""                    android:layout_marginRight=""80dp""                     android:src=""@drawable/circle_t"" /&gt;                &lt;ImageButton android:id=""@+id/imgnext"" android:src=""@drawable/saphal""                    android:background=""@android:color/transparent""                    android:layout_marginLeft=""2dp"" android:layout_height=""wrap_content""                    android:layout_width=""wrap_content""                     android:layout_marginTop=""5dp""/&gt;            &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>i am adding the linearlayout of childview.xml on ontouch event.</strong>can anyone tell me what is the wrong with this code?</p>","562296","","","","","2011-01-25 14:48:18","how to add layout on ontouch event of activity?","<android><android-layout>","2","0","0","",""
"4794776","1","4794872","","2011-01-25 14:41:11","3","4751","<p>I want to Start Broadcastreceiver form an Activity. How can i do that?</p>","399046","","","","","2011-01-25 14:50:08","Start BroadCastReceiver From Activity","<android>","1","0","2","",""
"4794893","1","4794931","","2011-01-25 14:51:55","7","11138","<p>If I build a website that is designed and developed for android or just the droid, is it possible to just make an app that will directly point to that url? or is that not considered an app because it will open in the droid browser etc...</p>","589173","","","","","2013-08-27 15:18:48","Android app that just points to a URL","<android>","6","0","4","",""
"4794909","1","4795486","","2011-01-25 14:53:32","1","780","<p>I am making a download service of sorts, and it has the ability to resume a previous partial download. I am currently using the skip method like this</p><pre><code>                long skipped = 0;                while (skipped &lt; track.getCacheFile().length()){                    skipped += is.skip(track.getCacheFile().length()-skipped);                }</code></pre><p>I just did a test and it took about 57 seconds seconds to skip 45 mb in an inputstream. I am curious how certain native code does this, for instance, the mediaplayer can seek to any part of a remote stream instantaneously. I realize that I do not have access to the same libraries, but can I achieve something similar.</p><p>btw, that test was on wifi. It is obviously much slower on normal data networks.</p><p>Update: very simple (thanks to below)</p><pre><code>if (track.getCacheFile().length() &gt; 0){    request.setHeader(""Range"",""bytes=""+track.getCacheFile().length()+""-"");  }</code></pre>","415422","","415422","","2011-01-25 16:17:56","2011-01-25 16:17:56","Fastest way to seek (skip) an inputstream with http protocol","<android><inputstream><seek>","2","0","1","",""
"4794991","1","4795083","","2011-01-25 15:01:00","1","2316","<p>I am new to Android development, and I had a question about an excerpt I read in Commonsware's ""The Busy Coder's Guide to Android Development"".  There is an example where it is constructing a class extending ListActivity, and showing the ability to remove and delete from the list via Context Menus.  Prior to setting up an ArrayAdapter with the source of strings for the list, the text says to convert the String array to an ArrayList type, because ""we want to be able to change the contents of the list on the fly, and that is much easier if you use an ArrayList rather than a ordinary String array""</p><p>I understand this concept IF we were using the ArrayList or String array to manipulate the list directly, but why does that matter if we're using the ArrayAdapter.add/insert/remove methods?  Once the ArrayAdapter is created (and from what I understand from that .java file), it turns the source data into a List object whether it is coming from an array or ArrayList.</p><p>I tried using the normal array when creating the adapter and I got an error (as expected by what the text said), but I do not understand why.  What is the difference between creating an ArrayAdapter with a string array vs an ArrayList...won't it turn it into the same List object anyway?  Is there some kind of tie back to the original source variable when trying to add/insert/remove via the adapter?</p><p>Sorry for the long question, but thanks in advance.</p>","589186","","","","","2011-01-25 15:14:11","Android Development - Using an ArrayList<String> vs an array of strings with ArrayAdapter","<android><arraylist><android-arrayadapter>","1","0","","",""
"4795094","1","4795123","","2011-01-25 15:09:54","4","849","<p>When I bring up the context menu on a contact in the Android built-in app, the context menu has a title (the contact's name). Same for playlist context menu in the Music app.</p><p>I have added a context menu to an ImageView (no list item). There is no title, just the options are shown. Is there an easy way to set a title so that my context menu looks like the built-in apps' ones?</p>","501976","","","","","2011-01-25 15:12:33","How to set a title for a context menu?","<android>","1","0","","",""
"4795104","1","4912714","","2011-01-25 15:10:36","11","16833","<p>I'm developing a video streaming application and I'm getting stuck when calling set setDataSource with a FileDescriptor.I want my application to play the video as it is being downloaded, so once I get a minimum number of bytes, I move those bytes to another file so it can be played in another file while it's being downloaded in the original file.</p><p>So, I check if I can start the media palyer every packet like this:</p><pre><code>if (mediaPlayer == null) {                    // Only create the MediaPlayer once we have the minimum                    // buffered data                    if (totalKbRead &gt;= INTIAL_KB_BUFFER) {                        try {                            startMediaPlayer();                        } catch (Exception e) {                            Log.e(getClass().getName(),                                    ""Error copying buffered conent."", e);                        }                    }                } else if (mediaPlayer.getDuration()                        - mediaPlayer.getCurrentPosition() &lt;= 1000) {                    transferBufferToMediaPlayer();                }}</code></pre><p>This is the startMediaPlayer method code:</p><pre><code>private void startMediaPlayer() {        try {            File bufferedFile = new File(context.getCacheDir(), ""playingMedia""                    + (counter++) + "".dat"");            // bufferedFile is the one that'll be played            moveFile(downloadingMediaFile, bufferedFile);            mediaPlayer = createMediaPlayer(bufferedFile);            mediaPlayer.start();            playButton.setEnabled(true);        } catch (IOException e) {            Log.e(getClass().getName(), ""Error initializing the MediaPlayer."",                    e);            return;}</code></pre><p>I move the file with the following code:</p><pre><code>public void moveFile(File oldLocation, File newLocation) throws IOException {        if (oldLocation.exists()) {            BufferedInputStream reader = new BufferedInputStream(                    new FileInputStream(oldLocation));            BufferedOutputStream writer = new BufferedOutputStream(                    new FileOutputStream(newLocation, false));            try {                byte[] buff = new byte[8192];                int numChars;                while ((numChars = reader.read(buff, 0, buff.length)) != -1) {                    writer.write(buff, 0, numChars);                }            } catch (IOException ex) {                throw new IOException(""IOException when transferring ""                        + oldLocation.getPath() + "" to ""                        + newLocation.getPath());            } finally {                try {                    if (reader != null) {                        writer.flush();                        writer.close();                        reader.close();                    }                } catch (IOException ex) {                    Log.e(getClass().getName(),                            ""Error closing files when transferring ""                                    + oldLocation.getPath() + "" to ""                                    + newLocation.getPath());                }            }        } else {            throw new IOException(                    ""Old location does not exist when transferring ""                            + oldLocation.getPath() + "" to ""                            + newLocation.getPath());        }    }}</code></pre><p>And I finally create the MediaPlayer object here:</p><pre><code>private MediaPlayer createMediaPlayer(File mediaFile) throws IOException {        if(mediaPlayer != null){            mediaPlayer.release();        }        MediaPlayer mPlayer = new MediaPlayer();        mPlayer.setOnErrorListener(new MediaPlayer.OnErrorListener() {            public boolean onError(MediaPlayer mp, int what, int extra) {                Log.e(getClass().getName(), ""Error in MediaPlayer: ("" + what                        + "") with extra ("" + extra + "")"");                return false;            }        });        // It appears that for security/permission reasons, it is better to pass        // a FileDescriptor rather than a direct path to the File.        // Also I have seen errors such as ""PVMFErrNotSupported"" and        // ""Prepare failed.: status=0x1"" if a file path String is passed to        // setDataSource().        FileInputStream fis = new FileInputStream(mediaFile);        mPlayer.reset();        FileDescriptor fd = fis.getFD();        mPlayer.setDataSource(fd);       // IM GETTING THE EXCEPTION HERE        mPlayer.setDisplay(mHolder);        mPlayer.prepare();        return mPlayer;    }</code></pre><p>This is the excepction I get:</p><pre><code>01-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229): Error initializing the MediaPlayer.01-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229): java.io.IOException: setDataSourceFD failed.: status=0x8000000001-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229):     at android.media.MediaPlayer.setDataSource(Native Method)01-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229):     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:854)01-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229):     at org.pfc.utils.StreamingMediaPlayer.createMediaPlayer(StreamingMediaPlayer.java:266)01-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229):     at org.pfc.utils.StreamingMediaPlayer.startMediaPlayer(StreamingMediaPlayer.java:226)01-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229):     at org.pfc.utils.StreamingMediaPlayer.access$4(StreamingMediaPlayer.java:203)01-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229):     at org.pfc.utils.StreamingMediaPlayer$2.run(StreamingMediaPlayer.java:183)01-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229):     at android.os.Handler.handleCallback(Handler.java:587)01-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229):     at android.os.Handler.dispatchMessage(Handler.java:92)01-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229):     at android.os.Looper.loop(Looper.java:144)01-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229):     at android.app.ActivityThread.main(ActivityThread.java:4937)01-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229):     at java.lang.reflect.Method.invokeNative(Native Method)01-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229):     at java.lang.reflect.Method.invoke(Method.java:521)01-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-25 16:03:15.663: ERROR/org.pfc.utils.StreamingMediaPlayer(2229):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I've been the whole morning stuck here and I really find no information on that error. Some people have told me to use the file path, but I get the other exception I talk about in the comments (right over the FileInputStream creation).</p><p>I'm really lost here, any help would be very appreciated</p>","483362","","","","","2014-02-28 13:07:38","Exception when calling setDataSource(FileDescriptor) method (failed.: status=0x80000000)","<android><video-streaming><media-player><file-descriptor>","5","0","3","",""
"4795131","1","4795461","","2011-01-25 15:13:49","13","2908","<p>Anyone out here use Spring Android? If so, why do you think it's worth while? </p><p>Thanks</p>","234723","","","","","2012-11-14 11:57:29","Why should I use Spring Android?","<java><android><spring>","2","0","5","",""
"4795264","1","4795381","","2011-01-25 15:24:00","2","1952","<p>I have an onClick method set in the xml layout file that triggers the vibration of the phone for 100ms at this point I have the ImageView Visibility set to visible so it can be seen. I want the ImageView to be set back to gone again when the vibration has stopped. How do I go about this? </p>","400406","","","","","2012-05-22 19:26:04","Make ImageView visible for set amount of time","<java><android><imageview>","2","0","","",""
"4795267","1","4918528","","2011-01-25 15:24:13","4","2553","<p>I was using this xml style: </p><pre><code>&lt;style name=""Theme.Transparent"" parent=""@android:style/Theme.Translucent.NoTitleBar""&gt;       </code></pre><p> </p><p>This was showing a tansparent layout with full screen, no title bar or status bar on the top in android 2.1 and 2.2.However, when I tested the application on 2.3, the same activity was showing the home screen status bar on the top (battery etc).</p><p>I had to enter these lines to my java code onCreate:</p><pre><code>requestWindowFeature(Window.FEATURE_NO_TITLE);      getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); </code></pre><p>To get it to remove any status or title bar from the top.</p><p>Can anybody shed light why this difference between 2.2 and 2.3?</p>","562497","","562497","","2011-01-25 16:03:19","2012-08-11 06:18:18","transparent activity's full screen on 2.3","<android>","2","2","1","",""
"4795384","1","4852849","","2011-01-25 15:34:01","0","1578","<p>I have a graphical Android project and my primary trick for providing user interface functionality is to use drawrect and drawtext to draw a rectangle with a label on the screen.  Then, I capture touch events and check to see if they occur in the rectangle -- when they do, voila, I have a button.</p><p>It may not be the most elegant method, but is seems to be working like a charm.  However, not all of my labels look good all on one line, and I'd like to write them on two.  I suppose I could write two separate lines and manually work out arranging the text to be nicely spaced and centered, but I'd like to avoid that if possible.</p><p>In Android, is there a simple way to split a text label and write it out in a single step??</p><p>Thanks,R.</p>","453989","","","","","2011-01-31 15:49:44","Displaying text in multiple lines in Android","<android><drawrect><drawtext>","2","0","","",""
"4795537","1","","","2011-01-25 15:45:25","2","212","<p>On Android, I'm running an application using the NDK that runs a series of tests in C++. If ever one of the tests fails, which most likely means a crash, I'd like the application to relaunch itself and start at the next test. </p><p>I wish I could use exceptions but the NDK doesn't support them.</p><p>Is this possible? </p>","93802","","437039","","2011-01-25 19:39:19","2011-01-25 19:39:19","Automatically Relaunch Application On Crash?","<c++><android><unit-testing><android-ndk>","1","1","","",""
"4795562","1","4795788","","2011-01-25 15:47:40","1","2301","<p>Ok, now this is my SimpleAdapter's getView function:</p><pre><code>    @Override    public View getView(int position, View convertView, ViewGroup parent) {      View view = super.getView(position, convertView, parent);      view.setBackgroundColor(R.drawable.color1);      return view;    }}</code></pre><p>And this is my color1.xml file, in res/drawable-lpi folder:</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=""#FFFF00FF""/&gt; &lt;!-- pressed --&gt;    &lt;item android:state_selected=""true""          android:color=""#FF0000FF""/&gt; &lt;!-- selected --&gt;    &lt;item android:state_focused=""true""          android:color=""#FF0000FF""/&gt; &lt;!-- focused --&gt;      &lt;item android:color=""#FFFFFFFF""/&gt; &lt;!-- default --&gt;&lt;/selector&gt;</code></pre><p>Why i still get this?</p><p><img src=""http://i.stack.imgur.com/k2cuA.png"" alt=""enter image description here""></p>","396133","","396133","","2011-01-26 09:12:24","2011-01-26 09:12:24","Android - I set a custom background for a listView, and the highlight has gone","<android><listview><background>","2","0","","",""
"4795885","1","","","2011-01-25 16:11:29","1","717","<p>I'm having an issue playing an mp4 video that involves the video freezing at a random but consistent point during playback (random in that it seems to differ from device to device, but consistent in that it seems to be the same place on a given device). The video in question is downloaded to the device from a remote url and saved to the internal device storage. Since the native VideoView class doesn't support video playback from the internal storage, I've created a modified version of VideoView with a new method that accepts a file descriptor pointing to the video file in question. The class has also been modified to set the media player's data source to this file descriptor. This results in the video being played from the internal device storage, albeit with the freezing issue described above.</p><p>Judging by the logcat output pasted below, there seems to be an issue with the mediaserver crashing, possibly involving a segfault. I've seen stack traces of similar crashes elsewhere on the 'net but they seem to be related to camera usage rather than video playback. I've tested this on three different handsets, two running Android 2.2.1 and the third running Android 2.1. Can anybody indicate to me what might be causing this issue and how I can fix or circumvent it?</p><blockquote>  <p>WARN/InputManagerService(103): [ 01-25 14:55:48.791  9274:0x27db F/MPEG4Extractor ]<br>  WARN/InputManagerService(103): frameworks/base/media/libstagefright/MPEG4Extractor.cpp:1595   srcOffset + mNALLengthSize &lt;= size<br>  INFO/DEBUG(55): <strong>* <em></strong> *</em>* <strong>* <em></strong> *</em>* <strong>* <em></strong> *</em>* <strong>* <em></strong> *</em>* <strong>* <em></strong> *</em>* **<br>  INFO/DEBUG(55): Build fingerprint: 'vodafone/vfpioneer/sapphire/sapphire:2.2.1/FRG83D/75603:user/release-keys'<br>  INFO/DEBUG(55): pid: 9274, tid: 10203  <strong>>>> /system/bin/mediaserver &lt;&lt;&lt;</strong><br>  INFO/DEBUG(55): <strong>signal 11 (SIGSEGV), fault addr deadbaad</strong><br>  INFO/DEBUG(55):  r0 00000000  r1 0000000c  r2 00000027  r3 00000000<br>  INFO/DEBUG(55):  r4 00000000  r5 deadbaad  r6 00001728  r7 fffde6df<br>  INFO/DEBUG(55):  r8 00100000  r9 a340a1f1  10 4050a000  fp 00016db8<br>  INFO/DEBUG(55):  ip ffffffff  sp 40609908  lr afd154c5  pc afd11dc4  cpsr 40000030<br>  WARN/AACDecoder(9274): AAC decoder returned error 1, substituting silence<br>  ...<br>  WARN/AACDecoder(9274): AAC decoder returned error 1, substituting silence<br>  INFO/DEBUG(55):          #00  pc 00011dc4  /system/lib/libc.so<br>  INFO/DEBUG(55):          #01  pc 0000135c  /system/lib/liblog.so<br>  INFO/DEBUG(55): code around pc:<br>  INFO/DEBUG(55): afd11da4 1c2bd00b 2d00682d e026d1fb 2b0068db<br>  INFO/DEBUG(55): afd11db4 4e17d003 51a02001 4d164798 24002227<br>  INFO/DEBUG(55): afd11dc4 f7fb702a 2106ee14 ef10f7fc 05592380<br>  WARN/AACDecoder(9274): AAC decoder returned error 1, substituting silence<br>  INFO/DEBUG(55): afd11dd4 6091aa01 1c116054 94012006 eab6f7fc<br>  INFO/DEBUG(55): afd11de4 2200a905 f7fc2002 f7fbeac2 2106ee00<br>  INFO/DEBUG(55): code around lr:<br>  INFO/DEBUG(55): afd154a4 b0834a0d 589c447b 26009001 686768a5<br>  INFO/DEBUG(55): afd154b4 220ce008 2b005eab 1c28d003 47889901<br>  INFO/DEBUG(55): afd154c4 35544306 d5f43f01 2c006824 b003d1ee<br>  INFO/DEBUG(55): afd154d4 bdf01c30 0002ae7c 000000d4 1c0fb5f0<br>  INFO/DEBUG(55): afd154e4 43551c3d a904b087 1c16ac01 604d9004<br>  INFO/DEBUG(55): stack:<br>  INFO/DEBUG(55):     406098c8  00000000<br>  INFO/DEBUG(55):     406098cc  000003a0<br>  INFO/DEBUG(55):     406098d0  afd40498  /system/lib/libc.so<br>  INFO/DEBUG(55):     406098d4  afd41b6c  /system/lib/libc.so<br>  INFO/DEBUG(55):     406098d8  00000000<br>  INFO/DEBUG(55):     406098dc  afd154c5  /system/lib/libc.so<br>  WARN/AACDecoder(9274): AAC decoder returned error 1, substituting silence<br>  INFO/DEBUG(55):     406098e0  00000009<br>  INFO/DEBUG(55):     406098e4  afd1450d  /system/lib/libc.so<br>  INFO/DEBUG(55):     406098e8  0000005f<br>  INFO/DEBUG(55):     406098ec  afd40328  /system/lib/libc.so<br>  INFO/DEBUG(55):     406098f0  00000000<br>  INFO/DEBUG(55):     406098f4  00001728<br>  INFO/DEBUG(55):     406098f8  fffde6df<br>  INFO/DEBUG(55):     406098fc  afd147ab  /system/lib/libc.so<br>  INFO/DEBUG(55):     40609900  df002777<br>  INFO/DEBUG(55):     40609904  e3a070ad<br>  INFO/DEBUG(55): #00 40609908  40609904<br>  INFO/DEBUG(55):     4060990c  00000001<br>  INFO/DEBUG(55):     40609910  a2f89987  /system/lib/libstagefright.so<br>  INFO/DEBUG(55):     40609914  0000000f<br>  INFO/DEBUG(55):     40609918  4060993c<br>  INFO/DEBUG(55):     4060991c  fffffbdf<br>  INFO/DEBUG(55):     40609920  4060993c<br>  INFO/DEBUG(55):     40609924  a2f89987  /system/lib/libstagefright.so<br>  INFO/DEBUG(55):     40609928  a2fab2a8  /system/lib/libstagefright.so<br>  INFO/DEBUG(55):     4060992c  afa0135f  /system/lib/liblog.so<br>  INFO/DEBUG(55): #01 40609930  4060993c<br>  INFO/DEBUG(55):     40609934  afa0135f  /system/lib/liblog.so<br>  WARN/AACDecoder(9274): AAC decoder returned error 1, substituting silence<br>  WARN/AACDecoder(9274): AAC decoder returned error 1, substituting silence<br>  INFO/DEBUG(55):     40609938  40609d54<br>  INFO/DEBUG(55):     4060993c  6d617266<br>  INFO/DEBUG(55):     40609940  726f7765<br>  INFO/DEBUG(55):     40609944  622f736b<br>  INFO/DEBUG(55):     40609948  2f657361<br>  INFO/DEBUG(55):     4060994c  6964656d<br>  INFO/DEBUG(55):     40609950  696c2f61<br>  INFO/DEBUG(55):     40609954  61747362<br>  INFO/DEBUG(55):     40609958  72666567<br>  INFO/DEBUG(55):     4060995c  74686769<br>  INFO/DEBUG(55):     40609960  45504d2f<br>  INFO/DEBUG(55):     40609964  78453447<br>  INFO/DEBUG(55):     40609968  63617274<br>  INFO/DEBUG(55):     4060996c  2e726f74<br>  INFO/DEBUG(55):     40609970  3a707063<br>  INFO/DEBUG(55):     40609974  35393531<br>  WARN/AACDecoder(9274): AAC decoder returned error 1, substituting silence<br>  ...<br>  WARN/AACDecoder(9274): AAC decoder returned error 1, substituting silence<br>  INFO/ServiceManager(52): service 'media.audio_flinger' died<br>  INFO/ServiceManager(52): service 'media.player' died<br>  INFO/ServiceManager(52): service 'media.camera' died<br>  INFO/ServiceManager(52): service 'media.audio_policy' died<br>  WARN/IMediaDeathNotifier(10181): media server died<br>  ERROR/MediaPlayer(10181): error (100, 0)<br>  ERROR/MediaPlayer(10181): Error (100,0)<br>  DEBUG/VideoView(10181): Error: 100,0<br>  WARN/AudioSystem(103): AudioFlinger server died!<br>  WARN/AudioSystem(103): AudioPolicyService server died!<br>  INFO/BootReceiver(103): Copying /data/tombstones/tombstone_03 to DropBox  (SYSTEM_TOMBSTONE)  </p></blockquote>","581460","","1288","","2011-01-28 21:07:49","2011-04-06 08:56:42","Video playback from Android internal storage eventually hangs/crashes","<android><segmentation-fault><media-player><internal><videoview>","0","1","1","",""
"4795916","1","","","2011-01-25 16:13:35","0","836","<p>I am having a list view in which i wanna to change the color when user clicks or scroll down over the List.. I included listSelector in the XML attributes its not working.. Is there any way to color change when the list scroll down..</p><p>My code is :</p><pre><code>&lt;ListView     android:id=""@+id/allcity""     android:listSelector=""@drawable/list""    android:cacheColorHint=""#00000000""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent"" /&gt;</code></pre><p>where drawable/list is the blue background image..</p>","555221","","321697","","2011-01-25 17:08:10","2011-01-25 17:08:10","Android List view color change","<android>","0","3","","",""
"4796059","1","","","2011-01-25 16:24:08","0","65","<p>In my app i have to store a no of audio files in database in webserver and then after recording the audio in android mobile i have to send it to server to match with the previous audio files. </p><p>How to do this??</p>","412168","","","","","2011-01-25 17:57:13","how to store and search mp3 by its content in android","<android><web-services><audio>","1","0","","",""
"4796091","1","4796447","","2011-01-25 16:26:15","0","797","<p>I already spent hours on this, its a layout issue. can someone tell me how to show both image and view switcher in the same activity.   </p><pre><code>&lt;RelativeLayout             xmlns:android=""http://schemas.android.com/apk/res/android""        xmlns:myapp=""http://schemas.android.com/apk/res/rg.client.muscle""            android:layout_width=""fill_parent""        android:layout_height=""fil_parent""&gt;    &lt;ViewSwitcher         android:id=""@+id/relative""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""         android:layout_alignParentBottom=""true""&gt;        &lt;!-- contains two relative layouts of same sizes         containing same elements just with switched positions --&gt;        &lt;RelativeLayout             android:layout_width=""fill_parent""            android:layout_height=""wrap_content""             android:layout_alignParentBottom=""true"" &gt;            &lt;com.admob.android.ads.AdView                 android:id=""@+id/adv""                 android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:layout_alignParentBottom=""true""                myapp:backgroundColor=""#000000""                 myapp:primaryTextColor=""#FFFFFF""                 myapp:secondaryTextColor=""#CCCCCC""                myapp:refreshInterval=""30"" &gt;            &lt;/com.admob.android.ads.AdView&gt;            &lt;LinearLayout                 android:id=""@+id/linear""                 android:orientation=""horizontal""                 android:weightSum=""100""                 android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                 android:layout_above=""@id/adv"" &gt;                &lt;Button                     android:id=""@+id/but_prev2""                     android:text=""Previous""                     android:layout_width=""0dp""                     android:layout_height=""wrap_content""                     android:layout_weight=""30"" &gt;                &lt;/Button&gt;                &lt;Button                     android:id=""@+id/but_more2""                     android:text=""More""                     android:layout_width=""0dp""                     android:layout_height=""wrap_content""                     android:layout_weight=""40"" &gt;                &lt;/Button&gt;                &lt;Button                     android:id=""@+id/but_next2""                     android:text=""Next""                     android:layout_width=""0dp""                     android:layout_height=""wrap_content""                     android:layout_weight=""30""&gt;                &lt;/Button&gt;            &lt;/LinearLayout&gt;        &lt;/RelativeLayout&gt;        &lt;RelativeLayout             android:layout_width=""fill_parent""            android:layout_height=""wrap_content""             android:layout_alignParentBottom=""true"" &gt;            &lt;LinearLayout                 android:id=""@+id/linear2""                 android:orientation=""horizontal""                  android:weightSum=""100""                 android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                 android:layout_alignParentBottom=""true"" &gt;                &lt;Button                     android:id=""@+id/but_prev""                     android:text=""Previous""                     android:layout_width=""0dp""                     android:layout_height=""wrap_content""                     android:layout_weight=""30""&gt;                &lt;/Button&gt;                &lt;Button                     android:id=""@+id/but_more""                     android:text=""More""                     android:layout_width=""0dp""                     android:layout_height=""wrap_content""                     android:layout_weight=""40""&gt;                &lt;/Button&gt;                &lt;Button                     android:id=""@+id/but_next""                     android:text=""Next""                     android:layout_width=""0dp""                       android:layout_height=""wrap_content""                     android:layout_weight=""30""&gt;                &lt;/Button&gt;            &lt;/LinearLayout&gt;            &lt;com.admob.android.ads.AdView                 android:id=""@+id/adv2""                 android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:layout_above=""@id/linear2""                 myapp:backgroundColor=""#000000""                 myapp:primaryTextColor=""#FFFFFF""                 myapp:secondaryTextColor=""#CCCCCC""                myapp:refreshInterval=""30""&gt;            &lt;/com.admob.android.ads.AdView&gt;        &lt;/RelativeLayout&gt;    &lt;/ViewSwitcher&gt;    &lt;ImageView         android:id=""@+id/image""        android:layout_above=""@id/relative""        android:padding=""2pt""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:layout_alignParentTop=""true"" &gt;    &lt;/ImageView&gt;&lt;/RelativeLayout&gt;</code></pre><p>If I put the imageview first then each time a new image is loaded the buttons disappear and the whole layout seems to be re inflated </p><p>Update:</p><p>The layout must have an image view at the top then a view switcher.</p>","557869","","557869","","2011-01-26 01:59:48","2011-01-26 01:59:48","android xml Layout issue","<android><xml><layout><android-layout><inflate>","2","0","","",""
"4796163","1","","","2011-01-25 16:32:18","1","401","<p>I am developing an app wich uses GPS in many Activities.At first I thought of implementing the LocationListener in each Activity. However I wonder if is possible a better aproach to the problem by having a service with the GPS. What do you think is the right path to follow? </p><p>Thanks a lot.D.</p>","588925","","","","","2011-01-25 16:47:30","Getting Location in Android for different activities","<android><gps>","1","0","","",""
"4796167","1","","","2011-01-25 16:32:37","2","680","<p>My application has a thread pool that creates 3 simultaneous threads. As I invoke runnables, they are added to my thread pool.</p><p>My problem happens when the application goes to the background for a while. Eventually, my threads stop executing the runnables in my pool and the pool just continues to grow. Even if I bring my application back to the foreground, my threads do not start running again.</p><p>My theory is that when my application goes to the background that my threads are being killed. I'm not sure by what and I'm also not sure of a good way of determining whether my threads are killed so that I can start them again.</p><p>Do you have any suggestions as to something I can look for to determine whether or not a thread has been killed?</p>","349179","","","","","2011-03-14 22:42:39","Android Thread Pool has runnables building up without execution after background state","<android><background><sleep><threadpool>","1","4","","",""
"4796197","1","","","2011-01-25 16:35:18","1","384","<p>I need to do an application to navigate in a museum, using a map of the museum and Android's compass. The app should help the user go to some pre-set positions on the map.Is it possible?What should be the format of the map?</p><p>thanks</p><p>jul</p>","326849","","","","","2011-01-25 17:36:43","Orienting a custom map in Android","<android><map><compass-geolocation>","1","1","1","",""
"4796330","1","","","2011-01-25 16:46:11","1","2674","<p>I am targeting devices that have native resolution of 480x800; however, my background image (480x800) gets resized (shrink down) to 480x774 because of the title bar on top. I know that Dell Streak or Samsung Galaxy Tab will have shorter (in terms of resolution) title bar since the screen size is bigger (although the resolution is same: 480x800)</p><p>Is there a way to make background stretch from all the way from top (including title bar) to very bottom? I don't care some top part of image is covered by Android title bar.</p><p>I just don't want 480x800 background image to shrink down.</p><p>I already use fill parent: </p><pre><code>android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background=""@drawable/background""</code></pre>","432056","","86860","","2011-01-25 16:51:35","2011-01-25 16:51:35","Android: Native App Background resolution? 480x800? or 480x774?","<android><background><resolution>","0","3","","",""
"4796497","1","4797773","","2011-01-25 16:58:59","0","2499","<p>Here is my problem. I would like to have an AlertDialog that have a title and a positive button. I want to describe the content of the AlertDialog in a XML file (except for the title/button).I have created a file called dlg_addpwd.xml in my layout resources.Here is the code I am using:</p><pre><code>     alertDlgAddPwd=new AlertDialog.Builder(this);    alertDlgAddPwd.setTitle(""Password access"");  alertDlgAddPwd.setView(findViewById(R.layout.dlg_addpwd));  alertDlgAddPwd.setPositiveButton(""Add"", listenAddPwdDlg);  alertDlgAddPwd.show();</code></pre><p>I guess the line,</p><pre><code>     alertDlgAddPwd.setView(findViewById(R.layout.dlg_addpwd));</code></pre><p>is wrong, isn't it ?So the main idea of my question is: how to define as a view for an AlertDialog a view described in a XML file ?</p><p>Thanks</p><p>Vincent</p>","575481","","","","","2013-10-19 17:42:04","Problem with customized Android AlertDialog","<android><alertdialog>","2","0","","",""
"4796498","1","","","2011-01-25 16:59:03","0","979","<p>im trying to create a simple application with no lucki just want to preform some action if i touches the list viewif i'm not adding the onClickListener everything is okjava:</p><pre><code>        ListView myListView = (ListView)findViewById(R.id.listViewOptions);    final ArrayList&lt;String&gt; optionsArray = new ArrayList&lt;String&gt;();    final ArrayAdapter&lt;String&gt; arrayAdapter;    arrayAdapter = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,optionsArray);    for(int i =1 ; i &lt; 3 ; i++)    {        optionsArray.add(""1"");        arrayAdapter.notifyDataSetChanged();    }    myListView.setAdapter(arrayAdapter);    myListView.setClickable(true);    myListView.setFocusable(true);   OnClickListener onClickListener = new OnClickListener() {    public void onClick(View v) {        // TODO Auto-generated method stub    }};myListView.setOnClickListener(onClickListener);</code></pre><p>XML:</p><pre><code>&lt;ListView android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:layout_weight=""1"" android:id=""@+id/listViewOptions"" android:clickable=""true""&gt;&lt;/ListView&gt;</code></pre><p>Thanks</p><p>Log:</p><pre><code>E/AndroidRuntime(  232): Caused by: java.lang.RuntimeException: Don't call setOnClickListener for an AdapterView. You probably want setOnItemClickListener insteadE/AndroidRuntime(  232):    at android.widget.AdapterView.setOnClickListener(AdapterView.java:750)E/AndroidRuntime(  232):    at com.resume.Resume.onCreate(Resume.java:52)E/AndroidRuntime(  232):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)E/AndroidRuntime(  232):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)E/AndroidRuntime(  232):    ... 11 moreI/Process (   52): Sending signal. PID: 232 SIG: 3I/dalvikvm(  232): threadid=7: reacting to signal 3E/dalvikvm(  232): Unable to open stack trace file '/data/anr/traces.txt': Permission deniedW/ActivityManager(   52): Launch timeout has expired, giving up wake lock!W/ActivityManager(   52): Activity idle timeout for HistoryRecord{439114c0 com.resume/.Resume}</code></pre>","556055","","1081831","","2011-12-28 13:50:10","2011-12-28 13:50:10","onClickListener couses Crash with TextView","<android>","1","2","","",""
"4796541","1","4818072","","2011-01-25 17:02:52","0","1405","<p>I'm working on an Android application that will send MMS internally without using the native messaging app. I've been using the code from the native app that I found at <a href=""http://android.git.kernel.org/"" rel=""nofollow"">http://android.git.kernel.org/</a> as a guide and have managed to create a working prototype. However, I'm having a slight issue when trying to make the HTTP_Post when the phone is connected to Wifi. </p><p>In the code snippet below I request the MMS network feature and wait for the android.net.conn.CONNECTIVITY_CHANGE intent indicating the connection is active. I then request the NetworkInfo for TYPE_MOBILE and check that it is connected. This is where I hit the issue. If the wifi is connected, when I call info.isConnected() it returns false and the MMS HttpPost cannot be made as this post must be made through the 3G/GPRS connection. </p><pre><code>ConnectivityManager.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, ""enableMMS"");//wait for android.net.conn.CONNECTIVITY_CHANGE intentNetworkInfo info = connMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);if (!info.isConnected())     return;</code></pre><p>The only way I can get it to work is by disconnecting the wifi at which point info.isConnected() returns true and I can go on to make the HttpPost successfully. But I don't think this is the correct way of performing this function as the native app doesn't seem to do this. From what I can see, the native messaging app's TransactionService.java uses an internal, deprecated class, NetworkConnectivityListener, to manage the connection but I can't see anything in its code that modifies the Wifi connection.</p><p>Has anyone had a similar issue to this or know of the correct way to work around it?I noticed in the ConnectivityManager documentation there's a connection type TYPE_MOBILE_MMS but I haven't tried this as it's only supported by devices running 2.2 and above and I want to be able to support devices running 1.6.</p><p>Any help would be most appreciated.</p>","397789","","","","","2011-08-03 09:40:34","MMS sending connectivity issues when wifi is active (Android)","<android><wifi><mms>","2","0","","",""
"4796658","1","4797000","","2011-01-25 17:13:18","12","21345","<p>I would like to develop an augmented reality application on a HTC Nexus One mobile phone for android using Flash Professional CS5 and Adobe AIR 2.5.</p><p>I found a couple of online sources showing how to develop AR application using webcam and Flash and i have found it very useful to follow and understand the basics of AR.</p><p>For example:</p><ol><li><p>Augmented Reality using webcam and Flash<br><a href=""http://www.adobe.com/devnet/flash/articles/augmented_reality.html"">http://www.adobe.com/devnet/flash/articles/augmented_reality.html</a></p></li><li><p>Introduction to Augmented Reality<a href=""http://www.gotoandlearn.com/play.php?id=105"">http://www.gotoandlearn.com/play.php?id=105</a></p></li></ol><p>I have also watched other videos regarding AIR for Android Applications from gotoandlearn website and i did all of the successfully such as:</p><ol><li>Air for Android – Part 1 </li><li>Air for Android – Part 2</li><li>Publishing AIR for Android Applications</li><li>AIR for Android GPU Acceleration</li><li>Introduction to Augmented Reality</li></ol><p>However, i didn't manage to get it work on my android phone (doing nothing and run very slow).  </p><p>I would like to ask a few questions on the following:</p><p>1) To develop an Augmented Reality application on android, is this done using the same method as the one's above? </p><p>2) Do I need to use any other software other than those that is showing on the video and adobe air 2.5?</p><p>3) Do you know of any other sources/reading material that are relevant and may be of help?</p><p>Thank you</p>","495296","","203600","","2011-01-25 17:15:20","2011-12-08 10:05:01","How to develop Augmented Reality application for Android","<android><air><flash-cs5><augmented-reality>","3","1","10","",""
"4796806","1","","","2011-01-25 17:28:47","4","2546","<p>I am trying to implement an ImageView with could holds both landscape or portrait images.Those images should fit the width of the imageview (if landscape) or the height (if portrait) but in any case they must be aligned to the top of the view with no margin or padding.</p><p>What I would like to achive is something like <code>android:scaleType=""fitStart""</code> but <em>centered</em> in the case of portrait images or aligned to top in case of landscape images.</p><p>Any idea?</p><p>Thanks a lot,</p><p>Omar</p><p>P.S.Now I am using such an ugly code, which seems to work, but not sure it is the best solution:</p><pre><code>&lt;com.custom.layout.MyImageView         android:id=""@+id/detail_view_image""         android:src=""@drawable/logo""         android:background=""#fff""        android:layout_width=""fill_parent""         android:layout_height=""fill_parent""        android:layout_centerHorizontal=""true""        android:cropToPadding=""false""        android:adjustViewBounds=""false""/&gt;</code></pre><p>and then in my class, that extends ImageView i do:</p><pre><code>@Override    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {        int imgWidth = getDrawable().getIntrinsicWidth();        int imgHeight = getDrawable().getIntrinsicHeight();        if(imgWidth&gt;imgHeight)            setScaleType(ScaleType.FIT_START);        else            setScaleType(ScaleType.FIT_CENTER);        int width = measureWidth(widthMeasureSpec);        int height = measureHeight(heightMeasureSpec);              setMeasuredDimension(width, height);    }</code></pre>","448660","","448660","","2011-01-25 17:45:10","2012-07-02 19:15:11","Android ImageView ScaleType *FIT_TOP*","<android><imageview><drawable><fit>","1","3","3","",""
"4796858","1","4876047","","2011-01-25 17:33:03","0","1169","<p>I'm currently making an SMS viewing application and using the ContentResolver to obtain all SMS messages on the phone (Yes, I understand the risks). Like other applications, I want to group all messages from the same person to one thread, display the latest message from them, and order the contacts by date of the last message.</p><p>When it comes to the address values of the incoming messages, they all contain the country code (e.g. +44123456789). But when the user saves his contacts, he could ignore the country code and simply type in the local format. So all outgoing messages are stored as 0123456789.</p><p>So, the database will contain the same address in both formats, +44123456789 and 0123456789. How do you match this 2 and remove the duplicate address?</p><p>Note:1) Messages from the same person may not have the same ""thread id""2) There may not be a ""contact id""/""display name"" value for the address </p>","156547","","","","","2013-03-21 09:26:00","Matching incoming and outgoing phone numbers","<android><sms><contact><country>","2","0","1","",""
"4796916","1","4796980","","2011-01-25 17:38:32","0","355","<p>This isnt specifically a programming question, more on the logic.</p><p>Basically I have a website which I am making an android app for. On the app I want the user to be able to login by entering their username and password to the prompt on the app. When the user clicks login the data is POSTED to the site URL. This is where I am a bit lost... how then does the app know whether the login was successful or not, and, if successful, I want the app to show then another form or whatever for the user to be able to post new content to the site, which will be POSTED again. I'd imagine this involves retrieving a cookie to check for authentication? Would I have to set up a custom response page? And how would the app maintain the session?</p>","568942","","","","","2011-01-25 17:45:03","Acessing the web from android application","<android>","1","0","","",""
"4796923","1","4796973","","2011-01-25 17:39:18","1","2280","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1114287/good-book-for-beginning-android-development"">Good book for beginning android development</a>  </p></blockquote><p>Hi friends i know android is a new concept but i would like to know if any good books are available on Android programming.Any help on this will be appreciated.</p>","538778","","","","","2011-01-25 17:57:36","android tutorial book","<android><android-manifest>","4","3","1","2011-01-25 18:42:10",""
"4797032","1","6453578","","2011-01-25 17:51:56","5","2160","<p>It is possible to programmatically interact with a phone call?  Can you, for example, play audio to a caller from a program?  </p>","267702","","229044","","2012-07-12 15:20:39","2012-07-12 15:20:39","How to play sound on phone call with Android?","<android><audio><phone>","1","1","1","",""
"4797187","1","","","2011-01-25 18:06:43","12","7063","<p>I have an application which has some static variables.These variables are stored in an independent Class named DataContext.These variables are initialized from raw files at the application start (a method named DataContext.initConstant() is called in the onCreate() of MyApplication which extends Application).</p><p>(EDIT : the initConstant method use an AsyncTask to load this data from files).</p><p>When my application comes to the background for a certain time or when my application used to much memory, these static variables become null.</p><p>1- How could I prevent it ?</p><p>2- if not what should I do with my static variables ?</p><p>I have other data which are stored in static variables to be used across different activities, but I clear them or pass them to null in the onLowMemory() of MyApplication.</p><p>3- What is the best way to keep some datas accessible between activities if these datas are to big to be serialized in an Intent, can't use a database for a reason, and can't be stored in files through serialization too ?</p><p>Thanks for your answers/advices</p>","589413","","589413","","2011-01-25 18:35:31","2013-03-27 11:58:03","Android : Static variable null on low memory","<android><memory><static>","7","2","10","",""
"4797296","1","","","2011-01-25 18:18:12","0","92","<p>I am new to android programming and I am trying to find a way to make a app that loads my web site each time it is called  Below is my code and it works great the first time but if I go back into the app the 2nd time it displays the app view and not the web site.  I guess the onCreate is not the right funcation to use can someone please help me</p><pre><code>public class mysite extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        String url = ""http://www.mysite.com"";        Uri uri = Uri.parse(url);        Intent i = new Intent(Intent.ACTION_VIEW, uri);        startActivity(i);    }}</code></pre>","589450","","407382","","2011-01-25 18:20:26","2011-01-25 18:24:57","How to reload web site each time the app is called","<java><android>","2","1","","",""
"4797411","1","4797639","","2011-01-25 18:29:12","9","6209","<p>Could please somebody explain me (ASCII is really welcome) what the <code>stride</code> argument stands for in <a href=""http://developer.android.com/reference/android/graphics/Canvas.html#drawBitmap%28int%5b%5d,%20int,%20int,%20float,%20float,%20int,%20int,%20boolean,%20android.graphics.Paint%29""><code>Canvas.drawBitmap()</code></a> and in <a href=""http://developer.android.com/reference/android/graphics/Bitmap.html#setPixels%28int%5b%5d,%20int,%20int,%20int,%20int,%20int,%20int%29""><code>Bitmap.setPixels()/getPixels()</code></a>? I understand it's a way to skip elements in the colors array, but how?</p>","503900","","","","","2011-01-27 07:14:51","drawBitmap() and setPixels(): what's the stride?","<android><canvas><bitmap><drawing>","2","0","","",""
"4797444","1","4798253","","2011-01-25 18:33:24","4","2483","<p>In IntelliJ IDEA I exported signed application (created a new key, etc.), entered command <code>adb install &lt;my_app&gt;.apk</code> and got an error:</p><blockquote>  <p>1990 KB/s (745096 bytes in 0.365s)<br>  pkg: /data/local/tmp/myapp.apk<br>  <strong>Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION]</strong></p></blockquote><p>Google doesn't seem to know about this error. I found the solution where application version in Manifest file was not an integer, but this is not the case with me. </p><p>Could I be making a mistake during the creation of new sign key???</p><p>EDIT: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=""org.example.app""        android:versionCode=""1""        android:versionName=""1.0""        &gt;    &lt;application            android:icon=""@drawable/icon""            android:label=""@string/app_name""            &gt;        &lt;activity                android:name="".App""                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:label=""@string/about""                android:name=""About""                &gt;&lt;/activity&gt;        &lt;activity                android:label=""@string/preference""                android:name=""Preference""                &gt;&lt;/activity&gt;        &lt;activity                android:name=""Empl""                android:label=""@string/empl""                &gt;&lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk            android:minSdkVersion=""8""/&gt;&lt;/manifest&gt; </code></pre>","437039","","437039","","2011-01-25 18:45:41","2013-01-31 21:22:20","Weird error while installing Android app?","<android><intellij-idea><failed-installation>","2","7","1","",""
"4797509","1","4799934","","2011-01-25 18:41:37","3","6276","<p>I have to use NDK for a clien't project. I am using Windows 7.</p><p>I followed the installation instructions. I have installed Cygwin 1.7.1.</p><p>In Cygwin bash, I go into the android NDK root directory.</p><p>When I see the contents of the directory, usin $dir command, I can see all the contents including ndk-build, but when I try to use ndk-build, this is the result I get:</p><p>$ndk-buildbash: ndk-build: command not found. </p><p>Not sure what I am doing wrong. </p>","289918","","","","","2011-01-25 23:17:40","Cannot use ndk-build on Cygwin","<android><cygwin><android-ndk>","1","2","","",""
"4797645","1","4799194","","2011-01-25 18:58:17","1","1206","<p>I have a class that needs to access my application's main activity, but by design outside of my control I cannot pass an instance to it. Its purpose is to dynamically create a view and set it to the activity. </p><p>Is there a way for me to access the main activity through a static method? Or is there an alternative? </p>","93802","","","","","2011-01-25 21:44:21","How Do I Get The Currently Running Activity In My Application?","<android><view><activity>","1","11","","",""
"4797696","1","4797740","","2011-01-25 19:02:28","0","2506","<p>How do I make my ads display at the bottom of the screen?</p><p>I have tried setting gravity to bottom but it still won't budge.</p><p>Current page 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"" android:background=""@color/Background_Color""&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""  xmlns:myapp=""http://schemas.android.com/apk/res/com.x.x"" &gt;  &lt;TextView android:id=""@+id/out_text""    android:layout_height=""fill_parent""   android:layout_width=""fill_parent""   android:textSize=""30dip""    android:textColor=""@color/Text_Color"" /&gt;  &lt;com.admob.android.ads.AdView   android:id=""@+id/ad""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   myapp:backgroundColor=""#000000""   myapp:primaryTextColor=""#FFFFFF""   myapp:secondaryTextColor=""#CCCCCC""   myapp:refreshInterval=""10""   android:visibility=""visible"" /&gt; &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>Any help would be greatly appreciated!</p>","576820","","21234","","2011-01-25 20:50:21","2011-08-07 23:16:10","Android AdMob - Alignment/Position Ads","<android><alignment><position><advertising><admob>","2","0","","",""
"4797771","1","4797843","","2011-01-25 19:10:58","0","172","<p>I have set up an alarm to run a service to grab events from the internet. The following is how I implemented it however it seems to run immediately and not delay the alarm at all.</p><pre><code>AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);        am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,                SystemClock.currentThreadTimeMillis()+30000, AlarmManager.INTERVAL_DAY, newsAlarm);</code></pre>","180825","","","","","2011-01-25 19:19:50","Have a repeating alarm start thirty seconds once started then once a day afterward in Android","<android>","2","0","","",""
"4797926","1","4798836","","2011-01-25 19:27:21","0","7703","<p>now i have a activity, that shows a list of usernames. OK it works. But that i need is to show a custom listview item with the username at the left and a button at the right (this button will do a call to a programatically given phone number).</p><p>I know that i have to do a custom adapter, but my skills are too low. And also i dont know how to use it when i have done.</p><p>Can someone help me making a easy custom adapter to manage my listitem with one textview and one button and giving me the code to use that custom adapter?</p><p>the adapter should be able to use this new list_item2.xml:</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;TextView         android:id=""@+id/friendName""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_alignParentLeft=""true""        android:padding=""10dp""        android:textSize=""16sp""/&gt;        &lt;Button        android:id=""@+id/callButton""        android:layout_alignBaseline=""@id/friendName""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:text=""Call""        android:width=""100px""        android:layout_alignParentRight=""true""/&gt;&lt;/RelativeLayout&gt; </code></pre><p>this is the code that i use now:</p><p>list_item.xml:</p><pre><code>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""    android:padding=""10dp""    android:textSize=""16sp"" &gt;&lt;/TextView&gt;</code></pre><p>this is the listactivity class:</p><pre><code>public class AllActivity extends ListActivity {    RemoteConnection con; //conexion remota    //private MyDbAdapter mDbHelper;    private List&lt;Friend&gt; friends; //lista de amigos    private List&lt;String&gt; usernames; //lista de usernames de amigos, para rellenar el listview    //private List&lt;Permission&gt; permissions;    //para almacenar la config local de mi app, mostrarme o no en el mapa...    static SharedPreferences settings;    static SharedPreferences.Editor configEditor;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        settings=PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext());        configEditor = settings.edit();        friends = new ArrayList&lt;Friend&gt;();        usernames = new ArrayList&lt;String&gt;();        //mDbHelper=MyApplication.getDatabaseAdapter();        con = new RemoteConnection();        actualizar();    }    protected void onActivityResult(int requestCode, int resultCode, Intent data) {        if (resultCode == 1) {            setResult(1);            finish();                           }    }    public void onResume() {        super.onResume();        actualizar();          }    public void actualizar()    {        //friends = con.RetrieveFriends(settings.getString(""login"",""""));        friends = MyApplication.getDatabaseAdapter().retrieveAllFriends();        usernames.clear();        for (int i=0;i&lt;friends.size();i++)        //for (int i=0;i&lt;permissions.size();i++)        {            usernames.add(i,friends.get(i).getFullName());            //if (friends.get(i).getLastPosition()!=null)            //  usernames.add(i,friends.get(i).getLastPosition().getpositiontimeFormated());            }        setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item3, usernames));        ListView lv = getListView();        lv.setTextFilterEnabled(true);        lv.setOnItemClickListener(new OnItemClickListener() {          public void onItemClick(AdapterView&lt;?&gt; parent, View view,              int position, long id) {              Bundle bundle = new Bundle(); //bundle is like the letter              bundle.putString (""user"", friends.get(position).getFullName()); //arg1 is the keyword of the txt, arg2 is the txt              bundle.putString (""email"", friends.get(position).getEmail());              bundle.putString (""permission"", friends.get(position).getPermission());              Intent i=null;              if (friends.get(position).getPermission().equals(""total""))                  i = new Intent (AllActivity.this, Locate.class);              else if (friends.get(position).getPermission().equals(""perhours""))                  i = new Intent (AllActivity.this, LocatePerHours.class);              else                  i = new Intent (AllActivity.this, LocatePerDays.class);              i.putExtras(bundle);              startActivity(i);              //startActivityForResult(i, 0);          }        });    }}</code></pre><p></p>","479886","","","","","2011-01-27 20:58:28","How to make a ListActivity with custom List Item with nested clickable Button","<android><listview><listactivity><listadapter>","1","0","","",""
"4797957","1","4798061","","2011-01-25 19:30:20","0","2714","<p>Android Development help please. </p><p>Can somone tell me how I might increase the quality of background images in my app? I have been using Photoshop where the images look great, then I save for the web as a png...then add it to my app... Then on the phone the image looks a little blurred. </p><p>Whats the best way to increase my image quality?</p>","577625","","","","","2011-01-25 20:22:19","Background Image Quality","<android>","2","3","","",""
"4798071","1","4798151","","2011-01-25 19:43:17","5","692","<p>I have an application with lots of activities. Many of these activities can start others, so the user's expected to generate a quite large activity stack. </p><p>I'm currently using the default activity launch behaviours. Does anybody know, if a large activity stack (like > 100) would be pose a problem? Is there a limit to this? Would it decrease performance, cause an ANR dialog, or something like that? </p><p>Thanks</p>","446529","","","","","2013-03-04 11:17:39","Android activity stack size problems?","<android><activity-stack>","2","0","","",""
"4798106","1","4800423","","2011-01-25 19:47:27","1","1893","<p>I changed the locale to hi_IN on the emulator. When I start my application (or even the home screen) on the emulator, all I see is boxes reminiscent of ""i dont know how to render this font"". Any input on why this might be happening and how to get rid of this is most welcome. I need to display the hindi font in order to test localization of my application.</p><p>Thanks,<br>Sriram.</p>","350685","","","","","2011-01-26 00:38:57","Android emulator does not display Hindi font","<android><localization><android-emulator>","1","1","1","",""
"4798189","1","4798317","","2011-01-25 19:57:50","1","2386","<p>Hey all, I'm trying to put text-to-speech in my CountDownTimer. I would like it to say ""There are x seconds left"" after a certain amount of time. I just started using TextToSpeech and I'm not really sure what I'm doing..</p><pre><code>    package com.android.countdown;import java.util.Locale;import android.app.Activity;import android.os.Bundle;import android.os.CountDownTimer;import android.view.View;import android.speech.tts.TextToSpeech;import android.widget.Button;import android.widget.TextView;import android.view.View.OnClickListener;public class countdown extends Activity implements TextToSpeech.OnInitListener{ CountDownTimer Counter1; CountDownTimer Counter2; CountDownTimer Counter3; int Interval = 1; TextToSpeech tts;    public String formatTime(long millis) {          String output = ""0:00"";          long seconds = millis / 1000;          long minutes = seconds / 60;          seconds = seconds % 60;          minutes = minutes % 60;          String secondsD = String.valueOf(seconds);          String minutesD = String.valueOf(minutes);          if (seconds &lt; 10)            secondsD = ""0"" + seconds;          if (minutes &lt; 10)            minutesD = ""0"" + minutes;          output = minutesD + "" : "" + secondsD;          return output;        }   @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);//Declare Start/Stop timer Button btnstart = (Button)findViewById(R.id.btnstart); Button btnstop = (Button)findViewById(R.id.btnstop);//Text field to show time left final TextView mCounter1TextField=(TextView)findViewById(R.id.counter1); final TextView mCounter2TextField = (TextView)findViewById(R.id.counter2); final TextView mCounter3TextField=(TextView)findViewById(R.id.counter3);//Counter 1Counter1 = new CountDownTimer(20000 , Interval) {public void onTick(long millisUntilFinished){    mCounter1TextField.setText(""Seconds left: "" + formatTime(millisUntilFinished));    if (millisUntilFinished == 10000) {     instantiate();    }}public void onFinish() {    Counter1.start();  }};//Counter 2Counter2 = new CountDownTimer(80000 , Interval) { public void onTick(long millisUntilFinished) {     mCounter2TextField.setText(""Seconds left: "" + formatTime(millisUntilFinished)); } public void onFinish() {     mCounter2TextField.setText(""Finished!"");     Counter2.start(); } };//Counter 3Counter3 = new CountDownTimer(3000 , Interval) {  public void onTick(long millisUntilFinished) {      mCounter3TextField.setText(""Seconds left: "" + formatTime(millisUntilFinished));  }  public void onFinish() {    mCounter3TextField.setText(""Finished!"");    Counter3.start();  }  };//Start Buttonbtnstart.setOnClickListener(new OnClickListener() { public void onClick(View v) {  Counter1.start();  Counter2.start();  Counter3.start();   }});//Stop Buttonbtnstop.setOnClickListener(new OnClickListener() { public void onClick(View v) {  Counter1.cancel();  Counter2.cancel();  Counter3.cancel();  if (tts != null) {  tts.stop();        tts.shutdown();  }    }});}   public void instantiate() {      tts = new TextToSpeech(this, this);      tts.setLanguage(Locale.US);         tts.speak(""You have 10 seconds remaining"", TextToSpeech.QUEUE_ADD, null);   } @Override public void onInit(int status) { }    @Override    public void onDestroy() {        // Don't forget to shutdown!        if (tts != null) {            tts.stop();            tts.shutdown();        }        super.onDestroy();    }}</code></pre>","533049","","533049","","2011-01-25 23:09:19","2013-06-08 11:40:43","What is wrong with my Text-To-Speech in my CountDownTimer?","<android><text-to-speech>","2","3","","",""
"4798212","1","4798303","","2011-01-25 20:00:42","1","480","<p>Building gestures in advance and forcing the user to use them is ok, but what would be great is if the end user could define their own gestures for my application.  Once great example that does this is the Dolphin web browser.</p><p>Does anyone have any good links to this or where one can locate the source code to the gesture builder app that comes in the emulator?</p>","242904","","","","","2011-01-25 20:11:16","Adding gesture builder to my app?","<android>","1","0","1","",""
"4798267","1","4798351","","2011-01-25 20:06:41","3","1910","<p>This seems like a really basic task, but after a lot of searching and research, still haven't found a clear answer.  I found GridView, but not sure this is how you're supposed to do it.</p><p>I've found several apps that have UI elements similar to what I need, for example the top buttons of the android market.</p><p><img src=""http://i.stack.imgur.com/kneNO.png"" alt=""here's an example of what I'm talking about""></p>","372528","","","","","2011-01-25 20:16:12","How do I create a panel of buttons with a simple divider line, or no dividers, in Android?","<android><user-interface>","1","0","","",""
"4798355","1","4798597","","2011-01-25 20:16:42","6","14068","<p>So I need to change the size of an image depending on the area of the screen.  The image will have to be half of the screen height, because otherwise it overlaps some text.</p><p>So Height= 1/2 Screen Height.Width = Height*Aspect Ratio (Just trying to keep the aspect ratio the same)</p><p>I found something that was:</p><pre><code>Display myDisplay = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();int width =myDisplay.getWidth();int height=myDisplay.getHeight();</code></pre><p>But how would I change image height in java? or even XML if possible? I can't seem to find a working answer.</p>","586680","","1620954","","2012-10-20 23:10:15","2012-10-20 23:10:15","Android Changing image size depending on Screen Size?","<android><imageview><screen-size>","1","0","3","",""
"4798380","1","8050038","","2011-01-25 20:19:31","5","1383","<p>What is the below animation supposed to do?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;rotate xmlns:android=""http://schemas.android.com/apk/res/android""    android:fromDegrees=""0""    android:toDegrees=""360""    android:pivotX=""50%""    android:pivotY=""50%""    android:interpolator=""@android:anim/linear_interpolator""    android:duration=""1000"" /&gt;</code></pre><p>Easy enough. It should represent a <em>clockwise</em> rotation about the centre. Just spin around once, then stop. Right?</p><p>And so it does... when I apply it to a View.</p><p>But when I animate an activity transition instead, something entirely different happens. The activity starts to rotate <em>counterclockwise</em>, but at the same time it flies off the top right of the screen. Then it comes back, still rotating counterclockwise and by now upside-down, and flies off the bottom left of the screen. Finally, it comes back and ends its rotation upright.</p><p>No matter what I specify for <code>pivotX</code> and <code>pivotY</code>, the behaviour is always the same. They seem to be ignored completely. And either way, the thing is certainly not rotating around any fixed pivot at all!</p><p><strong>What kind of nonsense is this? Is it a bug?</strong></p><p>For completeness, I saved this animation as <code>res/anim/spin.xml</code>, and invoke it as follows:</p><pre><code>startActivity(intent);overridePendingTransition(R.anim.spin, R.anim.spin);</code></pre><p>(Using the same animation for both in and out makes no sense, but this is the minimal example.)</p><hr><h2>Update: Demo app to reproduce this issue</h2><p>I've put together a minimal Android project that demonstrates the problem. The main activity looks like this:</p><pre><code>package com.example.animtest;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.animation.Animation;import android.view.animation.AnimationUtils;public class MainActivity extends Activity {    private View rootView;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        rootView = getLayoutInflater().inflate(R.layout.main, null);        setContentView(rootView);    }    public void animateRootView(View view) {        Animation spin = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.spin);        rootView.setAnimation(spin);        spin.start();    }    public void animateActivity(View view) {        Intent intent = new Intent();        intent.setClassName(""com.example.animtest"", ""com.example.animtest.MainActivity"");        startActivity(intent);        overridePendingTransition(R.anim.spin, R.anim.spin);    }}</code></pre><p>Here are the <a href=""http://thomas.home.fmf.nl/animtest.zip"">ZIP file with the project source</a> and the <a href=""http://thomas.home.fmf.nl/animtest.apk"">runnable APK file</a>. Tested on Nexus One, Android 2.2.2.</p>","14637","","14637","","2011-01-28 18:22:10","2011-11-08 12:00:57","Why is my rotate animation all wonky when applied to an Activity transition?","<android><animation><activity>","2","1","3","",""
"4798387","1","10347758","","2011-01-25 20:20:04","3","1816","<p>I've been grappling with this problem throughout the life of my project.  I have many lists in my project and most of them have headers.  I have been making a separate layout file and adding it to the list using addHeaderView().  The problem is that when the data (ArrayList, in my case) is empty, the header doesn't appear.  After hours of searching for a way to reuse the header layout as an empty view, I gave up and decided to replicate the layout in code and assign it as an empty view using setEmptyView().  The problem with this is that a lot of the headers contain clickable views and so I have to double all of my clickable logic for every view that is duplicated.  I tried to include the header before but failed, mostly because I still don't quite understand how layouts are inflated, etc.</p><p>Finally, I have come up with a solution that I would like to share with the community, in case others are having a similar problem.  I don't know if this is the best way to solve this problem and any feedback or suggestions would definitely be welcomed.</p><p>here is the code for the layout that contains the list list view:</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;ListView        android:id=""@+id/lv_my_list""        style=""@style/ListStyle""        android:headerDividersEnabled=""false""    /&gt;    &lt;include        layout=""@layout/my_list_header""        android:id=""@+id/my_list_empty""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>the style defines the layout width and height among other things.</p><p>now I have the layout file that contains the header view</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""    android:id=""@+id/my_list_header""&gt;    &lt;Button         android:id=""@+id/my_list_button""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""Click Me""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>I know LinearLayout is not very efficient and I am experimenting with using merge or other efficiency measures, but this is the first version that works so I'm going with it for now.  Finally the code:</p><pre><code>// set up the headermyListView = (ListView)findViewById(R.id.lv_my_list);View header = View.inflate(this, R.layout.my_list_header, null);Button b = (Button)header.findViewById(R.id.my_list_button);b.setOnClickListener(this);myListView.addHeaderView(header);// set up the empty view        LinearLayout ll = (LinearLayout)findViewById(R.id.my_list_empty);b = (Button)ll.findViewById(R.id.my_list_button);b.setOnClickListener(this);meLocalListView.setEmptyView(ll);</code></pre><p>The reason I wrapped the button in a layout is because I can set each instance of the button to use this as an OnClickListener and then refer to both of them with a single id: R.id.my_list_button in my onClick method.  I need to test this a lot more but it seems to work for now.  I haven't implemented it on all my lists yet, just the one so it might not work in all situations.  If you have any suggestions please let me know because this has been a problem for me for a long time now.  One problem might be that if you want to instantiate the button from the ID you would probably have to go through this entire process again to access the correct IDs?</p>","589567","","","","","2012-04-27 08:59:36","Android How to reuse a header layout as an empty view in a ListView","<android><listview><header><reusability>","2","0","2","",""
"4798472","1","","","2011-01-25 20:29:55","0","1304","<p>Im using PhoneGap to develop an android application. The problem is characters like ã â á ç are shown like ? (question mark)Has someone an idea to solve the problem?Thanks</p>","491637","","","","","2013-05-16 17:48:56","Special charcters in Android using PhoneGap","<android><internationalization><phonegap>","3","0","","",""
"4798504","1","4799249","","2011-01-25 20:32:38","-3","137","<p>I'm having difficulty performing what should be a simple task.  Let's say I have a text file that states:</p><pre><code>a = b</code></pre><p>I want my program to read this file and output ""b"" whenever the user inputs ""a"". In Python or C++ I can accomplish this in around 7 lines or less.</p><p>However, I'm having difficulty finding a simple way to do this on Android.  For example, one sample that I found here on SO had nearly 900 lines in 6 files. </p><p>Is there a simple way to parse a file and return a variable on Android that I am missing?</p>","589653","","19679","","2011-01-26 18:43:23","2011-01-26 18:43:23","Is there a simpler way to do parsing in Java on Android?","<android><parsing><dalvik>","3","6","","",""
"4798658","1","4798958","","2011-01-25 20:51:16","1","1571","<p>Have read the books and hints, got rid of all compile errors and warnings and put in some debug statements.</p><pre><code>package com.cit.BroadcastSim;import java.io.IOException;import android.app.Activity;import android.hardware.Camera;import android.os.Bundle;import android.util.Log;import android.view.SurfaceHolder;import android.view.SurfaceView;public class BroadcastActivity extends Activity implements SurfaceHolder.Callback {  public Camera myCamera;  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.broadcast);  // Inflate the broadcast.xml file    Log.d(""BROADCAST"", ""Creating the Activity"");    SurfaceView cameraSurface = (SurfaceView)findViewById(R.id.camerasurface);    SurfaceHolder cameraHolder = cameraSurface.getHolder();    cameraHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);    cameraHolder.addCallback(this);    Log.d(""BROADCAST"", ""Now wait for some CallBacks"");}  public void surfaceCreated(SurfaceHolder holder) {    // Surface created, now it is possible to set the preview    Log.d(""BROADCAST"", ""Surface Created"");    try {      Log.d(""BROADCAST"",""CAMERA: NOT NULL"");      myCamera = Camera.open();      myCamera.setPreviewDisplay(holder);      myCamera.startPreview();      } catch (IOException e) {        Log.d(""BROADCAST"", e.getMessage());      }  }  public void surfaceDestroyed(SurfaceHolder holder) {    Log.d(""BROADCAST"", ""Surface Destroyed"");    myCamera.stopPreview();    myCamera.release();  }  public void surfaceChanged(SurfaceHolder holder, int I, int J, int K) {    Log.d(""BROADCAST"", ""Surface Changed"");    myCamera.stopPreview();    myCamera.release();  }}</code></pre><p>In the DDMS debugger, I get a log message for 'Creating the Activity' followed by 'Now wait for some CallBacks' and nothing more in terms of my Debug messages so I think Callback is not working - for the life of me can't see where I have got it wrong.</p><p>In the manifest I have</p><p>  </p><p>The Activity XML page has</p><pre><code>&lt;TextView    android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:text=""@string/Broadcast""  /&gt;&lt;SurfaceView  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:id=""@+id/camerasurface""   /&gt;&lt;/LinearLayout&gt;</code></pre><p>Finally, on the Android phone (HTC Wildfire), the page loads, the textView message appears at the top left and that is all.</p><p>Should mention that I am very new to this platform and accept that I might have missed something very very basic.</p><p>Any ideas/comments will be very much appreciated,</p><p>Oliver</p>","586378","","21234","","2011-01-25 20:55:06","2011-01-26 08:44:34","Camera Preview: No errors but no picture :-(","<android><camera>","3","0","1","",""
"4798751","1","","","2011-01-25 21:00:34","2","20987","<p>when i run the code below everything works fine,it's a simple app with three balls that you can move around...</p><pre><code>public class dragndrop extends Activity {    /** Called when the activity is first created. */       private ColorBall[] colorballs = new ColorBall[3]; // array that holds the balls       private static final String TAG=""MyTAG"";       DrawView myView;       private int balID = 0; // variable to know what ball is being dragged       int X;       int Y;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Point point1 = new Point();            point1.x = 50;            point1.y = 20;            Point point2 = new Point();            point2.x = 100;            point2.y = 20;            Point point3 = new Point();            point3.x = 150;            point3.y = 20;            // declare each ball with the ColorBall class            colorballs[0] = new ColorBall(this,R.drawable.bol_groen, point1);            colorballs[1] = new ColorBall(this,R.drawable.bol_rood, point2);            colorballs[2] = new ColorBall(this,R.drawable.bol_blauw, point3);            myView = new DrawView(this);        setContentView(myView);    }    public class DrawView extends View {        public DrawView(Context context) {            super(context);            setFocusable(true); //necessary for getting the touch events            // setting the start point for the balls        }        // the method that draws the balls        @Override protected void onDraw(Canvas canvas) {            //draw the balls on the canvas            for (ColorBall ball : colorballs) {                canvas.drawBitmap(ball.getBitmap(), ball.getX(), ball.getY(), null);              }        }       // events when touching the screen        public boolean onTouchEvent(MotionEvent event) {            int eventaction = event.getAction();             X = (int)event.getX();             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) {                    Log.d(TAG,""inside action down inside for coords:""+X+"" coords: ""+Y);                    Log.d(TAG,""ball coords:""+ball.getX()+"" coords: ""+ball.getY());                    int x =X;                    int y =Y;                    Log.d(TAG,""lalalalalala""+x+"" coords: ""+y);                    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){//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){                        Log.d(TAG,""inside ball coords!!!!!!!!!!!!!!!!!!!!!!!!:""+ball.getX()+"" coords: ""+ball.getY());                        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) {                    colorballs[balID-1].setX(X-25);                    colorballs[balID-1].setY(Y-25);                }                break;             case MotionEvent.ACTION_UP:                 // touch drop - just do things here after dropping                 break;             }             // redraw the canvas            myView.invalidate();             return true;         }    }}</code></pre><p>But when i try to handle the onTouchevent from the main activity doesn't work and the strange is that it can't read a simple variable(x,y)!!!i can't understand why this happened,it seems it can red them only if it's in a View!!!</p><pre><code>public class dragndrop extends Activity {    /** Called when the activity is first created. */       private ColorBall[] colorballs = new ColorBall[3]; // array that holds the balls       private static final String TAG=""MyTAG"";       DrawView myView;       private int balID = 0; // variable to know what ball is being dragged       int X;       int Y;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Point point1 = new Point();            point1.x = 50;            point1.y = 20;            Point point2 = new Point();            point2.x = 100;            point2.y = 20;            Point point3 = new Point();            point3.x = 150;            point3.y = 20;            // declare each ball with the ColorBall class            colorballs[0] = new ColorBall(this,R.drawable.bol_groen, point1);            colorballs[1] = new ColorBall(this,R.drawable.bol_rood, point2);            colorballs[2] = new ColorBall(this,R.drawable.bol_blauw, point3);            myView = new DrawView(this);        setContentView(myView);    } // events when touching the screen    public boolean onTouchEvent(MotionEvent event) {        int eventaction = event.getAction();         X = (int)event.getX();         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) {                Log.d(TAG,""inside action down inside for coords:""+X+"" coords: ""+Y);                Log.d(TAG,""ball coords:""+ball.getX()+"" coords: ""+ball.getY());                int x =X;                int y =Y;                Log.d(TAG,""lalalalalala""+x+"" coords: ""+y);                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){//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){            Log.d(TAG,""inside ball coords!!:""+ball.getX()+"" coords: ""+ball.getY());                    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) {                colorballs[balID-1].setX(X-25);                colorballs[balID-1].setY(Y-25);            }            break;         case MotionEvent.ACTION_UP:             // touch drop - just do things here after dropping             break;         }         // redraw the canvas        myView.invalidate();         return true;     }    public class DrawView extends View {        public DrawView(Context context) {            super(context);            setFocusable(true); //necessary for getting the touch events            // setting the start point for the balls        }        // the method that draws the balls        @Override protected void onDraw(Canvas canvas) {            //canvas.drawColor(0xFFCCCCCC);     //if you want another background color                   //draw the balls on the canvas            for (ColorBall ball : colorballs) {                canvas.drawBitmap(ball.getBitmap(), ball.getX(), ball.getY(), null);              }        }    }}</code></pre><p>Anyone who knows why?</p><p>Yes @bigstones the onTouchevent is working,it captures all the actions,the problem is that if i have the ontouchevent code inside the activity the variables X,Y seems not to work althought that they have a value and i can print it(or log)what i am saying is tested,i've tried and change all the values from the if() statement(getX,getY)to integers and it didn't work only for X,Y.....check the code again please!thanks!</p>","587377","","587377","","2011-01-26 15:19:08","2012-09-26 16:00:38","onTouchevent() problem android","<android><view><ontouchevent>","2","2","2","",""
"4798780","1","","","2011-01-25 21:03:10","2","866","<p>I’m producing an Android app for a customer. Currently I do not have an Android device. Does any have any suggestions on what Android device I should get to test my code on a real device?</p><p>Could I just get a really cheap one?</p>","564653","","321697","","2011-01-25 21:37:52","2011-01-25 22:40:34","What would be a good Android tablet to buy to test code?","<android><testing>","2","4","","",""
"4798788","1","","","2011-01-25 21:04:15","6","5292","<p>I tried to perform a factory reset in Android using the RecoverySystem class, but I get permission errors, which I can not overwrite because they are system permissions. I want to know if there is another way to perform a factory reset?</p>","548852","","321697","","2011-01-25 21:49:32","2012-08-09 14:08:21","Android Factory Reset Programmatically","<android>","4","4","2","",""
"4798797","1","4799054","","2011-01-25 21:04:51","3","988","<p>I have put the following in <code>AndroidManifest.xml</code> as described in the <a href=""http://developer.android.com/guide/appendix/install-location.html"" rel=""nofollow"">article</a>:</p><pre><code>&lt;application android:name=""MyApp"" ... android:installLocation=""auto""&gt;    ...&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""4"" android:targetSdkVersion=""8"" /&gt;</code></pre><p>but the <code>Move to SD card</code> is remaining disabled for my application (other installed applications on my phone can be successfully moved to SD card). What's wrong with it?</p>","488489","","","","","2011-01-25 21:28:45","Application can't be moved to SD card","<android>","1","2","1","",""
"4798856","1","","","2011-01-25 21:10:26","0","495","<p>I have recently signed up to a poker website (www.pokerstrategy.com). Usually I use a tool to manage my passwords and generate passwords for me. So I generated a 22 character password using uppercase and lowercase letters, numbers and braces. This password works very well when entered using a normal PC.</p><p>However, entering the same password on android, specifically in the Android browser, the site tells me that the password is wrong. I have quadruple checked the password by typing it into a text editor on the Android phone and copypastaing it into the password field. The same message arises.</p><p>My problem now is: Where do I find information on this? I cannot ask the site as my problem is limited to my mobile device. I cannot ask Google (""Hey guys, when I enter my password on www.pokerstrategy.com, it tells me it is wrong. Check your code!""). So I'm asking you: Has anybody had a similar phenomenon? Is there a limit to the number of characters that can be inserted into a password field that is determined by the browser instead of the HTML code?</p><p>I'd really like to watch their videos in bed, so I'd appreciate any help. If I find out how to do it, I will set a bounty on this.</p>","494501","","","","","2014-02-26 19:57:44","Browser on Android 2.2: Strange password field behaviour","<android><browser><passwords>","1","2","","",""
"4798950","1","4798986","","2011-01-25 21:18:57","1","1856","<p>How can I change the verbosity level when running Test Monkey from the command line?</p><p>These two commands work:</p><pre><code>adb shell monkey -p com.my.package 5000adb shell monkey -p com.my.package -v 5000</code></pre><p>The Developer docs say, ""Each -v on the command line will increment the verbosity level. Level 0 (the default) provides little information beyond startup notification, test completion, and final results. Level 1 provides more details about the test as it runs, such as individual events being sent to your activities. Level 2 provides more detailed setup information such as activities selected or not selected for testing.""</p><p>However, when I try <code>adb shell monkey -p com.my.package -v -v 5000</code> I get a <code>segmentation fault    monkey -p com.my...</code>.</p><p>I tried <code>adb shell monkey -p com.my.package -v 2 5000</code>, but monkey reads <code>2</code> as the count, rather than the value for <code>-v</code>.</p><p>Help?  :)</p>","359519","","671375","","2013-01-08 10:30:52","2013-01-08 10:30:52","Android Test Monkey - Set Verbosity?","<android><unit-testing><testing><monkey><android-monkey>","2","0","","",""
"4799129","1","4799215","","2011-01-25 21:36:06","0","779","<p>In Reminder1.java I have the int <em>hourOfDay2</em> and int <em>minute2</em> variables. These equals with the <em>hourOfDay</em> and <em>minute</em> variable of the TimePickerDialog.In myfile.java i want to examine the value of these variables. How to do that?</p>","571648","","","","","2011-01-27 05:39:15","Android how to pass a variable to another java file","<android><variables>","2","2","","",""
"4799151","1","4799248","","2011-01-25 21:39:20","24","18411","<p>I need to download a web page on an android app and I am having a hard time deciding whether to use the android apache http client or java's URLConnection.</p><p>Any thoughts?</p>","62898","","40342","","2013-10-07 12:15:54","2013-10-07 12:15:54","Apache http client or URLConnection","<java><android><urlconnection><apache-commons-httpclient>","3","0","12","",""
"4799183","1","","","2011-01-25 21:43:23","2","969","<p>So while developing a custom camera application I've realized on rare occasions and on various devices if the app has to force close, it does not always release the camera resource.</p><p>Is there a way to find/detect the process that is holding onto this resource and kill it?  Or some other technique?  It is rather difficult bug to reproduce (for me anyway), but ultimately the device has to be restarted.</p><p>Thanks!</p>","225213","","","","","2012-11-13 21:06:38","Android Camera API - Force Close Does Not Release Camera Resource","<java><android><sdk><camera>","2","0","1","",""
"4799204","1","7140467","","2011-01-25 21:45:14","0","744","<p>I'm trying to use this <a href=""http://www.siegmann.nl/epublib"" rel=""nofollow"">Epub Library</a> in Android to parse an Epub file, but whenever I try to use it, the app just force closes.</p><pre><code>EpubReader epubReader = new EpubReader();</code></pre><p>Even this line makes it crash. The debugger is telling me it is caused by </p><blockquote>  <p>java.lang.ExceptionInInitilizerError</p></blockquote><p>I have no idea what to do. As far as I can tell, the library only uses Java, so I don't think it could be that it is not supported. </p><p>Could anyone help me on this? Or if anyone could recommend another way to parse an Epub on Android I would be just as grateful.</p>","451575","","","","","2011-08-21 19:13:57","Epublib crashing In Android","<java><android><parsing><epub>","2","1","","",""
"4799225","1","4876070","","2011-01-25 21:46:48","1","604","<p>I have a map application using an in-house map engine on Android. I'm working on a rotating Map view that rotates the map based on the phone's orientation using the Sensor Service. All works fine with the exception of dragging the map when the phone is pointing other than North. For example, if the phone is facing West, dragging the Map up still moves the Map to the South versus East as would be expected. I'm assuming translating the canvas is one possible solution but I'm honestly not sure the correct way to do this.</p><p>Here is the code I'm using to rotate the Canvas:</p><pre><code>public void dispatchDraw(Canvas canvas){    canvas.save(Canvas.MATRIX_SAVE_FLAG);    // mHeading is the orientation from the Sensor    canvas.rotate(-mHeading, origin[X],origin[Y]);    mCanvas.delegate = canvas;    super.dispatchDraw(mCanvas);    canvas.restore();}</code></pre><p>What is the best approach to make dragging the map consistent regardless of the phones orientation?  The sensormanager has a ""remapcoordinates()"" method but it's not clear that this will resolve my problem.  </p>","589740","","","","","2011-02-02 15:10:40","Rotating the Canvas impacts TouchEvents","<android><canvas><coordinates>","1","0","2","",""
"4799226","1","4800017","","2011-01-25 21:46:50","0","872","<p>I'm working on a project where I want my Droid 2 to be able to send and receive data over 3G, to a device connected to an ethernet port (not necessarily a PC, but I'm using this for testing the communication). I believe that eventually the end to end communication will be accomplished over an SSL tunnel, but for right now, I just need to establish basic communication to show that the devices can communicate.</p><p>I've written some client/server applications that worked between two computers on the same network, but I'm not sure if the communication in this case will work because of the different networks that the phone and PC are on.</p><p>I've been trying to establish if this can be done by pinging some of the PCs at my University and house using a pinging program I got off the market, but I've had no success so far. However, my friend has rooted his phone, and was able to do so.</p><p>I suppose this question really has two parts: 1) Is this possible? and 2) Do I need to root my phone to accomplish this, or should I be able to do it without rooting?</p><p>Thanks for any responses.</p>","580282","","","","","2011-01-25 23:28:54","Communicating between Android phone and PC using TCP in java","<java><android><ssl>","2","0","","",""
"4799247","1","4799280","","2011-01-25 21:49:28","0","741","<p>I have a text file within my raw folder of my app that I intend to use as a simple way to save settings and then read them back when needed.  I can read from this file with using the BufferedReader and what comes with it, but I've tried a few different ways to be able to write to this file and none seem to work.  </p><p>It seems to me that the problem is I never actually get the file, and I assume this is simply because I don't exactly know how I am supposed to give it the correct directory and file name.  I've tried all I could come up with, and I tend to get errors like ""No such file or directory exists"" or ""Read-only file system"".</p><p>This seems to be a very simple problem relating to me just giving the wrong information, so if anybody could point me in the right direction it would be much appreciated.</p><p>Thank you,Raphy</p>","589780","","79061","","2011-01-25 21:51:36","2011-01-25 21:56:07","Android writing to a text file","<android><directory><writing><text-files><bufferedwriter>","2","0","","",""
"4799380","1","","","2011-01-25 22:04:10","4","7085","<p>I'm trying to set up a an image GridView Layout, and this involves deriving a new class from the BaseAdapter class. I have been using the tutorial on the website developer.android.com, but I still don't quite understand what it means. Could someone please explain to me what exactly is a BaseAdapter? I don't understand the definition provided by the Android developers website.</p><p>Thanks</p>","489655","","321697","","2011-01-25 22:23:29","2012-01-07 13:16:35","Understanding BaseAdapters and how to use them","<android><android-widget><android-layout>","2","0","0","",""
"4799394","1","4799610","","2011-01-25 22:05:59","16","15749","<p>I am using this call:</p><pre><code>Secure.getString(getApplicationContext().getContentResolver(), Secure.ANDROID_ID);</code></pre><p>To get a UID for the device. I think I am getting the same ID from multiple devices though. Should this be possible? </p><p>The ID in question is: 9774d56d682e549c and apparently there is an issue with several devices returning this ID <a href=""http://code.google.com/p/android/issues/list?cursor=10603&amp;updated=10603&amp;ts=1295993403"">http://code.google.com/p/android/issues/list?cursor=10603&amp;updated=10603&amp;ts=1295993403</a></p>","507810","","60462","","2012-07-09 13:17:58","2014-02-26 18:32:22","Is Secure.ANDROID_ID unique for each device?","<android><uuid><uniqueidentifier>","3","2","3","",""
"4799472","1","","","2011-01-25 22:16:35","0","774","<p>Whenever I force portrait mode in onCreate</p><pre><code>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);</code></pre><p>I get an error </p><p>What does Portrait mode have to do with OOM VM budget on image scale?</p><pre><code>private void scaleFrom(BmpWrap image, Bitmap bmp)    {      if (image.bmp != null &amp;&amp; image.bmp != bmp) {        image.bmp.recycle();      }      if (mDisplayScale &gt; 0.99999 &amp;&amp; mDisplayScale &lt; 1.00001) {        image.bmp = bmp;        return;      }      int dstWidth = (int)(bmp.getWidth() * mDisplayScale);      int dstHeight = (int)(bmp.getHeight() * mDisplayScale);      image.bmp = Bitmap.createScaledBitmap(bmp, dstWidth, dstHeight, true);    }    private void resizeBitmaps()    {      scaleFrom(mBackground, mBackgroundOrig);      for (int i = 0; i &lt; mBOrig.length; i++) {        scaleFrom(mB[i], mBOrig[i]);      }      for (int i = 0; i &lt; mBlind.length; i++) {        scaleFrom(mBlind[i], mBlindOrig[i]);      }      for (int i = 0; i &lt; mFrozen.length; i++) {        scaleFrom(mFrozen[i], mFrozenOrig[i]);      }      for (int i = 0; i &lt; mTargeted.length; i++) {        scaleFrom(mTargeted[i], mTargetedOrig[i]);      }      scaleFrom(mBlink, mBlinkOrig);      scaleFrom(mWon, mWonOrig);      scaleFrom(mLost, mLostOrig);      mImagesReady = true;    }java.lang.OutOfMemoryError: bitmap size exceeds VM budgetat android.graphics.Bitmap.nativeCreate(Native Method)at android.graphics.Bitmap.createBitmap(Bitmap.java:498)at android.graphics.Bitmap.createBitmap(Bitmap.java:465)at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:370)at com.company.app.View$hread.scaleFrom(View.java:313)at com.company.app.View$hread.resizeBitmaps(View.java:337)at com.company.app.View$hread.setSurfaceSize(View.java:480)at com.company.app.View.surfaceChanged(View.java:905)at android.view.SurfaceView.updateWindow(SurfaceView.java:538)at android.view.SurfaceView.dispatchDraw(SurfaceView.java:339)at android.view.ViewGroup.drawChild(ViewGroup.java:1638)at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)at android.view.ViewGroup.drawChild(ViewGroup.java:1638)at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)at android.view.View.draw(View.java:6745)at android.widget.FrameLayout.draw(FrameLayout.java:352)at android.view.ViewGroup.drawChild(ViewGroup.java:1640)at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)at android.view.View.draw(View.java:6745)at android.widget.FrameLayout.draw(FrameLayout.java:352)at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1891)at android.view.ViewRoot.draw(ViewRoot.java:1416)at android.view.ViewRoot.performTraversals(ViewRoot.java:1172)at android.view.ViewRoot.handleMessage(ViewRoot.java:1736)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:143)at android.app.ActivityThread.main(ActivityThread.java:4701)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>","583739","","881229","","2014-02-01 20:20:00","2014-02-01 20:20:00","Forcing Portrait mode OOM bitmap resize","<android><out-of-memory><virtual-machine><portrait>","2","0","","",""
"4799540","1","4799619","","2011-01-25 22:23:20","6","6613","<p>I want to set timeout for Dialog (progress dialog) in android , to make the dialog disappears after a period of time (if there is No response for some action !)</p>","508377","","","","","2012-12-09 19:31:01","set timeout Dialog in android?","<android><dialog>","2","0","3","",""
"4799576","1","4838863","","2011-01-25 22:27:36","14","13406","<p>I want to write simple STL (geometrical data file) viewer application on Android, but I'm not able to make recognize a format to the system. What I wrote in my app manifest file is: </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:scheme=""http"" /&gt;     &lt;data android:pathPattern="".*\\.stl"" /&gt;    &lt;data android:mimeType=""application/sla"" /&gt;  &lt;data android:host=""*"" /&gt;  &lt;/intent-filter&gt;</code></pre><p>But at the moment I launch browser and go to download some sample STL file, download is interrupted and I'm reported that the data file type is unknown for the system. I have no real android device, so use only emulator, and for development I use C# on MonoDroid (but I don't think that is the problem honestly)</p><p>Any ideas on subject?</p><p>Thank you in advance.</p>","156695","","264837","","2012-10-13 19:42:43","2014-01-14 17:39:18","Register new file type in Android","<android><file-type>","3","1","15","",""
"4799614","1","","","2011-01-25 22:31:36","3","1663","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3572463/what-is-context-in-android"">What is Context in Android?</a>  </p></blockquote><p>everyone! Can someone please explain to me what exactly is a Context in Android??? I don't understand the definition on the android developers website and I have to use them for a GridView Layout. </p><p>Any help would be much appreciated. Thanks.</p>","489655","","","","","2011-01-25 22:37:30","Understanding and Using a Context","<android><android-widget><android-layout>","1","0","","2011-11-04 08:20:59",""
"4799643","1","","","2011-01-25 22:35:14","2","3181","<p>To my knowledge, on Android, there is:</p><ul><li>Internal memory for apps and cache</li><li>Internal SD Card on some phones (not removable)</li><li>External SD Card for music and photos (removable)</li></ul><p>How do I get the total and available for each with a check that they exist (some phones do not have an internal SD Card)</p><p>Thanks</p>","398148","","","","","2012-12-18 23:23:17","Getting all the total and available space on Android","<android><environment><sd-card><android-sdcard>","3","0","3","",""
"4799727","1","","","2011-01-25 22:46:43","0","464","<p>I have 2 activities. In one activity, I have a button. In the click event of that button, I want to open a map in a new activity. But I have no clue why I am having error when I click the button. It says:</p><blockquote>  <p>application has stopped unexpectedly, please try again.</p></blockquote><p>This is my button click event:</p><pre><code>Button btnDrive=(Button)findViewById(R.id.btnDrive);btnDrive.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            // TODO Auto-generated method stub            Intent myIntent=new Intent(v.getContext(),WebiMapActivity.class);            startActivityForResult(myIntent,0);                     }    });</code></pre><p>This is my map activity:</p><pre><code>public class WebiMapActivity extends MapActivity{    private MapView mapView;    private MapController mapController;    @Override    protected boolean isRouteDisplayed() {        // TODO Auto-generated method stub        return false;    }    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.mapview);        mapView = (MapView)findViewById(R.id.map_view);        mapView.setStreetView(true);        mapView.displayZoomControls(true);        mapController=mapView.getController();      }}</code></pre><p>N.B: I have permission for internet in manifest.xml.</p>","574308","","651104","","2012-04-14 19:00:21","2012-04-14 19:00:21","Can not display map in android","<android><google-maps><map>","3","2","","",""
"4799776","1","4800547","","2011-01-25 22:52:45","0","736","<p>I am working on an Android game and am currently trying to get text input working. I want to prompt the player to enter his or her name and have that name added to the high score list.</p><p>I am trying to do that through EditText which I can get to work if I put my code in the onCreate method, but not if I call it from my game loop.</p><p>The method I am currently using:</p><pre><code>public static void getInput(Context context){    final AlertDialog.Builder alert = new AlertDialog.Builder(context);    final EditText input = new EditText(context);    alert.setView(input);    alert.setPositiveButton(""Ok"", new DialogInterface.OnClickListener()     {        public void onClick(DialogInterface dialog, int whichButton)         {            String value = input.getText().toString().trim();        }    });    alert.setNegativeButton(""Cancel"",            new DialogInterface.OnClickListener()             {                public void onClick(DialogInterface dialog, int whichButton) {                    dialog.cancel();                }            });    alert.show();}</code></pre><p>If I call this from my gameloop the game crashes and I get the error:</p><pre><code>01-26 06:33:21.413: ERROR/AndroidRuntime(6960): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()</code></pre><p>I tried calling Looper.prepare() and then Looper.loop(), and that opened up the text input box, but when I closed the box my game just sat on a black screen and did not respond.</p><p>So, my question is: what am I doing wrong, and is there an easier way to get text input? My game is based off the LunarLander example, so I am using SurfaceView.</p><p>Any help or suggestions will be appreciated. Thank you :)</p>","549859","","","","","2011-01-26 01:03:10","TextEdit Text Input Issues in my game","<java><android>","2","3","2","",""
"4799803","1","","","2011-01-25 22:57:05","0","270","<p>I have a ProgressDialog that I couldn't get to display for love nor money. A bit of research suggested I needed to put it in a thread.</p><p>So example</p><pre><code>public void Update(final int ScheduleId, final Context context) {    final Handler progressHandler = new Handler() {        public void handleMessage(Message msg) {            x.dismiss();        }    };                x = ProgressDialog.show(context, ""Scheduling..."", ""Calculating and Storing Dates"", true, false);            new Thread() {        public void run() {            // Do Nothing            boolean bResult = UpdateHistory(ScheduleId, context);            Log.i(""HERE"",""Finished Here?"");            if (bResult) {                  progressHandler.sendEmptyMessage(0);            }        }    }.start();}</code></pre><p>But all that seems to happen for me, is that the spinner just disappears off the screen and the activity finishes, while UpdateHistory continues to run in the background.</p><p>If I move the call to UpdateHistory below the .start() (outside of the thread), I don't get a progress spinner displayed at all.</p><p>What exactly is it that Im missing?</p><p>All this code is in an Activity.</p><p>What can you recommend, most websites appear to talk about threads and I've tried doing them every which way you can, and as I say, I either get the the thread run in the background and the spinner displayed for a second, or I get no spinner at all while the function runs in the foreground.</p><p>ThanksSimon</p>","509326","","509326","","2011-01-25 23:44:34","2011-01-25 23:45:46","Android - ProgressDialogs and Threads","<android><multithreading><progressdialog>","1","1","1","",""
"4799858","1","4800096","","2011-01-25 23:04:43","0","210","<p>I've noticed a strange app on my Android Emulator (1.6)</p><p>Does anyone know what this is?  I can't un-install it, and ""Force Quit"" doesn't seem to do anything.It doesn't appear to take up any memory, but it has all kinds of permissions.</p><p>I don't know how to research this, because I don't read that language.</p><p>My specific questions are:</p><p>Has anyone seen this on their emulator?</p><p>Is it some kind of virus or Trojan, etc.?</p><p>Only one screen shot(Dont'ask for more, stackoverflow wont let me.):</p><p><a href=""http://img834.imageshack.us/i/weirdapp.png/"" rel=""nofollow"">http://img834.imageshack.us/i/weirdapp.png/</a></p>","582162","","","","","2011-01-25 23:38:27","Android emulator API 1.6, Manage Applications > (see screenshot)","<android><emulator>","1","0","","",""
"4799865","1","","","2011-01-25 23:05:58","5","1310","<p>I need a way to check whether or not my android app is currently being debugged (there's a condition we check for on startup that I specifically do -not- want to check when the debugger is running).  Does such a beast exist?</p>","139037","","","","","2011-01-26 00:29:25","How do i tell if i'm in the debugger under android?","<android><debugging>","2","1","","",""
"4799873","1","","","2011-01-25 23:07:35","0","2634","<p>Firstly, I have been greatly helped by this forum. Now my problem this time.</p><p>I have a TCP client running in Android phone. It connects and receives data from a windows application. Once I receive a message, I parse it and I try to display an image. I have to keep checking for new messages from this windows app.</p><p>The client thread keeps running. When a message is received, I pass it to the main activity, parse it but I am not able to display the image. I want to make the client check for new message every 100 ms. At the moment, the LogCat gets flooded as the thread keeps running and I am not able to really see the contents of LogCat.</p><p>Basically I want to run the client, keep checking for new messages every 100 ms, when a new message is there, pass it to the main activity, parse it and display an image. Please go through the code below and suggest any corrections or a better approach if necessary.</p><p>Cheers,</p><p>Madhu</p><p>The client code is below.</p><p>Main activity: </p><pre><code>public class TCPListen extends Activity implements TCPListener { private TextView mTitle; public String data[] = new String[2];    /** Called when the activity is first created. */  @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            //setContentView(R.layout.main);                   // Set up the window layout          requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);          setContentView(R.layout.main);          getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);          // Set up the custom title          mTitle = (TextView) findViewById(R.id.title_left_text);          mTitle.setText(R.string.app_name);          mTitle = (TextView) findViewById(R.id.title_right_text);          //TcpServiceHandler handler=new TcpServiceHandler(this);            //handler.execute(""192.168.62.23"");            TcpServiceHandler handler = new TcpServiceHandler(this,this);            Thread th = new Thread(handler);            th.start();                 }               public String[] callCompleted(String source){           Log.d(""TCP"", ""Std parser "" + source);          mTitle.setText(source);          //String data[] = new String[2];           //if (source.matches(""&lt;MSG&gt;&lt;N&gt;.*&lt;/N&gt;&lt;V&gt;.*&lt;/V&gt;&lt;/MSG&gt;"")) {                       Document doc = null;                try{              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();                   DocumentBuilder db = dbf.newDocumentBuilder();                   doc = (Document) db.parse(new ByteArrayInputStream(source.getBytes()));                   NodeList n = doc.getElementsByTagName(""N"");                   Node nd = n.item(0);                   String msgName = nd.getFirstChild().getNodeValue();                   NodeList n1 = doc.getElementsByTagName(""V"");                   Node nd1 = n1.item(0);                   String tmpVal = nd1.getFirstChild().getNodeValue();                   data[0] = msgName;                   data[1] = tmpVal;                  Log.d(""TCP"", ""Inside Std parser "" + data[0] + "" "" + data[1]);                 actionOnData(data[0], data[1]);                }                catch(Exception e){                e.printStackTrace();            }          Log.d(""TCP"", ""Just outside Std parser "" + data[0] + "" "" + data[1]);          return data;          //} else Log.d(""TCP"", ""Message in wrong format "" + source);          //mTitle.setText(""Message in wrong format "" + source);          //return data;      }    //Function to display driver messages/images based on individual messages      public void actionOnData(String name, String value) {       String tempName = name;       String tempVal = value;                //while (true) {        if(tempName.equals(""shiftDirection"") &amp;&amp; tempVal.equals(""1"")) {         Log.d(""TCP"",""in actionOnData "" + data[0] + "" "" + data[1]);         mTitle.setText(""Change to next higher gear"");               Intent myIntent = new Intent();               myIntent.setClassName(""com.example.android.TCPListen"", ""com.example.android.TCPListen.Images"");               //myIntent.putExtra(""Change gear"", ""Shift to next gear!""); // key/value pair, where key needs current package prefix.               startActivity(myIntent);                try {              wait(3000);              } catch(InterruptedException e) {              System.out.println(""InterruptedException caught"");              }            } else if(tempName.equals(""vehicleSpeed"") &amp;&amp; tempVal.equals(""120"")) {         Log.d(""TCP"",""in actionOnData "" + data[0] + "" "" + data[1]);         mTitle.setText(""Drive like a man"");               //Intent myIntent = new Intent();               //myIntent.setClassName(""com.example.android.TCPListen"", ""com.example.android.TCPListen.Images"");               ////myIntent.putExtra(""Change gear"", ""Shift to next gear!""); // key/value pair, where key needs current package prefix.               //startActivity(myIntent);                       } else Log.d(""TCP"", ""Just show an image"");       //}      }}</code></pre><p>Interface:</p><pre><code>public interface TCPListener { public String[] callCompleted(String msg);}</code></pre><p>Thread:</p><pre><code>public class TcpServiceHandler implements Runnable {       TCPListener _listener;                 private Activity _act;       public TcpServiceHandler(TCPListener listener, Activity act){             _listener = listener;           _act = act;       }             public synchronized void run() {           // TODO Auto-generated method stub                    //if(socket==null){                 try {                   //InetAddress serverAddr = InetAddress.getByName(""192.168.178.25"");                   Socket socket = new Socket(""192.168.2.103"", 1200, true);           //                   while(true){                    try {                                                    BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));                           final String str = in.readLine();                           this._act.runOnUiThread(new Runnable(){                           public void run() {                            _listener.callCompleted(str);                               }                                                         });                                                                    }                    catch(Exception e){                        e.printStackTrace();                    }                   }               } catch (UnknownHostException e) {                   // TODO Auto-generated catch block                   e.printStackTrace();               } catch (IOException e) {                   // TODO Auto-generated catch block                   e.printStackTrace();               }       }     }</code></pre>","487851","","","","","2011-02-03 03:47:18","TCP client in Android phone: run continuously, display image based on message received from server","<android><image><tcpclient><receive>","1","0","","",""
"4799916","1","","","2011-01-25 23:14:30","0","5322","<p>I'm working on an interface where one half of the screen has edit text boxes for the user to enter data into, and the other half has a canvas that can be drawn to and reads user touches.</p><p>Right now I'm extending a surface view and adding that to my layout(Layout is XML) at runtime with View.Addview.</p><p>My problem is setting the size and position of the view. I want it to be square and take up about half of the screen (landscape). I want it to be aligned to the right side and either centered vertically, or aligned with the top.</p><p>I can set the size by overriding the onMeasure method, but I don't know how to get the display size so I don't know what to set it to. </p><p>I don't have any ideas about how to align the view, I've been trying adding it to various layouts without much luck...</p><p>Thanks for any help!</p>","368845","","","","","2012-09-21 11:28:01","Setting the size and position of a Surface View","<android><surfaceview>","2","0","","",""
"4799919","1","4800986","","2011-01-25 23:15:13","0","173","<p>I have an app that lets the user select every item in the list and set it as their ""favorite"". I thought it would be neat if, when all the items are set as favorite, the button switched to ""unselect all"".</p><p>The way I'm thinking about doing this is by registering a ContentObserver, which whenever a change was made checked if all the items are now set as favorite. Then I realized that may not be very efficient. I can't think of any other way, though, so any hints?</p><p>How can I know that all the items in the database have one of their fields set to the same value (field favorite = 1, in this case)?</p>","397060","","","","","2011-01-26 02:42:33","Android: Knowing when all items in a database have their field set to the same value?","<android><sqlite><contentobserver>","3","0","","",""
"4799928","1","","","2011-01-25 23:17:04","1","196","<p>I'm working on a radio station app wherein I'm streaming a mp3 audio stream. The streaming company is passing some information through cuepoints in the stream itself, such as </p><pre><code> &gt;Type&lt;  &gt;FTE&lt; &gt;Title&lt;  &gt;THROUGH GLASS&lt; &gt;Time&lt;  &gt;239000&lt; &gt;PROGRAMID&lt;  &gt;P476&lt; &gt;Artist&lt;  &gt;STONE SOUR&lt; &gt;Album&lt;  &gt;&lt;</code></pre><p>I'm at loss on how to extract this data from the stream. This is not in the headers so I could not get it from there.</p><p>Can someone please help me on this?</p><p>Regards,Hari</p>","320293","","","","","2011-01-25 23:17:04","How to read cuepoints in Audio stream?","<android><stream><cue>","0","1","","",""
"4799935","1","","","2011-01-25 23:17:43","3","1235","<p>I still haven't really wrapped my head around synchronization. I know it's there, I know why it's used and what the idea is behind it, but Im lacking the practical skill and real world examples to understand exactly how it works and how it's implemented when several activies are trying to read/write to the database at the same time. Do you share your objects through Application, or is the system intelligent enough to synchronize various objects of the same type?</p><p>Perhaps a Content Provider is a better way to go as I understand that has built in sync.</p><p>I digress though.</p><p>Im still confused over database activity. Remember that I have a service running every 60 seconds in the background reading the same table an update function is writing to. Yes Im looking to change this, but right now I want to understand database handling in Android more and work out what's happening.</p><p>If I have a loop such as:</p><pre><code>db = provider.getReadableDatabase();while(theres_still_work_today) {  do_some_calculations;  update_database;}provider.close();</code></pre><p>this works fine as a standalone. If I try and place this in a thread, I get errors galore about locking. But when run like this:</p><pre><code>while(theres_still_work_today) {  do_some_calculations;  db = provider.getReadableDatabase();  provider.close();  update_database;}</code></pre><p>I find that bizarrely, this actually seems faster, and gives no locking issues.</p><p>Am I just being incredibly lucky that I don't get two events triggering at the same time causing a lock? Is there some kind of timeout built into database handling in Android/SQLite?</p><p>I don't understand why the last bit of code should work OK, and why it should work faster?</p><p>Im not entirely confident about the Android Emulator though. If I use the first option with a single open/close outside the loop, sometimes I can get through a long long loop fine even though the service triggers in the background.</p><p>Other times it crashes on a whim.</p><p>I also don't know why ""isDatabaseLockedByOtherThreads()"" does not report that it is locked by other threads.</p><p>Any advice?</p><p>ThanksSimon</p>","509326","","","","","2011-02-08 01:21:56","Android Database Locking Behaviour","<android><database><sqlite><locking>","0","0","","",""
"4799936","1","4800124","","2011-01-25 23:17:51","1","1379","<p>Hi :) I'm trying to write an android application that downloads a bunch of images and afterwads displays them in a gallery. I managed to download the images (i did download them do the data/data/project directory - not sure if that's right) but now i can't access them (i tried using the setImageURI method of the imageView to display the image after I've created an Uri instance via Uri.Builder().appendPath(""data/data/project/file.jpg"").build() but it was to no avail). I'm new to android developing so any help will be greatly appreciated. Thanks!</p>","588264","","","","","2011-01-25 23:47:59","Displaying downloaded image in an imageView","<android><image><download><gallery><imageview>","2","0","1","",""
"4799978","1","9507988","","2011-01-25 23:23:43","10","12442","<p>I have an <code>HorizontalScrollView</code> which contains a <code>RelativeLayout</code>. This layout is empty in the XML, and is populated from java in the onCreate.</p><p>I would like this scroll view to be initially somewhere in the middle of the <code>RelativeLayout</code>, which is way larger than the screen.</p><p>I tried <code>mHorizScrollView.scrollTo(offsetX, 0);</code> which doesn't work.I don't know what's wrong with this.</p><p>I could post the code, but it is not really relevant. What matters is that everything is done programatically (has to :s), and that the initial position of the <code>HorizontalScrollView</code> has to be set programmatically.</p><p>Thanks for reading. Please tell me if you need more details or if this is not clear enough.</p>","334493","","","","","2013-06-20 21:13:20","How to programmatically scroll an HorizontalScrollView","<android><horizontal-scrolling><horizontalscrollview>","8","0","1","",""
"4799988","1","4800039","","2011-01-25 23:25:25","1","226","<p>Does making custom roms involve the same skill set as making apps?Are they one in the same?</p>","589879","","","","","2013-07-02 13:19:20","custom roms vs apps","<android><rom>","3","0","","",""
"4800085","1","","","2011-01-25 23:36:55","1","39","<p><strong>BACKGROUND:</strong><br>Font files have some advanced tables embedded in them that allowed glyph substitution, combined forms and anchored pairs.</p><p>For English speakers, think about having the 3 characters ""1"", ""/"", and ""2 and the font automatically combines them into a new glyph that looks like a ½ </p><p>That was a small <strong>1/2</strong> if it doesn't display correctly for you.</p><p><strong>QUESTION:</strong>Does anyone know if Android supports these advanced typography tables?</p>","12113","","471272","","2013-03-25 15:16:16","2013-03-25 15:16:16","How to use anchored pairs with fonts on Android","<android><fonts><typography><glyph-substitution>","0","0","","",""
"4800178","1","4800260","","2011-01-25 23:53:12","0","243","<p>I just got done reviewing the Notepad tutorial and looking at how they do their database. If you wanted to expand it to a multi-table database, would you just add a new provider class that did anything possibly needed for that table? </p><p>Second If you don't mind answering a second slightly related question, What is a URI and how do I use them with android? I searched around and only came back with ""Universal Resource Identifier"". </p><p>Thank~Aedon</p>","480691","","","","","2011-01-26 00:07:55","How to manage a multitable database?","<android><database><cursor><uri>","1","0","","",""
"4800235","1","","","2011-01-26 00:03:23","11","4705","<p>In Android, when decoding a Bitmap from a photo on the phone, the EXIF data in the original gets lost.  I am sending this Bitmap to my server via a socket and would like to re-attach the missing EXIF data to the data being sent.</p><p>I have some code that loads a Bitmap object from the MediaStore and compresses it to a byte array in preparation to send it over a socket:</p><pre><code>Bitmap bitmap = ...ByteArrayOutputStream stream = new ByteArrayOutputStream(bitmap);bitmap.compress(CompressFormat.JPEG, 70, stream);byte[] input = stream.toByteArray();</code></pre><p>I want to use the ExifInterface to get at the EXIF metadata in the original jpeg on the SD card and somehow add that to the outgoing byte array in a way that I'd be able to extract a jpeg with all the correct EXIF on the server side (hopefully without doing this on the server).  So far, I managed to use the ExifInterface to read all EXIF data:</p><pre><code>String path = ... //bitmap file pathExifInterface exif = new ExifInterface(path);... = exif.getAttribute(...)</code></pre><p>EDIT: Optimally, I'd like to find a solution that uses no libraries.  If I could just get the indices of the byte array of the original jpeg that contain the EXIF and prepend/append these bytes to the byte array produced by <code>bitmap.compress(...)</code> that would be best.</p>","184145","","184145","","2011-01-26 01:56:15","2012-11-02 18:11:02","How to attach EXIF metadata to a serialized Bitmap in Android?","<android><exif>","1","1","4","",""
"4800244","1","4801804","","2011-01-26 00:05:59","0","211","<p>Ok, I realise that the question is vague so I will supply some context, and perhaps I will receive some context related answers.</p><p>I am conducting a final year project as part of my BSc Computer Science with Maths degree, and my chosen project is to evaluate pitch tracking algorithms running on a mobile device. There are a few standard algorithms that I am likely to implement on an Android based device.</p><p>I will evaluate the frequency estimators on performance, reliability and accuracy, so I am required to produce some quantitative measures to relate to.</p><p>My concern is that my conclusions are going to be heavily related to my own implementation of these algorithms. How would I go about detecting or minimising inefficiencies that I've introduced?</p><p>Furthermore, are there any performance issues related to mathematical calculations on mobile devices in general that I should be aware of? I read that integer arithmetic is favoured because floating point values aren't always supported by the processor?</p><p>I read some of the related questions and they point towards books with standard algorithms, but it's not so easy when a number of pitch tracking algorithms only exist as a description in an academic paper.</p><p>I am also directed towards performace evaluation software, but not in the direction of any specific applications. Are there any popular choices?</p>","589919","","","","","2011-01-26 06:06:35","How can I reliably evaluate the performance of pitch tracking algorithms on an Android device?","<android><performance><pitch-tracking>","1","0","","",""
"4800263","1","","","2011-01-26 00:08:07","0","955","<p>I have an android app that displays a custom contact list of about 500 people and it works fine; however if I am looking for a name that starts with the letter ""s"", then it takes forever to scroll down.</p><p>How can I program it to jump to S without scrolling the entire list?</p><p>Here is the xml 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:layout_height=""fill_parent""   android:layout_width=""fill_parent""  android:background=""@color/background""  android:orientation=""vertical""&gt;  &lt;ListView android=""@+id/android:thelist"" android:layout_height=""0dip""   android:layout_width=""wrap_content""   android:scrollbars=""vertical""  android:fadingEdge=""vertical""  android:padding=""2dp""   android:fastScrollEnabled=""true""&gt;  &lt;/ListView&gt;&lt;TextView android:text=""@+id/TextView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/label"" android:textSize=""14dip"" android:textStyle=""bold"" android:paddingLeft=""10dip"" android:paddingTop=""3dip""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre>","578866","","750987","","2011-05-28 12:48:46","2011-05-28 12:48:46","How to add a UI to a large android listview?","<android><android-listview>","2","0","","",""
"4800415","1","4802312","","2011-01-26 00:36:22","2","8706","<p>I am trying to set item selected in OnItemClick event in ListView and it just wouldn't leave item selected. What am I doing wrong?</p><pre><code>lView.setOnItemClickListener(new OnItemClickListener()   {    @Override    public void onItemClick(@SuppressWarnings(""rawtypes"") AdapterView parent, View clickedview, int position, long id)    {     clickedview.setSelected(true);         mItemsAdapter.select(position);    }   }); </code></pre><p>few things:<br>1. I am trying to implement Multiple Select on the list View.<br>2. I cannot extend from ListActivity because Activity extends from BaseActivity custom class already.<br>3. mItemsAdapter is a custom ItemsAdapter adapter that extends BaseAdapter.<br>4. I don't need a checkbox in there, just to be able to see the row selected is fine.<br>5. ItemsAdapter overrides getView() and sets the layout of the row by inflating xml  </p>","538428","","","","","2012-10-10 19:34:19","Android - setSelected in OnItemClick in ListView","<android><listview><multiple-select>","3","0","0","",""
"4800575","1","4800679","","2011-01-26 01:10:59","4","3674","<p>I was wondering if there is an easier way (or any way) to start a Browser with a Google search query. For example user can select a certain word or phrase and click a button and the activity will start the browser with the Google search query.</p><p>Thank you.</p>","455048","","","","","2013-10-29 13:13:09","Start Google search query from activity - Android","<android><search>","3","0","1","",""
"4800592","1","4801679","","2011-01-26 01:15:26","1","1942","<p>guys I've been searching and studying about this for a whole day. The app crashes not only when a dialog is open, but also when a spinner is open (and I'm sure it would be bunch of other scenarios that I haven't come across).</p><p>choosing between onRetainNonConfigurationInstance() and onConfigurationChanged(Configuration newConfig) won't help me. (maybe I'm wrong) - actually I prefer to use first one.</p><p>BUT I want to ask: for a single open dialog box or open spinner do I have to create everything from scratch? is this a way? sometimes it's worthless to reinitialize a big class with lot of widgets inside just for a time that maybe user changes the orientation.</p><p>plz give me hints and guidance. Thanks in advance. </p><p>Edited :::</p><pre><code>Error code:01-25 17:56:48.182: ERROR/WindowManager(312): Activity XXX has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@43e63058 that was originally added here01-25 17:56:48.182: ERROR/WindowManager(312): android.view.WindowLeaked: Activity XXX has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@43e63058 that was originally added here01-25 17:56:48.182: ERROR/WindowManager(312):     at android.view.ViewRoot.&lt;init&gt;(ViewRoot.java:247)01-25 17:56:48.182: ERROR/WindowManager(312):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)01-25 17:56:48.182: ERROR/WindowManager(312):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)01-25 17:56:48.182: ERROR/WindowManager(312):     at android.view.Window$LocalWindowManager.addView(Window.java:424)01-25 17:56:48.182: ERROR/WindowManager(312):     at android.app.Dialog.show(Dialog.java:241)01-25 17:56:48.182: ERROR/WindowManager(312):     at XXX.menuGroupDialog(XXX.java:946)0    1-25 17:56:48.182: ERROR/WindowManager(312):     at XXX.onOptionsItemSelected(GroupManagement.java:257)01-25 17:56:48.182: ERROR/WindowManager(312):     at android.app.Activity.onMenuItemSelected(Activity.java:2195)01-25 17:56:48.182: ERROR/WindowManager(312):     at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:730)01-25 17:56:48.182: ERROR/WindowManager(312):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)01-25 17:56:48.182: ERROR/WindowManager(312):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)01-25 17:56:48.182: ERROR/WindowManager(312):     at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:532)01-25 17:56:48.182: ERROR/WindowManager(312):     at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)01-25 17:56:48.182: ERROR/WindowManager(312):     at android.view.View$PerformClick.run(View.java:8816)01-25 17:56:48.182: ERROR/WindowManager(312):     at android.os.Handler.handleCallback(Handler.java:587)01-25 17:56:48.182: ERROR/WindowManager(312):     at android.os.Handler.dispatchMessage(Handler.java:92)01-25 17:56:48.182: ERROR/WindowManager(312):     at android.os.Looper.loop(Looper.java:123)01-25 17:56:48.182: ERROR/WindowManager(312):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-25 17:56:48.182: ERROR/WindowManager(312):     at java.lang.reflect.Method.invokeNative(Native Method)01-25 17:56:48.182: ERROR/WindowManager(312):     at java.lang.reflect.Method.invoke(Method.java:521)01-25 17:56:48.182: ERROR/WindowManager(312):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-25 17:56:48.182: ERROR/WindowManager(312):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-25 17:56:48.182: ERROR/WindowManager(312):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I know that this is from calling dismiss() function. but how can I handle orientation change when having dialog open?</p>","536853","","234039","","2011-01-26 02:06:55","2011-03-09 09:38:38","app crashes when alert dialog is open and phone(emulator) changes its orientation","<android><dialog><orientation><spinner><alertdialog>","4","2","3","",""
"4800609","1","4800730","","2011-01-26 01:19:12","0","678","<p>I have this activity that is recording GPS positions along a route.  I am not sure what the processes or methods I need to keep this alive even after my screen shuts off and the security trace thingy comes up.  It seems the stop recording happens, right now I have two buttons that handle a boolean that starts recording or not.  I am not sure what I have to do or what event I have to trap to make sure my state of the program remains constant even if another call comes in, or something else happens... (Do I have to make it a service?!)</p><p>Really I only care about the gps recorder still recording after the screen goes dark cause phones been idle.  Before I put that security patttern draw thingy it would work, but now that its on something else is going on where my code state is getting kind of hosed.  Whats this wake lock I hear about?</p>","327258","","327258","","2011-01-26 18:36:59","2011-01-26 18:36:59","My android app stops recording GPS data when screen goes to home after being idle","<android><activity><gps>","1","0","","",""
"4800620","1","","","2011-01-26 01:21:40","2","642","<p>I am developing a 2d sprite-based game with a bunch of animations. Developed with separate threads and in general everything is great.</p><p>I recently added a level that has a alpha PNG graphic drawn over the Canvas after the rest of the animated bitmaps have been drawn.</p><p>There is now a noticeable speed degradation on this level and it seems to sputter etc... to top it off I just added a Multiply Xfermode to the paint for the graphic and it went to a stand-still.</p><p>Is there a better way to overlay graphics in this fashion to avoid the hit in performance (I'm assuming it has to calculate the alpha channels and it apply it to the canvas bitmap)? Is there an alternative to drawing the overlay with a drawbitmap/png?</p>","437414","","","","","2011-01-26 02:30:24","PNG overlay over active Canvas animations","<android><canvas><bitmap><overlay>","1","1","1","",""
"4800672","1","4800821","","2011-01-26 01:35:06","2","4051","<p>As stated in my question above, is it possible to have an apk file within another apk?To further explain, here is my situation:</p><p>I have two apps and the first one calls the other through an intent.. I don't have problem with this.. But what I need is to install only one apk file instead of two. And the first thing that came into my mind is to put a .apk file inside the other .apk file.. I really don't know if this is possible that's why I need your take on this. But if this is not possible, I hope someone can tell me what would be the best practice to doing this kind of thing.</p><p>I can make it as one application, but that would be my last solution.</p>","82350","","2680216","","2013-12-09 04:40:44","2013-12-09 04:40:44","android APK within an APK?","<android><install><apk>","4","0","3","",""
"4800734","1","4800754","","2011-01-26 01:48:42","1","742","<p>My text file contains a known number of lines (the first line of the file is the number of lines). I want to randomly read a line from the file - to do this I use <code>LineNumberReader</code>. The problem is, that it doesn't generate a new string - the random number changes but the string it gets from the <code>LineNumberReader</code> doesn't.</p><p>As the title implies this is an Android app. <code>textbox</code> is the output area, <code>testbox</code> is for debugging (in this code it displays the random number - to check that it has changed) and <code>r</code> is a <code>Random</code></p><p>This sample code is the <code>onClick</code> for the only button in the app.</p><pre><code>           String fileName = ""\\sdcard\\Q's.txt"";   try {       BufferedReader br = new BufferedReader(               new InputStreamReader(                       new DataInputStream(                               new FileInputStream(fileName))));       // Get the number of lines in the text file       numLines = Integer.parseInt(br.readLine().toString().trim());       // get a random number and write it to the test text box       int rnd = r.nextInt(numLines);       String tmp = Integer.toString(rnd);       testBox.setText(tmp);       // get random number - go to line - save in String ""text""       LineNumberReader rdr = new LineNumberReader(br);       rdr.setLineNumber(r.nextInt(numLines));       textBox.setText(rdr.readLine());    } catch (FileNotFoundException e) {        textBox.setText(""FileNotFound"");        e.printStackTrace();    } catch (IOException e) {        textBox.setText(""IOException"");        e.printStackTrace();    } catch (NumberFormatException nfe){        textBox.setText(""Number Formated Wrong"");    } finally {}</code></pre><p>What am I doing wrong? I have tried closing and reseting  <code>br</code> and <code>rdr</code>and can't seem to get it to work.</p>","551878","","","","","2011-01-26 02:00:23","Android/Java - Random Read line not changing","<java><android><file-io>","3","0","","",""
"4800953","1","4801039","","2011-01-26 02:34:19","0","1010","<p>Yesterday I was trying to get admob advertising to work on my new app. Unfortunately, and embarassingly I had programmed myself into a corner by using minimal XML files in my programming. (its a long story why), i.e. I did layouts for all views programatically in Java. Anyway, when it came to adding the AdView I had a problem since the Admob Guide assumed developers would use XML extensively. So I browsed the Admob API and blundered around and I ended up with the following:</p><pre><code>   ad = new AdView(this);    ad.setEnabled(true);    sublayout.addView(ad);    SimpleAdListener sal = new SimpleAdListener();    sal.onReceiveAd(ad);    ad.setAdListener(sal);    ad.getAdListener();    ad. setKeywords(""KEYWORDS RELEVANT TO MY APP"");    ad.requestFreshAd();</code></pre><p>My question is, is this code ok? It works. I mean, I'm displaying ads on my app (still unpublished). If anyone has experience with the Admob SDK Id like some advice.</p>","485498","","","","","2011-01-26 02:51:17","Admob Adview works. Why?","<java><android><admob><adview>","2","0","","",""
"4800959","1","4801451","","2011-01-26 02:35:38","0","1107","<p>In my android application I have a custom view that functions like a map. When the user touches a particular location, I would like to be able to display more information in a sort of information bubble. This is very similar to how the google maps api works, but I do not want to use their api. </p><p>So far I have tried drawing a rounded rectangle directly to the canvas and drawing text over top at the specified location. But this has considerable drawbacks: </p><p>1) I don't know how to calculate how big the rectangle should be relative to the length and size of the text. </p><p>2) Drawing a rectangle leaves no room for the power of views (with built in onTouch events, and room to easily customize the view)</p><p>I have also tried using a view (Button) to display the information but have had no success. As far as I know, I cannot specify the coordinates for where the view should display (since the information bubble needs to move according to where the map is scrolled).</p><p>In summary, I need the best of both methods where an image should easily resize according to the amount of text displayed, and the information bubble should be able to move around the screen according to where the map is scrolled.</p><p>Does anyone have any suggestions on what the best approach would be to create an information bubble like this without using the google maps api?</p>","590017","","","","","2011-01-26 04:44:14","How to create an information bubble on a map (not google api)","<java><android><maps>","2","0","2","",""
"4801074","1","4808934","","2011-01-26 03:01:34","5","3333","<p>I have noticed that my app's SharedPreferences are completely reset if the app is force closed or is killed by the system for some reason.  Obviously, yes, I should avoid having a crash in the first place but it does happen.  If it does happen, the user shouldn't loss all of their settings and other data stored with the Preferences.</p><p>I found <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/36895ca5e47befed"">this thread on Google Groups</a> but they couldn't solve it.</p><p>Anyone have any insight into why or how this happens and if there is a way to prevent it?</p><p>Also, fyi I have seen this on a 2.1 and a 2.2 device.  It will happen on every crash, not just some of them.</p><p>Thanks</p>","445348","","","","","2011-01-26 19:31:30","Shared Preferences reset when the app is force closed or crashes","<android><crash><preferences><sharedpreferences>","1","2","","",""
"4801094","1","","","2011-01-26 03:05:03","3","3328","<p>I'm a 4th year computer engineering student and have some experience with Android dev.</p><p>I am working on an application that has a 3D component to it which requires me to be able to rotate it around. I was looking at the example at the android resources site.</p><p><a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/TouchRotateActivity.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/TouchRotateActivity.html</a></p><p>This example does not talk about rotation around the z-axis. I have already tried using Quaternion for the rotations but I don't understand how to get rotations around the z-axis.</p><p>Once you rotate something, the axis are no longer the same (x,y) so how can you find out how much to rotate in which axis?</p><p>I was wondering if anyone can help me with learning how to just be able to rotate around an object. like the example above but also around the z-axis. I have already spend about 24 hours searching and trying to figure this out.</p><p>The bigger issue is that once you rotate 90 degrees around the y-axis how can you detect that the next rotation (going vertically on the touchscreen) should be around the z-axis.</p><p>Thank you in advance.</p>","590054","","","","","2012-01-13 14:55:18","Control rotation of a 3D object using the touchscreen in openGL","<android><opengl-es><3d><rotation><ontouchevent>","4","0","2","",""
"4801347","1","","","2011-01-26 04:10:42","1","2655","<p>I've recently found out that there is no hard limit to the amount of memory NDK code can allocate in contrast to the heavily limited amount of memory (~25Mb on most devices) you can allocate on the Java side.</p><p>I want to write an image processing app (something like Photoshop) that needs to keep several large bitmaps in memory at once where the bitmap data will take ~20Mb of memory. Doing this in Java makes the app prone to out of memory exceptions on many devices I've tried.</p><p>All my current code makes use of the Bitmap and Canvas class for doing my image manipulations. <strong>Can anyone suggest some way that allows me to allocate most of my memory on the C side and still make use of Bitmap+Canvas for performing my drawing operations (using Android 2.1 and above)?</strong></p><p>As an example, if my image is composed of 6 bitmap layers and the user is painting on the 3rd layer, I need to draw a paint blob bitmap to the 3rd layer and then update the screen to show the result of flattening all layers on top of each other in real time. I've considered something along the lines of allocating my 6 bitmaps in C as int arrays and performing the painting operation on the Java side with Canvas using a copy of the layer being edited stored in a Bitmap object. I'm not sure how the flattening stage is going to work though.</p>","590099","","","","","2011-02-26 21:15:53","Bitmap/Canvas use and the NDK","<java><android><c><android-ndk>","1","1","1","",""
"4801371","1","4801401","","2011-01-26 04:17:50","47","61545","<p>I am writing a simple program of Android, and getting these no errors, I don't know what they are. My program is right, but showing not output.I think it is because of these two lines:</p><pre><code>[2005-01-06 19:56:38 - my_Android] No Launcher activity found![2005-01-06 19:56:38 - my_Android] The launch will only sync the application package on the device!</code></pre>","576792","","1195594","","2012-12-15 19:24:14","2014-01-19 19:58:12","What does it mean ""No Launcher activity found!""","<android><eclipse>","13","0","8","",""
"4801443","1","4801820","","2011-01-26 04:36:04","0","284","<p>My application uses tabs and it is built on top of SDK Level 3 (Android 1.5).</p><p>Google mentions that tab icons ""changed drastically"" in Android 2.0, so they recommend making two sets of icons, one for &lt; level 5 and another for >= level 5, and set the <code>android:targetSdkVersion</code> to 5 in the application manifest (see <a href=""http://developer.android.com/guide/practices/ui_guidelines/icon_design_tab.html"" rel=""nofollow"">http://developer.android.com/guide/practices/ui_guidelines/icon_design_tab.html</a>). BUT this attribute was introduced in API Level 4, so there is no way to declare it because I'm on API Level 3 (see <a href=""http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#target"" rel=""nofollow"">http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#target</a>).</p><p>What's the proper way to handle this case?</p>","489765","","","","","2011-01-26 06:10:56","Tab icons compatibility between API level 3 and >=5","<android><tabs><compatibility>","1","0","0","",""
"4801631","1","","","2011-01-26 05:26:59","4","7218","<p>I don't like to manage <code>XML</code> and <code>Java</code> together, can I create same GUI using <code>Java</code> language?How can I do that, can you tell me code for simple <code>Button</code>?I will appreciate the proper answer.</p>","576792","","457982","","2011-01-26 07:31:25","2012-01-15 20:01:30","How to create GUI in Android instead of using XML?","<java><android><xml><gui>","3","0","2","",""
"4801646","1","4802432","","2011-01-26 05:32:06","1","2677","<p>HI </p><p>can anybody tell how to create  our own custom text view in android .I want to set different color for textview font can anybody give example</p>","426344","","","","","2011-01-26 08:10:40","can anybody tell how to create our own custom text view in android","<android>","3","1","","",""
"4801667","1","4801695","","2011-01-26 05:36:34","1","599","<p>I have an asynch task with my app which goes to a website, grabs the results from the API and appends a number of clickable textviews to an existing LinearLayout.</p><p>However I want to be able to launch a new activity when the textview is clicked. This isn't possible with the asynch class defined in a seperate file, would it be easier to define it as an inline class within the activity?</p>","487076","","","","","2013-05-03 18:13:25","Launching an Intent outside an activity","<android><android-intent>","3","0","","",""
"4801700","1","","","2011-01-26 05:42:19","4","491","<p>I have a sub-classed Gallery widget which I customized its onFling method, otherwise everything should be the same as the original Gallery widget. </p><p>And I am trying to animate its scrolling left or right by using:</p><pre><code>gallery.onKeyDown(KeyEvent.KEYCODE_DPAD_LEFT, new KeyEvent(0, 0));</code></pre><p>But that doesn't seems to work on the sub-class Gallery. Any idea why?</p>","42340","","","","","2013-01-16 14:50:28","Android: Sub-class Gallery doesn't scroll by onKeyDown event","<android><android-widget>","1","0","","",""
"4801710","1","4801747","","2011-01-26 05:44:40","0","596","<p>I have a composite widget that consists of an ImageView and TextView object wrapped up inside a LinearLayout. Since this is used several times inside one of my activities I made it a separate layout and include it multiple times inside the main layout. I understand you can override the view id for the included layout from the  tag in the main layout. My question is, is it possible to set things like the image source and textview string from the main layout in XML? Sure, I could do this programmatically but I was wondering if it was possible purely in XML...</p>","246793","","","","","2012-07-12 13:57:39","How to set attributes inside Android layout that is included in another layout?","<android><xml><layout><attributes><include>","1","0","","",""
"4801793","1","4802579","","2011-01-26 06:02:04","0","5453","<p>My environment is: windows xp sp3, eclipse, all available software installed using SDK Manager.</p><p>Following Android developer site's guide, I could write and run hello world app on Android 2.3 emulator. Then I wanted to see if I could run my app on a real device - vodafone 845 (huawei U8120?) in my case. Here I stuck for two days now trying to install windows usb driver for my device. When I connect my device through usb with Debug setting On, windows keeps to ackowledge it as usb mass storage. On Device Manager, I tried Update Driver, selected C:\Program Files\Android\android-sdk-windows\google-usb_driver\android_winusb.inf file. it complained like: </p><p>""The specified location does not contain information about your hardware""</p><p>It's probably because of missing manufacturer/product information (VID_12D1&amp;PID_1031) in inf file, right?</p><p><a href=""http://developer.android.com/sdk/win-usb.html"" rel=""nofollow"">http://developer.android.com/sdk/win-usb.html</a> site lists supported devices and says that any additional devices will require Windows drivers provided by the hardware manufacturer but so far I couldn't any information.</p><p>I guess many developers are facing this issue with their own devices that is not supported by Android SDK and I wonder how they overcome this issue - especially for vodafone 845 device.</p><p>Thanks in advance</p><p>Bob</p>","588521","","","","","2011-04-12 15:12:12","can't install windows usb driver - vodafone 845","<android>","2","0","1","",""
"4802002","1","4802151","","2011-01-26 06:50:13","1","638","<p>I have a alertdialog in which data coming from internet. Sometimes due to internet connectivity data comes late. so i want progress bar before spinner shows itself. while getting data i have written this.</p><pre><code>final String[] List= new String{ 'abc', 'def'};                ArrayList&lt;String&gt; ListArray = new ArrayList&lt;String&gt;();                  ListArray.addAll(Arrays.asList(List));                ListAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_dropdown_item, ListArray);                  AlertDialog.Builder builder = new AlertDialog.Builder(this);                builder.setTitle(""Data"");                builder.setAdapter(ListAdapter, new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int item) {                        txtExec.setText(ClientList[item]);                    }                 });                AlertDialog alert = builder.create();                alert.show();ProgressDialog dialog = new ProgressDialog(this);                dialog.setMessage(""Please wait while loading..."");                dialog.setIndeterminate(true);                dialog.setCancelable(true);</code></pre><p>So how do i adjust progessDialog before alert dialog box?</p>","566590","","399815","","2011-01-26 06:52:34","2011-01-26 07:12:45","how to set progress bar before spinner?","<android>","1","1","","",""
"4802018","1","4802066","","2011-01-26 06:52:08","0","436","<p>Okay i have an android apk lets say app1.apk and it's located at /system/app</p><p>app1.apk has an outdated xml lets say file.xml located within the apk at res/drawable</p><p>A new updated file.xml is located at /data/misc/file.xml on the phone</p><p>I want to have the updated file.xml located on the phone be switched into the apk and replace the old one how can i go about doing this in java?</p><p>Thank you for any help it is greatly appreciated</p><p>It would be for only rooted devices by the way but i'm going to copy the apk out of the system as well</p>","577732","","577732","","2011-01-26 07:57:08","2011-01-26 07:57:08","Update a file inside an apk with java","<java><android><xml><replace>","1","0","0","",""
"4802031","1","4966734","","2011-01-26 06:53:44","0","519","<p>I need to get amplitude from mediaplayer.</p><p>I try to use AudioManager, mAudioManager.getStreamVolume( AudioManager.STREAM_MUSIC ); but is not my need.</p><p>Thanks.</p>","590220","","399815","","2011-01-26 06:56:40","2011-09-17 04:22:57","Android: How I get amplitude from mediaplayer?","<android>","1","0","","",""
"4802076","1","4802183","","2011-01-26 07:00:15","0","1327","<p>I am adding <code>webview</code> in <code>table row</code> and loading data, but data is not displaying for me, can anybody tell what is problem. If it <code>linear layout</code> working but not working in <code>table layout</code> with table row?</p><p>*<strong><em>main.xml</em>*</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=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""      &gt;    &lt;TableLayout        android:layout_width=""fill_parent""            android:layout_height=""wrap_content""&gt;            &lt;TableRow android:layout_width=""fill_parent""            android:layout_height=""wrap_content""&gt;            &lt;WebView android:id=""@+id/link4_view""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""/&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>SampleWebCheckActivity.java</strong></p><pre><code>package com.samplecheck;import android.app.Activity;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.text.util.Linkify;import android.view.View;import android.webkit.WebView;import android.widget.Button;import android.widget.TextView;public class SampleWebCheckActivity extends Activity{    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        WebView wv=(WebView)findViewById(R.id.link4_view);        String data=""sample 1234 2345 5678 123456 "";        wv.loadDataWithBaseURL(null, data, ""text/html"", ""UTF-8"", null);       // wv.loadDataWithBaseURL(baseUrl, data, mimeType, encoding, failUrl)(data, ""text/html"", ""UTf-8"");    }}</code></pre><p>Even I used loadData it's not working.</p>","426344","","18061","","2012-10-11 05:51:48","2012-10-11 05:51:48","Table Layout with WebView","<android>","3","0","","",""
"4802095","1","4802163","","2011-01-26 07:02:37","0","106","<p>I want to develop my application on android which can load a web service to show on a mobile. At this time,design phase is coming but I don't know, how I can design because on a website is not complete yet.So, I want to know a constrains that make I can design my application.Thank you ka :)</p>","538788","","","","","2011-01-26 07:14:31","Constrains of mobile web application on Android","<android><mobile-website>","1","0","","",""
"4802203","1","4802306","","2011-01-26 07:24:10","8","9428","<p>I am just learning <a href=""http://www.phonegap.com/"">PhoneGap</a> and I would like to push notifications to the notification tray on a timer. </p><p>I tried the <a href=""http://docs.phonegap.com/phonegap_notification_notification.md.html#Notification"">notification function</a> in the PhoneGap API but its only for messages boxes with in the application its self. </p><p>Any ideas how to send a push notifications to the ""Notification tray"" android system? </p>","58456","","","","","2014-03-04 19:40:21","Phonegap adding items to the notification tray","<android><phonegap>","2","0","9","",""
"4802277","1","4852739","","2011-01-26 07:38:07","3","3142","<p>i use php to post to apple ..</p><blockquote>  <p>$message = $error_msg;</p><pre><code>  $deviceToken = $dtoken;  $badge = 1;  $sound = 'received3.caf';    $body = array();    $body['aps'] = array('alert' =&gt; $message);    if ($badge)            $body['aps']['badge'] = $badge;    if ($sound)            $body['aps']['sound'] = $sound;    $ctx = stream_context_create();    stream_context_set_option($ctx, 'ssl', 'local_cert', '/home/administrator/applecert/apns-dev.pem');    $fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx);    error_reporting(E_ALL);    if (!$fp) {            print ""Failed to connect $err $errstr\n"";            return;            } else {           print ""Connection OK\n"";        }    $payload = json_encode($body);    $msg = chr(0) . pack(""n"",32) . pack('H*', str_replace(' ', '', $deviceToken)) . pack(""n"",strlen($payload)) . $payload;    print ""sending message :"" . $payload . ""\n"";    fwrite($fp, $msg);    fclose($fp);</code></pre></blockquote><p>and andriod have similar way to post with php?</p><p>thanks ,all</p>","491231","","","","","2011-04-23 17:56:38","Android can use like apple push-notification with php?","<php><android><push-notification>","1","1","","",""
"4802398","1","","","2011-01-26 08:04:45","13","3672","<p>Given a path (on the SD card) to an audio file, what is the best way of determining the length of the audio in milliseconds and the file format (or Internet media type)?</p><p>(For the duration one could use <code>MediaPlayer</code>'s <code>getDuration</code>-method, but this seems too slow/clumsy.)</p>","12547","","","","","2014-02-25 18:14:36","Determining the duration and format of an audio file","<android><audio>","3","1","5","",""
"4802425","1","","","2011-01-26 08:09:32","2","2673","<p>How do I launch any application via a terminal or command shell on android emulator engine? For example, if I want to start any game, how do I do via a terminal or command shell?</p><p>Anyone could help is really appreciated.</p><p>Thanks,</p><p>Sam.</p>","590276","","437039","","2011-01-26 12:27:32","2011-01-26 12:27:32","Launch any application on emulator via terminal","<android><command-line>","1","0","0","",""
"4802441","1","","","2011-01-26 08:12:52","2","778","<p>I am using webview to show google canlender but want to pass google account programmatic-ally,so the setHttpAuthUsernamePassword() function should be what I need but it doesn't work at all. Here is the code: </p><pre><code>WebView webview = (WebView) findViewById(R.id.webview);webview.getSettings().setJavaScriptEnabled(true);webview.setHttpAuthUsernamePassword(""www.google.com"", """", ""email"", ""password"");    webview.setWebViewClient(new WebViewClient() {        @Override         public void onReceivedHttpAuthRequest (WebView view, HttpAuthHandler handler, String host,String realm){             handler.proceed(""email"",""password"");             }        }         public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {            Toast.makeText(activity, description, Toast.LENGTH_SHORT).show();        }    });    webview.loadUrl(""http://www.google.com/calendar/"");</code></pre><p>If you have any idea to make this worked, please let me know. I tried to search a lot but don't see any useful. </p>","578309","","756941","","2013-12-11 05:08:20","2013-12-11 05:08:20","Android how to pass google account to webview","<android><webview><google-calendar><account>","2","1","1","",""
"4802457","1","4803757","","2011-01-26 08:16:03","1","3908","<p>I am having a tad of an issue when creating shortcuts on my android desktop.</p><p>First, I have a 72x72 icon, I load it from my SD card into a Bitmap object.</p><p>With that bitmap object I set it as my icon resource.</p><p>The problem I am having is when I set it, the image on the shortcut appears off center and cut off. From the screen metrics I get the size as 72x72, not sure what the deal is.</p><p>Code:Bitmap theBitmap = BitmapFactory.decodeFile(""/sdcard/icon.png"");intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, theBitmap)</p><p>I've tried resizing it and have got it to work utilizing a canvas, drawable and another bitmap, however when restarting the phone it reverts to a small size.</p><p>Using the very same icon as a drawable resource makes it look perfect, but its not dynamic:</p><p>Parcelable iconResource = Intent.ShortcutIconResource.fromContext(this, R.drawable.icon);intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);</p><p>Using a Samsung Epic 4g w/ 2.1</p>","590282","","","","","2013-05-22 08:15:21","intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, bmp) image is off center","<android>","2","1","2","",""
"4802501","1","","","2011-01-26 08:22:11","0","3746","<p>Is there way to interact with the recent apps list which appears when you long press the home button? I would like to turn it off completely or if that is not possible to clear the entries.</p>","2450","","","","","2013-12-06 09:56:28","Turn off or modify recent apps list","<android><list>","3","0","","",""
"4802521","1","4802680","","2011-01-26 08:26:13","4","1084","<p>In my app i connect to a server, which responds with an xml. I parse it with the SAX Parser, and get the data.</p><p>The question is: </p><p><strong>What is the best way to handle connection issues?</strong> </p><p>(At this moment if there is no internet connection available the app simply continues showing the <code>ProgressDialog</code> i implemented)</p>","396133","","","","","2011-01-26 08:51:58","Android - Downloading data from the internet >> catch connection errors","<android><internet>","2","0","1","",""
"4802584","1","4826592","","2011-01-26 08:36:43","2","1242","<p>Im working on android application in which i take backup of all contact information and then restore,i retreive all information of contact,For example:</p><p>Display Name</p><pre><code>Cursor cursor = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,null,null, null, null)String  name = cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME));</code></pre><p>Phone Number</p><pre><code>Cursor phones = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,ContactsContract.CommonDataKinds.Phone.CONTACT_ID +"" = ""+ contactId,null, null);   </code></pre><p>SimilaryBut i unable to get ""Internet Call"" value.Kindly anyone tell in which class i will get information about Internet Call information.</p><p>Any help in this regards greatly appreciated.and it is urgent  </p>","575218","","71724","","2011-01-26 09:14:24","2013-02-13 07:02:42","How to get ""Internet Call"" Information in Android","<android>","2","1","1","",""
"4802700","1","5013818","","2011-01-26 08:55:53","1","111","<p>When I run my application on either Android emulator or an actual device, the LogCat output is filled withing literally seconds with this message in yellow color</p><blockquote>  <p>01-26 10:50:42.550: WARN/PrintK(24):  rpc_zdelay_work_func => 0</p></blockquote><p>This started happening pretty recently and I don't even know what to look at, I mean this warning, supposedly it warns me about something, doesn't it?</p><p>A bit about the app features:so the application uses a lot of communication over XMPP (uses pretty many threads for that), it has a map, uses the GPS, I draw some stuff on the screen myself from the code, I use some custom png graphics, the layouts of the screens are made with merge, Relational and Linear layouts. To me it seems quite a natural app, without any fancy stuff...</p><p>OK, this is really weird, today that warning is just gone! It disappeared like never existed. The only difference I can think of is that I unplugged the usb cable.</p>","309946","","309946","","2011-02-14 09:20:42","2011-02-16 07:50:10","What causes the warning 'rpc_zdelay_work_func => 0'","<android>","1","4","0","",""
"4802716","1","4802842","","2011-01-26 08:57:44","2","3732","<p>I am setting a wake lock using <code>wl.acquire()</code>. This works fine. I need that wake lock as long as my application lives, so calling <code>release()</code> can only be done when the application is left.</p><p>Do I have to call <code>release()</code> somewhere? For example in <code>onStop()</code>? I would say no, but I am not sure.</p><p>Thanks, A.</p>","481493","","418183","","2011-01-26 09:12:14","2011-08-19 10:44:08","How to release a wake lock?","<android><wakelock>","3","1","1","",""
"4802723","1","4861882","","2011-01-26 08:59:03","1","1159","<p>I have a android app that has an ongoing service for tracking a persons location. I want to be able to start up the service from within the activity and end it from within the activity. When the activity is running I need to be able to bind to the service and communicate to it via aidl. However I need the service to continue even when the activity has ended. I only want the service to end when the it is told to by the activity.</p><p>So far I have my activity and service and they can communicate through a aidl file. But at the moment the service ends when the activity does.</p><p>How do I get it to continue running when the activity has ended AND how do I rebind to it when the activity is restarted?</p>","197310","","197310","","2011-02-01 11:14:34","2011-07-11 10:56:52","How to create an android service that runs after the activity has ended","<android><service>","1","4","","",""
"4802829","1","4802892","","2011-01-26 09:12:12","1","1859","<p>When I run my application, it's automatically create a droid-bot picture on surface of application. So, I want to change a picture, what should I do?</p>","538788","","1065190","","2013-08-15 18:56:26","2013-08-15 18:56:26","How to change default picture application to my own picture?","<android><icons><screen>","2","1","","",""
"4802869","1","","","2011-01-26 09:17:16","0","954","<p>In my application I am launching a new <code>Intent</code> with url (browser) using the following code:</p><pre><code>Intent myIntent = new Intent(Intent.ACTION_VIEW,Uri.parse(url));                try {    context.startActivity(myIntent);} catch (ActivityNotFoundException e) {    Log.e(TAG, ""cannot initiate Browser"", e);}</code></pre><p>Is there a way tolet the new activity to send user agent </p><p>thanks-Z</p>","449466","","418183","","2011-01-26 09:22:01","2011-01-30 11:34:24","How to set user agent for new ACTION_VIEW intent","<android><android-intent><user-agent>","2","0","","",""
"4802964","1","4805177","","2011-01-26 09:27:35","0","171","<p>I have</p><pre><code>public class Preferences extends PreferenceActivity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.xml.preferences);    }}</code></pre><p>Before the preferences are left I want to do a sanity check. I can do that in activity which calls the preference activity during the <code>onAcitivtyResult()</code> method. But that means if I have to tell the user to correct the preferences I have to call the preference activity again which I want to avoid. Is there some way that I can do a check before I leave this preference activity? Something that the user can only leave the preference activity when the sanity check is ok. I guess I have to override the back button, do I?</p><p>Thanks.</p>","481493","","418183","","2011-01-26 09:36:50","2011-01-26 13:38:44","Android: Checking generated preferences","<android><preferences>","1","0","","",""
"4802989","1","","","2011-01-26 09:30:14","0","1329","<p>I'm not able able to launch a Simple Hello World for Android using Eclipse.</p><p>The emulator is launched.There is no error on Eclipse console.</p><p>I might have a java exception that appears in Windows terminal but i can't see it because the window get closed instantanly...</p><p>What can I do ?</p><p>Pl. help me!Thanks</p>","590353","","590353","","2011-01-26 10:47:04","2011-01-26 10:47:04","Android + Eclipse : unable to run application on emulator","<java><android><android-emulator>","1","2","","2011-01-26 09:47:04",""
"4803219","1","4804373","","2011-01-26 09:57:21","0","152","<p>Anyone else notice Google Checkout now initiates charges for Android apps after 10 hours instead of 24?</p>","444761","","","","","2011-01-26 12:05:52","Android app payments now charged after 10 hours instead of 24 hours?","<android><google-checkout>","1","4","","",""
"4803227","1","","","2011-01-26 09:59:02","1","429","<p>Hey, I'm really new with android development just started a few hours ago. I need to make a application for a school project and it needs to be done soon.</p><p>So far have I made a spinner with some alternatives to choose from. But here is my problem.How do I make so when I click on one of the targets listed in my spinner so it links to a webpage.</p><p>I don't know how to use ""AdapterView.OnItemSelectedListener."" or if it is necessary here or not.</p><p>I would be very thankful for some advices. thanks a head</p>","590389","","","","","2011-01-26 11:27:05","How do I make so my spinner target links to a website?","<android><eclipse><hyperlink><spinner>","1","1","1","",""
"4803248","1","5435053","","2011-01-26 10:01:35","5","4920","<p>I have an app which is used for lets say 4 hours, but only every 5  minutes a user needs to make an input or read the screen. Putting the phone to sleep and locking the screen is a bit annoying. So I have two options:</p><ol><li><p><code>getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);</code> which doesn't lock the screen but the screen is always bright, I would like to dim it while there is no activity. Just because of battery life span, or doesn't that matter that much for these 4 hours?</p></li><li><p>a wake lock <code>SCREEN_DIM_WAKE_LOCK</code>which does as well what I want, but I was told rather to use option 1 above.</p></li></ol><p>Can I achieve the wanted somehow without a wake lock?</p>","481493","","707111","","2013-11-21 01:18:58","2014-03-17 13:44:50","Dim screen while user inactive","<android><wakelock>","3","0","1","",""
"4803342","1","4803631","","2011-01-26 10:12:51","15","4718","<p>Could someone describe me a solution to implement a plugin inside an Android application and how could it be sold on the Android Market?</p><p>Typically, you create a game whose 4 first levels are free. Then, the user should buy something using the Android Market to unlock additional levels.</p><p>A solution could be to list the packages set up on the phone which are named com.company.myApp.additionalLevelSet1 but it doesn't seem secure at all! (a user could manually set up the plugin packages and so unlock additional features freely)</p><p>On iPhone, you could use InAppPurchase to buy non-consumable or consumable products.</p><p>Any help or suggestion would be appreciated. Thanks!</p>","590392","","193892","","2013-04-11 13:19:23","2013-04-11 13:19:23","How to release application plugin using Android Market?","<android><plugins><google-play>","2","1","15","",""
"4803563","1","4804400","","2011-01-26 10:37:21","4","3367","<p>I've been trying to use an android preference activity, I got it all set up but I'm having trouble actually retrieving the users preference. To be specific it's two edittext preferences, term length and year length, that i want to retrieve the values of as int's so i can use them in a calculation in another activity.</p><p>Every example i find is different and I can't really find a clear explanation. I'll post the class and the method I'm using below, I know the code that's there isn't correct but i feel like I've messed around with it every which way now and can't figure it out. This line in particular i don't believe is correct: <code>SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);</code> and i don't really understand preference activities as a whole, they don't seem to work as I'd expect. Any advice would really be great! I've been juggling the same lines of code about for days.<br>Thanks. </p><p>My preferences activity looks like this:</p><pre><code>package com.geistware.studentbudgetapp;import android.content.SharedPreferences;import android.os.Bundle;import android.preference.EditTextPreference;import android.preference.PreferenceActivity;import android.preference.PreferenceManager;import android.text.method.DigitsKeyListener;import android.util.Log;public class UserPrefs extends PreferenceActivity {    public int termLength = 1;    public int yearLength = 1;    @Override //OnCreate never runs, why?    protected void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.xml.setup);         EditTextPreference usersTermLength =(EditTextPreference)        findPreference(getString(R.string.term_length_set)); //finds         //the edittext box by its key, term_length_set        usersTermLength.getEditText().setKeyListener(DigitsKeyListener.            getInstance()); //DigitsKeyListener only allows digits to be typed in        Log.v(""UserPrefs"", ""UsersTermLength: "" + usersTermLength);        EditTextPreference usersYearLength =(EditTextPreference)            findPreference(getString(R.string.year_length_set));        usersYearLength.getEditText().setKeyListener(DigitsKeyListener.            getInstance());    }}</code></pre><p>and i want to be able to retrieve the users termLength and yearLength (as ints) in this method:</p><pre><code>public float alterForFrequency(float enteredAmount, String spinnerPosition){    //get user preferences (not working)    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);    String termKey = getString(R.string.term_length_set, """");    String yearKey = getString(R.string.year_length_set, """");    int termLength = prefs.getInt(termKey, 1);    int yearLength = prefs.getInt(yearKey, 1);    Log.v(""alterForFrequency"", ""userprefs: "" + termLength + yearLength);    //perform calculations for monthly/temly/yearly    if(spinnerPosition.equals(""Monthly"")){        usersAmount = ((enteredAmount / 31)* 7);        Log.v(""FiscFreq"", ""revisingAmount="" + usersAmount);    }    else if(spinnerPosition.equals(""Termly"")){        usersAmount = (enteredAmount / termLength);        Log.v(""FiscFreq"", ""revisingAmount="" + usersAmount);    }    else if(spinnerPosition.equals(""Yearly"")){        usersAmount = (enteredAmount / yearLength);    }    else{        usersAmount = enteredAmount;    }    currencyRevisedAmount = toCurrency(usersAmount); //drops the unwanted digits    return currencyRevisedAmount;}</code></pre><p>I'm actually creating an instance of FiscalFrequency to use alterForFrequency in an activity called Keypad like so:</p><pre><code>public class Keypad extends Activity { .....   public float reviseOnSpinnerPos(){    enteredAmount = Float.valueOf(userAmount.getText().toString());    FiscalFrequency ff = new FiscalFrequency();    revisedAmount = ff.alterForFrequency(enteredAmount, spinnerPosition);    return revisedAmount;    }}</code></pre>","523874","","281545","","2013-12-30 20:33:55","2013-12-30 20:33:55","I can't figure out how to use an android PreferenceActivity","<java><android><user><preferences><preferenceactivity>","2","3","","",""
"4803636","1","","","2011-01-26 10:48:08","1","432","<p>i need to do auto complete word suggestion.When i click ""th""on Autocomplete edit text box,It will display ""the"",""there"",""those""...like that on vertical list view.I need to display that results(the,there,those..)on horizontal way.How could i do this?</p><p>My code is:</p><pre><code>public class AutoCompleteDemo extends Activityimplements TextWatcher {TextView selection;AutoCompleteTextView edit;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""};@Overridepublic void onCreate(Bundle icicle) {super.onCreate(icicle);setContentView(R.layout.main);edit=(AutoCompleteTextView)findViewById(R.id.edit);edit.addTextChangedListener(this);edit.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple dropdown item 1line,items));}public void onTextChanged(CharSequence s, int start, int before,int count) {}public void beforeTextChanged(CharSequence s, int start,int count, int after) {// needed for interface, but not used}public void afterTextChanged(Editable s) {// needed for interface, but not used}}</code></pre>","555948","","510491","","2011-05-31 11:36:31","2011-05-31 11:36:31","AutoComplete word suggestion horizontally in android","<android><autocomplete><edittext>","0","2","","",""
"4803756","1","4806456","","2011-01-26 11:00:03","9","15635","<p>I have ListView with my own layout and CustomCursorAdapter. Every row has it's own checkbox. So... it's absolutely clear that during sroll the checkboxes loose their states. The only stuff I found is <a href=""http://stackoverflow.com/questions/2406937/android-save-checkbox-state-in-listview-with-cursor-adapter"">Android save Checkbox State in ListView with Cursor Adapter</a> but there is no answer there. And one more question. I had the same problem with my CustorArrayAdapter. I solved that problem using SparseBooleanArray to keep checkboxes states. It works fine, but every scroll calls onCheckedChanged. That's normal? The deal is my list view describes alarm elements and periodic calls (of onCheckedChanged) start/stop the alarms. A lot of unnesseccary actions.</p>","577841","","","","","2014-03-04 07:16:46","Android: CursorAdapter, ListView and CheckBox","<android><listview><checkbox>","5","1","10","",""
"4803870","1","4803949","","2011-01-26 11:10:23","2","586","<p>I am looking to see if anyone is using Mobile Web Development Frameworks, examples of these include: </p><ul><li>Sencha Touch</li><li>jQuery Mobile</li><li>iWebKit</li></ul><p>Has anyone used any of these or anything similar? I really want to gauge if the mobile web community on StackOverflow are using Frameworks. </p><p>Cheers, J</p>","394601","","","","","2011-09-15 18:32:10","Mobile Web Development Frameworks","<android><ios><blackberry><symbian><mobile-website>","2","3","","",""
"4803925","1","","","2011-01-26 11:15:40","-1","2484","<p>Is there any way for printing via bluetooth on Android Phone ? Any applications ? </p>","564844","","","","","2011-03-11 12:53:18","Printing via bluetooth on android phone","<android>","1","0","1","",""
"4804052","1","","","2011-01-26 11:30:25","0","184","<p>I am working on an app, which has a spinner in two activities. In the first activity the user can edit the spinner item and save the value. I used an <code>ArrayAdapter</code> and a <code>onItemSelectedListener</code> to store the value in the database. This works fine.</p><p>In the second activity the spinner with the changes of the user should be shown. Can anybody tell me how to solve this problem? If you need some more information, please ask, because I am a newbie on android.</p><p>This is the code for the first activity:</p><pre><code>@Overrideprotected void onCreate(final Bundle icicle) {super.onCreate(icicle);setContentView(R.layout.my_spinner1);final Spinner spinner1 = (Spinner)findViewById(R.id.sp_countries);ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(this, R.array.countries,R.layout.spinner1);adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);spinner1.setAdapter(adapter);spinner1.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { public void onItemSelected(AdapterView&lt;?&gt; parentView, View childView, int position, long id) {mSave.countries = spinner1.getSelectedItem().toString();}public void onNothingSelected(AdapterView&lt;?&gt; parentView) {}});</code></pre><p>Thanks for your answers in advance.</p>","589469","","382818","","2011-01-31 14:41:29","2011-01-31 14:41:29","How can I get changes of a Spinner?","<android><database><spinner>","1","0","","",""
"4804157","1","4804445","","2011-01-26 11:42:51","0","704","<p>I'm looking for a way to play videos, or rather, show a frame-by-frame animation with the built-in web browsers of iPhone and Android devices.</p><p>Conditions:</p><ul><li>It must be played <strong>inline</strong> on the <strong>built-in mobile web browsers</strong></li><li>The videos are 240x240 in size and around 10 seconds in length<ul><li>They were originally .swf files containing Flash animation</li></ul></li></ul><p>HTML5 video tag is disqualified because there is only fullscreen playback on iPhone devices.</p><p>Any ideas?</p>","20226","","","","","2011-01-26 12:16:18","Inline video playback solution for iPhone and Android?","<iphone><android><video><animation><inline>","2","0","","",""
"4804158","1","","","2011-01-26 11:42:59","3","711","<p>I am currently trying to implement GestureOverlay to capture both vertical and horizontal strokes on top my view.  Typically this functionality is not accepted, as it assumes you are applying on top of a scrollable view.</p><p>Using android:orientation I am able to set it to capture one or the other, but I need to know if there is a way to override this to accept both, or if I am stuck using a custom gesture adapter.</p><p>Thank You,Josh McKinney</p>","453305","","","","","2013-11-27 17:45:40","Android GestureOverlay with vertical and horizontal strokes","<android><gestures>","2","3","3","",""
"4804161","1","4804194","","2011-01-26 11:43:27","0","745","<p>I am using Android 1.5</p><p>I am trying to download mp3 via URL link, but instead of download proccess I get auto-play via the webkit.I do want to download the mp3 file, not to play it straightly from the browser.</p><p>Any idea how could I solve this?</p><p>thanks,ray.</p>","260511","","","","","2011-01-26 11:47:49","Download mp3 instead of playing with Webkit","<android>","1","0","","",""
"4804177","1","","","2011-01-26 11:46:16","0","185","<p>I am using eclipse as the IDE and I have written small programs but now I want to debug them so that i could check the flow of control</p>","1081629","","114066","","2011-01-26 11:51:56","2011-01-26 11:51:56","debugging in android","<android><eclipse><debugging>","1","1","","",""
"4804214","1","","","2011-01-26 11:50:10","0","496","<p>I have a problem in my application. When I click the EditText in my custom dialog, the soft keyboard appears, but after it is displayed / hide, the UI is unresponsive for 2-3 seconds.If I wait until after 2-3 seconds, it runs smoothly.</p><p>Why would the keyboard cause my app to run slowly?</p><pre><code>//CustomDialog Classpubilc CustomDialog extends Dialog implements OnClickListener{    private Context context;    private Activity activity;    private Button button1, button2;    private EditText editTextpublic CustomDialog(Context context, Activity activity){    this.context = context;    this.activity = activity;    this.button1 = null;            this.button2 = null;            this.editText = null;        }public void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    this.requestWindowFeature(Window.FEATURE_NO_TITLE);     this.setContentView(R.layout.custom_dialog_layout);    this.editText = (EditText)findViewById(R.id.custom_edittext);                   button1 = (Button)findViewById(R.id.confirm_button);    button1.setOnClickListener(this);    button2 = (Button)findViewById(R.id.cancel_button);    button2.setOnClickListener(this);}public void onClick(View view){    if(view == this.confirmButton){        activity.doSomething();    }else if(view == this.cancelButton){        this.dismiss();    }}}//Main Activitypublic Main extends Dialog implements OnClickListener{    private Button button;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        this.requestWindowFeature(Window.FEATURE_NO_TITLE);         setContentView(R.layout.main);         this.bindResources();    }    private void bindResources(){        this.button = (Button)this.findViewById(R.id.main_button);        this.button.setOnClickListener(this);    }    public void onClick(View view){        if(view == this.button){            CustomDialog dialog = new CustomDialog(this, this);            dialog.show();        }    }}//CustomDialog XML</code></pre><p></p><pre><code>&lt;TextView   android:id=""@+id/custom_message""        android:layout_width=""wrap_content""          android:layout_height=""wrap_content""         android:textStyle=""bold""        android:layout_centerHorizontal=""true""        android:text=""@string/custom_message""        android:textSize=""20px""        android:paddingTop=""5px""        android:textColor=""#FFFFFF""/&gt; &lt;EditText   android:id=""@+id/custom_edittext""                android:layout_height=""wrap_content""                android:layout_marginTop=""10px""                android:layout_width=""250px""                android:layout_centerHorizontal=""true""                android:layout_below=""@id/custom_message""                android:digits=""0123456789.""                android:inputType=""phone""                android:singleLine=""true""                android:maxLength=""20""/&gt;                &lt;RelativeLayout android:id=""@+id/button_group""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:gravity=""center_horizontal""        android:layout_marginTop=""5px""        android:layout_below=""@id/custom_edittext""&gt;   &lt;Button  android:id=""@+id/confirm_button""                android:text=""@string/confirm_button_label""                android:layout_width=""100px""                android:textSize=""15px""                android:textColor=""#000000""                android:textStyle=""bold""                android:layout_height=""wrap_content""/&gt;              &lt;Button     android:id=""@+id/cancel_button""                android:text=""@string/cancel_button_label""                android:layout_width=""100px""                android:textSize=""15px""                android:textColor=""#000000""                android:textStyle=""bold""                android:layout_toRightOf=""@id/confirm_button""                android:layout_height=""wrap_content""/&gt;&lt;/RelativeLayout&gt;                         </code></pre><p></p><p>Thank you.</p>","558890","","558890","","2011-01-27 04:35:47","2011-01-27 04:35:47","Displaying soft keyboard from EditText in a custom dialog causes UI to temporarily stop responding","<java><android>","0","5","","",""
"4804305","1","5239634","","2011-01-26 11:58:34","1","1324","<p>Have a user who just updated to 2.2.1 on his Galaxy S.  Now, when he hits HOME and then relaunches the app, I can see in the logs that the application context is re-initialized and a new process ID is created (verified via log messages in onCreate() in my application instance.)</p><p>The odd thing is that when it is relaunched from history, my shared preferences where I store important state are no longer available and all requests to context.getSharedPreferences(PREFS_FILE, Mode.WORLD_PRIVATE).getString() return NULL which ultimately leads to a force-close.</p><p>After re-launching the app again, everything works as expected and the sharedPreferences are again available.</p><p>I've only noticed this on the Samsung Galaxy S after he upgraded to 2.2.1.</p><p>The odd thing I'm curious about is the fact that it appears a new process is launched when returning to the app.</p><p>Has anyone else seen this behavior?  Perhaps I'm doing something wrong?</p><p>I've read a little about task re-parenting, etc, from <a href=""http://developer.android.com/guide/topics/manifest/activity-element.html#proc"" rel=""nofollow"">http://developer.android.com/guide/topics/manifest/activity-element.html#proc</a>, but not sure any options would really help here?</p>","7888","","","","","2011-03-23 14:09:01","Can't retrieve sharedPreference when activity is resumed from history on Samsung Galaxy S 2.2.1","<android>","2","2","2","",""
"4804460","1","4806120","","2011-01-26 12:18:01","1","2141","<p>Currently, I am trying to develop an Android application. Application reads Location data from <code>GPS</code> first(thru <code>onLocationUpdates(GPS_PROVIDER, 0, 0 , Listener)</code> and if <code>GPS</code> is not able to retrieve data in specific time ( in my case 5 sec ),it again asks to <code>Network provider</code> ( thru <code>onLocationUpdates(NETWORK_PROVIDER,0,0, Listener)</code> ). </p><p>In my program I have handled this task as follows.</p><pre><code>mWorker = new WorkerThread();mWorker.start(); //  Thread creation and Calling run() Method class WorkerThread extends Thread{      public void run() {   try {    if(isGPSEnabled){    //Call GPS_PROVIDER for Location updates, //Will get location value in Location Change Listener requestLocationUpdates(GPS_PROVIDER,0,0,Listener);Log.d(TAG,""GPS Listener is  registered and thread is going for Sleep"");Thread.sleep(THREAD_SLEEP_TIME);}else if (isNetworkEnbles){// if  GPS_PROVIDER is not available, will call to NETWORK_PROVIDER // Will get location value to OnLocationChangeListener requestLocationUpdates(NETWORK_PROVIDER,0,0,listener); Log.d(TAG,""NETWORK Listener is  registered and thread is going for Sleep"");Thread.sleep(THREAD_SLEEP_TIME);}} catch ( InterruptedException e ){    // Thread is interrupted on OnLocationChange Listener  // Thread has been Interrupted, It means.. data is available thru Listener.}// Thread had sleep for THREAD_SLEEP_TIME , but Still data is not availableIf (GPS or Network data isnt available thru GPS listener or Network Listener ) {   // Do try for one more time.}}</code></pre><p>Now My OnLocationChanged Listener code as Follows:</p><pre><code>public void onLocationChanged(Location location) { // Listener got location // First Intrupt the sleeping ThreadmWorker.interrupt();if ( loc != null ){  //get Location}}</code></pre><p>Now  <strong>my problem is</strong> , when I run this code , Worker Thread never calls <code>OnLocationChanged</code> Listener.</p><p>I have inserted  <code>looper.Loop()</code> in worker thread , <code>OnLocationChanged</code> is called. But it runs continuously and <code>looper</code> not get stop. How should I stop <code>looper.loop()</code>? </p><p>Is there any <strong><em>other</em></strong> way  thru which I can manage  my above task except <code>workerThread.</code>If you need more clarification, just let me know.</p>","517752","","","","","2011-01-26 15:11:06","how to stop looper.loop() in Android Multithreading program?","<android><multithreading><gps>","1","1","","",""
"4804485","1","5687144","","2011-01-26 12:21:22","1","4123","<p>Would anyone know how to configure the emulator to make ssl connections via a proxy ?</p><p>I use the -http-proxy when starting the emulator. I can access any website except those with https protocol.</p><p>Any idea ?</p><p>Thanks</p>","569558","","","","","2012-06-20 19:22:42","Proxy and SSL connections in android emulator","<android><ssl><proxy><emulator>","2","0","","",""
"4804493","1","4804547","","2011-01-26 12:22:33","2","5489","<p>I have Edit Text field where I have to input a password, but I have to push this field. How to automatically pop-up keyboard without touching the Edit Text?</p><p>There is an Edit text xml field:</p><pre><code>&lt;EditTextandroid:id=""@+id/editPasswd""android:focusable=""true""android:focusableInTouchMode=""true""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:inputType=""phone""android:password=""true""/&gt;</code></pre>","572853","","19068","","2011-01-26 12:23:48","2013-07-01 12:58:03","How to automatically pop-up keyboard?","<android><xml><keyboard>","3","0","","",""
"4804666","1","4804711","","2011-01-26 12:40:51","0","365","<p>I'm using a ViewFlipper to flip between three Views with a simple animation. This animation persists for about 1 minute before complete and this is the point.The code immediately below the showNext() called to start flipping the views is reached BEFORE the animation end producing an ugly effect.</p><p>Is it possible to call a synchronous showNext() that doesn't returns until animation completes?Otherwise, is it possible to register a Listner for an ipotetic <em>OnAnimationComplete</em> event?</p><p>Thanks you in advance</p>","520032","","30618","","2011-01-26 12:55:31","2011-01-26 12:55:31","Synchronous view flipping","<android><animation><synchronous><viewflipper>","1","0","","",""
"4804685","1","4804740","","2011-01-26 12:41:50","3","107","<p>I'm getting ready to start my first app, and I wanted to grab some data from exposed webservices at data.gov.  However, it seems that all the web services they offer are SOAP based.  </p><p>I cruised <a href=""http://stackoverflow.com/questions/297586/how-to-call-web-service-with-android"">this</a> question and I don't want to use ksoap2 if the overall community isn't happy with it.  That question is also almost 2 years old, and something might exist now that I didn't find via google.  (which is only ksoap2).</p>","557153","","","","","2011-01-26 12:59:29","Android and data.gov","<java><android><soap>","1","0","","",""
"4804730","1","","","2011-01-26 12:47:24","0","1787","<p>Is it ok to update the UI of the activity in the onResume method? For example, to update the cursor adapter of a listview with a new cursor.</p><p>In my application I have an activity A and another one B. The UI, for both activities contains listviews with cursor adapters that depend on a common string list. I have buttons to navigate from A to B and also from B to A. The problem is, that if I go from A to B, and then, in the B activity I change the string list data and by that the UI data configuration, if I press BACK, I will go to A again, but the listview will not be updated according to the changes made in B. </p><p>Is using the onResume method in this manner a good practice, or is there a better solution?</p><p>Thanks a lot,</p><p>Gratzi</p>","460611","","","","","2012-03-22 06:13:16","Updating the UI in onResume","<android>","3","1","","",""
"4804798","1","","","2011-01-26 12:56:35","3","16771","<p>I need to create a small text area.Within that text area when i double click,it will move to next activity.How could i do this?</p>","555948","","","","","2013-10-28 08:13:57","DoubleTap in android","<android>","7","1","2","",""
"4804909","1","","","2011-01-26 13:09:14","0","978","<p>I am writing this code and getting error: </p><blockquote>  <p>""Sorry! The Application  Android_Name(process com.pckge) has  stopped unexpectedly. Please try  again. Force Close""</p></blockquote><p>What's the mistake?</p><pre><code>package com.pckge;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import java.util.Date;public class Now extends Activity implements View.OnClickListener {    Button btn;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);       btn.setOnClickListener(this);            updateTime();        setContentView(btn);    }    @Override    public void onClick(View view) {        updateTime();        // TODO Auto-generated method stub    }    private void updateTime() {        btn.setText(new Date().toString());        // TODO Auto-generated method stub    }}</code></pre>","576792","","546999","","2011-01-26 13:20:04","2011-01-26 13:20:04","I am getting error ""Sorry! The Application Android_Name(process com.pckge) has stopped unexpectedly. Please try again."" Force Close?","<android><eclipse>","2","1","","",""
"4805261","1","4805612","","2011-01-26 13:49:38","4","17507","<p>I'm new to Android and I'm working through a tutorial on programmatically creating a layout instead of doing it through the xml, I'm sorta stuck can someone advise please. </p><p>So I have a ScrollView then have added a LinearLayout into it, I want both to be a specific size - 480 x 800 (code below). I was able to set the size in the LinearLayout but I cannot get the ScrollView to also be that size but I can't find how to do it. </p><p>Is this possible, and can I therefore just specify the ScrollView dimensions and get the subsequent views to inherit that.</p><pre><code>ScrollView home_scroll = new ScrollView(this);LinearLayout home_linear = new LinearLayout(this);home_linear.setOrientation(LinearLayout.VERTICAL);home_scroll.addView(home_linear, new LinearLayout.LayoutParams(480, 800));</code></pre><p>Any help would be greatly appreciated, thanks.</p>","590672","","48503","","2011-12-09 23:55:14","2013-12-05 12:41:50","Android - Programmatically specify height and width of new ScrollView","<android><scrollview><dimensions>","3","0","2","",""
"4805269","1","4806091","","2011-01-26 13:50:27","38","51813","<p>I'd like to know what is the best practice/way of programmatically register a broadcast receiver. I want to register specific receivers according to user choice.As the registration is done through the manifest file, I'm wondering if there's a proper way to achieve this in code.</p><p>Thank you</p><p>KrMiloud B.</p>","429059","","","","","2014-01-16 08:27:15","Programmatically register a broadcast receiver","<android><broadcastreceiver>","7","0","22","",""
"4805348","1","4805405","","2011-01-26 13:58:35","3","1392","<p>I would like to retrieve a Webpage thumbnail by URL programmatically.</p><p>Done some searching and came up with several solutions:</p><ol><li>using Swing (JEditorPane) - but as I understand &amp; correct me if I'm wrong, it's not possible to use swing with Android app.</li><li>using a third party site with api services, like thumbalizr.com - prefer not to use that as it watermarks the thumbnail unless I pay (my app is free).</li><li>Don't know if it's possible but maybe use the android browser function for that? maybe go to the URL in hidden way while activity shows only a progress bar? :)</li></ol><p>Can anyone maybe offer something that works? maybe something more native?</p><p>Appreciate any direction!</p>","444324","","","","","2011-12-26 03:33:18","Android: retrieve Webpage thumbnail by URL programmatically","<android>","2","0","1","",""
"4805556","1","","","2011-01-26 14:20:49","0","2730","<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 to detect that a phone is rooted? I have an idea to check by writing a file at root of Android OS but there are some software that if installed can hide a rooted phone.</p><p>For reference, <a href=""http://developer.android.com/reference/android/content/Context.html"" rel=""nofollow""><code>Context#checkPermission()</code></a></p>","185022","","1267661","","2012-10-15 23:26:53","2012-10-15 23:26:53","How to detect if a phone is rooted?","<android><rooted-device>","0","1","","2012-10-16 01:52:42",""
"4805616","1","4806050","","2011-01-26 14:26:11","1","1034","<p>I'm building a Android application, and it's designed for Galaxy Tab, by specs, the screen size is 1024x600, but if I try to add my component in this size, the left and bottom are cut off.</p><p>I added the following code to see the difference</p><pre><code>  WindowManager mWMgr = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE);  int width = mWMgr.getDefaultDisplay().getWidth();  int height = mWMgr.getDefaultDisplay().getHeight();  Toast.makeText(getApplicationContext(),    ""[system][w="" + width + "":h="" + height + ""]"", Toast.LENGTH_LONG).show();  width = getWindowManager().getDefaultDisplay().getWidth();  height = getWindowManager().getDefaultDisplay().getHeight();  Toast.makeText(getApplicationContext(),    ""[this][w="" + width + "":h="" + height + ""]"", Toast.LENGTH_LONG).show();</code></pre><p>When running, this shows:[system][w=600:h=1024][this][w=400:h=683]</p><p>Why it happens?</p><p>If needed I add my code to put the components on screen.</p><p>This is my 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=""match_parent""    android:layout_height=""match_parent""&gt;    &lt;ImageView android:id=""@+id/image01"" android:layout_width=""match_parent""        android:layout_height=""match_parent"" android:scaleType=""fitXY"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>In this case, the image I draw on the ImageView get scaled to the screen size (400x683)</p><p>I tested with:</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=""600px""    android:layout_height=""1024px""&gt;    &lt;ImageView android:id=""@+id/image01"" android:layout_width=""match_parent""        android:layout_height=""match_parent"" android:scaleType=""fitXY"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>And by this way, the left and bottom of the image is cut off the screen.</p>","558433","","558433","","2011-01-26 16:04:55","2011-01-26 16:04:55","Application do not fit all the display size","<java><android><tablet>","3","0","","",""
"4805723","1","4805867","","2011-01-26 14:35:57","1","449","<p>Is there anyway to rename a database of a published android app? I am working something out to just change the database name and onCreate of that database, check for the old database and copy the contents out, but wondering if thats my only recourse.</p>","415422","","","","","2011-02-10 11:33:36","Any way to rename a database of a published app?","<android><database>","2","0","1","",""
"4805845","1","4805906","","2011-01-26 14:46:48","4","6355","<p>I have a <code>ListActivity</code> which shows list of items. I prepared another <code>layout</code> for detailed view that contains items' name, address, phone number and image. I want to show these items detailed in a popup window if one is clicked without closing my <code>ListActivity</code>.</p><p>How can i do that?  </p>","590757","","119895","","2011-01-26 14:51:12","2011-01-26 14:51:12","How to open an activity in a popup window?","<android><layout><activity>","3","0","2","",""
"4805896","1","13414112","","2011-01-26 14:50:12","23","10642","<p>I've an android application with preferences declared in XML, loaded with <code>addPreferencesFromResource</code>. The user can open preferences, click on each item and edit them, all works.</p><p>One preference I have is:</p><pre><code>        &lt;ListPreference android:key=""abc""            android:title=""@string/abc""            android:summary=""@string/cde""            android:persistent=""true""/&gt;</code></pre><p>How can I show the preference dialog to a user automatically (without the need for the user to go to the preference screen and click on it?).</p><p>I tried <code>( (android.preference.DialogPreference) prefMgr.findPreference( ""abc"" )).showDialog(null)</code>, but is says it is a protected method...? Called it from my main activity (which is a <code>PreferenceActivity</code>), that's why it obviously cannot work. But how else?</p><p>EDIT</p><p>I just found two threads (<a href=""https://groups.google.com/group/android-developers/browse_thread/thread/3b38965a44525190"">1</a>, and <a href=""https://groups.google.com/group/android-developers/browse_thread/thread/6ee893906962e821"">2</a>) with the idea to use <code>findViewById</code> to access the preference, but with no success. It always returns <em>null</em> (does for me, too).</p><p>It looks like there is really no possibility to do this from code.</p>","590761","","1136195","","2012-08-21 07:56:42","2014-02-01 13:11:25","How to open or simulate a click on an android Preference, created with XML, programatically?","<android><android-preferences>","6","4","11","",""
"4806015","1","4807182","","2011-01-26 15:01:09","1","624","<p>I'm using the following code...</p><pre><code> var result = document.evaluate(expr,context,null,9,null);</code></pre><p>When printing the result I get the following error...</p><pre><code>Error: TYPE_ERR: DOM XPath Exception 52</code></pre><p>This appears to be an issue with webkit in general as evident from the following issue...</p><p><a href=""http://code.google.com/p/chromium/issues/detail?id=68770"" rel=""nofollow"">http://code.google.com/p/chromium/issues/detail?id=68770</a></p><p>I'm wondering, does anyone know of a workaround way I can make this work? The work around need only suit just webkit. It does not needed to work in Firefox, IE, etc.</p><p><strong>NOTE:</strong> I myself am working with Google Chrome but I've included the other popular applications which use webkit since this issue is relevant to them too.</p><p><strong>EDIT:</strong> Same result when I call <code>screenshotLength()</code> on <code>result</code>.</p><p><strong>EDIT 2</strong></p><pre><code>var result = document.evaluate(expr,context,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;</code></pre><p>Appears to produce <code>undefined</code></p>","358438","","358438","","2011-01-26 15:33:22","2011-01-26 16:39:48","webkit problem printing XPathResults, need workaround","<android><safari><webkit><google-chrome-extension><xpath>","1","0","","",""
"4806061","1","4833271","","2011-01-26 15:05:44","10","6474","<p>I have a MapView in an activity and it works fine, the map shows, and it responds to taps, and I can extract the location easily. However this handler is also responding to the pinch-zoom, so if a user tries to pinch-zoom, the app responds as if they tapped (and it's very confusing for them).</p><p>How can I respond to taps on a MapView and only pick up single-taps, specifically ignoring pinch-zoom and double-taps?</p><p>Do I need to use OnTouchEvent() instead of OnTap()? If so how do I distinguish between the different touch events, and how do I access the GeoPoint?</p><p>Here's the code from inside my MapActivity:</p><pre><code>class MapOverlay extends com.google.android.maps.Overlay{    @Override    public boolean onTap(GeoPoint p, MapView map)    {        if ( p!=null )        {            // Do stuff with the geopoint            return true;                                 // We handled the tap        }        else        {            return false;                                // We didn't handle the tap        }    }}</code></pre>","477415","","","","","2012-01-22 10:56:05","How do I respond to a tap on an Android MapView, but ignore pinch-zoom?","<android>","1","3","9","",""
"4806071","1","4885023","","2011-01-26 15:06:31","8","13339","<p>I am trying to make ndk-build to work within Cygwin on windows. As per the NDK documentation (specifically INSTALL.htm), <em>""The NDK requires GNU Make 3.81 or later being available on your development.""</em></p><p>I have Gnu Make installed on my computer.</p><p>So far, so good.</p><p>Within Cygwin bash, I cd over to the android NDK root directory. Now when I type in the following command (without parameters right now, just to see if the command works):</p><p><em>$./ndk-build</em><br><strong>ERROR: Cannot find 'make' program. Please install Cygwin make package or define the GNUMAKE variable to point to it.</strong></p><p>So I try to set the GNUMAKE variable, but no luck:</p><p><em>$export GNUMAKE='/cygdrive/c\Program Files\GnuWin32\bin'</em><br><strong>ERROR: Your GNUMAKE variable is defined to an invalid name: /cygdrive/c\Program Files\GnuWin32\binPlease fix it to point to a valid make executable (e.g. usr/bin/make)</strong></p><p>I even tried setting it to usr/bin/make as it suggests, but same invalid name error.</p><p>Anyone, knows how to resolve this?</p><p>I'm using Windows 7, NDK r5, Cygwin 1.7.1</p>","289918","","1446598","","2012-11-30 09:31:51","2013-07-29 06:28:19","How to set GNUMAKE variable for ndk-build to work","<android><android-ndk><make><cygwin><gnu-make>","7","0","4","",""
"4806181","1","4806509","","2011-01-26 15:16:03","8","12377","<p>I'm looking to create a sqlite database on the sd card (don't want to use up the user's internal storage). I'm familiar with the OpenHelper pattern:</p><pre><code>public DatabaseFoo(Context context) {    OpenHelper openHelper = new OpenHelper(context);    mDb = openHelper.getWritableDatabase();}private static class OpenHelper extends SQLiteOpenHelper {    public OpenHelper(Context context) {        super(context, DATABASE_NAME, null, DATABASE_VERSION);    }    ...</code></pre><p>so if we want to create on the sd card, I think instead we have to use:</p><pre><code>public static SQLiteDatabase openOrCreateDatabase (String path,       SQLiteDatabase.CursorFactory factory);</code></pre><p>But what is the ""factory"" argument supposed to be, what factory should be used?</p><p>Also a bit worried about what happens if the user removes the SD card while my app is in use..</p><p>Thanks</p>","291701","","1765573","","2013-07-26 13:55:33","2013-07-26 13:55:33","SQLite database on SD card","<android><sqlite><android-sdcard>","5","0","1","",""
"4806231","1","","","2011-01-26 15:20:17","1","424","<p>I have a problem with the android API: if I look at the android API documentation, the method isUP() of the class NetworkInterface exists, but when I try to use it in a code, I can not compile my application. By looking in the android referenced library, I realized that this method is not present in the class.</p><p>I precise that I work with Android 2.2 and eclipse Helios.This is my code:</p><hr><pre><code>import java.net.NetworkInterface;import java.net.SocketException;import android.app.Activity;import android.os.Bundle;public class startEssai extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        try {   NetworkInterface n = NetworkInterface.getNetworkInterfaces().nextElement();   n.isUp();  } catch (SocketException e) {   // TODO Auto-generated catch block   e.printStackTrace();  }    }}</code></pre><hr><p>Can somebody help me? Maybe the referenced library is the wrong?</p><p>Thanks in advance.Sandrine Beauche.</p>","590821","","419075","","2011-01-26 15:24:52","2011-01-26 15:28:44","Android method NetworkInterface.isUp() not found","<android><api>","2","0","","",""
"4806420","1","","","2011-01-26 15:36:09","0","692","<p>I want to allow the user to enter only certain characters to an EditText on a galaxy tab (Android 2.2) but block all other characters. An OnKeyListener seems not to react to the software keyboard.</p><p>PS: I dont want to block entire ranges of characters, like all digits or all special chars and so on. Let's say just the character 't'.</p><p>Please help. After an hour I couldn't find a solution.</p>","1854856","","","","","2011-01-26 16:56:01","Android: Blocking keys from virtual keyboard","<java><android>","2","0","","",""
"4806423","1","4806788","","2011-01-26 15:36:26","0","765","<p>Below is my code example: I inflated a view and want to add animation to only the inflated one. Right now its doing for the entire layout.</p><pre><code>    LinearLayout lLay = (LinearLayout)this.findViewById(R.id.FirstContact);    AnimationSet set = new AnimationSet(true);    Animation animation = new AlphaAnimation(0.0f, 1.0f);    animation.setDuration(50);    set.addAnimation(animation);    animation = new TranslateAnimation(        Animation.RELATIVE_TO_SELF, 0.0f,Animation.RELATIVE_TO_SELF, 0.0f,        Animation.RELATIVE_TO_SELF, -1.0f,Animation.RELATIVE_TO_SELF, 0.0f    );    animation.setDuration(500);    set.addAnimation(animation);    LayoutAnimationController controller = new LayoutAnimationController(set, 0.5f);    LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);                lLay.addView(inflater.inflate(R.layout.genericrelativelayout, null, false), position);                lLay.setLayoutAnimation(controller);</code></pre>","484691","","","","","2011-01-26 16:07:22","Can we apply animation to a specific child and not the entire root in android","<android><animation><inflate>","1","0","1","",""
"4806424","1","4826384","","2011-01-26 15:36:27","1","1640","<p>This is my textview. It has also an image selector as on its top.</p><pre><code>    &lt;TextView        android:id=""@+id/icon_live_ticker""         android:layout_width=""100dp""        android:layout_height=""wrap_content""        android:drawableTop=""@drawable/selector_live_ticker""         android:gravity=""center""         android:textAppearance=""?android:attr/textAppearanceMedium""         android:textStyle=""bold""                     android:textSize=""10dp""        android:text=""@string/text_icon_live_ticker""&gt;    &lt;/TextView&gt; </code></pre><p>The problem is, that if I set textColor, there are no state changes of the image selector to see anymore.</p><p>Can anybody explain why does it happen?</p>","408780","","","","","2011-01-28 08:51:42","TextView with drawableTop and textcolor","<android><textview>","1","0","","",""
"4806432","1","4806495","","2011-01-26 15:37:22","0","260","<p>I tried to follow Android Developer instructions to develop on my device (http://developer.android.com/guide/developing/device.html)</p><p>In bulletin 3, (Windows USB Driver) I downloaded the driver and theWindows Add New Hardware Wizard couldn't find the driver in the downloaded file.</p><p>what should I do? is it a configuration issue with my machine? how else can I install the driver? </p><p>Thanks !!!</p>","590841","","","","","2011-01-26 18:24:58","How do I set Samsung Galaxy Device to run on APK?","<android><debugging><device>","2","0","","",""
"4806543","1","","","2011-01-26 15:46:57","3","1365","<p>I am working on creating an LBS location aware app for iPhone, Android, Java, and Blackberry, which does <strong>NOT</strong> rely on GPS.</p><p>I therefore need a GSM cell tower GeoLocation API to identify the phone's location. I can use 3rd party solutions such as Google's Geolocation API / Skyhook / Navizon / Xtify / etc.</p><p>From what I understand, Google's Geolocation API is free, while all the others are not free and do not have as much coverage as Google's.</p><p>Therefore the obvious solutions would be to write my mobile application using and accessing Google's Geolocation API.</p><p>The dilemma seems too simple and if it is too good to be true, it usually is.</p><p>What am I missing...??</p><p>Many thanx</p>","292351","","292351","","2011-01-26 18:10:30","2013-11-29 13:35:12","Non GPS GeoLocation API - Google Vs. others (Skyhook / Navizon / Xtify / etc)","<java><iphone><android><geolocation><location>","1","1","1","",""
"4806596","1","4809355","","2011-01-26 15:50:54","1","746","<p>In the Google Maps JavaScript API V2 there is a constant named:G_PHYSICAL_MAP. It is a map type which displays maps with physicalfeatures such as terrain and vegetation.I'm looking for something similar in the Google Maps API for Android.ThanksJosé</p>","556057","","","","","2011-01-26 19:57:42","How to show a physical (relief) map with the Google Maps API for Android?","<android><google-maps><maps>","1","0","","",""
"4806664","1","","","2011-01-26 15:56:59","1","1416","<p>:(Please help me, I get this error whenever I am trying to call a Camera Activity. Well, you see, I'm trying to combine my friend's activity with my activity. But when I try to call his activity, it just Force Closes. :( </p><p>I know there is nothing wrong with his code, I mean, he ran it as a different project and it worked as expected. I have copied and pasted his activity,xml and everything so it should be fine right? All I had to do was call his activity. I've also added the said activity to the manifest. But still nothing, I've been trying to debug this bizarre behavior for three days and it's bothering me too much. </p><p>Here are the contents of my logcat:</p><pre><code>01-26 14:54:15.528: WARN/ActivityManager(60): Activity pause timeout for HistoryRecord{43ffc1c8 bukojuice.kiss.ass.bukojuice/.CameraActivity}01-26 14:54:19.598: INFO/Process(743): Sending signal. PID: 743 SIG: 901-26 14:54:19.638: INFO/ActivityManager(60): Process bukojuice.kiss.ass.bukojuice (pid 743) has died.01-26 14:54:19.638: INFO/WindowManager(60): WIN DEATH: Window{4406b0f0 bukojuice.kiss.ass.bukojuice/bukojuice.kiss.ass.bukojuice.profileCreator paused=true}01-26 14:54:19.658: INFO/WindowManager(60): WIN DEATH: Window{43f151e8 bukojuice.kiss.ass.bukojuice/bukojuice.kiss.ass.bukojuice.CameraActivity paused=false}01-26 14:54:19.658: INFO/WindowManager(60): WIN DEATH: Window{43f98ed8 SurfaceView paused=false}01-26 14:54:19.678: INFO/ActivityManager(60): Displayed activity bukojuice.kiss.ass.bukojuice/.CameraActivity: 5210 ms (total 5210 ms)01-26 14:54:19.758: WARN/InputManagerService(60): Got RemoteException sending setActive(false) notification to pid 743 uid 1003901-26 14:54:24.778: DEBUG/dalvikvm(237): GC_EXPLICIT freed 174 objects / 10880 bytes in 90ms01-26 14:54:26.016: WARN/ActivityManager(60): Activity destroy timeout for HistoryRecord{43febbc8 bukojuice.kiss.ass.bukojuice/.profileCreator}01-26 14:54:26.029: WARN/ActivityManager(60): Activity destroy timeout for HistoryRecord{43ffc1c8 bukojuice.kiss.ass.bukojuice/.CameraActivity}</code></pre><p>I hope someone can help me. It will be greatly appreciated.</p>","588051","","","","","2011-01-26 15:56:59","WARN/InputManagerService(60): Got RemoteException sending setActive(false) notification to pid 743","<android><activity><camera><ddms>","0","3","1","",""
"4806883","1","4806952","","2011-01-26 16:14:58","10","12833","<p>Sorry, I'm a beginner programmer, and I'm learning only now the Android Java specific language. I have a book, from I want to learn, but I don't have a raw folder when I make a new project. How can I make it? Or I deleted it before? I don't know, because I'm only try to discover the Eclipse IDE, and I made some mistakes. :) </p><p>Thanks!</p>","590898","","321697","","2011-01-26 16:24:44","2011-01-26 16:24:44","I don't have a raw folder in Eclipse, after making a new Android file project. What can I do?","<android><eclipse>","2","1","2","",""
"4806987","1","4991119","","2011-01-26 16:23:11","1","1382","<p>I have a SyncAdapter and contact syncing works fine. Only i want a nice badge added to the QuickContactBadge in the contact application. How can i get this to work?</p>","473358","","","","","2012-02-23 16:10:59","Add badge and intent to QuickContactBadge with SyncAdapter","<android><sync><contact><badge>","1","0","0","",""
"4807131","1","4807917","","2011-01-26 16:34:52","17","11868","<p>What's the best way to go to a new activity but make it look like the activity slides to the left and the new activity enters the screen? I am using intents to call the new activity, is that the way to do it if I want the application to be lightweight?</p><p>To explain a bit better: on my Android phone I can swipe the view with the home meny to the right and then enters a friend stream from the left and takes place on the screen. I want to do it in my app with buttonclicks, it's the ""sliding"" i am after. THanks!</p>","455479","","","","","2014-03-21 17:47:56","New Activity in Android ""enter from the side""","<android><gui><activity><screen><android-sliding>","4","0","9","",""
"4807154","1","15469584","","2011-01-26 16:36:42","1","5118","<p>I have an HTC EVO and I can be sitting around doing nothing, when all of a sudden the screen comes on and stays on. I try to turn it off, but it keeps turning back on - sometimes after a second, sometimes after a few minutes. If I just leave it, it will not turn off by itself, as it would if I manually turned it on but didn't enter the password. This is killing my already horrendous battery life!</p><p>I have killed almost all background processes except some of the ones by HTC that looked important.</p><p>I have also turned off application refresh, wifi, blue tooth, tried rebooting ... even put it into Airplane mode. Arghhh! Nothing helps!</p><p>I thought I hit pay dirt last week - I replaced the factory 1500mAh battery with a 3500mAh for obvious reasons. For a few days the auto-turn-on seemed to be cured but now it has started happening again.</p><p>Any ideas how I can get this paper weight to be more obedient?</p><p>Thanks, Victor</p>","522729","","","","","2013-12-07 01:20:24","Why does my EVO Android phone screen keep turning on?","<android><htc>","2","6","","",""
"4807232","1","4810000","","2011-01-26 16:43:29","0","221","<p>I'm making an app that sends a notification to the status bar, it sends the notification when stepping through the code in the debugger, however it never sends the notification when run in realtime.</p><p>Here is my runnable that generates the notification, again when stepping through this code in the debugger the notification runs however in realtime nothing happens.</p><pre><code>public class NewsEvents_Service extends Service {    private static final String NEWSEVENTS = ""newsevents"";    private static final String KEYWORDS = ""keywords"";    private NotificationManager mNM;    private ArrayList&lt;NewsEvent&gt; neList;    private int count;    @Override    public void onCreate() {        mNM = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);        neList = new ArrayList&lt;NewsEvent&gt;();        getKeywords();        //getNewsEvents();        Thread thr = new Thread(null, mTask, ""NewsEvents_Service"");        thr.start();        Log.d(""Thread"", ""IT STARTED!!!!!!????!!!!!!!!!!!!!!!?!!?"");    }    @Override    public void onDestroy() {        // Cancel the notification -- we use the same ID that we had used to start it    mNM.cancel(R.string.ECS);        // Tell the user we stopped.        Toast.makeText(this, ""Service Done"", Toast.LENGTH_SHORT).show();    }    /**     * The function that runs in our worker thread     */    Runnable mTask = new Runnable() {        public void run() {        getNewsEventsFromWeb();    for(NewsEvent ne : neList){            Log.d(""Thread Running"", ""Service Code running!!!!!!!!!!!!!!!"");            String body = ne.getBody().replaceAll(""\\&lt;.*?&gt;"", """");            String title = ne.getTitle();            for(String s : keyWordList){                if(body.contains(s) || body.contains(s.toLowerCase()) ||                    title.contains(s) || title.contains(s.toLowerCase())){                ne.setInterested(true);                }            }            if(ne.isInterested() == true ){                    Notification note = new Notification(R.drawable.icon,                        ""New ECS News Event"", System.currentTimeMillis());                    Intent i = new Intent(NewsEvents_Service.this, FullNewsEvent.class);                    i.putExtra(""ne"", ne);                    PendingIntent pi = PendingIntent.getActivity(NewsEvents_Service.this, 0,                        i, 0);                    note.setLatestEventInfo(NewsEvents_Service.this, ""New Event"", ne.getTitle(), pi);                    note.flags = Notification.FLAG_AUTO_CANCEL;                    mNM.notify(R.string.ECS, note);            }        }        }    };    @Override    public IBinder onBind(Intent intent) {        return mBinder;    }    /**     * Show a notification while this service is running.     */    private void getNewsEventsFromWeb() {    HttpClient client = new DefaultHttpClient();    HttpGet get;        try {                get = new HttpGet(getString(R.string.jsonnewsevents));            ResponseHandler&lt;String&gt; response = new BasicResponseHandler();            String responseBody = client.execute(get, response);            String page = responseBody;            Bundle data = new Bundle();                     data.putString(""page"",page);            Message msg = new Message();            msg.setData(data);            handler.sendMessage(msg);        }        catch (Throwable t) {            Log.d(""UpdateNews"", ""PROBLEMS"");        }    }    private Handler handler = new Handler(){        @Override        public void handleMessage(Message msg) {            String page = msg.getData().getString(""page"");            try {                 JSONArray parseArray = new JSONArray(page);                 for (int i = 0; i &lt; parseArray.length(); i++) {                     JSONObject jo = parseArray.getJSONObject(i);                     String title = jo.getString(""title"");                     String body =jo.getString(""body"");                   String pd = jo.getString(""postDate"");                     String id = jo.getString(""id"");                   NewsEvent ne = new NewsEvent(title, pd , body, id);                   boolean unique = true;                   for(NewsEvent ne0 : neList){                   if(ne.getId().equals(ne0.getId())){                      unique = false;                   }else{                       unique = true;                   }                   }                   if(unique == true){                   neList.add(ne);                   }               }                } catch (JSONException e) {                 // TODO Auto-generated catch block                 e.printStackTrace();                }        }    };    private ArrayList&lt;String&gt; keyWordList;    public void getNewsEvents(){    try {        InputStream fi = openFileInput(NEWSEVENTS);        if (fi!=null) {            ObjectInputStream in = new ObjectInputStream(fi);                    neList = (ArrayList&lt;NewsEvent&gt;) in.readObject();                    in.close();        }    }    catch (java.io.FileNotFoundException e) {        // that's OK, we probably haven't created it yet    }    catch (Throwable t) {        Toast            .makeText(this, ""Exception: ""+t.toString(), Toast.LENGTH_LONG)            .show();    }    if(neList == null){        neList = new ArrayList&lt;NewsEvent&gt;();    }    }    public ArrayList&lt;String&gt; getKeywords(){    try {        InputStream fi = openFileInput(KEYWORDS);        if (fi!=null) {            ObjectInputStream in = new ObjectInputStream(fi);                    keyWordList = (ArrayList&lt;String&gt;) in.readObject();                    in.close();        }    }    catch (java.io.FileNotFoundException e) {        // that's OK, we probably haven't created it yet    }    catch (Throwable t) {        Toast            .makeText(this, ""Exception: ""+t.toString(), Toast.LENGTH_LONG)            .show();    }    if(keyWordList == null){        keyWordList = new ArrayList&lt;String&gt;();        return keyWordList;    }    return keyWordList;    }    /**     * This is the object that receives interactions from clients.  See RemoteService     * for a more complete example.     */    private final IBinder mBinder = new Binder() {        @Override        protected boolean onTransact(int code, Parcel data, Parcel reply,                        int flags) throws RemoteException {            return super.onTransact(code, data, reply, flags);        }    };}</code></pre><p>Here is my activity that schedules the service to run</p><pre><code>public class NewsEvents extends ListActivity{    private URL JSONNewsEvents;    private ArrayList&lt;NewsEvent&gt; neList;    private ArrayList&lt;String&gt; keyWordList;    private Worker worker;    private NewsEvents ne;    public static final String KEYWORDS = ""keywords"";    private static final String NEWSEVENTS = ""newsevents"";    public static final int ONE_ID = Menu.FIRST+1;    private PendingIntent newsAlarm;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.newsevents);        ne = this;        neList = new ArrayList&lt;NewsEvent&gt;();        try {        JSONNewsEvents = new URL(getString(R.string.jsonnewsevents));    } catch (MalformedURLException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }        worker = new Worker(handler, this);        setListAdapter(new IconicAdapter());        getKeywords();         worker.execute(JSONNewsEvents);    }        @Override    protected void onStop() {        super.onStop();        writeNewsEvents() ;    }        @Override    protected void onPause(){        super.onPause();        writeNewsEvents();      }    private void writeNewsEvents() {    try {        OutputStream fi = openFileOutput(NEWSEVENTS, 0);        if (fi!=null) {            ObjectOutputStream out = new ObjectOutputStream(fi);            out.writeObject(neList);            out.close();        }    }    catch (java.io.FileNotFoundException e) {        // that's OK, we probably haven't created it yet    }    catch (Throwable t) {        Toast            .makeText(this, ""Exception: ""+t.toString(), Toast.LENGTH_LONG)            .show();    }    }    /**     * @return     */    public ArrayList&lt;String&gt; getKeywords(){    try {        InputStream fi = openFileInput(KEYWORDS);        if (fi!=null) {            ObjectInputStream in = new ObjectInputStream(fi);                    keyWordList = (ArrayList&lt;String&gt;) in.readObject();                    in.close();        }    }    catch (java.io.FileNotFoundException e) {        // that's OK, we probably haven't created it yet    }    catch (Throwable t) {        Toast            .makeText(this, ""Exception: ""+t.toString(), Toast.LENGTH_LONG)            .show();    }    if(keyWordList == null){        keyWordList = new ArrayList&lt;String&gt;();        return keyWordList;    }    return keyWordList;    }    public void onListItemClick(ListView parent, View v,        int position, long id) {    startFullNewsEvent(neList.get(position));    }    /**     * @param newsEvent     */    public void startFullNewsEvent(NewsEvent ne) {    Intent intent = new Intent(this, FullNewsEvent.class);    intent.putExtra(""ne"", ne);    this.startActivity(intent);    finish();    }    private Handler handler = new Handler(){        @Override        public void handleMessage(Message msg) {            String page = msg.getData().getString(""page"");            try {                 JSONArray parseArray = new JSONArray(page);                 for (int i = 0; i &lt; parseArray.length(); i++) {                     JSONObject jo = parseArray.getJSONObject(i);                     String title = jo.getString(""title"");                     String body =jo.getString(""body"");                   String pd = jo.getString(""postDate"");                     String id = jo.getString(""id"");                   NewsEvent ne = new NewsEvent(title, pd , body, id);                   boolean unique = true;                   for(NewsEvent ne0 : neList){                   if(ne.getId().equals(ne0.getId())){                      unique = false;                   }else{                       unique = true;                   }                   }                   if(unique == true){                   neList.add(ne);                   }               }                } catch (JSONException e) {                 // TODO Auto-generated catch block                 e.printStackTrace();                }              ne.setListAdapter(new IconicAdapter());        }    };    public class IconicAdapter extends ArrayAdapter&lt;NewsEvent&gt; {    IconicAdapter() {        super(NewsEvents.this, R.layout.rownews, neList);    }    public View getView(int position, View convertView,ViewGroup parent) {        LayoutInflater inflater=getLayoutInflater();        View row=inflater.inflate(R.layout.rownews, parent, false);        TextView label=(TextView)row.findViewById(R.id.label);        ImageView image= (ImageView)row.findViewById(R.id.icon);        String body = neList.get(position).getBody();        body.replaceAll(""\\&lt;.*?&gt;"", """");        String title = neList.get(position).getTitle();        for(String s : keyWordList){            if(body.contains(s) || body.contains(s.toLowerCase()) ||                title.contains(s) || title.contains(s.toLowerCase())){            neList.get(position).setInterested(true);            }        }        if(neList.get(position).isInterested() == true){            image.setImageResource(R.drawable.star);        }        label.setText(neList.get(position).getTitle());        return(row);    }    }    @Override    public boolean onCreateOptionsMenu(Menu menu) {        populateMenu(menu);         return(super.onCreateOptionsMenu(menu));    }@Override    public boolean onOptionsItemSelected(MenuItem item) {        return(applyMenuChoice(item) || super.onOptionsItemSelected(item));    }    //Creates our activity to menus    private void populateMenu(Menu menu) {         menu.add(Menu.NONE, ONE_ID, Menu.NONE, ""Home"");    }    private boolean applyMenuChoice(MenuItem item) {         switch (item.getItemId()) {        case ONE_ID: startHome(); return(true);        }    return(false);    }    public void startHome() {        Intent intent = new Intent(this, ECS.class);        this.startActivity(intent);        finish();    }}</code></pre>","180825","","180825","","2011-01-26 20:36:05","2011-01-26 21:03:41","When running my Android App in the Eclipse Debugger, I have a service that notifies. Outside of the debugger it does not send a notification","<android><android-service>","1","0","","",""
"4807428","1","6693475","","2011-01-26 16:59:20","8","10621","<p>I've been having this issue with initializing <code>AudioRecord</code> for Android. I searched for quite a while on the web with no success.</p><p>For the phone, I'm using a Samsung GalaxyS on SDK version 7. For the <code>AudioRecord</code> initialization, I'm using 8000 as the sample rate, MONO for channel config, 16bit for audio format, and according to the log, the minBufferSize is set to be 4160. I have added the AUDIO_RECORD permission to the manifest.</p><p>My code for the initialization is as follows:</p><pre><code>...private static int SAMPLE_RATE = 8000;private static int CHANNEL_CONFIG = AudioFormat.CHANNEL_CONFIGURATION_MONO;private static int AUDIO_FORMAT = AudioFormat.ENCODING_PCM_16BIT;// ??? Both 8Bit and Default are deemed illegal.public MicVolumeManager() {    this.bufferSize = AudioRecord.getMinBufferSize(SAMPLE_RATE,        CHANNEL_CONFIG, AUDIO_FORMAT);    PhoneDebugger.debug(""AUDIO-BUFFER-SIZE"",         Integer.toString(this.bufferSize));    this.recorder = new AudioRecord(AudioSource.MIC, SAMPLE_RATE,        CHANNEL_CONFIG, AUDIO_FORMAT, this.bufferSize);    this.audioBuffer = new byte[this.bufferSize];}...</code></pre><p>However, the object (this.recorder) failed to be initialized. The following is from the log using DDMS:</p><blockquote>  <p><strong>AUDIO-BUFFER-SIZE(3253):</strong> 4160<br>    <strong>AudioRecord(3253):</strong> set(): sampleRate 8000, channels 16, frameCount 2080<br>     <strong>AudioPolicyManager(2175):</strong> getInput() inputSource 1, samplingRate 8000, format 1, channels 10, acoustics 0<br>     <strong>AudioFlinger(2175):</strong> openInput() openInputStream returned input 0x0, SamplingRate 8000, Format 1, Channels 10, acoustics 0, status -17<br>     <strong>AudioRecord(3253):</strong> Could not get audio input for record source 1<br>     <strong>AudioRecord-JNI(3253):</strong> Error creating AudioRecord instance: initialization check failed.<br>     <strong>AudioRecord-Java(3253):</strong> [ android.media.AudioRecord ] Error code     -20 when initializing native AudioRecord object.</p></blockquote><p>Any help please? Many thanks!</p>","510421","","1534123","","2012-10-26 15:52:04","2013-07-16 18:26:31","<AudioRecord> ""Could not get audio input for record source 1""","<android><audio-recording><android-sdk-2.1><android-audiorecord>","7","0","5","",""
"4807477","1","","","2011-01-26 17:03:06","17","18254","<p>I want to build my own music player app on android and I don't want to start from scratch.</p><p>Music player from android source doesn't compile with sdk available since google hasn't included some internal apis to open source release of sdk. (This I learn from <a href=""http://forum.xda-developers.com/showthread.php?t=687317"">http://forum.xda-developers.com/showthread.php?t=687317</a>)</p><p>Can anyone suggest me any open source project useful for my purpose ?  </p>","95876","","","","","2012-07-10 20:31:29","Open source 'Android Music Player App'","<android><open-source><music-player>","2","1","14","2012-09-22 22:17:01",""
"4807523","1","","","2011-01-26 17:07:23","0","3300","<p>helloiam a novice to android app development i recently leant how to implement list activityi have a application which shows the all states of USA </p><p>now i have to add a simple search facility to this app when required state name is typed it shud display the state name and print a msg when it doesn't find suitable name!!</p><pre><code> package shashi.android.Statelist;import android.app.ListActivity;import android.os.Bundle;import android.widget.ArrayAdapter;public class Statelist extends ListActivity { String[] listofstates = {     ""Alabama: AL"",      ""Alaska: AK"",      ""Arizona: AZ"",      ""Arkansas: AR"",      ""California: CA"",      ""Colorado: CO"",      ""Connecticut: CT"",      ""Delaware: DE"",      ""Florida: FL"",      ""Georgia: GA"",      ""Hawaii: HI"",      ""Idaho: ID"",      ""Illinois: IL"",      ""Indiana: IN"",      ""Iowa: IA"",      ""Kansas: KS"",      ""Kentucky: KY"",      ""Louisiana: LA"",      ""Maine: ME"",      ""Maryland: MD"",      ""Massachusetts: MA"",      ""Michigan: MI"",      ""Minnesota: MN"",      ""Mississippi: MS"",      ""Missouri: MO"",      ""Montana: MT"",      ""Nebraska: NE"",      ""Nevada: NV"",      ""New Hampshire: NH"",      ""New Jersey: NJ"",      ""New Mexico: NM"",      ""New York: NY"",      ""North Carolina: NC"",      ""North Dakota: ND"",      ""Ohio: OH"",      ""Oklahoma: OK"",      ""Oregon: OR"",      ""Pennsylvania: PA"",      ""Rhode Island: RI"",      ""South Carolina: SC"",      ""South Dakota: SD"",      ""Tennessee: TN"",      ""Texas: TX"",      ""Utah: UT"",      ""Vermont: VT"",      ""Virginia: VA"",      ""Washington: WA"",      ""West Virginia: WV"",      ""Wisconsin: WI"",      ""Wyoming: WY"" };    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        //setContentView(R.layout.main);        setListAdapter(new ArrayAdapter&lt;String&gt;(this,           android.R.layout.simple_list_item_1, listofstates));    }}</code></pre><p>the search i need. e.g.: to retrieve the typed text and return my search response</p><p>So, basically i need just the design, not it's functionality.</p><p>Can someone tell me if i can use this bar only for my personal data, not a general search from internet or the hole phone, and i would appreciate link for a simple and clear tutorial, because i couldn't found anything concrete till now.</p><p>like only the result for finding the typed text or else printing the ""result not found"" msg</p><p>thanks in advance!!</p>","565989","","565989","","2011-01-27 16:37:02","2011-01-27 16:37:02","add search for list on android!","<android><search><listview><listactivity>","2","1","0","",""
"4807634","1","4807777","","2011-01-26 17:18:01","21","6351","<p>I used:</p><pre><code>getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);</code></pre><p>How do I resume to Default state (no-keep-on)?</p>","380490","","39709","","2011-09-10 14:17:53","2013-04-05 08:42:51","Disable keep screen on","<android><flags>","2","1","4","",""
"4807704","1","4879972","","2011-01-26 17:24:44","0","2683","<p>I want to know if Android 2.3 Gingerbread and the Nexus S phone supports reading/writing ISO 15693 RFID chips? As of now, I know it can READ ISO 14443...</p><p>Does anyone know?!</p><p>Thanks,</p><p>Juan</p>","591009","","","","","2013-07-14 12:37:08","Android 2.3 and ISO 15693","<android><nfc><nexus-s><mifare>","5","0","","",""
"4807770","1","4808390","","2011-01-26 17:29:48","0","120","<p>I have a tierview that uses a shape xml file for the background.</p><pre><code>Drawable greyGradient =     this.getResources().getDrawable(R.drawable.grey_gradient);final TierListView tierView = (TierListView) findViewById(R.id.content_list);tierView.setBackgroundDrawable(greyGradient);</code></pre><p>My problem is that whenever I scroll the list my Stroke around the edges of the TierListView disappears. Actually the entire xml file stops working until the scrolling stops. When I release the touch the stroke returns. How do I keep the stroke and just cause the list items to scroll within it?</p><pre><code>&lt;shape       xmlns:android=""http://schemas.android.com/apk/res/android""       android:shape=""rectangle"" &gt;    &lt;corners                 android:topLeftRadius=""5dip""           android:topRightRadius=""5dip""           android:bottomLeftRadius=""5dip""           android:bottomRightRadius=""5dip"" /&gt;   &lt;gradient           android:angle=""90""                 android:endColor=""#000000""                android:startColor=""#3d3d3d""          android:type=""linear"" /&gt;       &lt;size           android:scaleType=""center"" /&gt;      &lt;stroke           android:width=""2dip""           android:color=""#d6d7d6"" /&gt;&lt;/shape&gt;</code></pre>","591016","","418183","","2011-01-26 18:02:33","2011-01-26 18:28:02","Shape TierListView Scrolling Problem","<android><android-layout>","1","0","","",""
"4807819","1","4811754","","2011-01-26 17:33:54","3","4986","<p>I'm trying to use Jackson in an Android project via the ObjectMapper.</p><p>My POJO is as follows:</p><pre><code>public class Product {    @JsonProperty(""title"")    String title;    @JsonProperty(""vendor"")    String vendor;    public void setTitle(String title){ this.title = title; }    public void setVendor(String vendor){ this.vendor = vendor; }    public String getTitle() { return title; }    public String getVendor() { return vendor; }}</code></pre><p>I've written up a Unit Test to see if I could get Jackson working to deserialize my JSON objects.</p><pre><code>Context ctx;public void setUp() throws Exception {    super.setUp();    ctx = getContext();}public void testConvertJSONToProduct() throws Exception {    ObjectMapper m = new ObjectMapper();    Product product = m.readValue(ctx.getAssets().open(""foo.json""), Product.class);    assertEquals(""Macbook"", product.getTitle());}</code></pre><p>My actual JSON file contains much more information than what I've set in my Product, but I just want to get it working.  Using the larger file it causes the Product to get created but all it's values are set to null. I thought this might be because of all the data that is in there, so I created another file (foo.json) that contains the following:</p><pre><code>{""title"" : ""Macbook"", ""vendor"" : ""Apple""}</code></pre><p>With which I am also getting the same problem.</p>","480475","","","","","2011-01-27 00:23:28","Using Jackson to deserialize JSON objects to POJOs","<android><json><json-decode><jackson>","1","2","0","",""
"4807879","1","","","2011-01-26 17:39:06","1","1721","<p>I have a MapActivity that will display the Android Search box when a search button is pressed. The SearchManager manages the dialog, and passes the user's query to a searchable activity, which searches an SQLite DB and displays the results using a custom adapter.</p><p>This works fine - and I'm getting the correct results from the DB displayed.</p><p>However, what I want to do is display the result in the MapActivity on a map when the user clicks on a search result. Currently, this means starting a new MapActivity, passing the search result in using a Bundle.</p><p>I'd have thought the cleaner way was to pass the search result back to the original activity, rather than start a new one. At the moment, my activity stack goes MapAct -> SearchManager -> Search Result -> New MapAct. Which means pressing ""back"" from the new MapAct will go back to the query results, then to the original MapAct.</p><p>It seems that in the Search Result, calling finish() does not cause onActivityResult to be called in the calling MapActivity.</p><p>Any ideas how to get this callback and maintain a sensible activity stack?</p>","565915","","","","","2011-05-11 02:20:50","Android onSearchRequested() callback to the calling activity","<android><search><stack>","1","0","2","",""
"4807935","1","","","2011-01-26 17:43:32","0","563","<p>So, the idea is to be able to view a very simple html page (text and one image) that can scroll vertically and place this view in a horizontal list that scrolls and snaps to the closest html page.</p><p>I've read over and over that, for performance reasons, it isn't a good idea to place web/scroll views inside list views.  I'm trying to avoid writing a new view from scratch but am lost as to what direction I should go.</p>","591042","","","","","2011-01-26 18:35:05","Android -- Displaying HorizontalScrollView of WebViews","<android><listview><webview><scrollview>","1","0","","",""
"4808097","1","","","2011-01-26 18:00:02","0","325","<p>i just update my mac os from leopard to snow leopard everything look fine but the menu toolbar of eclipse look backward i delete and download a new version and install but the same problem  i will appreciate help</p><p>thanks in advance </p>","591063","","","","","2011-01-26 18:00:02","menu toolbar Show backward eclipse (android developer)","<android><eclipse><osx><osx-snow-leopard>","0","3","","",""
"4808161","1","","","2011-01-26 18:08:15","0","2589","<p>I am trying to compile tesseract for android using android ndk r5, code of tesseract is obtained by checking out <a href=""http://android.git.kernel.org/platform/external/tesseract.git"" rel=""nofollow"">http://android.git.kernel.org/platform/external/tesseract.git</a>, i am unable to compile tesseract and got errors,</p><pre><code>&gt; StaticLibrary  : libstdc++.aSharedLibrary  : libocr.soout/apps/tesseract/armeabi/objs/ocr/liblept/jpegio.o: In function `pixWriteStreamJpeg':E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:496: undefined reference to `jpeg_std_error'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:499: undefined reference to `jpeg_CreateCompress'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:500: undefined reference to `jpeg_stdio_dest'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:514: undefined reference to `jpeg_set_defaults'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:528: undefined reference to `jpeg_set_quality'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:533: undefined reference to `jpeg_start_compress'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:536: undefined reference to `jpeg_write_marker'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:579: undefined reference to `jpeg_finish_compress'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:588: undefined reference to `jpeg_destroy_compress'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:576: undefined reference to `jpeg_write_scanlines'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:563: undefined reference to `jpeg_write_scanlines'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:530: undefined reference to `jpeg_simple_progression'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:496: undefined reference to `jpeg_std_error'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:499: undefined reference to `jpeg_CreateCompress'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:500: undefined reference to `jpeg_stdio_dest'out/apps/tesseract/armeabi/objs/ocr/liblept/jpegio.o: In function `jpeg_error_do_not_exit':E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:1009: undefined reference to `jpeg_destroy'out/apps/tesseract/armeabi/objs/ocr/liblept/jpegio.o: In function `pixReadStreamJpeg':E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:218: undefined reference to `jpeg_std_error'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:221: undefined reference to `jpeg_CreateDecompress'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:224: undefined reference to `jpeg_set_marker_processor'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:225: undefined reference to `jpeg_stdio_src'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:226: undefined reference to `jpeg_read_header'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:230: undefined reference to `jpeg_calc_output_dimensions'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:268: undefined reference to `jpeg_start_decompress'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:294: undefined reference to `jpeg_read_scanlines'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:357: undefined reference to `jpeg_finish_decompress'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:358: undefined reference to `jpeg_destroy_decompress'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:332: undefined reference to `jpeg_read_scanlines'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:273: undefined reference to `jpeg_start_decompress'E:/Mobile_Development_Stuff/android-ndk-r5/sources/tesseract/liblept/jpegio.c:264: undefined reference to `jpeg_start_decompress'collect2: ld returned 1 exit statusmake: *** [out/apps/tesseract/armeabi/libocr.so] Error 1</code></pre><p>my android.mk looks like this look that libjpeg is included in LOCAL_STATIC_LIBRARIES</p><pre><code>    ifneq ($(TARGET_SIMULATOR),true)LOCAL_PATH:= /cygdrive/e/Mobile_Development_Stuff/android-ndk-r5/sources/tesseractBUILD_FOR_HOST:=0## libocr (common)#LOCAL_SRC_FILES_:=      \    ccutil/ambigs.cpp   \    ccutil/basedir.cpp  \    ccutil/bits16.cpp   \    ccutil/boxread.cpp  \    ccutil/clst.cpp     \    ccutil/debugwin.cpp \    ccutil/elst.cpp     \    ccutil/elst2.cpp    \    ccutil/errcode.cpp  \    ccutil/globaloc.cpp \    ccutil/hashfn.cpp   \    ccutil/mainblk.cpp  \    ccutil/memblk.cpp   \    ccutil/memry.cpp    \    ccutil/mfcpch.cpp   \    ccutil/ocrshell.cpp \    ccutil/scanutils.cpp    \    ccutil/serialis.cpp \    ccutil/strngs.cpp   \    ccutil/tessdatamanager.cpp  \    ccutil/tessopt.cpp  \    ccutil/tordvars.cpp \    ccutil/tprintf.cpp  \    ccutil/unichar.cpp  \    ccutil/unicharmap.cpp   \    ccutil/unicharset.cpp   \    ccutil/varable.cpp  \    ccutil/ccutil.cppLOCAL_SRC_FILES_+=      \    api/baseapi.cppLOCAL_SRC_FILES_+=      \    viewer/scrollview.cpp   \    viewer/svmnode.cpp  \    viewer/svutil.cpp#   viewer/svpaint.cpp  \LOCAL_SRC_FILES_+=      \    cutil/bitvec.cpp    \    cutil/cutil.cpp     \    cutil/danerror.cpp  \    cutil/efio.cpp      \    cutil/emalloc.cpp   \    cutil/freelist.cpp  \    cutil/globals.cpp   \    cutil/listio.cpp    \    cutil/oldheap.cpp   \    cutil/oldlist.cpp   \    cutil/structures.cpp    \    cutil/tessarray.cpp \    cutil/cutil_class.cpp LOCAL_SRC_FILES_+=      \    image/image.cpp     \    image/imgbmp.cpp    \    image/imgio.cpp     \    image/imgs.cpp      \    image/imgtiff.cpp   \    image/bitstrm.cpp   \    image/svshowim.cppLOCAL_SRC_FILES_+=      \    liblept/adaptmap.c  \    liblept/affine.c    \    liblept/affinecompose.c \    liblept/arithlow.c  \    liblept/arrayaccess.c   \    liblept/bardecode.c \    liblept/baseline.c  \    liblept/bbuffer.c   \    liblept/bilinear.c  \    liblept/binarize.c  \    liblept/binexpand.c \    liblept/binexpandlow.c  \    liblept/binreduce.c \    liblept/binreducelow.c  \    liblept/blend.c     \    liblept/bmf.c       \    liblept/bmpio.c     \    liblept/bmpiostub.c \    liblept/boxbasic.c  \    liblept/boxfunc1.c  \    liblept/boxfunc2.c  \    liblept/boxfunc3.c  \    liblept/ccbord.c    \    liblept/ccthin.c    \    liblept/classapp.c  \    liblept/colorcontent.c  \    liblept/colormap.c  \    liblept/colormorph.c    \    liblept/colorquant1.c   \    liblept/colorquant2.c   \    liblept/colorseg.c  \    liblept/compare.c   \    liblept/conncomp.c  \    liblept/convolve.c  \    liblept/convolvelow.c   \    liblept/correlscore.c   \    liblept/dwacomb.2.c \    liblept/dwacomblow.2.c  \    liblept/edge.c      \    liblept/endiantest.c    \    liblept/enhance.c   \    liblept/fhmtauto.c  \    liblept/fhmtgen.1.c \    liblept/fhmtgenlow.1.c  \    liblept/flipdetect.c    \    liblept/fliphmtgen.c    \    liblept/fmorphauto.c    \    liblept/fmorphgen.1.c   \    liblept/fmorphgenlow.1.c    \    liblept/fpix1.c     \    liblept/fpix2.c     \    liblept/gifio.c     \    liblept/gifiostub.c \    liblept/gplot.c     \    liblept/graphics.c  \    liblept/graymorph.c \    liblept/graymorphlow.c  \    liblept/grayquant.c \    liblept/grayquantlow.c  \    liblept/heap.c      \    liblept/jbclass.c   \    liblept/jpegio.c    \    liblept/jpegiostub.c    \    liblept/kernel.c    \    liblept/list.c      \    liblept/maze.c      \    liblept/morphapp.c  \    liblept/morph.c     \    liblept/morphdwa.c  \    liblept/morphseq.c  \    liblept/numabasic.c \    liblept/numafunc1.c \    liblept/numafunc2.c \    liblept/pageseg.c   \    liblept/paintcmap.c \    liblept/parseprotos.c   \    liblept/partition.c \    liblept/pix1.c      \    liblept/pix2.c      \    liblept/pix3.c      \    liblept/pix4.c      \    liblept/pixabasic.c \    liblept/pixacc.c    \    liblept/pixafunc1.c \    liblept/pixafunc2.c \    liblept/pixalloc.c  \    liblept/pixarith.c  \    liblept/pixconv.c   \    liblept/pixtiling.c \    liblept/pngio.c     \    liblept/pngiostub.c \    liblept/pnmio.c     \    liblept/pnmiostub.c \    liblept/projective.c    \    liblept/psio.c      \    liblept/psiostub.c  \    liblept/ptra.c      \    liblept/pts.c       \    liblept/queue.c     \    liblept/rank.c      \    liblept/readbarcode.c   \    liblept/readfile.c  \    liblept/rop.c       \    liblept/ropiplow.c  \    liblept/roplow.c    \    liblept/rotateam.c  \    liblept/rotateamlow.c   \    liblept/rotate.c    \    liblept/rotateorth.c    \    liblept/rotateorthlow.c \    liblept/rotateshear.c   \    liblept/runlength.c \    liblept/sarray.c    \    liblept/scale.c     \    liblept/scalelow.c  \    liblept/seedfill.c  \    liblept/seedfilllow.c   \    liblept/sel1.c      \    liblept/sel2.c      \    liblept/selgen.c    \    liblept/shear.c     \    liblept/skew.c      \    liblept/stack.c     \    liblept/textops.c   \    liblept/tiffio.c    \    liblept/tiffiostub.c    \    liblept/utils.c     \    liblept/viewfiles.c \    liblept/warper.c    \    liblept/watershed.c \    liblept/writefile.c \    liblept/zlibmem.c   \    liblept/zlibmemstub.c   \LOCAL_SRC_FILES_+=      \    ccstruct/blobbox.cpp    \    ccstruct/blobs.cpp  \    ccstruct/blread.cpp \    ccstruct/callcpp.cpp    \    ccstruct/coutln.cpp \    ccstruct/detlinefit.cpp \    ccstruct/genblob.cpp    \    ccstruct/labls.cpp  \    ccstruct/linlsq.cpp \    ccstruct/lmedsq.cpp \    ccstruct/mod128.cpp \    ccstruct/normalis.cpp   \    ccstruct/ocrblock.cpp   \    ccstruct/ocrrow.cpp \    ccstruct/otsuthr.cpp    \    ccstruct/pageres.cpp    \    ccstruct/pdblock.cpp    \    ccstruct/points.cpp \    ccstruct/polyaprx.cpp   \    ccstruct/polyblk.cpp    \    ccstruct/polyblob.cpp   \    ccstruct/polyvert.cpp   \    ccstruct/poutline.cpp   \    ccstruct/quadlsq.cpp    \    ccstruct/quadratc.cpp   \    ccstruct/quspline.cpp   \    ccstruct/ratngs.cpp \    ccstruct/rect.cpp   \    ccstruct/rejctmap.cpp   \    ccstruct/statistc.cpp   \    ccstruct/stepblob.cpp   \    ccstruct/vecfuncs.cpp   \    ccstruct/werd.cpp   \    ccstruct/ccstruct.cppLOCAL_SRC_FILES_+=      \    dict/choices.cpp    \    dict/context.cpp    \    dict/conversion.cpp \    dict/dawg.cpp       \    dict/dict.cpp       \    dict/hyphen.cpp     \    dict/permdawg.cpp   \    dict/permngram.cpp  \    dict/permute.cpp    \    dict/states.cpp     \    dict/stopper.cpp    \    dict/trie.cppLOCAL_SRC_FILES_+=      \    classify/adaptive.cpp   \    classify/adaptmatch.cpp \    classify/baseline.cpp   \    classify/blobclass.cpp  \    classify/chartoname.cpp \    classify/classify.cpp   \    classify/cluster.cpp    \    classify/clusttool.cpp  \    classify/cutoffs.cpp    \    classify/extract.cpp    \    classify/featdefs.cpp   \    classify/flexfx.cpp \    classify/float2int.cpp  \    classify/fpoint.cpp \    classify/fxdefs.cpp \    classify/hideedge.cpp   \    classify/intfx.cpp  \    classify/intmatcher.cpp \    classify/intproto.cpp   \    classify/kdtree.cpp \    classify/mf.cpp     \    classify/mfdefs.cpp \    classify/mfoutline.cpp  \    classify/mfx.cpp    \    classify/normfeat.cpp   \    classify/normmatch.cpp  \    classify/ocrfeatures.cpp\    classify/outfeat.cpp    \    classify/picofeat.cpp   \    classify/protos.cpp \    classify/speckle.cpp    \    classify/xform2d.cppLOCAL_SRC_FILES_+=      \    wordrec/associate.cpp   \    wordrec/badwords.cpp    \    wordrec/bestfirst.cpp   \    wordrec/chop.cpp    \    wordrec/chopper.cpp \    wordrec/closed.cpp  \    wordrec/drawfx.cpp  \    wordrec/findseam.cpp    \    wordrec/gradechop.cpp   \    wordrec/heuristic.cpp   \    wordrec/makechop.cpp    \    wordrec/matchtab.cpp    \    wordrec/matrix.cpp  \    wordrec/metrics.cpp \    wordrec/mfvars.cpp  \    wordrec/olutil.cpp  \    wordrec/outlines.cpp    \    wordrec/pieces.cpp  \    wordrec/plotedges.cpp   \    wordrec/plotseg.cpp \    wordrec/render.cpp  \    wordrec/seam.cpp    \    wordrec/split.cpp   \    wordrec/tally.cpp   \    wordrec/tessinit.cpp    \    wordrec/tface.cpp   \    wordrec/wordclass.cpp   \    wordrec/wordrec.cppLOCAL_SRC_FILES_+=      \    ccmain/tessvars.cpp \    ccmain/tstruct.cpp  \    ccmain/reject.cpp   \    ccmain/callnet.cpp  \    ccmain/charcut.cpp  \    ccmain/docqual.cpp  \    ccmain/paircmp.cpp  \    ccmain/adaptions.cpp    \    ccmain/ambigsrecog.cpp  \    ccmain/applybox.cpp \    ccmain/blobcmp.cpp  \    ccmain/charsample.cpp   \    ccmain/control.cpp  \    ccmain/expandblob.cpp   \    ccmain/fixspace.cpp \    ccmain/fixxht.cpp   \    ccmain/imgscale.cpp \    ccmain/matmatch.cpp \    ccmain/osdetect.cpp \    ccmain/output.cpp   \    ccmain/pagewalk.cpp \    ccmain/pgedit.cpp   \    ccmain/scaleimg.cpp \    ccmain/tessbox.cpp  \    ccmain/tesseractclass.cpp   \    ccmain/tfacepp.cpp  \    ccmain/thresholder.cpp  \    ccmain/varabled.cpp \    ccmain/werdit.cpp   \    ccmain/tessedit.cpp#   ccmain/tessembedded.cpp \LOCAL_SRC_FILES_+=      \    textord/alignedblob.cpp \    textord/bbgrid.cpp  \    textord/blkocc.cpp  \    textord/colfind.cpp \    textord/colpartition.cpp    \    textord/colpartitionset.cpp \    textord/drawedg.cpp \    textord/drawtord.cpp    \        textord/edgblob.cpp \    textord/edgloop.cpp \    textord/fpchop.cpp  \    textord/gap_map.cpp \    textord/imagefind.cpp   \    textord/linefind.cpp    \    textord/makerow.cpp \    textord/oldbasel.cpp    \    textord/pagesegmain.cpp \    textord/pithsync.cpp    \    textord/pitsync1.cpp    \    textord/scanedg.cpp \    textord/sortflts.cpp    \    textord/strokewidth.cpp \    textord/tabfind.cpp \    textord/tablefind.cpp   \    textord/tabvector.cpp   \    textord/topitch.cpp \    textord/tordmain.cpp    \    textord/tospace.cpp \    textord/tovars.cpp  \    textord/underlin.cpp    \    textord/wordseg.cpp     \    textord/workingpartset.cppLOCAL_C_INCLUDES_+=     \    $(LOCAL_PATH)/ccmain        \    $(LOCAL_PATH)/api   \    $(LOCAL_PATH)/ccstruct      \    $(LOCAL_PATH)/cstruct       \    $(LOCAL_PATH)/cutil     \    $(LOCAL_PATH)/ccutil        \    $(LOCAL_PATH)/ccmain        \    $(LOCAL_PATH)/image         \    $(LOCAL_PATH)/include   \    $(LOCAL_PATH)/liblept   \    $(LOCAL_PATH)/dict      \    $(LOCAL_PATH)/classify      \    $(LOCAL_PATH)/viewer    \    $(LOCAL_PATH)/wordrec       \    $(LOCAL_PATH)/textord   \    external/jpegLOCAL_CFLAGS_:=         \    -DGRAPHICS_DISABLED \    -DHAVE_LIBLEPT          \        -O3#   -DFST_DISABLED      \#   -DDISABLE_INTEGER_MATCHING  \#   -DDISABLE_DOC_DICT  \LOCAL_STATIC_LIBRARIES_:=   \    libjpeg## libocr (native)#include $(CLEAR_VARS)LOCAL_SRC_FILES:=$(LOCAL_SRC_FILES_)    \    api/jni.cpp         \    liblept/_open_memstream.c   \    liblept/_fopencookie.c      \    liblept/_fmemopen.cLOCAL_C_INCLUDES:=$(LOCAL_C_INCLUDES_)LOCAL_CFLAGS:=$(LOCAL_CFLAGS_)LOCAL_STATIC_LIBRARIES:=$(LOCAL_STATIC_LIBRARIES_)LOCAL_SHARED_LIBRARIES:= \    liblogLOCAL_MODULE_TAGS := optionalLOCAL_MODULE:= libocrLOCAL_PRELINK_MODULE:= falseinclude $(BUILD_SHARED_LIBRARY)ifeq ($(BUILD_FOR_HOST),1)## libocr (host)#include $(CLEAR_VARS)LOCAL_SRC_FILES:=$(LOCAL_SRC_FILES_) api/jni.cppLOCAL_C_INCLUDES:=$(LOCAL_C_INCLUDES_)LOCAL_CFLAGS:=$(LOCAL_CFLAGS_)LOCAL_STATIC_LIBRARIES:=$(LOCAL_STATIC_LIBRARIES_)LOCAL_SHARED_LIBRARIES:=$(LOCAL_SHARED_LIBRARIES_)LOCAL_MODULE:= libocrinclude $(BUILD_HOST_SHARED_LIBRARY)## tesseract test (host)#include $(CLEAR_VARS)LOCAL_MODULE:= tesseractLOCAL_SRC_FILES:= \    api/tesseractmain.cppLOCAL_CFLAGS:= \    -DGRAPHICS_DISABLED \    -DHAVE_LIBLEPT      \    -DFST_DISABLED      \    -DBUILD_HOSTLOCAL_C_INCLUDES+= \    $(LOCAL_PATH)/ccutil        \    $(LOCAL_PATH)/ccstruct  \    $(LOCAL_PATH)/image     \    $(LOCAL_PATH)/include   \    $(LOCAL_PATH)/dict      \    $(LOCAL_PATH)/classify  \    $(LOCAL_PATH)/wordrec   \    $(LOCAL_PATH)/viewer    \    $(LOCAL_PATH)/cutil     \    $(LOCAL_PATH)/textord   \    $(LOCAL_PATH)/api   \    $(LOCAL_PATH)/ccmainLOCAL_SHARED_LIBRARIES:= \    libocrinclude $(BUILD_HOST_EXECUTABLE)## simple raw-YUV test (host)#include $(CLEAR_VARS)LOCAL_MODULE:= tesseract LOCAL_SRC_FILES:= \    ccmain/jni.cppLOCAL_CFLAGS:= \    -DGRAPHICS_DISABLED \    -DHAVE_LIBLEPT      \    -DFST_DISABLED      \    -DBUILD_HOSTLOCAL_C_INCLUDES+= \    $(LOCAL_PATH)/ccutil        \    $(LOCAL_PATH)/ccstruct  \    $(LOCAL_PATH)/image     \    $(LOCAL_PATH)/include   \    $(LOCAL_PATH)/liblept   \    $(LOCAL_PATH)/dict      \    $(LOCAL_PATH)/classify  \    $(LOCAL_PATH)/wordrec   \    $(LOCAL_PATH)/viewer    \    $(LOCAL_PATH)/cutil     \    $(LOCAL_PATH)/textord   \    $(LOCAL_PATH)/api   \    $(LOCAL_PATH)/ccmainLOCAL_SHARED_LIBRARIES:= \    libocr#include $(BUILD_HOST_EXECUTABLE)endif #BUILD_FOR_HOSTendif #TARGET_SIMULATOR</code></pre><p>Please help me out to build tesseract for android.</p><p>Thanks in advance.</p>","576123","","71904","","2011-12-02 19:39:56","2013-10-25 10:01:43","Compiling tesseract through android NDK","<android><tesseract>","3","0","1","",""
"4808206","1","","","2011-01-26 18:12:54","1","475","<p>how to animate(transition) view from  left to right.and hide and show on touch event.</p><p>thankx</p>","411359","","","","","2011-01-26 18:12:54","how to animate(transition) view from left to right?","<android><android-layout>","0","3","","",""
"4808240","1","","","2011-01-26 18:15:17","0","415","<p>As far as I know we can create notifications in Android using Notification Manager + remote Views.</p><p>I am Creating a notification for downloading Mp3 files. And I want an animations beside It. So far I have learned from forums that it is not possible.</p><p>However I saw A video for an android App which downloads and displays animation beside it while downloading it. Link: <a href=""http://www.youtube.com/watch?v=yNcs-sS2nFU&amp;feature=related"" rel=""nofollow"">http://www.youtube.com/watch?v=yNcs-sS2nFU&amp;feature=related</a></p><p>Moreover its the same animation used by the browser. How can they do it?</p><p>If any one suggests using level drawable for me, Please also suggest still I have to send a whole remote View to the notification manager with the same Notification ID. It will override it. That gives a animation like thing if I do it again and again. Is there no way to update remoteviews without sending the changed remoteviews to Notification manager.</p><p>WHY, I dont want the above mentioned animation effect?Because It hangs the android. If the updates are sent more faster then 2000ms.</p><p>This question is also asked elsewhere at stackoverflow but never been answered.</p>","557869","","","","","2013-01-10 20:22:54","Downloads, Shown in notification bar?","<android><xml><multithreading><notifications><android-asynctask>","2","0","","",""
"4808260","1","","","2011-01-26 18:16:55","0","139","<p>I have implemented a ListView and want the OnClickListener to use the long id parameter (ie. which item from the list was clicked) to index the String[] that I am populating the list from, so that I can pass that String ie. the text of the specific item I clicked. I would make it final but that would be an issue as I need to repopulate this list later on in the lifecycle of the program (which you might say can't be done with a string, I will probably switch to a StringBuilder[] but if anyone has advice on this part feel free). I hope this is not confusing, to give some elaboration on what I am doing, I am populating a ListView from a String[] gathered from a mysql database and then I am going to later sort the list based on proximity (obtained from GPS position) so because the id for the listitem will be different for each person I am going to pass the text string that makes up the item in the list that was clicked on, so using item id alone is not feasible, because the item id for an individual list (that has been re-sorted) will be useless to the server. Can anyone advise me on how to make this possible or a potential work around?</p>","573576","","","","","2011-01-26 18:30:15","How can I pass a string through an inner class without finalizing it","<android><listview><parameter-passing><listviewitem><inner-classes>","1","0","","",""
"4808468","1","4949412","","2011-01-26 18:33:46","3","3973","<p><br>How can I change the default font for keys of keyboard I am writing in android (Eclipse)?<br>Thank you</p>","456582","","","","","2012-07-30 08:52:20","How to change android keyboard key font?","<android><fonts><keyboard>","3","1","3","",""
"4808516","1","4808580","","2011-01-26 18:38:07","1","755","<p>I´m looking for an <code>android:inputType</code> for an EditText to make sure the user can´t enter any number, but all different kinds of lettres.<br>I thought, the <a href=""http://developer.android.com/reference/android/widget/TextView.html#attr_android%3ainputType"" rel=""nofollow"">inputType</a> is the right xml-attribute I have to change, but I can´t find a suitable value. Does anybody have a solution? Does <code>android:digits</code> help?</p><p>Thanks in advance,Jonathan</p>","419780","","","","","2011-01-26 18:45:23","EditText validation - no numbers","<android><validation><android-edittext>","1","0","","",""
"4808656","1","5425545","","2011-01-26 18:53:04","0","555","<p>Hello<br>How can I draw shift letter at the corner of a key on keyboard?<br>I am changing SoftKeyboard sample.<br>Thank you.</p>","456582","","","","","2011-03-24 21:08:04","How to draw shift letter on keyboard in android?","<android><keyboard>","1","2","","",""
"4808705","1","4808749","","2011-01-26 18:58:43","68","23034","<p>I'm working on a little personal todo list app and so far everything has been working quite well. There is one little quirk I'd like to figure out. Whenever I go to add a new item, I have a Dialog with an EditText view showing inside. When I select the EditText view, the keyboard comes up to enter text, as it should. In most applications, the default seems to be that the shift key is held for the first letter... although it does not do this for my view. There has to be a simple way to fix, but I've searched the reference repeatedly and cannot find it. I'm thinking there has to be an xml attribute for the reference loaded by the Adapter, but I can't find out what it is.</p>","351060","","623850","","2011-11-18 04:07:56","2014-03-11 09:48:14","First letter capitalization for EditText","<android>","3","0","11","",""
"4808744","1","4810216","","2011-01-26 19:02:24","1","725","<p>I'm creating an activity that views a record and displays it's data to a user to modify. After everything is done just click a button to save the data back into the database. However, once saving time comes around I get an unusual ""java.lang.IllegalArgumentException: Empty values"" error. I think it's a SQL code error on my end, but I don't know enough about SQL to find it. Can I get a couple of eyes to see what I did wrong?</p><p>Thanks~Aedon</p><p>Here is where the save button is declared and the listener is set. mBoundService is the service that hosts the database and it's calls. DevicesTable is a class that holds the table and column names. DevicesTable.gt_fields[0] is autoincrementID and then serial, name, and first seen columns</p><pre><code>public void init() {            mDevName = (EditText)findViewById(R.id.dv_name);    mCurReads = (TextView)findViewById(R.id.dv_readings);    mSave = (Button)findViewById(R.id.dv_save);        mSave.setOnClickListener(new OnClickListener() {            @Override public void onClick(View arg0) {                mBoundService.updateRecord(DevicesTable.gt_name, mId, DevicesTable.g_fields[2], mDevName.getText().toString());            }        });}</code></pre><p>And this is the database call itself. </p><pre><code>/** * Updates a record at the given table with the given record. * @param table The table to update * @param id The id of the actual record. Do not pass the incorrect id! * @param column The column in which the data is changing * @param data The data that is to be changed to */public void updateRecord(String table, String id, String column, String data) {    mDB.update(table, null, ""SET "" + column + "" = '"" + data + ""',"", new String[]{""id="" + id});}</code></pre>","480691","","","","","2011-01-26 21:25:24","Odd database error: Empty values?","<android><database><sqlite>","1","0","","",""
"4808765","1","","","2011-01-26 19:03:52","0","3013","<p>Hey, So I have searched the internet high and low for this.Whenever, someone makes a dialog they do it on a class extending Activity.So I have a class extends SurfaceView and I need to show a dialog every time the player in my game destroys a certain number of enemies.</p><p>How do I do this?I keep getting errors on the code I copy from online.</p><p>This is my class :-</p><pre><code>class SurvivorPanel extends SurfaceView implements SurfaceHolder.Callback </code></pre><p>This is my constructor:-</p><pre><code> public SurvivorPanel(Context context) { // set panel's holder &amp; thread    super(context);    getHolder().addCallback(this);    _thread = new TutorialThread(getHolder(), this);    setFocusable(true);}</code></pre><p>Some one please advise me how to create an AlertDialog here....</p>","591148","","","","","2011-01-26 19:37:23","Create AlertDialog in Android on a class that extends SurfaceView","<android><dialog><alertdialog><surfaceview>","1","0","1","",""
"4808813","1","","","2011-01-26 19:09:01","1","7551","<p>I am trying to run the following Android app, but I get a NullPointerException</p><p>Main.java</p><pre><code>import android.app.ListActivity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.ArrayAdapter;import android.widget.ListView;public class Main extends ListActivity { String[] listActivityNames =   {""Text1"", ""Text2"", ""Text3"", ""Text4""};    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);        // Use an existing ListAdapter that will map an array        // of strings to TextViews        setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, listActivityNames));        getListView().setTextFilterEnabled(true); } /*protected void onListItemClick(ListView l, View v, int position, long id) {  Intent myIntent = new Intent();  myIntent.setClassName(""com.utsc"", ""com.utsc.Announcements"");  startActivity(myIntent);  }*/}</code></pre><p>Console:</p><pre><code>[2011-01-26 13:58:57 - ddms]nulljava.lang.NullPointerException at com.android.ddmlib.JdwpPacket.writeAndConsume(JdwpPacket.java:213) at com.android.ddmlib.Client.sendAndConsume(Client.java:573) at com.android.ddmlib.HandleHello.sendHELO(HandleHello.java:142) at com.android.ddmlib.HandleHello.sendHelloCommands(HandleHello.java:65) at com.android.ddmlib.Client.getJdwpPacket(Client.java:670) at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:317) at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)[2011-01-26 13:58:57 - ddms]nulljava.lang.NullPointerException at com.android.ddmlib.JdwpPacket.writeAndConsume(JdwpPacket.java:213) at com.android.ddmlib.Client.sendAndConsume(Client.java:573) at com.android.ddmlib.HandleHello.sendHELO(HandleHello.java:142) at com.android.ddmlib.HandleHello.sendHelloCommands(HandleHello.java:65) at com.android.ddmlib.Client.getJdwpPacket(Client.java:670) at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:317) at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)</code></pre>","425439","","1720391","","2013-02-21 12:07:58","2013-02-21 12:07:58","NullPointerException in JdwpPaquet","<android>","4","1","","",""
"4808837","1","4808927","","2011-01-26 19:12:09","0","506","<p>Am I able to use JSON with a MySQL for my database, in an Android application, for data retrieval?</p>","229616","","651104","","2012-06-19 06:58:55","2012-06-19 06:58:55","Can JSON be used with MySQL for Android?","<android><json>","3","0","","",""
"4808849","1","4809328","","2011-01-26 19:13:21","1","628","<p>I am currently developing an application which is not fullscreen (Notification bar is visible). On the bottom of most of my activities, I have a sliding drawer that brings up a kind of dashboard. As of now, this sliding drawer is part of the main RelativeLayout and shows/hides fine. However, of course, it gets expanded up to the bottom of the notification area.</p><p>I would need this sliding drawer to cover the notification bar in order for it to take the whole screen. Maybe by attaching it to the main Layout instead of the activity Layout?</p><p>Another way that would be ok would be to hide the notification bar (maybe using an animation to slide it up) when the sliding drawer is opening and show it back when the drawer is closing.</p><p>Has anybody managed to do such a thing?</p>","490961","","","","","2011-01-26 19:55:08","Android SlidingDrawer on top of the notification bar (or toggle visibility of that one)","<android><android-widget><slidingdrawer>","1","0","","",""
"4808950","1","","","2011-01-26 19:23:01","1","1802","<p>I have number displayed in EditText that can go up to 20 character + 4 decimal before it's too long.  I would like to have number that are longer than that displayed with de exposant at the end so it's not truncated.</p><p>ex: 123456789 will show as is123456789123456789123456 is too long and will be displayed as 1.123456789E8 (just an example !)</p><p>I have tested this:</p><pre><code>DecimalFormat df = new DecimalFormat(""#.####"");df.setMaximumIntegerDigits(20);</code></pre><p>But after 20char, the numbers are just not displayed correctly.  ex: 123456789123456789123456 became 56789123456789123456 (trunked 4 first digit.)</p><p>Thank you !</p>","591185","","501557","","2011-01-26 20:23:04","2011-01-26 21:44:07","How to determine max size of DecimalFormat before it's shown with exponent?","<java><android><numbers><decimal>","4","0","","",""
"4809019","1","4854450","","2011-01-26 19:27:27","1","937","<p>I have some hardware that sends the AVRCP play command to the phoneupon bluetooth connection. What I am seeing is the MEDIA_BUTTON actionintent spammed over and over in the debugger. This is causing problemswith a few apps but mainly Pandora. Pandora will constantly play/pauseover and over. It is almost like the AVRCP command gets sent to thephone which generates a MEDIA_BUTTON broadcast that keeps getting sentout over and over.</p><p>I set up a Broadcast Receiver to catch it and try to determine what'sgoing on. Here is what is being spammed:</p><blockquote>  <p>01-17 12:20:04.324: ERROR/NPT:(1558):  Intent {  act=android.intent.action.MEDIA_BUTTON  (has extras) } 01-17 12:20:04.324:  ERROR/NPT:(1558): KeyEvent{action=0  code=85 repeat=0 meta=0 scancode=200  mFlags=8}</p></blockquote><p>which is the bluetooth Play/Pause media key. This is what it shouldbe, as the AVRCP command triggers this, but as I said, it's like theOS just keeps spamming this.</p><p>I have tried using the <code>abortBroadcast()</code> method to stop it but that hasno effect. I am guessing the broadcast is non-ordered and can't bestopped explicitly?</p><p>I have verified it is not the hardware spamming the AVRCP command bydebugging my firmware code. The spamming behavior also continues if Iunplug the hardware.</p><p>I am using 2.2.</p><p>Thanks.</p>","548949","","142162","","2011-01-26 19:30:37","2011-01-31 18:14:16","Sending AVRCP play command, getting spammed with broadcast","<android><bluetooth><android-intent><broadcast><avrcp>","1","0","1","",""
"4809111","1","4866059","","2011-01-26 19:35:19","0","749","<p>I build a SideBar menu that contains some icons, when clicking on one of them, I need to popover a view next to the bar with a View inside of it.</p><p>My question is how add this view in top of any view that is not in the bar.</p><p>Just for clarify, this is my layout to get the SideBar on screen.</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=""match_parent"" android:layout_height=""match_parent""&gt; &lt;ImageView android:id=""@+id/image01"" android:layout_width=""wrap_content""  android:layout_height=""wrap_content"" android:scaleType=""fitXY"" /&gt; &lt;com.view.SideBarView android:id=""@+id/sideBar""  android:layout_width=""40px"" android:layout_height=""match_parent""  layout_toLeftOf=""@id/image01"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>I need when click a icon on the bar to pop over the image on the left, and also have a View inside the balloon and get some user input.</p><p>If it's not too much, I need to draw a arrow next to the icon to this floating view.</p><p>There's an way to do that?</p>","558433","","","","","2011-06-03 12:10:54","How add a floating view in Activity","<java><android><view><custom-view>","2","0","1","",""
"4809156","1","","","2011-01-26 19:39:29","2","380","<p>I'm running into problems where a<code>db.exe</code> is working great on its own. </p><p>I'm able to communicate with my phone (HTC EVO) from a command line, but whenever I fire up eclipse (or even launch DDMS from <code>ddms.bat</code>), it won't maintain a connection with ADB.</p><p>Stuff I've tried:</p><ol><li>I've tried '<code>kill-server/start-server</code>' to no avail.</li><li>Disabled VirusProtection / Firewalls</li><li>Using different drivers from <code>HTC</code>, <code>GoogleUSB</code>, and the generic <code>WindowsUSB</code></li></ol><p>My Setup: Eclipse 3.5.2, SDK Tools Rev. 9,  ADT 9.0.0., fresh WindowsXP,SP3 install.</p><p>Any help would be appreciated.</p>","207880","","881286","","2013-08-18 01:35:38","2013-08-18 01:35:38","DDMS doesn't like ADB?","<android><adb><ddms>","0","1","","",""
"4809163","1","4810921","","2011-01-26 19:40:07","1","355","<p>how can i pass an integer variable to an xml animation like it's mentioned here:</p><pre><code>&lt;alpha    android:interpolator=""@android:anim/decelerate_interpolator""    android:fromAlpha=""0.0"" android:toAlpha=""1.0""    android:duration=""@android:integer/config_shortAnimTime"" /&gt;</code></pre><p>i've no idea how to do that. At the moment the only thing i know is that i canhardcode it like this -> <code>android:duration=""200""</code></p><p>anyone knows the answer on that?</p>","325479","","17028","","2011-01-26 22:51:03","2011-01-26 22:51:27","How can i pass an integer variable to an animation?","<java><android><xml><variables><animation>","2","0","","",""
"4809202","1","","","2011-01-26 19:42:43","0","372","<p>This returns a null pointer.  <code>array[0].toString()</code> does as well.  What am I doing wrong?</p><pre><code>final CharSequence[] array = res.getTextArray(R.array.arrayOfThings);System.out.println(""array pos 0: "" + array[0]);</code></pre><p>...</p><pre><code>&lt;array name=""arrayOfThings""&gt;        &lt;item&gt;1&lt;/item&gt;        &lt;item&gt;2&lt;/item&gt;        &lt;item&gt;3&lt;/item&gt;        &lt;item&gt;4&lt;/item&gt;        &lt;item&gt;5&lt;/item&gt;        &lt;item&gt;6&lt;/item&gt;        &lt;item&gt;7&lt;/item&gt;&lt;/array&gt;</code></pre>","375566","","","","","2011-01-26 19:51:27","Android - printing CharSequence[]","<java><android><android-sdk-2.2>","1","0","","",""
"4809291","1","4809699","","2011-01-26 19:51:38","0","746","<p>Hey all, so I'm trying to run Text-to-speech once one of my timers is at 10 seconds. However, it isn't saying anything when the timer reaches 10 seconds.</p><pre><code>package com.android.countdown;import java.util.Locale;import android.app.Activity;import android.os.Bundle;import android.os.CountDownTimer;import android.view.View;import android.speech.tts.TextToSpeech;import android.widget.Button;import android.widget.TextView;import android.view.View.OnClickListener;public class countdown extends Activity implements TextToSpeech.OnInitListener{    CountDownTimer Counter1;    CountDownTimer Counter2;    CountDownTimer Counter3;    int Interval = 1;    TextToSpeech tts;    public String formatTime(long millis) {          String output = ""0:00"";          long seconds = millis / 1000;          long minutes = seconds / 60;          seconds = seconds % 60;          minutes = minutes % 60;          String secondsD = String.valueOf(seconds);          String minutesD = String.valueOf(minutes);          if (seconds &lt; 10)            secondsD = ""0"" + seconds;          if (minutes &lt; 10)            minutesD = ""0"" + minutes;          output = minutesD + "" : "" + secondsD;          return output;        }      @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);//Declare Start/Stop timer    Button btnstart = (Button)findViewById(R.id.btnstart);    Button btnstop = (Button)findViewById(R.id.btnstop);//Text field to show time left    final TextView mCounter1TextField=(TextView)findViewById(R.id.counter1);    final TextView mCounter2TextField = (TextView)findViewById(R.id.counter2);    final TextView mCounter3TextField=(TextView)findViewById(R.id.counter3);//Counter 1Counter1 = new CountDownTimer(20000 , Interval) {public void onTick(long millisUntilFinished){    mCounter1TextField.setText(""Seconds remaining: "" + formatTime(millisUntilFinished));    if (millisUntilFinished == 10000) {        countdown1speech();    }}public void onFinish() {    Counter1.start();  }};}      public void countdown1speech() {            tts = new TextToSpeech(this, this);            tts.setLanguage(Locale.US);            tts.speak(""You have 10 seconds remaining"", TextToSpeech.QUEUE_ADD, null);        }    @Override    public void onInit(int status) {    }    @Override    public void onDestroy() {        // Don't forget to shutdown!        if (tts != null) {            tts.stop();            tts.shutdown();        }        super.onDestroy();    }}</code></pre><p>My onTick() is nested inside an object instantiation for my countdown timer. So I'm not able to put my </p><pre><code>tts = new TextToSpeech(this, this);tts.setLanguage(Locale.US);tts.speak(""You have 10 seconds remaining"", TextToSpeech.QUEUE_ADD, null);</code></pre><p>in there without getting an error..But I'm not sure why the speech isn't working.</p>","533049","","168868","","2012-01-01 21:56:07","2012-01-01 21:56:07","Text To Speech is not working in CountDownTimer","<android><eclipse><text-to-speech>","2","0","1","",""
"4809454","1","4810214","","2011-01-26 20:07:13","0","631","<p>Is there a way to provide different navigation voice files to the android navigation app? (Other than hard solutions of intercepting voice data sent to the sound component on the device)</p>","81012","","","","","2011-01-26 21:25:22","custom voice while navigating","<android><navigation><voice>","1","3","","",""
"4809490","1","4863506","","2011-01-26 20:10:04","19","4058","<p>I've set up user auth for my rails App with Devise and Omniauth.Now I'm wondering where I should start to use the same auth for an Android and iPhone app I want to create.</p><p>Should I use a mobile version of my /auth/facebook or should I directly send a request from the app ?</p><p>This is a quite general question, but I've found nowhere to look at.</p><p>EDIT : I've just added Token Auth to the app to use with the RESTful api, I'm just missing the Omniauth/Facebook-token part.</p>","300115","","300115","","2011-01-26 21:07:47","2012-05-11 08:54:11","Devise Omniauth and Iphone/Android App","<iphone><android><ruby-on-rails><devise><omniauth>","1","1","21","",""
"4809509","1","4810199","","2011-01-26 20:11:40","0","485","<p>Up to now I was only developing in J2ME and would like to know about the differences compared to Android. </p><p>The situation for a java enabled phone is that it might, for example, has a built-in camera, but the manufacturer didn't implemented the Java API for camera capabilities. Which means you can't use that API. It is even possible that only parts of an API were implemented.</p><p>Now, what about Android? For what I know, when a device has Android Platform 2.2 it supports every API Level up to Level 8. And I would guess, that if the built in camera doesn't have a flash then you can't use the Android API call to change the flash mode. Is that right?Now let's assume that the device has a built in flash enabled camera. Can a developer be sure that the function for changing the flash mode can be used, or is it possible that the manufacturer didn't implemented that specific function even though it is part of the supported API Level which the device was advertised for?</p>","591221","","","","","2011-01-26 21:23:39","Hardware capabilities and actual implementation of Android API of a device","<android><api><implementation>","1","0","","",""
"4809511","1","4811309","","2011-01-26 20:11:46","0","1317","<p>I want to return to certain location in a textview.For example, I have a textview, scroll to a certain location (% of text or to a line).I want to capture that location, and then when open same textview with same text and same font size, I want to return to same location.</p><p>What are the commands to get location and scroll to that location?</p>","380490","","","","","2011-01-26 23:23:41","TextView scroll to last location","<android><scrolling><textview>","1","0","1","",""
"4809521","1","","","2011-01-26 20:13:24","0","8811","<p>I am making a really simple android application that will display a picture after a button is clicked.  I have searched for days and tried everything I can think of but cant seem to get it to work.  I have been able to host the picture online and link to it but I want the content available offline too.  Please help, sorry for the stupid question.</p><h3>Update:</h3><p>It is a fixed image and in my drawable resource. Here is the current code I am using to display the image from a URL.  What changes should I make to to display that same image from my drawable resource?</p><p>JAVA</p><pre><code>public class StandingOrders extends Activity{    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    public void buttonClick (View image)    {         Uri uri = Uri.parse(""my url"");        Intent intent = new Intent(Intent.ACTION_VIEW, uri);        startActivity(intent)     }}</code></pre><p>XML</p><pre><code>&lt;Button android:id=""@+id/btn1""         android:layout_height=""wrap_content""         android:layout_width=""170px""         android:text=""The Button""         android:layout_gravity=""center""         android:clickable=""true""        android:onClick=""buttonClick""&gt;&lt;/Button&gt;</code></pre>","591264","","1288","","2011-01-27 00:28:24","2014-03-28 00:31:28","Display image after button click","<android>","4","0","","",""
"4809633","1","4811189","","2011-01-26 20:24:26","1","1346","<p>I create an augmented reality application on android using the Adobe Flash Professional CS5 by following this video tutorial from Lee Brimelow(<em>http://www.gotoandlearn.com/play.php?id=105</em>) </p><p>I wrote the program exactly as it shows on the video and it works correctly on my pc.I then made the necessary changes to be able to publish it on my android nexus one mobile phone using Adobe Air for Android. I works correctly on my phone, however it is too slow and it crashes. Is there a way that I can make it work faster or do I need to make some specific modifications to what I have done?</p><p>Thank you</p>","495296","","495296","","2011-01-26 21:59:06","2011-01-26 23:09:00","Augmented Reality application on Android using Flash","<android><air><flash-cs5><augmented-reality>","1","1","1","",""
"4809757","1","","","2011-01-26 20:37:13","5","2497","<p>I'm just starting out working with Android and it was recommended to me to try and find an Eclipse WYSIWYG plugin that could handle the top layer UI.</p><p>So far my searches haven't come up with much other than App Inventor (which won't really do the trick).</p><p>Any help would be greatly appreciated.</p><p>Mt</p>","591304","","","","","2011-01-26 20:42:43","Is there an Eclipse plugin for WSYIWYG UI for Android","<android>","2","0","","",""
"4809834","1","4810375","","2011-01-26 20:45:58","12","7700","<p>I have a view with radios, inputs and a button and when I click it, I want to check that all inputs contain information. How can I iterate through the view's elements in the activity and check if every textview meets the aforementioned requirement ? Thanks.</p>","253944","","","","","2014-03-27 17:02:12","How to iterate through a view's elements","<android><forms>","2","0","7","",""
"4809874","1","4809910","","2011-01-26 20:49:54","17","47433","<p>Beginner Android dev here.</p><p>I'm trying to create an app that will read the SMS messages stored on the device and then give the user statistics about their habits (like who they message often, common words, etc).  </p><p>But to my knowledge, there doesn't seem to be a way to do this. I've looked around on forums and the most anyone talks about is accessing the inbox where you can find messages the user hasn't read. How then can the default app and third-party (Handcent for example) display the same texts? They don't keep their own database because Handcent will display all texts upon fresh install.</p><p>tl;dr: How do I read SMS messages on an Android devices, specifically messages that have been read before.</p>","344688","","","","","2013-03-12 00:07:58","How to access the SMS storage on Android?","<android><sms><android-contentprovider>","3","2","11","",""
"4809934","1","","","2011-01-26 20:56:59","2","323","<p>I want to define a hierarchy as such:</p><pre><code>Category 1  SubCategory 1.1  SubCategory 1.2Category 2  SubCategory 2.1</code></pre><p>And I would like to do it using Android's XML files (the ones that go inside the ""values"" folder) and not using code.</p><p>In a ""regular"" XML file I would do something like:</p><pre><code>&lt;category&gt;  &lt;id&gt;1&lt;/id&gt;  &lt;title&gt;Category 1&lt;/title&gt;&lt;/category&gt;&lt;category&gt;  &lt;id&gt;11&lt;/id&gt;  &lt;title&gt;Category 1.1&lt;/title&gt;  &lt;parent_id&gt;1&lt;/parent_id&gt;&lt;/category&gt;</code></pre><p>Any suggestions? Thanks.</p>","425749","","","","","2011-01-26 21:04:15","Defining hierarchy using XML in Android","<android><xml><arrays>","1","0","","",""
"4810048","1","4810359","","2011-01-26 21:07:47","1","4251","<pre><code>int columnIndexFromAddrCountry;public FavoritesActAdapter(Context context, int layout,         Cursor c, String[] from, int[] to) {    super(context, layout, c, from, to);    gnCursor = c;    columnIndexFromAddrCountry =         c.getColumnIndex(DBAdapter.KEY_FROM_ADDR_COUNTRY);}@Overridepublic void bindView(View view, Context context, Cursor cursor) {    gnCursor = getCursor();    final String fromAddrCountry =         gnCursor.getString(columnIndexFromAddrCountry);        ...        super.bindView(view, context, cursor);}</code></pre><p>Why am I getting an <code>IllegalStateException</code>?</p><blockquote>  <p>IllegalStateException: get field slot  from row 0 col -1 failed</p></blockquote><p>What does this Exception mean? The Exception is thrown for this line </p><pre><code>final String fromAddrCountry = gnCursor.getString(columnIndexFromAddrCountry);</code></pre><p>because <code>columnIndexFromAddrCountry</code> is <code>-1</code>.The column exists and ten other columns can be resolved. What can causes this problem? </p><p>Thanks in advance!</p>","566904","","418183","","2011-01-26 21:16:31","2011-01-26 21:41:31","IllegalStateException: get field slot from row 0 col -1 failed","<android><cursor><listadapter>","1","0","","",""
"4810099","1","4824293","","2011-01-26 21:13:19","2","946","<p>It seems that in order to debug with adb on os x you need to have your droid x set to ""usb mass storage"". See the following:</p><p><a href=""http://stackoverflow.com/questions/3323271/droid-x-not-connecting-to-adb-on-os-x"">Droid X not connecting to adb on OS X</a></p><p>The problem with ""usb mass storage mode"" is that you cannot access the sd card while in this mode. The app I'm creating has some key functionality that accesses the sd card and needs to be debugged.</p><p>Is there a workaround for this issue?</p>","29899","","","","","2011-01-28 02:54:41","Droid x cannot debug and connect to sdcard at the same time (os x)","<android><eclipse><osx><motorola><motorola-droid>","2","0","","",""
"4810105","1","","","2011-01-26 21:13:56","7","2875","<p>I just installed Eclipse 3.6.1 and added the ADT Plugin v9 on Mac OS X 10.6.6. When I go to preferences to add the path to the Android SDK, I get a popup with ""Thanks for using the Android SDK!"" with a checkbox for enabling usage stats. At this point, Eclipse freezes, and I can neither continue nor cancel.</p><p>I have to force quit Eclipse, and when relaunching, the same issue appears every time.</p><p>Any ideas how to avoid or bypass this? I suppose the popup will only be displayed until some config value has been set to first_launch = false or similar.</p>","184844","","750987","","2011-05-29 06:49:04","2012-01-11 02:01:40","Android preferences freeze when using ADT Plugin v9 with Eclipse on Mac?","<android><eclipse><eclipse-plugin><adt><android-3.0-honeycomb>","5","3","","",""
"4810116","1","","","2011-01-26 21:14:46","3","18150","<p>I am writing an Android application that will connect to a MySQL server. For now, I am testing the MySQL server on my computer through XAMPP using <a href=""http://localhost:3306/"" rel=""nofollow"">http://localhost:3306/</a>.  The code below works fine when testing it strictly as a JAVA application.</p><pre><code>import java.sql.*;public class MySQL{  public static void main(String[] args) {    System.out.println(""MySQL Connect Example."");    Connection conn = null;    String url = ""jdbc:mysql://localhost:3306/"";    String dbName = ""database"";    String driver = ""com.mysql.jdbc.Driver"";    String userName = ""root"";     String password = """";    try {      Class.forName(driver).newInstance();      conn = DriverManager.getConnection(url+dbName,userName,password);      System.out.println(""Connected to the database"");      conn.close();      System.out.println(""Disconnected from database"");    } catch (Exception e) {      e.printStackTrace();    }  }}</code></pre><p>However when I add it to my Android application I get the Exception e error.</p><pre><code>// interact with MySQL!!! private View.OnClickListener onSendRequest = new View.OnClickListener() {  @Override  public void onClick(View v) {   EditText username = (EditText) findViewById(R.id.Huusername);      //    String un = "" "" + username.getText().toString() + "" "";      System.out.println(""MySQL Connect Example."");      Connection conn = null;      String url = ""jdbc:mysql://localhost:3306/"";      String dbName = ""database"";      String driver = ""com.mysql.jdbc.Driver"";      String userName = ""root"";       String password = """";      try {        Class.forName(driver).newInstance();        conn = DriverManager.getConnection(url+dbName,userName,password);        Toast.makeText(getBaseContext(),      ""Connected to the database."", Toast.LENGTH_LONG)      .show();        conn.close();        Toast.makeText(getBaseContext(),      ""Disconnected form the database."", Toast.LENGTH_LONG)      .show();      } catch (Exception e) {       Toast.makeText(getBaseContext(),      ""Exception e."", Toast.LENGTH_LONG)      .show();        e.printStackTrace();      }  } };</code></pre><p>As I am compiling my Android application, I notice the following statement in the Console:</p><pre><code>[2011-01-26 16:05:54 - hookup]: Dxwarning: Ignoring InnerClasses attribute for an anonymous inner class(com.mysql.jdbc.interceptors.ResultSetScannerInterceptor$1) that doesn't come with anassociated EnclosingMethod attribute. This class was probably produced by acompiler that did not target the modern .class file format. The recommendedsolution is to recompile the class from source, using an up-to-date compilerand without specifying any ""-target"" type options. The consequence of ignoringthis warning is that reflective operations on this class will incorrectlyindicate that it is *not* an inner class.</code></pre><p>I assume this statement has something to do with the Exception I am getting.  Has anyone worked with MySQL and Android that could lead me in the right direction?Thanks</p>","536673","","","","","2012-12-04 18:20:48","Android + MySQL using com.mysql.jdbc.Driver","<java><android><mysql><exception><inner-classes>","4","1","","",""
"4810152","1","4810262","","2011-01-26 21:18:48","6","2856","<p>We've been working on a webapp for some time now which is designed to be accessed solely through our Android app.  Obviously, the App itself is extremely lightweight -- mostly providing functionality for creating accounts and logging in, as well as make sure the webapp itself is only accessible through our Android app - BUT I digress...</p><p>The app is pretty dependent on PHP Session variables, which expire, and in the current testing environment, if your session expires you just get kicked out to the login screen anyway.  But in production, the login screen will be on the Android app, completely independent of the WebView.  </p><p>My idea right now is to have a Service run in the background which checks the timestamp we have in the database for a user's last activity, and if it's outside of a certain window, we close the webview.  But if there was someway we could just exit the app after 15 minutes (or whatever) of inactivity--that would be preferable--or at least easier... I think...</p><p>Is there a way to do this -- set up an auto timeout exit function?  Or maybe exit the app with the onPause function?</p>","446882","","","","","2011-01-26 21:31:27","Android App auto-exit/timeout functionality","<android><timeout><exit>","2","0","3","",""
"4810157","1","","","2011-01-26 21:19:00","2","639","<p>I am attempting to use a view flipper to animate the transition between 2 views. It seems that, by default, the ViewFlipper places the Out animation above the In animation in Z order. Is there a way to get the incoming animation to display over the outgoing animation?</p><p>Thanks</p>","583342","","","","","2011-01-31 20:22:41","Android ViewFlipper ZOrder","<android><animation><viewflipper><z-order>","1","0","1","",""
"4810218","1","4810282","","2011-01-26 21:25:41","4","398","<p>I want to develop an android application and publish it. It is a very simple messenger application.</p><p>For testing it on a <strong>real device</strong> I would need to buy a android phone first. Normally I would just set up some <strong>virtual devices</strong> with different screen resolutions and different sdk's and start the application on that devices using the <strong>emulator</strong>.</p><p>So would you recommend to test the application on a real device? Any other suggestion?</p>","401025","","401025","","2011-01-27 09:11:12","2012-02-21 13:56:43","Is it advisable to develop and publish an android application without testing it on a real device first?","<android><android-emulator>","7","1","1","",""
"4810333","1","9433422","","2011-01-26 21:37:40","6","646","<p>When I click on ""Show CPU usage"" checkbox, nothing happens. Checkbox does not get checked.</p><pre><code>Dev Tools &gt; Development Settings &gt; Show CPU usage</code></pre><p>Any ideas?</p>","62192","","","","","2014-02-11 23:32:56","Can't enable ""Show CPU usage"" on emulator","<android>","2","3","1","",""
"4810356","1","","","2011-01-26 21:41:21","1","795","<p>After spending more time on this issue, I found that launching my app from a link within an email DOES in fact work. However, it only works if I set up my android email app with a gmail account. It does not work for the other two accounts: yahoo and work email. So that means, only when I view the email link within my gmail account, I could launch the app. Anyone know what configuration I'm missing or why this is happening?</p><p>--- original question below ---</p><p>Hi, So I was able to get my app to launch from an email link using a custom scheme, however I am only seeing this work while debugging using the emulator. I cannot get it to work when testing on the actual phone/device.It shows Web page not available The Web page at email:// might be temporarily down or it may have moved permanently to a new web address. Is this because the application has not yet been signed? How do I test on my actual phone device.Thanks</p>","591326","","591326","","2011-01-27 16:54:01","2011-01-27 16:54:01","Launching app from email link only works from gmail account","<android>","1","2","","",""
"4810421","1","4903506","","2011-01-26 21:49:17","2","9660","<p>I've an WebApp showed with Webview.  In those pages I've some links to videos (MP4, 3GP...).When I click on the link, nothing happend ?  Can somebody helpme about this case ?</p><pre><code>public class luxgateway extends Activity {WebView myWebView;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);         myWebView = (WebView) findViewById(R.id.webview);    myWebView.getSettings().setJavaScriptEnabled(true);    myWebView.getSettings().setAllowFileAccess(true);     WebViewClient webViewClient = new MyWebViewClient();    myWebView.setWebViewClient(webViewClient);    myWebView.loadUrl(""http://www.XXX.com/demo.html"");}public boolean onKeyDown(int keyCode, KeyEvent event) {    if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; myWebView.canGoBack()) {        myWebView.goBack();        return true;    }    return super.onKeyDown(keyCode, event);}private class MyWebViewClient extends WebViewClient {    public boolean shouldOverrideUrlLoading(WebView view, String url) {        if (url.endsWith("".3gp"")) {            Intent intent = new Intent(""android.intent.action.VIEW"", Uri.parse(url));            view.getContext().startActivity(intent);                return true;        } else {            return super.shouldOverrideUrlLoading(view, url);        }    }}</code></pre><p>I've found some parts on this code on this server, but it does'nt help me.</p><pre><code>        if (url.endsWith("".3gp"")) {            Intent intent = new Intent(""android.intent.action.VIEW"", Uri.parse(url));            view.getContext().startActivity(intent);                return true;        } else {            return super.shouldOverrideUrlLoading(view, url);        }</code></pre><p>In this case I'm limited to 3GP files, but I'don't know which extension will be place on the WEBsite.</p><p>I've tryed this code thisout the test, only to see if the video could be played (or videoplayer start with only this code </p><pre><code>                Intent intent = new Intent(""android.intent.action.VIEW"", Uri.parse(url));            view.getContext().startActivity(intent);                return true;</code></pre><p>In this case, the video is only dowloaded.  I want to have the sample interaction as the webrowser.  When I click on the video link, the browser ask wich player I want to user for this video.</p><p>Thank's for your help.</p>","590708","","","","","2011-06-03 07:55:18","Open video player in webview?","<android><video><webview><player>","1","0","2","",""
"4810448","1","","","2011-01-26 21:52:02","0","868","<p>I have a Location service that runs in the background as long as the the device is booted. I requested the network and gps provider update by calling LocationManager requestLocationUpdate method, however, when the My Location setting page is changed by enabling or disabling the location service, the onProviderEnabled or on ProviderDisabled are never called. So I want to know how could my background service got notified everytime the user changes the location setting? Can I do it in a receiver mode which caches the broadcast message ?</p>","591387","","","","","2011-01-27 02:19:04","android :how to get noticed when the My Location setting location service is enabled or disabled by user","<android><location>","1","2","","",""
"4810478","1","","","2011-01-26 21:55:04","8","14767","<p>When trying to create an AVD with the android SDK AVD manager I get 'Error: null'. This keeps happening because the SDK manager is looking for 'List of existing Android Virtual Devices located at \...(wrong location).How can I change the file location?</p>","591390","","","","","2014-03-13 03:50:59","Android SDK and AVD Manager -Cant create AVD in correct file location","<android>","4","0","5","",""
"4810529","1","4813699","","2011-01-26 21:59:49","8","3953","<p>how can i get android device's platformId,deviceUser,deviceName,deviceModel, deviceOperatingSystem,deviceOSVersion from my program.</p><p>Edit: i have already used that Build class and got device id, model and user but for my requirement i need device OS, OS version and platform id.so how can i get them??</p><p>thanks<br>venu</p>","461975","","461975","","2011-01-27 04:56:44","2011-02-24 07:29:42","How to get android device properties","<android>","3","0","2","",""
"4810550","1","4810659","","2011-01-26 22:01:58","3","1369","<p>Very odd bug that I cant seem to figure out, been looking at it for about an hour trying to refactor to fix this issue, but I cant seem to figure it out, maybe a fresh set of eyes will be able to help me.  Listed below is a short bit of code.  Any help is appreciated.</p><p>Sample KML coordinate string</p><pre><code>-98.493095,29.416311,0.000000</code></pre><p>KMLHandler.java (I read in kml in a string format)  </p><pre><code>String[] coords = s.split("","");     if ( coords.length == 3 ) {        GeoPoint gp = GeoPointUtils.getGeoPoint(coords[0].trim(), coords[1].trim());      ((Region)overlayItem).addCoordinate(gp);      Log.d(TAG, ""gp.getLat(): "" + gp.getLatitudeE6())      Log.d(TAG, ""gp.getLong():"" + gp.getLongitudeE6());    }</code></pre><p>GeoPointUtils.java</p><pre><code>public static GeoPoint getGeoPoint(double latitude , double longitude) {   Log.d(TAG, ""GeoPointUtils.getGeoPoint(double)"");   Log.d(TAG, ""\tIncoming lat -&gt; "" + latitude);   Log.d(TAG, ""\tConverted lat -&gt; "" + (int) (latitude * 1E6));   Log.d(TAG, ""\tIncoming long -&gt; "" + longitude);   Log.d(TAG, ""\tConverted long -&gt; "" + (int) (longitude * 1E6));   return new GeoPoint((int) (latitude * 1E6), (int) (longitude * 1E6));}public static GeoPoint getGeoPoint(String latitude , String longitude) {   Log.d(TAG, ""GeoPointUtils.getGeoPoint(String)"");   Log.d(TAG, ""\tIncoming lat -&gt; "" + latitude);   Log.d(TAG, ""\tConverted lat -&gt; "" + Double.parseDouble(latitude));   Log.d(TAG, ""\tIncoming long -&gt; "" + longitude);   Log.d(TAG, ""\tConverted long -&gt; "" + Double.parseDouble(longitude));   return getGeoPoint(Double.parseDouble(latitude), Double.parseDouble(longitude));}</code></pre><p>Logcat results (sorry for syntax highlighting)</p><pre><code>GeoPointUtils.getGeoPoint(String)   Incoming lat  -&gt; -98.493095   Converted lat -&gt; -98.493095   Incoming long -&gt;  29.416311   Converted long -&gt; 29.416311GeoPointUtils.getGeoPoint(double)   Incoming lat  -&gt; -98.493095   Converted lat -&gt; -98493095   Incoming long -&gt;  29.416311   Converted long -&gt; 29416311gp.getLat(): -80000000gp.getLong(): 29416311</code></pre>","561717","","454406","","2011-01-26 22:05:23","2011-01-26 22:27:38","GeoPoint getLatitudeE6() returning -80000000 but getLongitudeE6() returns correct value","<java><android>","2","0","","",""
"4810694","1","4817163","","2011-01-26 22:17:20","3","1415","<p>I am trying to build a child view with 7 columns and 24 TextViews in each column.</p><p>I get an exception when my activity starts and it does not have my package anywhere in the stack trace.</p><p>Here is my background drawable resource for each of the 24 text views</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;layer-list xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item&gt;&lt;shape&gt;&lt;solid android:color=""#CCC""/&gt;&lt;/shape&gt;&lt;/item&gt;    &lt;item android:top="".5pt"" android:bottom="".5pt""&gt;        &lt;shape android:shape=""line""&gt;            &lt;size android:height=""1pt"" android:color=""#CCC"" android:dashWidth=""1pt"" android:dashGap=""1pt"" /&gt;        &lt;/shape&gt;    &lt;/item&gt;&lt;/layer-list&gt;</code></pre><p><strike>The CPU goes to 100% for a second or two before this happens.</strike></p><p>I am using the emulator for Android 2.2</p><p>Here is my exception.</p><pre><code>01-26 16:51:38.084: ERROR/AndroidRuntime(955): FATAL EXCEPTION: main01-26 16:51:38.084: ERROR/AndroidRuntime(955): java.lang.NullPointerException01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.graphics.Canvas.drawLine(Canvas.java:809)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.graphics.drawable.GradientDrawable.draw(GradientDrawable.java:347)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.graphics.drawable.LayerDrawable.draw(LayerDrawable.java:320)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.View.draw(View.java:6725)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.drawChild(ViewGroup.java:1640)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.View.draw(View.java:6846)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.widget.FrameLayout.draw(FrameLayout.java:352)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.View.buildDrawingCache(View.java:6502)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.onAnimationStart(ViewGroup.java:1253)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.drawChild(ViewGroup.java:1499)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.View.draw(View.java:6743)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.drawChild(ViewGroup.java:1640)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.View.draw(View.java:6743)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.widget.FrameLayout.draw(FrameLayout.java:352)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.drawChild(ViewGroup.java:1640)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.View.draw(View.java:6743)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.widget.FrameLayout.draw(FrameLayout.java:352)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1842)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewRoot.draw(ViewRoot.java:1407)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1163)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.os.Handler.dispatchMessage(Handler.java:99)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.os.Looper.loop(Looper.java:123)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at java.lang.reflect.Method.invokeNative(Native Method)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at java.lang.reflect.Method.invoke(Method.java:521)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-26 16:51:38.084: ERROR/AndroidRuntime(955):     at dalvik.system.NativeStart.main(Native Method)</code></pre><h3>Edit</h3><p>Renaming size to stroke eliminates the crash but I do not get a dotted line. I want a horizontal dotted line either in the middle or on the bottom of the drawable.</p>","463304","","463304","","2011-01-27 13:41:16","2011-01-27 13:53:26","Android: java.lang.NullPointerException at android.graphics.Canvas.drawLine(Canvas.java:809) (probably related to my drawable resource)","<android><nullpointerexception><drawable>","1","7","","",""
"4810709","1","","","2011-01-26 22:20:02","0","321","<p>I'm struggling to find the root cause of a problem that occurs apparently randomly in my application. I have a listener registered for SENSOR.TYPE_ORIENTATION in my service and on Screen OFF broadcast I unregister the listener, and on Screen ON a register it again.From time to time, after phone reboot, or maybe unplug, while the most of the time the phone is in stand by I get a high sensor usage in phone information (along with high battery use associated with my app...)In logcat I find lines like this just before Screen OFF :</p><p>01-26 18:02:52.891 E/SensorManager(13487): unregisterListener: alex.munteanu.SimpleService$2@48790020 MS-3C Orientation Sensor</p><p>These are some kind of errors that shows that the Listener could not be unregistered ?If yes, why and what can I do ?</p>","467780","","","","","2011-01-26 22:20:02","High sensor usage in stand by","<android><listener><sensor>","0","2","","",""
"4810803","1","10213314","","2011-01-26 22:28:55","50","21013","<p>from my Android app, I would like to open a link to a Facebook profile in the official Facebook app (if the app is installed, of course). For iPhone, there exists the <code>fb://</code> URL scheme, but trying the same thing on my Android device throws an <code>ActivityNotFoundException</code>.</p><p>Is there a chance to open a Facebook profile in the official Facebook app from code?</p>","459812","","","","","2014-02-25 11:49:23","Open Facebook page from Android app?","<android><facebook><url-scheme>","6","1","32","",""
"4811022","1","","","2011-01-26 22:50:08","0","669","<p>I have an arraylist for some kind of objects. These objects, have some attributes like strings and some integers. But also, an arraylist of another kind of objects. </p><p>I create the 2nd object first. And group them into an arraylist of this kind of objects. Then i check if this arraylist is empty. If its not, then i create the other object, and pass it the first arrayList. And put it inside another arraylist. So at the end, i have an arraylist of one kind of objects. And all of these objects, also have an arraylist (and a few other values, like some strings and integers) with other objects.</p><p>The problem is that at the end, when i try to acces the arraylist inside one of these objects, its empty.</p><p>Dont know if what im trying to do in imposible. Ive declared both arraylists as arraylists of objects. Perhaps i should declare them as an arraylist of arraylists?</p><p>Thanks in advance.</p><p>Edited:</p><p>Would be something like this:</p><pre><code>class Obj1 {    String string;    int integer;    ArrayList objects2;    public Obj1(String string, int integer, ArrayList objects2) {        this.string = string;        this.integer = integer;        this.objects2 = objects2;    }}</code></pre><p>This would be the first object (its ArrayList objects2, but ""&lt;>"" doesnt appear).</p><pre><code>class Obj2 {    String string;    int integer;    public Obj2(String string, int integer2) {        this.string = string;        this.integer = integer;    }}</code></pre><p>Same as before with the ""&lt;>""s.</p><p>Then, with an asynctask, i start to search from a webpage. I create some Ob2. I can have from 0 to maybe, 15. So if i get some, put all of them into an ArrayList of Objs2. Then i create an Obj1 and pass it its attributes string and integer, and the ArrayList of Objs2. And after, put this Obj1 into ArrayList of Objs1.</p><p>At the end, i can have for example, 12 Ojs1 into an ArrayList. And each one of these Obj1, have an ArrayList of Objs2, with 1 to 15 Objs2. What i return from the asynctask is the ArrayList of Objs1.</p><p>Hope you understand what i mean. Also my english wont help. hehe</p><p>Thanks again.</p><p>Edited 2:</p><p><pre><code>private class DownloadWork extends AsyncTask<code>&lt;URL, String, List&lt;Obj1&gt;&gt;</code> {    ArrayList<code>&lt;Obj1&gt;</code> objs1Downloaded = new ArrayList<code>&lt;Obj1&gt;</code>();    ArrayList<code>&lt;Obj2&gt;</code> objs2Downloaded = new ArrayList<code>&lt;Obj2&gt;</code>();    //Some more stuff    protected List doInBackground(URL... params) {    for(...) {        //Do some stuff here ...    }    return objs1Downloaded;}</pre></code></p><p>That objs1Downloaded, as i said, would have 12 objs1 for example. And each obj1 could have an arraylist of objs2, with 1 to 15 obj2. Thats more or less the idea.</p><p>Thanks again and sorry for the edits and so.</p>","568288","","568288","","2011-01-27 00:22:36","2011-01-27 00:22:36","Problem: Arraylist of objects, with objects wich also have arraylist inside","<java><android><arraylist>","1","2","","",""
"4811211","1","4811438","","2011-01-26 23:11:19","3","1323","<p>I'm currently using the AudioTrack to play back recorded music. This involves writing the track data to the audio buffer. How would I go about using the audio data stream to draw a wave form on the screen that represents the audio being played in real time? I've not used any advanced graphics on android before I'm not sure how to get started. Do I have to use openGL or can I implements a View? and also how do I convert the data to something useful to use for drawing.</p>","460449","","","","","2012-03-12 19:58:45","Visualising Android AudioTrack from a ByteStream","<java><android><graphics>","2","0","3","",""
"4811301","1","4811480","","2011-01-26 23:23:01","0","688","<p>I'm trying to draw an image inside a do while in the <code>OnCreate</code> method but it fails to show.</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_NO_TITLE);     getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);     drawElements();}public void drawElements(){     do{         RelativeLayout layout = new RelativeLayout(this);   RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(80, 60);params.setMargins(0, 0, 0, 0);   ImageView image = new ImageView(this);personaje.setImageResource(R.drawable.image);layout.addView(image, params);      setContentView(layout);      Log.i(""MainActivity"",""here comes"");     }while(!esc)    }</code></pre><p>It's strange because it comes in the <code>do while</code>, because the log shows constantly on the LogCat but the image does not show.</p><p>In fact, it fails to remove the status bar or the title of the application as specified in the <code>onCreate</code>, but if I remove the do while it shows everything correctly. </p><p>Any suggestions?</p>","591452","","23199","","2011-01-26 23:33:13","2011-01-26 23:45:37","cannot display an image with a do while in the OnCreate method","<android><image>","1","2","","",""
"4811352","1","4811443","","2011-01-26 23:29:07","0","715","<p>I am currently trying to get my code to reject a null (empty) input, every time I enter nothing for values it crashes, however telling it to reject ""0"" worked (as seen in the else if part of the code).</p><pre><code>boolean check_input1 = Add.this.input.getText().toString().equals(null);        boolean check_input2 = Add.this.input2.getText().toString().equals(null);        boolean check_input3 = Add.this.input3.getText().toString().equals(null);        float pricecheck_input2 = Float.valueOf(Add.this.input2.getText().toString().trim()).floatValue();        float pricecheck_input3 = Float.valueOf(Add.this.input3.getText().toString().trim()).floatValue();        if (check_input1 == true | check_input2 == true | check_input3 == true) {       // prepare the alert box               AlertDialog.Builder alertbox = new AlertDialog.Builder(Add.this);               // set the message to display               alertbox.setMessage(""No fields may be blank"");               alertbox.show();        }        else if (pricecheck_input2 == 0 | pricecheck_input3 == 0) {         // prepare the alert box               AlertDialog.Builder alertbox = new AlertDialog.Builder(Add.this);               // set the message to display               alertbox.setMessage(""Prices must be greater than 0"");               alertbox.show();        }        else {         new InsertDataTask().execute(Add.this.input.getText().toString(), Float.toString(abv_ppl_calculation), Add.this.input3.getText().toString());        }</code></pre><p>Help would be greatly appreciated!</p>","576820","","","","","2011-01-27 00:16:25","Android - Reject null input problem","<android><validation><input><filter><mask>","1","1","","",""
"4811366","1","","","2011-01-26 23:30:47","4","2630","<p>So I have a class that draws and does all the lifting in my game, which extends SurfaceView.I want to start a new Activity that shows the score of the player after he dies. The GameOver activity has the score.How do I do this?</p>","591148","","","","","2011-10-08 10:47:48","How to make a class that extends SurfaceView start an Activity?","<android><activity><surfaceview>","1","0","1","",""
"4811456","1","","","2011-01-26 23:41:17","1","547","<p>I want the user to be able to select from ALL images - those included with my app aswell as any they may have on their sdcard.  For example, I have a .jpg file called cat.jpg in the data/com.mypackage/files folder, but it will not show in the list of images.  This is the code I used, but it only displays images on the sdcard: </p><pre><code>  // Open up a gallery browser  Intent intent = new Intent();  intent.setType(""image/*"");  intent.setAction(Intent.ACTION_GET_CONTENT);  startActivityForResult(Intent.createChooser(intent, ""Select Picture""),1);</code></pre><p>I know that  I could have two screens, one showing my images and another showing those from the sdcard, but I would rather have all of pictures in one gallery list. </p><p>Any ideas?Thank you.</p><p>update:Since no one has responsed, then maybe this type of task just can't be done.  I cannot find any documentation one way or the other.  If someone knows where the gallery view gets its data, please let me know (docs just says images - not the source of them).  Or if it is not possible to combine all images from both the phone and the sdcard in one display, I would appreciate that response also.    </p><p>Thanks again.</p>","591491","","591491","","2011-01-27 13:24:17","2011-01-27 13:24:17","How can I display all images - those included with the app and on the sdcard?","<android>","0","2","1","",""
"4811473","1","4811578","","2011-01-26 23:43:57","1","1694","<p>What sort of data do credit card readers output? I know that many have drivers that automatically translate data into something useful, but what sort of raw data is there? I'm referring to card readers like the free ones given out by <a href=""http://squareup.com"" rel=""nofollow"" title=""Square"">Square</a> that input data via the microphone port of a device. Do those sort of readers just pull raw data straight from a card to be interpreted by the software, or do the card readers themselves do any sort of data formatting.</p>","553508","","","","","2012-06-29 20:35:23","What sort of data do credit card readers output?","<iphone><android><api><data><credit-card>","2","0","","",""
"4811564","1","4814859","","2011-01-26 23:57:27","14","27916","<p>I'm running Eclipse Helios on Mac and just updated to ADT 9.0.0.It seems to have broken the Layout editor.Any time I try to open a layout xml file with the layout editor I get an error.The editor has a ""missing theme"" message while the main error generated is as follows.</p><pre><code> Selecting page '0' in AndroidXmlEditor failed    java.lang.NullPointerExceptionat com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.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:1067)at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:607)at com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor.selectDefaultPage(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor.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.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.Display.sendEvent(Display.java:3776)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1367)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1390)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1187)at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3622)at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3277)at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)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(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:597)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)Session data eclipse.buildId=M20100909-0800 java.version=1.6.0_22 java.vendor=Apple Inc.BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US Framework arguments:  -product org.eclipse.epp.package.java.product -keyring /Users/test/.eclipse_keyring -showlocation command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.java.product -keyring /Users/test/.eclipse_keyring -showlocation</code></pre><p>I even tried reinstalling Eclipse and Android plugins but to no avail. Not found anything on the web either I'm afraid.Anyone else have the same problem or any suggestions?</p><p>tim</p>","516286","","","","","2012-05-16 11:03:09","Eclipse Android Graphical Layout Editor Broken","<android><eclipse><android-layout>","7","2","1","",""
"4811603","1","","","2011-01-27 00:02:33","2","2139","<p>I see several examples here, but none speak to backing up SQLite databases specifically, does anyone have a sample of doing this?<a href=""http://www.microdu.com/docs/guide/topics/data/backup.html"" rel=""nofollow"">http://www.microdu.com/docs/guide/topics/data/backup.html</a></p>","558783","","810368","","2012-10-29 10:19:19","2013-09-22 13:00:15","Looking for a BackupAgent (for a sqlite database) example","<android><sqlite><android-backup-service>","1","2","1","",""
"4811646","1","","","2011-01-27 00:08:10","0","310","<p>I am guessing that it would be a shake listener of some sort. but what I want to do is have the sound play when I shake the phone. could some one help? I know that there is a way I see them all the time. Any help is GREATLY appreciated.</p>","424421","","","","","2011-01-27 00:59:21","implement sound into shake?","<android><sdk><shake>","1","0","","",""
"4811688","1","","","2011-01-27 00:13:33","7","11843","<p>Guys, in onCreateDialog i have this: </p><pre><code>case DIALOG_REVIEW: {    if (bundle.containsKey(""POSITION"")) {    final int position = bundle.getInt(""POSITION"");    ArrayList&lt;String&gt; alterNumbers = numbers.get(position);    final String[] phoneNums = new String[alterNumbers.size()];    for (int i = 0; i &lt; alterNumbers.size(); i++) {        phoneNums[i] = alterNumbers.get(i);    }    AlertDialog.Builder dialog = new AlertDialog.Builder(this);    dialog.setTitle(names.get(position) + ""'s number(s)"");    dialog.setSingleChoiceItems(phoneNums, 0,        new DialogInterface.OnClickListener() {            @Override            public void onClick(DialogInterface dialog,                int which) {            // get selected item and close the dialog            String selectedNumber = phoneNums[which];            updateUserSelectedNumber(position , selectedNumber);            }        });    return dialog.create();    }</code></pre><p>which is working and great.</p><p>BUT pay attention to line </p><pre><code>dialog.setSingleChoiceItems(phoneNums, 0,        new DialogInterface.OnClickListener() {</code></pre><p>phoneNums are suppose to be changing each time the dialog pops up.I've overriden onPrepareDialog method but I don't know how to assign new values to it.and also there is no setSingleChoiceItems there.</p><p>here is my onPrepareDialog method</p><pre><code>case DIALOG_REVIEW: {    final int position = bundle.getInt(""POSITION"");    ArrayList&lt;String&gt; alterNumbers = numbers.get(position);    final String[] phoneNums = new String[alterNumbers.size()];    for (int i = 0; i &lt; alterNumbers.size(); i++) {    phoneNums[i] = alterNumbers.get(i);    }    AlertDialog alertDialog = (AlertDialog) dialog;    alertDialog.setTitle(names.get(position) + ""'s number(s)"");    ???    break;}</code></pre><p>What is the solution?thanks in advance guys.</p>","536853","","536853","","2011-01-27 17:46:04","2011-09-28 17:52:26","how to set contents of setSingleChoiceItems in onPrepareDialog?","<android><dialog><activity><alertdialog>","2","0","4","",""
"4811864","1","4811941","","2011-01-27 00:43:18","1","748","<p>I'm writing an alarm-based application, and I'm looking for a way to wake up the user insistently. Ideally, I'd like the phone to vibrate, ring, and display a message. I tried a few different options, here's what I have for the moment:</p><ul><li><p>Have the background service start an activity that vibrates &amp; plays music.</p><blockquote>  <p>problem: even with a WAKE_LOCK, it seems that the user still has to turn on the screen and unlock it to see my activity</p></blockquote></li><li><p>Use the AlarmManager with RTC_WAKEUP and a broadcast receiver to start the aforementioned activity</p><blockquote>  <p>same issue</p></blockquote></li><li><p>Simply pop up a notification, which the user can click to see the activity</p><blockquote>  <p>problem: stil the same issue, and also I can't get the notification to vibrate and ring, and repeat often until dismissed</p></blockquote></li></ul><p>What I would really like is to have a  behaviour similar to the basic Android morning alarm, or similar to receiving a phone call: regardless of whether your phone is awake or sleeping, it rings, vibrates and displays information such as a message, a photo...</p><p>Any tips on the direction to use would be greatly appreciated! I'm sure I've seen alarm apps or ""fake phone call"" apps do something similar, but I'm out of ideas.</p><p>Cheers</p><p>ps: in the context of this application, I think it would be reasonable to wake up the user this way. A discreet notification would not be appropriate - unless you can wake up to a single vibration :)</p>","51473","","51473","","2011-01-27 00:53:14","2011-01-27 00:57:23","Android: creating an insistent alarm (ex: morning alarm, incoming call)","<android><screen><alarm><vibrate><ring>","1","0","","",""
"4811905","1","4813072","","2011-01-27 00:50:22","8","26562","<p>How do you programmatically set the width of an ImageView inside a TableRow? I do NOT want the cell width to change, only the width of the image inside the cell.</p><p><em>Layout: (The ellipsis are there to reduce the code)</em></p><pre><code>&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""horizontal""&gt;&lt;TableRow android:gravity=""center_vertical""&gt;&lt;Button&gt;...&lt;/Button&gt;&lt;ImageView    android:id=""@+id/fruit""    android:layout_width=""120dp""    android:layout_height=""44dp""    android:src=""@drawable/apple""    android:scaleType=""matrix""&gt;&lt;/ImageView&gt;&lt;Button&gt;...&lt;/Button&gt;&lt;/TableRow&gt;&lt;TableRow&gt;...&lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p><em>Java:</em></p><pre><code>ImageView iv = (ImageView) findViewById(R.id.fruit);LayoutParams frame = iv.getLayoutParams();frame.width = 100;iv.setLayoutParams(frame);</code></pre><hr><p><strong>EDIT</strong>: i want the image to be cropped inside the bounds i set and have the table cell be the original width. Below is the code example that worked for me thanks to parag's suggestion:</p><pre><code>Bitmap bmp = BitmapFactory.decodeResource(getResources() , R.drawable.apple); int width = 50;int height = 44; Bitmap resizedbitmap = Bitmap.createBitmap(bmp, iv.getScrollX(), iv.getScrollY(), width, height);iv.setImageBitmap(resizedbitmap);</code></pre>","591546","","591546","","2011-01-27 19:20:04","2012-04-10 14:35:18","Android: how to programmatically set width of ImageView inside TableRow","<android><android-layout>","2","0","4","",""
"4811920","1","4812005","","2011-01-27 00:54:10","8","8703","<p>I need to get the speed and heading from the gps. However the only number i have from <code>location.getSpeed()</code> is 0 or sometimes not available.  my code: </p><pre><code>        String provider = initLocManager();    if (provider == null)        return false;    LocationListener locListener = new LocationListener() {        public void onLocationChanged(Location location) {            updateWithNewLocation(location, interval, startId);            Log.i(getString(R.string.logging_tag), ""speed ="" + location.getSpeed());        }        public void onProviderDisabled(String provider){            updateWithNewLocation(null, interval, startId);        }        public void onProviderEnabled(String provider) {}        public void onStatusChanged(String provider, int status, Bundle extras) {}    };    _locManager.requestLocationUpdates(provider, interval,  DEFAULT_GPS_MIN_DISTANCE, locListener);    private String initLocManager() {    String context = Context.LOCATION_SERVICE;    _locManager = (LocationManager) getSystemService(context);    Criteria criteria = new Criteria();    criteria.setAccuracy(Criteria.ACCURACY_FINE);    criteria.setAltitudeRequired(false);    criteria.setBearingRequired(true);    criteria.setSpeedRequired(true);    criteria.setCostAllowed(true);    //criteria.setPowerRequirement(Criteria.POWER_LOW);    String provider = _locManager.getBestProvider(criteria, true);    if (provider == null || provider.equals("""")) {        displayGPSNotEnabledWarning(this);        return null;    }    return provider;}</code></pre><p>I tried to play the Criteria with but no success. Does anyone have an idea what is the problem?</p>","591539","","1431239","","2012-09-05 02:34:45","2014-03-22 10:52:05","why getSpeed() always return 0 on android","<android><gps><performance><location>","4","0","9","",""
"4811947","1","4812465","","2011-01-27 00:58:25","1","231","<p>I have a basic object that responds to flings on the screen. my problem i am not sure how to animate the image I am flinging on the screen. basically I have a static image of a football, that I want to animate as its flung across the screen. here is a snippet of my code where I define my image to fling:</p><pre><code>public PlayAreaView(Context context) {            super(context);            translate = new Matrix();            gestures = new GestureDetector(FGKick.this,                    new GestureListener(this));            football = BitmapFactory.decodeResource(getResources(),                    R.drawable.fgball);        }</code></pre>","565644","","142162","","2011-01-27 02:19:12","2011-01-27 03:33:53","animating an object after fling gesutre","<java><android>","1","0","","",""
"4811967","1","4812000","","2011-01-27 01:00:54","0","191","<p>Hey all, so I have a start and a stop button. What I would like to happen is once the start button is clicked, it disappears and the stop button shows up right in the spot of the start button so that the stop button is able to be clicked. Is this done by switch statements?</p><pre><code>//Start Buttonbtnstart.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        ...   }});//Stop Buttonbtnstop.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        ...        }    }});</code></pre>","533049","","79125","","2011-01-31 00:11:18","2011-01-31 00:11:18","How do you switch from 1 button to another in Android?","<android>","1","5","","",""
"4811981","1","","","2011-01-27 01:02:51","2","6872","<p>I am trying to draw a circle in opengl-es using the following code. It creates a number of points around a circle. If I print out the values in the vertex array it can be seen that they form points around a circle.</p><pre><code>// Create verticies for a circlepoints=40;vertices = new float[(points+1)*3];//CENTER OF CIRCLEvertices[0]=0.0f;vertices[1]=0.0f;vertices[2]=0.0f;for (int i = 3; i&lt;(points+1)*3; i+=3){    double rad = deg2rad(i*360/points);    vertices[i] = (float) (Math.cos(rad));    vertices[i+1] = (float) (Math.sin(rad));    vertices[i+2] = 0;}// vertexBuffer is filled with verticies</code></pre><p>And the calls to opengl in my drawing function:    </p><pre><code>// IN MY DRAWING FUNCTION:gl.glPushMatrix();gl.glTranslatef(x, y, 0);gl.glScalef(size, size, 1.0f);gl.glColor4f(1.0f,1.0f,1.0f, 1.0f); gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);gl.glDrawArrays(GL10.GL_TRIANGLE_FAN, 0, points/2);gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);gl.glPopMatrix();</code></pre><p>However I never get a circle drawn to the screen, only ever a square. I am very confused, any help is appreciated :)</p>","315998","","44729","","2011-01-27 04:52:41","2013-01-28 05:13:37","Drawing a circle in android with opengl-es results in a square","<android><opengl-es><trigonometry><circle>","2","1","1","",""
"4812032","1","5051900","","2011-01-27 01:10:11","7","6348","<p>I would like to be able to detect all forms of data usage using the android environment. Is it possible to keep tabs on which applications call on say RTP vs WAP etc such that i can know at all times when data is being used by a native program or third party app? </p><p>your help and guidance would be appreciated as i am a novice at all of this and just starting to learn about android.</p>","245823","","","","","2011-02-19 17:13:17","how to go about detecting data usage in the android env","<android>","2","0","5","",""
"4812114","1","","","2011-01-27 02:29:36","0","5196","<p>I have a new project - MyProject.  In that project I have the class <code>MyProject</code> and another class <code>uTorrent</code>.  How do I show a toast from the uTorrent class?  When I try this:</p><pre><code>Toast toast = Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_LONG);</code></pre><p>I get this error: </p><blockquote>  <p>The method getApplicationContext() is undefined for the type uTorrent</p></blockquote><p>Thanks</p>","531100","","","user577537","2012-07-18 08:49:50","2012-07-18 09:06:48","How to create a Toast from a class","<android>","6","0","","",""
"4812193","1","4812950","","2011-01-27 02:44:15","0","587","<p>My fade in code works properly, but at the end before transitioning to the main .java file it shows the image again for a second. What could I do to fix this?</p><p>FadeIn code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;setxmlns:android=""http://schemas.android.com/apk/res/android""android:shareInterpolator=""false""&gt;&lt;alphaandroid:fromAlpha=""0.0""android:toAlpha=""1.0""android:duration=""1500""&gt;&lt;alphaandroid:startOffset=""1500""android:fromAlpha=""1.0""android:toAlpha=""0.0""android:duration=""1500""&gt;&lt;/alpha&gt;&lt;/alpha&gt;&lt;/set&gt;</code></pre>","394842","","","","","2011-01-27 05:09:31","Android <alpha> issues... image blinks?","<android><eclipse><animation><fadein><alpha>","1","0","","",""
"4812297","1","","","2011-01-27 02:58:11","0","1847","<p>I've searched for a long time and haven't quite found the answer. There are several that come close, but nothing that seems to exactly answer my question! I would like to take a set of coordinates, create a polygon out of them, and determine if a given location is inside that polygon. Any help would be very appreciated!</p>","591598","","","","","2012-11-20 12:19:04","How can I determine if a location (lat/long) is within a certain polygon with corners that all have a given lat/long as well in Android?","<android><location><polygon><point-in-polygon>","3","2","","",""
"4812907","1","","","2011-01-27 04:59:46","0","811","<p>The code below seems to crash my app</p><p>Not sure why</p><p>Help appreciated.</p><pre><code>final String SOAP_ACTION = ""http://tempuri.org/MyFunction"";    final String METHOD_NAME = ""MyFunction"";    final String NAMESPACE = ""http://tempuri.org/"";    final String URL = ""http://localhost:23250/WS1.asmx"";    final SoapObject requestObject = new SoapObject(NAMESPACE, METHOD_NAME);    requestObject.addProperty(""UserIdentifier"", """");    requestObject.addProperty(""PhoneIdentifier"", """");    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);    envelope.dotNet = true;    envelope.setOutputSoapObject(requestObject);    try    {        HttpTransport androidHttpTransport = new HttpTransport(URL);        androidHttpTransport.call(SOAP_ACTION, envelope);        SoapObject response = (SoapObject)envelope.getResponse();        String result =  response.getProperty(0).toString();    }    catch(Exception e)    {        e.printStackTrace();    }</code></pre><p>I can call the webservice from my browser just fine</p><p>Below is the LogCat data</p><pre><code>01-27 09:29:49.564: DEBUG/dalvikvm(296): GC_EXPLICIT freed 307 objects / 16416 bytes in 169ms01-27 09:29:55.555: INFO/ActivityManager(106): Starting activity: Intent { cmp=myapp.android.v2/.myPage }01-27 09:29:56.035: INFO/dalvikvm(1074): Could not find method javax.microedition.io.Connector.open, referenced from method org.ksoap2.transport.ServiceConnectionMidp.&lt;init&gt;01-27 09:29:56.035: WARN/dalvikvm(1074): VFY: unable to resolve static method 113: Ljavax/microedition/io/Connector;.open (Ljava/lang/String;IZ)Ljavax/microedition/io/Connection;01-27 09:29:56.035: DEBUG/dalvikvm(1074): VFY: replacing opcode 0x71 at 0x000501-27 09:29:56.035: DEBUG/dalvikvm(1074): VFY: dead code 0x0008-000d in Lorg/ksoap2/transport/ServiceConnectionMidp;.&lt;init&gt; (Ljava/lang/String;)V01-27 09:29:56.055: INFO/dalvikvm(1074): Could not find method javax.microedition.io.HttpConnection.close, referenced from method org.ksoap2.transport.ServiceConnectionMidp.disconnect01-27 09:29:56.055: WARN/dalvikvm(1074): VFY: unable to resolve interface method 114: Ljavax/microedition/io/HttpConnection;.close ()V01-27 09:29:56.065: DEBUG/dalvikvm(1074): VFY: replacing opcode 0x72 at 0x000201-27 09:29:56.065: DEBUG/dalvikvm(1074): VFY: dead code 0x0005-0005 in Lorg/ksoap2/transport/ServiceConnectionMidp;.disconnect ()V01-27 09:29:56.085: INFO/dalvikvm(1074): Could not find method javax.microedition.io.HttpConnection.openInputStream, referenced from method org.ksoap2.transport.ServiceConnectionMidp.openInputStream01-27 09:29:56.085: WARN/dalvikvm(1074): VFY: unable to resolve interface method 115: Ljavax/microedition/io/HttpConnection;.openInputStream ()Ljava/io/InputStream;01-27 09:29:56.085: DEBUG/dalvikvm(1074): VFY: replacing opcode 0x72 at 0x000201-27 09:29:56.095: DEBUG/dalvikvm(1074): VFY: dead code 0x0005-0006 in Lorg/ksoap2/transport/ServiceConnectionMidp;.openInputStream ()Ljava/io/InputStream;01-27 09:29:56.115: INFO/dalvikvm(1074): Could not find method javax.microedition.io.HttpConnection.openOutputStream, referenced from method org.ksoap2.transport.ServiceConnectionMidp.openOutputStream01-27 09:29:56.115: WARN/dalvikvm(1074): VFY: unable to resolve interface method 116: Ljavax/microedition/io/HttpConnection;.openOutputStream ()Ljava/io/OutputStream;01-27 09:29:56.115: DEBUG/dalvikvm(1074): VFY: replacing opcode 0x72 at 0x000201-27 09:29:56.115: DEBUG/dalvikvm(1074): VFY: dead code 0x0005-0006 in Lorg/ksoap2/transport/ServiceConnectionMidp;.openOutputStream ()Ljava/io/OutputStream;01-27 09:29:56.135: INFO/dalvikvm(1074): Could not find method javax.microedition.io.HttpConnection.setRequestMethod, referenced from method org.ksoap2.transport.ServiceConnectionMidp.setRequestMethod01-27 09:29:56.135: WARN/dalvikvm(1074): VFY: unable to resolve interface method 117: Ljavax/microedition/io/HttpConnection;.setRequestMethod (Ljava/lang/String;)V01-27 09:29:56.145: DEBUG/dalvikvm(1074): VFY: replacing opcode 0x72 at 0x000201-27 09:29:56.145: DEBUG/dalvikvm(1074): VFY: dead code 0x0005-0005 in Lorg/ksoap2/transport/ServiceConnectionMidp;.setRequestMethod (Ljava/lang/String;)V01-27 09:29:56.165: INFO/dalvikvm(1074): Could not find method javax.microedition.io.HttpConnection.setRequestProperty, referenced from method org.ksoap2.transport.ServiceConnectionMidp.setRequestProperty01-27 09:29:56.165: WARN/dalvikvm(1074): VFY: unable to resolve interface method 118: Ljavax/microedition/io/HttpConnection;.setRequestProperty (Ljava/lang/String;Ljava/lang/String;)V01-27 09:29:56.165: DEBUG/dalvikvm(1074): VFY: replacing opcode 0x72 at 0x000201-27 09:29:56.175: DEBUG/dalvikvm(1074): VFY: dead code 0x0005-0005 in Lorg/ksoap2/transport/ServiceConnectionMidp;.setRequestProperty (Ljava/lang/String;Ljava/lang/String;)V01-27 09:30:05.580: WARN/ActivityManager(106): Launch timeout has expired, giving up wake lock!01-27 09:30:05.796: WARN/ActivityManager(106): Activity idle timeout for HistoryRecord{4405ce08 myapp.android.v2/.myPage}</code></pre>","399411","","399411","","2011-01-27 09:34:47","2012-04-26 06:27:27","ksoap2 101 how to","<android><eclipse><android-emulator><adt><ksoap2>","4","2","","",""
"4812947","1","","","2011-01-27 05:08:53","1","3884","<p>It now plays on first press, stops on second press or press of another sound button. If I let a sound play through I can restart it or play another sound on a single press. </p><p>My goal is for the second press of the same button to stop it, but the press of a new button to just start the new sound instead of first press of new button stopping the old sound, second press starting the new sound.</p><p>I can see why it does what it does now but am not sure how to make it work the way I want.</p><pre><code>public void playSound(int input){    if (mp!=null &amp;&amp; mp.isPlaying()) {         mp.stop();         mp.reset();    } else{         if (mp!=null){             mp.reset();             mp.release();         }         mp = MediaPlayer.create(Soundboard.this, input);         mp.start();    }}</code></pre>","585308","","183110","","2011-12-01 18:42:30","2011-12-01 18:42:30","Android: Mediaplayer stop / start playing raw resource","<android><media-player><stop><playback>","1","2","1","",""
"4812977","1","4813016","","2011-01-27 05:14:06","2","5366","<p>I want to develop a panel with animation same as notification panel. I mean to say the notification panel is a cool control where you grab and slide down the notification bar and see all the notifications.</p><p><strong>Actually, I am having 2 UI , 1st should be shown with Button at top, when user click on that button, the 2nd UI with listview items should be slide down same as notification panel and again when user click or drag the 2nd UI at the top side, then 2nd UI should be become invisible. I hope i made clear my question.</strong></p><p>From <strong><code>Christian's answer</code></strong>, I am trying to use a sliding drawer that will display alist of options. I need this to expand over the current ListView on the page.</p><p>So if anybody know how to implement such layout or UI with sliding down animation then please share it. </p><p>Please suggest how to build with such control or layout? any ideas or suggestions</p><p>Thanx</p>","379693","","379693","","2011-01-27 06:03:50","2012-10-09 14:30:28","android - UI like sliding down notification bar","<android><android-layout><android-ui><android-notifications>","3","0","1","",""
"4813091","1","","","2011-01-27 05:35:43","0","127","<p>I have to make application in android.similar to the that made in the iphone,,Here is the link <a href=""http://itunes.apple.com/us/app/road-trip-bingo/id376434962?mt=8#"" rel=""nofollow"">http://itunes.apple.com/us/app/road-trip-bingo/id376434962?mt=8#</a>can anybody tell me how should i proceed.Should i start with the User designing part first??  Thanks in advanceTushar Sahni</p>","475349","","","","","2011-03-18 07:13:27","making an application similar in android like that of iphone","<android>","1","3","","",""
"4813134","1","","","2011-01-27 05:44:17","0","687","<p>want to download a file from a online server and I don't want it to be acessible outside my application so I have protected the folder using the control panel , now I need to know how can I acccess and download that file in my java program ? Its an android app that downloads a database. My situation is that I have two databases, one for the free app and another for the paid version.And I dont want people downloading the paid version to the pc and using them on the free version app.Is there another easy way ?</p>","591724","","591724","","2011-01-27 05:55:34","2011-02-05 14:54:11","how can I download a file from a password protected folder in java","<java><android><passwords><download><protection>","1","0","","",""
"4813224","1","","","2011-01-27 06:01:38","1","1062","<p>below is my code for listactivity can anyone tell me how can i get the event for an item click?</p><pre><code>public class MyCustomListView extends ListActivity{    private ArrayList&lt;String&gt; m_orders=null;    private ArrayList&lt;String&gt; artistsList=new ArrayList&lt;String&gt;();    private OrderAdapter m_adapter;    String[] array;    String[] artists;    ListView listView;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.main);        Intent intent=getIntent();        array=intent.getStringArrayExtra(""trackname"");        artists=intent.getStringArrayExtra(""artists"");        m_orders = new ArrayList&lt;String&gt;();        for(int i=0;i&lt;array.length;i++)        {            m_orders.add(array[i]);            artistsList.add(artists[i]);        }        this.m_adapter = new OrderAdapter(this, R.layout.row, m_orders);                setListAdapter(this.m_adapter);    }    private class OrderAdapter extends BaseAdapter    {        private ArrayList&lt;String&gt; items;        public OrderAdapter(Context context,int id,ArrayList&lt;String&gt; items)        {            super();            this.items=items;        }        public View getView(int position,View convertView,ViewGroup parent)        {            View view=convertView;            if(view==null)            {                LayoutInflater inflater=(LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);                view=inflater.inflate(R.layout.row,parent,false);            }            String string=items.get(position);            if(string!=null)            {                TextView t1=(TextView)view.findViewById(R.id.toptext);                TextView t2=(TextView)view.findViewById(R.id.bottomtext);                if(t1!=null)                {                    t1.setText(items.get(position));                }                if(t2!=null)                {                    String artistName=artistsList.get(position);                    if(artistName.equals(""""))                    {                        t2.setText(""UnKnown"");                    }                    else                    {                        t2.setText(artistName);                    }                }            }            return view;        }        @Override        public int getCount() {            // TODO Auto-generated method stub            return array.length;        }        @Override        public Object getItem(int position) {            // TODO Auto-generated method stub            return position;        }        @Override        public long getItemId(int position) {            // TODO Auto-generated method stub            return position;        }    }    @Override    public void onListItemClick(ListView arg0, View arg1, int arg2, long arg3) {          Log.i(""Position"",""""+arg2);            }</code></pre><p>what is the wrong with this code?</p>","411359","","","","","2011-01-27 07:00:21","listactivity doesnt respond the onlistitemclick event?","<android><android-layout>","2","0","","",""
"4813228","1","4813308","","2011-01-27 06:02:39","0","857","<p>I'd like to ask for your help concerning Android's built in Camera Interface</p><p>When i click capture, the screen captures(meaning it freezes)But when i click ok, it hangs. It's suppose to go back to the main interface but it doesn't.When i press cancel, it would force close.the code is pretty long but this is my listener:</p><pre><code> @Override     protected void onActivityResult(int requestCode, int resultCode, Intent data)      {      super.onActivityResult(requestCode, resultCode, data);      Double x = null;      Toast.makeText(mContext, x.toString(),Toast.LENGTH_LONG);         if (resultCode == Activity.RESULT_OK) {             switch (requestCode) {             case CAMERA_PIC_REQUEST:                 image.setImageURI(uri);                 break;             }         }}</code></pre><p>thanks..</p>","535837","","","","","2011-01-27 06:26:08","Android Built-in Camera Interface wont return image and crashes on cancel","<android><camera>","2","0","","",""
"4813239","1","4813288","","2011-01-27 06:04:40","0","279","<p>I've deleted my debug key, generated a new one, gotten the new MD5 fingerprint and registered that with google and used the new API key in my layout XML, still broken. It was all working fine until a few days ago. Now all my maps are just a bunch of X's. Any ideas?</p><p>Do I need to sign my app for debug/development? All I have done so far is generate the fingerprint and used that to get an API key, am I missing a step perhaps?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""edu.elon.ecs""      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;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;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;service android:name=""NewsEvents_Service""&gt;&lt;/service&gt;        &lt;activity android:name="".ECS""                  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=""ElonMap""&gt;&lt;/activity&gt;        &lt;activity android:name=""NavigationActivity""&gt;&lt;/activity&gt;        &lt;activity android:name=""NewsEvents""&gt;&lt;/activity&gt;        &lt;activity android:name=""EditKeywords""&gt;&lt;/activity&gt;        &lt;activity android:name=""FullNewsEvent""&gt;&lt;/activity&gt;                &lt;activity android:name=""OnTheJob""&gt;&lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""4""/&gt;&lt;/manifest&gt; </code></pre>","180825","","180825","","2011-01-27 06:29:28","2011-11-09 01:16:57","All of a sudden the Maps in my Android Map stop working and all I see are a bunch of X's","<android>","2","4","0","",""
"4813268","1","4813338","","2011-01-27 06:09:22","0","1857","<p>In made the android app. I installed it in my mobile. When I press back button on my mobile it comes out of the app. But it is running in the background. So, how can I finish the activity completely? I wrote the code <code>onkeydown</code> event also. Even it is running in background. </p>","537819","","221194","","2013-06-03 11:25:24","2013-06-03 11:29:05","Completely finish the actitvity","<android>","6","0","","",""
"4813323","1","4814626","","2011-01-27 06:17:53","0","2809","<p>I am running Ubuntu inside VirtualBox installed on Windows 7. For some reason, when I type <code>adb devices</code> after connecting my phone, nothing happens. It just gives me a message saying that no devices were found. </p><p>The device is recognized in Windows but under Ubuntu, nothing happens. I tried using sudo but that doesn't work either. Is there anyway to get Ubuntu inside the VM to recognize the device?</p>","184046","","","","","2011-01-27 13:09:21","Android device not being recognized inside Ubuntu running in VirtualBox on Windows 7?","<android><linux><ubuntu><virtual-machine><virtualbox>","2","0","","",""
"4813336","1","4813671","","2011-01-27 06:18:52","4","8203","<p>java.lang.UnsatisfiedLinkError</p><p>I'm using the hello-jni example, and for whatever reason, I'm getting a java.lang.UnsatisfiedLinkError when I try to call the hello-jni library. Any ideas why? Do I have to set my path somewhere?</p><p>in HelloJni.java:</p><pre><code>public native String  stringFromJNI();</code></pre><p>and</p><pre><code>static {    System.loadLibrary(""hello-jni"");}</code></pre><p>in hello-jni.c:</p><pre><code>jstringJava_com_bdunlay_hellojni_HelloJni_stringFromJNI( JNIEnv* env,                                                  jobject thiz ){    return (*env)-&gt;NewStringUTF(env, ""Hello from JNI !"");}</code></pre><p><img src=""http://i.stack.imgur.com/fOoMd.png"" alt=""exception trace""></p><p>the .so file is... project_root/libs/armeabi/libhello-jni.so</p>","387064","","387064","","2011-01-27 06:49:34","2013-09-03 08:32:37","java.lang.UnsatisfiedLinkError","<android><android-ndk>","3","6","","",""
"4813452","1","","","2011-01-27 06:36:38","0","1486","<p>Hi have created a file login.html and display it using webview. However, I would like to create the text box with titanium javascript and not html tag. Can anyone give me an example on this?</p>","324850","","324850","","2011-01-27 07:01:43","2011-01-31 14:58:10","How to create textbox with titanium api in a html doc","<javascript><android><titanium>","1","3","","",""
"4813466","1","","","2011-01-27 06:38:59","2","995","<p>I have been building an app whose base function is to translate things into various languages.</p><p>However, I can't find a way to let the TextView support languages like Arabic, Hindi, Tamil, Telugu and so on.</p><p>So far, I have seen that device manufacturers are controlling which language their device supports. Like, Samsung supports Hindi in India but no one else does.</p><p>I am also providing my custom fonts for Arabic, Hindi, Tamil and other languages in assets, still nothing works.</p><p>Any workaround?</p>","243709","","527702","","2012-10-08 15:24:25","2012-10-08 15:24:25","Supporting various languages (Hindi, Arabic, Tamil) in Android","<android><arabic><hindi><tamil>","0","5","","",""
"4813484","1","","","2011-01-27 06:41:25","1","263","<p>I have one <code>ListActivity</code> on which i want to overlap one transparent view. Is it possible? If so, how?</p>","411359","","244296","","2011-01-28 04:49:47","2011-01-28 14:44:48","How to overlap view on ListActivity that has a custom adapter?","<android><android-layout>","2","0","","",""
"4813486","1","4813559","","2011-01-27 06:42:04","3","2857","<p>I have a MediaPlayer member variable posted in my parent class, and after I start it, it doesn't ever call onCompletion, or at least onCompletionListener doesn't ever catch it? My code looks something to this effect</p><pre><code>mediaPlayer = Mediaplayer.create(this, currentSample);mediaPlayer.start();</code></pre><p>elsewhere in code is my onCompletionListener</p><pre><code>mediaPlayer.setOnCompletionListener(new OnCompletionListener() {    public void onCompletion(MediaPlayer mp) {              if (repeatFlag == true) {            handler.removeCallbacks(sampleRunnable);            handler.postDelayed(sampleRunnable, delay);        }    }   });</code></pre><p>I'm using the handler to call sampleRunnable because I want to loop it at a specified delay interval. However, onCompletion seems to never be called. I'm quite positive of this because I've set breakpoints in onCompletion which never suspends the program, and I've tried stepping through and it never seems to be called. Any ideas? </p>","591604","","","","","2011-11-01 19:44:31","onCompletion isn't being called when I would expect it to","<android>","3","0","1","",""
"4813619","1","","","2011-01-27 07:04:35","0","520","<p>In one of my application my customer reported the problem with installation. He/She is unable to install my application in his/her Android mobile it's having problem to install application in SD card how to fix this problem?</p><p>Thanks,   </p>","532445","","","","","2011-01-27 09:21:46","Problem with my Android application installation in SD Card?","<android><android-manifest>","1","1","","",""
"4813627","1","","","2011-01-27 07:05:58","0","323","<p>I am having trouble making an app that draws the path of an projectile. I have all the data about the path of the object, but I am having trouble getting the program to actually draw it. The height and width need to be kept in their proper ratios, but I also need it to fit the containing view. In other words, no matter what the actual distances of the arc are, either the height or the width should fill the view. Whenever I run the program, though, all I get are 2 lines for some reason. Does anyone know why this is happening? Here is the code that I've come up with (there is also some functioning code for drawing the ground in there):</p><pre><code>float constx = 400;    float consty = 375;    float deltx = (float) ProjectileMotionDrawingActivity.dx;    float delty = (float) ProjectileMotionDrawingActivity.dy;    float maxDrawingHeight;    float totwidth;    float totheight;    float starty;    float ydist;    float cx = canvas.getWidth()/2;    float cy = 210;    boolean limiter;    float vin = (float) ProjectileMotionDrawingActivity.vin;    float vxd = (float) ProjectileMotionDrawingActivity.vxd;    float acc = (float) ProjectileMotionDrawingActivity.ac;    float scaleda;    float scaledv;    float scaledvi;    //Set background color and get paint ready    canvas.drawColor(Color.WHITE);    Paint linePaint = new Paint(Paint.ANTI_ALIAS_FLAG);    linePaint.setColor(Color.BLACK);    //Define maxDrawingHeight    if(delty &gt;= 0){        maxDrawingHeight = (float) ProjectileMotionDrawingActivity.mhe;    }else{        maxDrawingHeight = (float) (ProjectileMotionDrawingActivity.mhe + Math.abs(delty));    }    // Determine whether x or y is limiting factor (true=x, false =y) (For future use if needed)    if(Math.abs(maxDrawingHeight/deltx) &gt;=consty/constx){        limiter = false;    }else{        limiter = true;    }    //set width and height of projectile motion    if(limiter){        totwidth = constx;        totheight = constx*maxDrawingHeight/deltx;        scaleda = acc*constx/deltx;        scaledvi = vin*constx/deltx;        scaledv = vxd*constx/deltx;    }else{        totheight = consty;        totwidth = consty*deltx/maxDrawingHeight;        scaleda = acc*consty/maxDrawingHeight;        scaledvi = vin*consty/maxDrawingHeight;        scaledv = vxd*consty/maxDrawingHeight;    }    //height of cliff    ydist = delty*totheight/maxDrawingHeight;    //start height    starty = cy+(totheight/2);    canvas.drawLine(0, starty, totwidth+35, starty, linePaint);    canvas.drawLine(totwidth+35, starty, totwidth+35, starty-ydist, linePaint);    canvas.drawLine(totwidth+35, starty-ydist, 2*cx, starty-ydist, linePaint);    //Parabola    float porabx = 35;    float poraby = starty;    float porabx2 = 35 + totwidth/50;    float poraby2 = (float) (starty - scaledvi*porabx2/scaledv-.5*scaleda*Math.pow(porabx2/scaledv,2));    for(int i=0;i&lt;50;i++){        canvas.drawLine(porabx, poraby, porabx2, poraby2 , linePaint);        porabx = porabx2;        poraby = poraby2;        porabx2 += totwidth/50;        poraby2 = (float) (starty - scaledvi*porabx2/scaledv-.5*scaleda*Math.pow(porabx2/scaledv,2));    }</code></pre>","583082","","","","","2011-01-27 07:05:58","Drawing a projectile porbaola in android","<android><physics><draw><gravity>","0","2","","",""
"4813668","1","4813945","","2011-01-27 07:12:34","1","411","<p>I want to create <code>layout</code> programmatically in different class which is not an <code>activity</code> so i will call one function from Activity and all code for creating layout is in function. so please give me some idea to write code.</p><p>this is my Activity:</p><pre><code>public class Main extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    TableLayout tl = (TableLayout) findViewById(R.id.table1);    testing t1 = new testing();    Main m = new Main();   t1.makelayout(tl,m); }}</code></pre><p>And this is my class which has function that is generating layout programmatically:</p><pre><code>public class testing {public void makelayout(TableLayout tl,Main m1) {    // TODO Auto-generated method stub    //Main m = new Main();     TextView tv= new TextView(m1);      tv.setText(""hello1"");      tl.addView(tv);  }}</code></pre><p>can i do this or not please help me.</p>","591790","","720508","","2012-09-03 13:23:10","2012-09-03 13:23:10","Making activity layout in another class","<android>","1","0","","",""
"4813773","1","","","2011-01-27 07:32:57","1","1913","<p>I am developing an Android native application in Eclipse using Java and I added that MySQL connector for Java. I want to display data from database in mobile emulator. I'm unable to connect to the database.</p>","591812","","496830","","2011-11-08 13:55:59","2011-11-08 13:55:59","How can I connect to the database?","<android>","3","0","","",""
"4813816","1","5042270","","2011-01-27 07:39:35","1","841","<p>Application has a tabhost managed through TabActivity.It has option to add tabs at runtime.</p><p>Say 5 tabs are added in runtime and different activities are shown.</p><p>When I rotate the screen the activity undergoes the cycle o destroy and create. I want to maintain the tabs added by user in runtime to be available during this cycle.</p>","62889","","62889","","2011-01-28 03:00:45","2011-02-18 14:08:23","How to save tabhost tabs between destroy-create cycle","<android><android-tabhost><android-lifecycle>","1","0","1","",""
"4813822","1","","","2011-01-27 07:40:19","5","911","<p>I have a webview in which user has to type their email and password in the corresponding input fields. I want to show the email friendly keyboard when the user taps on the email field. How to do it using javascript ?</p><p>I tried using the javascript by using the following code</p><pre><code> String emailKeyboard=""document.getElementById('src').type=\""email\"";""; mWebView.loadUrl(""javascript:(function() { "" + emailKeyboard +""})()"");</code></pre><p>also i tried by getting the element by name as</p><pre><code>String emailKeyboard=""document.getElementByName('j_username').type=\""email\"";"";mWebView.loadUrl(""javascript:(function() { "" + emailKeyboard +""})()"");</code></pre><p>where j_username is the name of the input field. But it is not working. Any help greatly appreciated.</p><p>Thanks,Senthil.M</p>","404196","","404196","","2011-01-28 05:12:25","2011-08-07 01:58:44","Android email friendly keyboard in the input field of webview","<android><email><input><keyboard><webview>","1","0","0","",""
"4813825","1","8854908","","2011-01-27 07:40:41","0","409","<p>I thought that i can use oauth to login to my AdSense account page to view how much i've earned today, but it seems that AdSense is not in <a href=""http://googlecodesamples.com/oauth_playground/"" rel=""nofollow"">oauth list</a> </p><p>duplicate of <a href=""http://stackoverflow.com/questions/4683105/google-adsense-for-android"">this post</a> and <a href=""http://stackoverflow.com/questions/3937975/source-code-to-retrieve-google-adsense-earnings"">this one</a> </p><p>htt_p://www.adsensefeed.info/ provide exactly what i want, but i just don't understand how to get to adsense account by myself. Help me please :)</p>","464328","","464328","","2011-01-27 09:19:36","2012-01-13 17:47:00","Google AdSense monitor android app","<android><login><monitor><adsense>","1","0","1","",""
"4813828","1","4813883","","2011-01-27 07:41:17","2","4042","<p>I am trying to calculate the distance between two map point using Google Map in android. I have used two lat long value to put two map pin and also able to draw a route between two points.Now how to calculate distance of the path that i have drawn?Please any body help!</p><p>Thanks &amp; Regards!</p>","489762","","","","","2012-07-23 21:20:06","Distance between two map point or lat long in android","<android>","3","0","1","",""
"4813831","1","4813885","","2011-01-27 07:41:38","5","23450","<pre><code>import android.content.pm.ActivityInfo;import android.os.Bundle;import android.preference.ListPreference;import android.preference.Preference;import android.preference.PreferenceActivity;import android.util.Log;import android.view.Window;import android.view.WindowManager;public class OptionsActivity extends PreferenceActivity { private ListPreference mListPreference; @Override protected void onCreate (Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);  requestWindowFeature(Window.FEATURE_NO_TITLE);  getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);              getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);  addPreferencesFromResource(R.xml.options);  mListPreference = (ListPreference) findPreference(""listpreference"");  mListPreference.setPersistent(false);   }}Exception Stacktrace is given below:01-27 12:35:51.920: ERROR/AndroidRuntime(615): FATAL EXCEPTION: main01-27 12:35:51.920: ERROR/AndroidRuntime(615): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.game/com.android.game.OptionsActivity}: android.util.AndroidRuntimeException: requestFeature() must be called before adding content01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at android.os.Handler.dispatchMessage(Handler.java:99)01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at android.os.Looper.loop(Looper.java:123)01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at java.lang.reflect.Method.invokeNative(Native Method)01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at java.lang.reflect.Method.invoke(Method.java:521)01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at dalvik.system.NativeStart.main(Native Method)01-27 12:35:51.920: ERROR/AndroidRuntime(615): Caused by: android.util.AndroidRuntimeException: requestFeature() must be called before adding content01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:172)01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at android.app.Activity.requestWindowFeature(Activity.java:2719)01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at com.android.game.OptionsActivity.onCreate(OptionsActivity.java:20)01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)01-27 12:35:51.920: ERROR/AndroidRuntime(615):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)01-27 12:35:51.920: ERROR/AndroidRuntime(615):     ... 11 more</code></pre>","534957","","233142","","2011-01-27 11:13:40","2012-05-11 13:40:25","requestWindowFeature(Window.FEATURE_NO_TITLE); gives the exception","<android><android-preferences>","2","0","0","",""
"4813995","1","4814651","","2011-01-27 08:06:35","11","9408","<p>Is it possible to set and get the Alpha/Opacity of a Layout and all it's child views? I'm not talking about the background. Say a collection of Video Controls like Play, Pause and Progressbar in a Relative Layout.</p><p>I can use animation to fade in and out but wanted to know if there was a direct method I could use.</p>","553462","","","","","2013-09-21 12:12:22","Set Alpha/Opacity of Layout","<java><android><user-interface>","3","0","8","",""
"4814035","1","4814146","","2011-01-27 08:14:23","0","1311","<p>I am new to android.I have a image which is declared in xml file using imageView.The problem is onRuntime I want to replace that with any image from gallery when the image is long clicked.what should I have to do.Thanks in advance</p>","366916","","","","","2011-01-27 08:31:16","Android-Replace one image by another image","<android>","2","0","","",""
"4814065","1","","","2011-01-27 08:20:06","1","101","<p>I have recently gotten a new android phone and it does not have root intill the  30 day warranty is up.my older android has root access but it is my sisters now.i use to use drocap </p><p>So what im asking is  there a way were I can take a screen shot of my app in the emulater.i know on a mac (thats what I use) you can take screen spots with command shift 4. But is there something for the emulater in eclipse that I can use to take screen shots?</p>","583952","","","","","2011-01-27 08:23:33","what is the easiest way to take screen spots of an android app?","<android>","1","0","","",""
"4814124","1","4814716","","2011-01-27 08:26:34","22","44879","<p>I have TextView added Programmatically in to LinearLayout and on some external events I want to decrease bottom margin of that TextView to -10, for that I tried following. </p><pre><code>LinearLayout.LayoutParams lastTxtParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);lastTxtParams.setMargins(0, 0, 0, -10);mOldTextView.setLayoutParams(lastTxtParams);mOldTextView.invalidate();</code></pre><p>Is the right way of modifying Margin of widget that has been added to View?<br>Some how it is not working.</p><p>Thanks,<br>PP.</p>","314247","","","","","2014-03-03 12:25:18","How to Change Margin of TextView","<android>","5","0","5","",""
"4814185","1","4814325","","2011-01-27 08:34:27","2","1829","<p>In my apps I currently only support the portrait orientation for some activities, because I assume that most phone users will be using portrait orientation (and holding the device with one hand) most of the time.</p><p>On the new Honeycomb tablets, however, it seems likely that users will be using the landscape orientation much more often, so I'd like to support both orientations for more of my activities.</p><p>I'd rather not have to go back and add landscape layouts for the smaller screen sizes (all the way down to QVGA), though, so I'm wondering if there's a way of supporting landscape only for the xlarge screen type but not for the others.</p>","98286","","750987","","2011-05-29 06:48:57","2011-08-10 01:23:18","Is it possible to support both orientations on some screen sizes but not others?","<android><screen-orientation><android-3.0-honeycomb>","1","1","2","",""
"4814196","1","","","2011-01-27 08:36:11","0","2731","<p>I have  a relative layout which consists a <code>Button</code> a <code>EditText</code></p><p>At the time of page loading I am initializing the relative layout like this </p><pre><code>RelativeLayout bottomLayout;bottomLayout = (RelativeLayout) findViewById(R.id.s_r_l_bottom);RelativeLayout.LayoutParams layoutParams =      (RelativeLayout.LayoutParams) bottomLayout .getLayoutParams();layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, -1);bottomLayout.setLayoutParams(layoutParams );</code></pre><p>As a result my relative layout was at the bottom of the screen.Now what I am trying that  I also have  <code>Button</code> on the top the screen .</p><p>By pressing the button I want that the relative layout will be on the center of the screen</p><p>For that I have used the following code on button click(The code is executing.I have tested that).But it did not help me.</p><pre><code>RelativeLayout.LayoutParams layoutParams =     (RelativeLayout.LayoutParams) bottomLayout.getLayoutParams();layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT, -1);bottomLayout.setLayoutParams(layoutParams);</code></pre><p>Can you please help me out to fix this?</p>","463721","","23368","","2011-01-27 08:48:57","2011-01-27 11:11:16","Relative Layout Programmatically","<android><android-layout><relativelayout>","1","0","","",""
"4814230","1","4815089","","2011-01-27 08:41:08","3","2900","<p>I have a linear layout say V1, inside L1 i have a scrollview V2, Inside scrollview i have another linear layout V3, Now V3 has a gridtview V4. The pbm is that if my listview has say 6 items, only 2 are visible, for rest i have to scroll even when i see plenty of space left vacant. I set the background colors(Background color for V2:magenta, for V3 Green) and observed this:V2 covers the entire V1V3 covers only a fraction say 30% of V2,V4 covers complete V3.So I have done nearly everything i could follow to make V3 cover All of V2, but not success.I have wasted many hours on this, plz let me know if this has any solution.</p><p>//Scrollview Params V2LinearLayout.LayoutParams svParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,     ViewGroup.LayoutParams.WRAP_CONTENT,1.0F);</p><p>So all these things I tried do not work:</p><pre><code>V3.getLayoutParams().height = V2.getHeight();//((LinearLayout)gv.getParent()).getLayoutParams().height = LinearLayout.LayoutParams.FILL_PARENT;//((LinearLayout.LayoutParams)((LinearLayout)gv.getParent()).getLayoutParams()).weight = 1.0F;//((LinearLayout) ((LinearLayout)gv.getParent()).getParent()).getLayoutParams().height = LinearLayout.LayoutParams.FILL_PARENT;</code></pre><p>BUT if I give some hardcoded value for V4, it does increases the height of all its parent views,but I do not want to do that and that is not feasible in my application</p>","340353","","266272","","2011-01-27 11:15:52","2011-01-27 11:15:52","Linear layout in a scrollview does not occupies full height","<android>","2","0","","",""
"4814307","1","4814648","","2011-01-27 08:53:05","0","520","<p>I'm making my own image to run on the Android Emulator. Within this image I have a application that wants to use alsa for sound. Is this possible withing the Android Emulator?</p><p>With adb push I send over aplay. And with aplay -l I get a message that there are no sound devices available. </p><p>Any idea how I can do this? </p>","359156","","359156","","2011-01-27 10:08:06","2011-12-01 09:23:31","Can I run a application with alsa inside the android emulator?","<android><image><audio><android-emulator><alsa>","2","1","","",""
"4814341","1","","","2011-01-27 08:56:53","0","84","<p>I am new to android.</p><p>I have an application where i am calculating the loan amount based on salary. For that I have a database of salary,Tax and medicare column. The tax and medicare depends upon the salary bracket. I want to know how to create the database and access it through the coding.</p><p>If any good sample code example is there please give the link.</p><p>Thanks in advance.</p>","582760","","","","","2011-01-27 09:26:01","android database issue","<android><database>","4","0","","",""
"4814417","1","5546073","","2011-01-27 09:06:34","0","871","<p>How can i do the live http radio stream on android and Blackberry? I didn't fine suitable example for live streaming on Android and Blackberry.</p>","573847","","","","","2011-04-05 12:45:46","How can i do the http radio stream on android and Blackberry?","<java><android><blackberry><audio><streaming>","1","2","1","",""
"4814443","1","","","2011-01-27 09:10:06","0","722","<p>I have created auto text reply application in which i declared receiver in manifeast file and declared action tag as follows.</p><pre><code>&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; </code></pre><p>In receiver class i just check action type of receiver as follows.</p><pre><code>public void onReceive(Context context, Intent intent){          if(intent.getAction().equalsIgnoreCase(""android.provider.Telephony.SMS_RECEIVED""))         {           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"";                     address=msgs[i].getOriginatingAddress();                 }       /* other functionality........... */     }     }</code></pre><p>Now this receiver is getting call for incoming text message but some time missed call alsoi don't want this to get call on missed call. what i have to do to avoid missed call.</p><p>Thank You.  Vikram</p>","395627","","","","","2011-08-26 20:05:32","broadcast receiver for sms receive is geting call at missied call in Android","<android>","1","0","","",""
"4814610","1","4814636","","2011-01-27 09:29:38","0","302","<p>Hi <br>I need to write a query to delete specific colums of a particular row from SQLIte in Android.I want to use it in the form of  ""db.delete (String table, String whereClause, String[] whereArgs)"". Actually my application contains 4 columns for each row.  I need to delete only 2 columns of a particular row.<br>Can anyone help me in sorting out this issue?</p><p>Thanks in Advance, </p>","429501","","","","","2011-01-27 09:41:23","how to delete specific colums of a particular row from SQLIte in Android","<android>","2","0","","",""
"4814640","1","5531686","","2011-01-27 09:32:23","23","3611","<p>As recomended here <a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">http://developer.android.com/guide/practices/screens_support.html</a> for compatibility reasons my AndroidManifest.xml contains this:</p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""4""/&gt;</code></pre><p>This generates warning in eclipse:</p><blockquote>  <p>Attribute minSdkVersion (3) is lower  than the project target API level (4)</p></blockquote><p>Are there any means to suppress this warning or get rid of it any other way? It is really annoying.</p>","544406","","","","","2012-05-24 10:44:09","Suppress AndroidManifest.xml minSdkVersion related warning","<android><android-manifest><suppress-warnings>","3","0","4","",""
"4814699","1","7361024","","2011-01-27 09:38:02","2","499","<p>i am about to complete my application but i am facing few problems with facebook and twitter.</p><p>1). I have downloaded and installed facebook application in my device but now when my app redirects on facebook as per it's flow, it open ups that installed facebook app instead of my FB official SDK login screen. Any solution to this?</p><p>2). I am using Fb Official SDK and twitter4j 2.1.7 which was working perfectly, but after upgrading my device to Android 2.1update1.. Both Fb and Twitter has stopped working with Device whereas works fine in emulator of the same update or later.</p><p>Please do help in these regard asap. </p><p>Thanks in advance. </p>","457146","","","","","2011-09-09 11:34:05","Downloaded Facebook app replaces my App's facebook login page","<android><facebook><twitter>","1","0","1","",""
"4814788","1","","","2011-01-27 09:47:05","1","6637","<p>In the table layout i have a tablerow and in that tablerow i have 6 edit text boxes and i want to set the layout margins for that 6 edit text boxes </p><pre><code>TableLayout t1=(TableLayout)findViewById(R.id.table_layout01);  TableRow tr1=new TableRow(inventory.this);  tr1.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));  tr1.setBackgroundColor(Color.BLACK);  EditText ed6=new EditText(inventory.this);  //ed6.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));  /*ViewGroup.MarginLayoutParams editmargin=new ViewGroup.MarginLayoutParams(ViewGroup.MarginLayoutParams.FILL_PARENT,ViewGroup.MarginLayoutParams.WRAP_CONTENT);  editmargin.setMargins(leftMargin, rightMargin, topMargin, bottomMargin);*/  ed6.setTextColor(Color.BLACK);  ed6.setBackgroundColor(Color.WHITE);  ed6.setText(""1"");        tr1.addView(ed6);  EditText ed7=new EditText(inventory.this);  //ed7.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));  ed7.setTextColor(Color.BLACK);  ed7.setBackgroundColor(Color.WHITE);  ed7.setText(""2"");  tr1.addView(ed7);  EditText ed8=new EditText(inventory.this);  //ed8.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));  ed8.setTextColor(Color.BLACK);  ed8.setBackgroundColor(Color.WHITE);  ed8.setText(""3"");  tr1.addView(ed8);  EditText ed9=new EditText(inventory.this);  //ed9.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));  ed9.setTextColor(Color.BLACK);  ed9.setBackgroundColor(Color.WHITE);  ed9.setText(""4"");  tr1.addView(ed9);  EditText ed10=new EditText(inventory.this);  //ed10.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));  ed10.setTextColor(Color.BLACK);  ed10.setText(""5"");  ed10.setBackgroundColor(Color.WHITE);  tr1.addView(ed10);  EditText ed11=new EditText(inventory.this);  //ed11.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));  ed11.setTextColor(Color.BLACK);  ed11.setText(""6"");  ed11.setBackgroundColor(Color.WHITE);  tr1.addView(ed11);  t1.addView(tr1);</code></pre>","591944","","109702","","2011-01-27 09:55:33","2011-05-06 13:21:50","How to set the layout margins of edit text boxes?","<java><android><ellipse>","2","0","","",""
"4814934","1","4816965","","2011-01-27 10:01:18","2","1117","<p>Hello In my android application i would like to open for suppose <a href=""http://www.google.com"" rel=""nofollow"">http://www.google.com</a> using intent.But i would like to hide the link that is being passed.Is there any way that i can achieve this in android.</p><p>I am using the below code.</p><blockquote>  <p>startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(""http://www.google.com"")));  </p></blockquote><p>Please share your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","","","","2011-08-07 22:45:25","Hide the url opened using action view in android","<android>","2","0","1","",""
"4814945","1","4814988","","2011-01-27 10:02:45","0","583","<p>I am using mediaplayer class to play audio, in which i am using seekTo, onSeekCompletion() routines to implement seeking.</p><p>My problem is that while seeking i can hear sound. How to avoid playing sound while seeking.</p><p>One option that i have is to pause first then do seek. but Is there other settings or Mediaplayer API to do this.</p><p>Thanks in advance.</p>","465751","","","","","2011-01-27 10:07:31","Android : MediaPlayer : How to disable audio when seeking","<android><media-player>","1","0","","",""
"4814992","1","4815053","","2011-01-27 10:07:53","40","9312","<p>I thought the <a href=""http://stackoverflow.com/questions/4432531/gingerbread-emulator-instance-is-much-more-sluggish-than-froyo-and-below-why"">Gingerbread emulator was slow</a>, but man - the Honeycomb emulator is so slow on a modern PC, it's practically unusable. Since Reto Meier asked to throw up our Honeycomb questions onto StackOverflow, here is mine - will it get faster any time soon? How are we expected to develop apps for tablets when I want to pull my hair out instead?</p><p>The SDK tools site now <a href=""http://developer.android.com/sdk/tools-notes.html"">mentions</a> ""Known issues with emulator performance: Because the Android emulator must simulate the ARM instruction set architecture on your computer, emulator performance is slow. We're working hard to resolve the performance issues and it will improve in future releases"" but I'm wondering just how soon these future releases with the fixes will be coming out.</p>","47680","","750987","","2011-05-29 06:48:50","2012-04-09 19:51:48","Honeycomb Android emulator is dog slow - will it get manageable before the official release?","<android><performance><sdk><android-3.0-honeycomb>","1","4","6","2011-01-29 07:48:30",""
"4815028","1","","","2011-01-27 10:12:18","1","1211","<p>I want to receive Broad Cast receiver for ""when will i remove or uninstall my application in device,How to implement,</p><p>Thanks </p>","500595","","","","","2011-01-27 10:39:09","how implement broadcastrecevier for uninstall particular application in device?","<android>","3","0","","",""
"4815077","1","4816955","","2011-01-27 10:16:03","0","270","<p>I'm creating a password field. I want to input password and at once star new intent. Her is my code:</p><pre><code>EditText passwd = (EditText) findViewById(R.id.passwd);passwd.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        EditText ryt = (EditText) findViewById(R.id.editPasswd);        if(ryt.getText().toString().equals(""123"")) {                                Intent intent = new Intent(first.this, second.class);            startActivity(intent);                           System.exit(0);        }    }}</code></pre><p>I wondering how to change onClick method. Maybe some one had similar problem. Thanks in advance</p>","572853","","418183","","2011-01-27 10:21:30","2011-01-27 13:32:01","How to create EditText field without click run intent?","<android><onclick><edittext>","2","2","","",""
"4815127","1","4815181","","2011-01-27 10:21:49","3","4782","<p>I want to use onBackPressed() method and still want to provide support for Android SDK before 2.0.onBackPressed() is introduced in Android SDK 2.0. but how to do ?</p>","185022","","","","","2011-01-27 11:28:49","using onBackPressed() with backward compatibility","<android><sdk>","3","0","3","",""
"4815146","1","5016948","","2011-01-27 10:24:52","0","401","<p>Making a social media app. I have a main viewFlipper with several views therein. In this vf, I have a sliding drawer (containing a social media stream such as twitter and facebook) in which I want to place a second viewFlipper, so as to flip between the different medias. </p><p>Is this possible and how would be the simplest way of implementing it?</p><p>newbie question perhaps, but still! :D anyone want to help?  </p>","591995","","591995","","2011-01-27 11:03:48","2011-02-16 13:22:14","slidingDrawer with a viewFlipper INSIDE an other viewFlipper? possible?","<android><viewflipper><gestures><slidingdrawer>","1","3","","",""
"4815167","1","4815870","","2011-01-27 10:26:50","9","5868","<p>I added <code>proguard.config=proguard.cfg</code>to my default.properties file and have a proguard.cfg file in my project root. If I now use Export as Android Application from within Eclipse I get the following Errors: </p><pre><code>[2011-01-27 11:11:37 - Application] Warning: class [classes/com/package.Class.class] unexpectedly contains class [com/package.Class][2011-01-27 11:11:37 - Application] Warning: class [classes/com/package.Class2.class] unexpectedly contains class [com/package.Class2][2011-01-27 11:11:37 - Application] Note: there were 145 duplicate class definitions.[2011-01-27 11:11:37 - Application] Warning: there were 146 classes in incorrectly named files.[2011-01-27 11:11:37 - Application]          You should make sure all file names correspond to their class names.[2011-01-27 11:11:37 - Application]          The directory hierarchies must correspond to the package hierarchies.[2011-01-27 11:11:37 - Application]          If you don't mind the mentioned classes not being written out,[2011-01-27 11:11:37 - Application]          you could try your luck using the '-ignorewarnings' option.[2011-01-27 11:11:37 - Application] java.io.IOException: Please correct the above warnings first.[2011-01-27 11:11:37 - Application]     at proguard.InputReader.execute(InputReader.java:133)[2011-01-27 11:11:37 - Application]     at proguard.ProGuard.readInput(ProGuard.java:195)[2011-01-27 11:11:37 - Application]     at proguard.ProGuard.execute(ProGuard.java:78)[2011-01-27 11:11:37 - Application]     at proguard.ProGuard.main(ProGuard.java:499)</code></pre><p>It seems that somehow my classes are saved in a classes subfolder but Proguard uses this classes subfolder as a package. Therefore the definition of the classes can not be understood by Proguard. </p><p>Is this a problem with my SDK Setup? Or are there errors in my Proguard Configuration causing this problem?</p>","114066","","","","","2012-04-17 17:18:01","How to obfuscate an apk with Proguard through Eclipse?","<android><eclipse><proguard>","3","1","2","",""
"4815192","1","","","2011-01-27 10:29:42","16","4695","<p>I'm working on an image processing application for Android that recognizes music notation from pictures taken of music sheets.</p><p>I tried to load the entire image into a Bitmap using the <a href=""http://developer.android.com/reference/android/graphics/BitmapFactory.html#decodeFile%28java.lang.String%29"">BitmapFactory.decodeFile(imgPath)</a> method, but because my phone doesn't have enough memory I get a ""VM heap size"" error. To work around this, I'd like to chop the full image into smaller pieces, but I'm not sure how to do that.</p><p>I also saw that it was possible to reduce the memory size of the Bitmap by using the <a href=""http://developer.android.com/reference/android/graphics/BitmapFactory.Options.html#inSampleSize"">inSampleSize property</a> of the BitmapFactory.Option class, but if I do that I won't get the high resolution image I need for the music notation recognition process.</p><p>Is there anyway to handle this without going to NDK?</p>","591989","","366234","","2011-01-28 07:34:19","2011-04-11 17:45:41","Is it possible to chop a bitmap to small pieces without loading the entire thing into memory?","<android><image-processing><out-of-memory>","3","5","5","",""
"4815361","1","","","2011-01-27 10:49:24","0","2685","<p>Can you draw a Bitmap to a Canvas by telling it to draw Bitmap's X,Y at Canvas' X1,Y1?  Rather than drawing Bitmap's 0,0 at Canvas X1, Y1?</p>","442912","","881229","","2014-01-31 04:19:28","2014-01-31 04:19:28","Android Bitmap Drawing","<android><bitmap><android-canvas><draw>","1","0","","",""
"4815363","1","","","2011-01-27 10:49:33","0","682","<p>I am new to the android maven plugin. I have created two test classes inside the application. One class extends <strong>TestCase</strong> and the other class extends the <strong>ActivityInstrumentationTestCase2&lt; MyActivity ></strong>. When the project runs as the android JUnit test from eclipse all the test cases are executing fine. No errors. But when i try to build the project from eclipse it generates errors in the test classes. </p><p>However, In the class which extends the <strong>TestCase</strong> the test methods executes without any error through the maven also. But if i try to create an object of an activity it generates an error. ex: PINLoginController mActivity = new PINLoginController() - generates an initializationError. </p><p>And with the class which extends <strong>ActivityInstrumentationTestCase2&lt; MyActivity ></strong> i get a runtime exception. </p><p>Exception in constructor: testPreconditions (java.lang.RuntimeException: Stub!</p><p>Any help would be greatly appreciated. Thanks in advance</p>","511737","","","","","2011-01-28 10:08:34","Android maven plugin runtime exception when executing tests","<java><android><exception><junit><maven>","1","0","","",""
"4815389","1","4991812","","2011-01-27 10:53:22","0","1180","<p>I am trying to attach an image that is picked from the image gallery to a MMS.</p><p>I am using the following code</p><pre><code>public void onActivityResult(int requestCode, int resultCode, Intent data) {if (resultCode == RESULT_OK) {    if (requestCode == SELECT_PICTURE) {        Uri selectedImageUri = data.getData();        selectedImagePath = getPath(selectedImageUri);        Uri uri = Uri.parse(selectedImagePath);        Intent sendIntent = new Intent(Intent.ACTION_SEND);         sendIntent.putExtra(""sms_body"", ""some text"");         sendIntent.putExtra(Intent.EXTRA_STREAM, uri);        sendIntent.setType(""image/png"");         startActivity(Intent.createChooser(sendIntent, """"));    }}</code></pre><p>When I select the image it is redirecting to the MMS application but displaying a toast which says <code>Sorry you could not attach this image</code>.</p><p>When I tried to email the same image there was no errors thrown. Here is the Logcat output.</p><pre><code>01-27 16:04:26.485: ERROR/Mms/media(728): IOException caught while opening or reading stream01-27 16:04:26.485: ERROR/Mms/media(728): java.io.FileNotFoundException: No content provider: /sdcard/6906-lightning.jpg01-27 16:04:26.485: ERROR/Mms/media(728):     at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:507)01-27 16:04:26.485: ERROR/Mms/media(728):     at android.content.ContentResolver.openInputStream(ContentResolver.java:345)01-27 16:04:26.485: ERROR/Mms/media(728):     at java.lang.reflect.Method.invoke(Method.java:521)</code></pre><p>I want to also know how to insert a pre defined PhoneNumber when the MMS application is opened.</p>","303155","","418183","","2011-05-24 07:26:04","2011-05-24 07:26:04","Attaching images to MMS","<android><mms>","1","1","2","",""
"4815396","1","4815625","","2011-01-27 10:53:35","0","118","<p>I want to use constraints in SQLite.</p><p><strong>Scenario:</strong> Stop parent delete if child is present. </p><p>How can I achieve that?</p>","309990","","418183","","2011-01-27 11:20:23","2011-01-27 11:42:48","How to stop parent delete if child present","<android><sqlite>","2","0","","",""
"4815464","1","4815593","","2011-01-27 11:01:04","0","672","<p>I am an ANDROID app developer,i just need to know, that what are the conditions and things ,to create app for android tablets.</p><p>Is there any registration fees apart from the $25, where should i register and how to develop, is it different from android mobile app development.</p><p>Plz suggest.</p><p>Regards</p>","1497488","","591995","","2011-01-27 12:18:59","2011-01-27 12:18:59","Android Tablet Application Development Query","<android><tablet>","1","3","1","",""
"4815467","1","5500611","","2011-01-27 11:01:10","2","1251","<p>I have Facebook and Twitter integration in my app. For Facebook I use the API they provided and for Twitter I open a WebView for Oauth.</p><p>To save the Twitter key I get back from Oauth I have to use CallBack. However using CallBack lets the user see a black screen (for less than a second) before going to the activity with the sharing options.</p><p>Is there a way I can avoid this black screen.</p><p>Or better:</p><p>Can I make a WebView pop-up like the Facebook API does? If yes, how can I achieve this and how can I save the key I get back from Oauth?</p>","517460","","","","","2011-03-31 13:27:19","Create Facebook API-like WebView pop-up in Android","<android><facebook><twitter><callback><webview>","1","0","","",""
"4815474","1","4815577","","2011-01-27 11:02:04","1","198","<p>Developing mobile apps is a challenging job. </p><p>Customers want to be present not only on iPhone and iPad but maybe on Android and other <strong>mobile platforms</strong> like Windows Phone 7, Blackberry and Symbian, too.</p><p>It costs a lot of money to keep this apps up to date on <strong>different platforms</strong>. Besides the developer has to dig in different sdk's and learn different languages.</p><p>I thought about having just <strong>one app</strong>, that is rendered in a mobile browser like webkit, which is a standart for rendering web content.</p><p>Of course there are constraints like the use of camera or specific hardware for advanced rendering. But I think this will change over time.</p><p><strong>How do you challange that? Do you re-use your code? Could mobile web be an alternative?</strong> </p>","401025","","","","","2011-01-27 19:28:20","If you have developed an app for mobile devices, which line did you take?","<iphone><android><blackberry><windows-phone-7><webkit>","5","2","1","2011-01-28 10:37:19",""
"4815568","1","4815747","","2011-01-27 11:10:31","1","1505","<p>i want to mark with push pin image on more than one places on google map using overlayitem class..OR in simple how to add more than one overlay items on map..</p><p>as of now i can only mark a single place by overriding draw method of mapoverlay subclass...here is my code </p><pre><code>class MapOverlay extends com.google.android.maps.Overlay{    @Override    public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when)     {        super.draw(canvas, mapView, shadow);                           //---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-24, null);        return true;    }}</code></pre>","505580","","569101","","2013-09-09 08:41:15","2013-09-09 08:41:15","adding multiple overlay items on google map","<android><google-maps>","1","0","","",""
"4815595","1","","","2011-01-27 11:12:57","0","109","<p>I am working on an application where I am using the TabHost and I have four Tabs. Each of the tabs are given in a class MyTabHost that extends TabActivity. </p><p>Again I have one class that extends ActivityGroup and I have given all the tab classes in that class.</p><p>Now the problem is that when I move to another activity from one activity and when I come back to the previous activity, the position of the view gets refreshed and I don't want that. I want to maintain the view when I get back to the previously left activity on demand.</p><p>Is there any solution to anybody?</p><p>Thanks,david</p>","422859","","","","","2011-01-27 11:20:26","Maintaining the View of the Layout when user gets back to the View from another view","<android><android-tabhost><activitygroup>","1","0","","",""
"4815669","1","","","2011-01-27 11:21:12","0","599","<p>I installed the <a href=""http://developer.android.com/resources/samples/AccelerometerPlay/index.html"" rel=""nofollow"">accelerometer sample app</a> from the android SDK 2.3 om the device (Nexus s). I get several balls falling towards one side of the screen and nothing changes their position.Is there any place in which the expected behavior of this application is described?Does anyone here knows the expected behavior?I suspects it exposed a problem with the hardware operation.Thanks,Yoav</p>","592081","","102937","","2012-07-11 17:25:09","2012-07-11 17:25:09","How should the accelerometer sample android app work?","<android><accelerometer>","1","0","","",""
"4815718","1","","","2011-01-27 11:26:31","3","8251","<p>I want to do something fairly straightforward, but I can't quite work out if the method in the Gingerbread API is for the ID of the token being scanned or the hardware on-board the Nexus S. What I want to be able to do is get the unique identifier of the NFC chip of the device, so I can register it (eg. when the device is waived over an RFID reader, I can associate the device being waived with an account). Is this possible with the current API methods available?</p><p>The piece of code that looks most promising (but I can't test because I don't have a device) is</p><pre><code>byte[] tagId = intent.getByteArrayExtra(NfcAdapter.EXTRA_ID);</code></pre>","219196","","","","","2011-08-14 02:39:58","Getting the NFC Hardware ID In Android","<android><nfc>","3","0","2","",""
"4815743","1","","","2011-01-27 11:29:28","0","4153","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/775188/add-an-array-of-buttons-to-a-gridview-in-an-android-application"">Add an array of buttons to a GridView in an Android application</a>  </p></blockquote><p>I have Button List. I want to add these buttons in addition to current layout and also setOnclickListener to Button list. I can do how?</p>","592088","","","","","2012-11-06 22:57:54","how to add button array to layout in android?","<java><android><layout><button>","1","2","","2012-11-07 23:40:37",""
"4815767","1","4815850","","2011-01-27 11:32:42","0","408","<p>I want to draw a vertical  line in before a textView..I am able to draw  horizontal line by using View but not horizontal line...</p><p>Pls help thanks in Advance..</p>","555221","","","","","2011-03-12 08:14:41","Android Table Layout","<android>","1","0","","",""
"4815775","1","","","2011-01-27 11:33:34","0","193","<p>I like to give alert/notification when music File will be added to sdcard.How can I do that?Can I get any event from os when a file is added to the system?</p>","592092","","","","","2011-05-17 09:20:37","Android Give alert when music File will be added to sdcard","<android><events><file>","1","1","","",""
"4815783","1","","","2011-01-27 11:33:51","3","1789","<p>I'm trying to schedule a wifi scan every 1 second as the current 6 secs delay between each scan result is too long for me. I think somehow it works, but I barely understand either the way it works or the result.Here is the basic code telling the timer to start <code>wifiMgr.startScan();</code> every 1000 ms.</p><pre><code>private void startNetworkScan() {    mTimer = new Timer();    mTimer.schedule(new TimerTask() {        @Override        public void run() {            TimerMethod();        }    }, 0, 1000);}private void TimerMethod() {    this.runOnUiThread(rTimer);}private Runnable rTimer = new Runnable() {    public void run() {        wifiMgr.startScan();        Bundle bb = wifiScanReceiver.getResultExtras(true);        txtList.append(""Result "" + bb.getString(""scanresult"") + ""\n"");    }};</code></pre><p>Below is the code on the BroadcastReceiver class. I just display the timestamp and related info from the access point.</p><pre><code>private void handleScanResultsAvailable() {    List&lt;ScanResult&gt; results = wifiMgr.getScanResults();    String currentTimeStr = new SimpleDateFormat(""HH:mm:ss"").format(new Date());    Bundle b = new Bundle();    StringBuilder sb = new StringBuilder();    sb.append(i + "": "" + currentTimeStr);    for (ScanResult result : results) {        sb.append(String.format("" SSID: %s, RSSI: %s dBm "", result.SSID, result.level));    }    b.putString(""scanresult"", sb.toString());    setResultExtras(b);    i++;}</code></pre><p>And here is a snippet of the result:</p><pre><code>Result 1: 10:04:12 SSID: XXXXX, RSSI: -88 dBm Result 1: 10:04:12 SSID: XXXXX, RSSI: -88 dBm Result 2: 10:04:14 SSID: XXXXX, RSSI: -87 dBm Result 2: 10:04:14 SSID: XXXXX, RSSI: -87 dBm </code></pre><p>Mostly each result is displayed every 1-2 seconds, which is quite good. What I don't understand is, for each result, I always get two lines with the same value. I actually expect that there should be some overlapping results because <code>wifiMgr.startScan()</code> is not stopped at every execution by the timer, like this:</p><pre><code>// there are ca. 6-7 lines for every record// as the wifi scanresult delay is 6 secsResult 1: 10:03:40 SSID: XXXXX, RSSI: -85 dBm Result 1: 10:03:41 SSID: XXXXX, RSSI: -85 dBm Result 1: 10:03:42 SSID: XXXXX, RSSI: -85 dBm Result 1: 10:03:43 SSID: XXXXX, RSSI: -85 dBm Result 1: 10:03:44 SSID: XXXXX, RSSI: -85 dBm Result 1: 10:03:45 SSID: XXXXX, RSSI: -85 dBm Result 2: 10:03:45 SSID: XXXXX, RSSI: -85 dBm Result 1: 10:03:46 SSID: XXXXX, RSSI: -85 dBm Result 2: 10:03:46 SSID: XXXXX, RSSI: -85 dBm Result 1: 10:03:47 SSID: XXXXX, RSSI: -85 dBm Result 2: 10:03:47 SSID: XXXXX, RSSI: -85 dBm Result 1: 10:03:48 SSID: XXXXX, RSSI: -85 dBm Result 2: 10:03:48 SSID: XXXXX, RSSI: -85 dBm </code></pre><p>Can anyone shed some light? - is the code right, is the result fine. Would appreciate any explanation on the logic behind it.</p><p><strong>Update</strong>: Here is the rest of the BroadcastReceiver code.</p><pre><code>@Overridepublic void onReceive(Context context, Intent intent) {    if (intent.getAction().equalsIgnoreCase(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)) {        handleScanResultsAvailable();    }}</code></pre>","404437","","404437","","2011-02-08 08:21:54","2012-01-07 01:02:16","unexpected result using timer for wifi scan android","<android><timer><wifi>","1","0","1","",""
"4815785","1","4816002","","2011-01-27 11:34:09","0","2133","<p>I use the following code to launch a call from within the android app:</p><pre><code>intent.setData(Uri.parse(""tel:+12345 #123""));startActivity(intent);</code></pre><p>While it starts the call, it ignores everything starting with the #.</p><p>I read something about modifying SpecialCharSequenceMgr.java file, but I can't find this anywhere and quite honestly don't know what exactly one has to do. What is the best way to solve this ?</p><p>Many thanks</p>","387184","","","","","2012-10-28 14:22:29","initiate a phone call on android with special character #","<android><special-characters><call><phone>","2","0","1","",""
"4815800","1","4816097","","2011-01-27 11:35:26","0","605","<p>i have a pretty standard android widget, that starts it's configure activity, where you can set up several options.</p><p>now what should i do after the setup is finished. cause when i press the back or home button the widget is not there.</p>","97688","","","","","2011-01-27 12:07:31","android widget, what to do after configure activity","<android><android-widget>","1","0","1","",""
"4815803","1","4826549","","2011-01-27 11:35:55","3","974","<p>Does anyone know what the various android views in eclipse do.Specifically the ""tree overview"", ""tree view"", ""view properties"" and ""layout view""You can access them via Window..Show View... Other... Android </p><p>I can't find out any documentation on them or work out what they do. I've clicked on classes and layouts but they never seem to change.</p>","516286","","","","","2011-01-28 09:16:34","What do the various Android view in Eclipse do?","<android><eclipse><treeview><view>","1","0","1","",""
"4815868","1","4818116","","2011-01-27 11:41:56","1","1238","<p>In my app I am recording voice using the microphone. I want to be able to implement some sort of visual indicator of the current volume level of the sound being taken in by the microphone. For example like in the Audio Recorder application for the iPhone which has a simulated analogue meter which moves to the right as the volume gets louder and to the left when the volume gets quieter. </p><p>How can I get the current level of volume? I am recording the audio using an AudioRecorder object.</p>","400406","","","","","2011-01-27 15:14:08","Current volume level of the Microphone input","<java><android><avaudiorecorder>","1","0","","",""
"4816004","1","","","2011-01-27 11:55:55","7","11183","<p>I have GridView with 6 images in 2 columns. I want to display this 6 images in the middle of the screen. I set gravity properties to center but this center elements only horizontally. GridView takes whole screen.</p><pre><code>&lt;GridView    android:id=""@+id/gridview""    android:layout_above=""@id/ad"" android:layout_alignParentTop=""true""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:numColumns=""2""        android:verticalSpacing=""10dp""    android:horizontalSpacing=""10dp""    android:stretchMode=""columnWidth""           android:background=""#ffffff""    android:gravity=""center""/&gt;</code></pre>","518494","","","","","2013-03-20 08:37:59","Center elements in GridView","<android><gridview>","4","0","2","",""
"4816028","1","","","2011-01-27 11:59:11","2","3611","<p>How can I to add an array of <code>TextView</code> data  into an existing text view? I tried the following code:</p><pre><code>TextView tvArrQuestion[]=(TextView) findViewById(R.id.Textparse);</code></pre><p>...but I get this error:</p><blockquote>  <p>Type mismatch: cannot convert from <code>TextView</code> to <code>TextView[]</code></p></blockquote><p>How can I resolve this?</p>","571256","","23897","","2012-12-04 03:50:36","2013-03-13 11:28:50","How can I to add an array of `TextView` data into an existing text view?","<android><textview>","4","0","1","",""
"4816098","1","4816189","","2011-01-27 12:07:35","0","738","<p>Can someone please give the Code and XML file required to create an animation using .png files?I've tried the one given in here <a href=""http://developer.android.com/reference/android/graphics/drawable/AnimationDrawable.html"" rel=""nofollow"">http://developer.android.com/reference/android/graphics/drawable/AnimationDrawable.html</a></p><p>But, once I type,</p><pre><code>&lt;animation-list android:id=""selected"" android:oneshot=""false""&gt;&lt;item android:drawable=""@drawable/connected01"" android:duration=""50"" /&gt;&lt;item android:drawable=""@drawable/connected02"" android:duration=""50"" /&gt;&lt;item android:drawable=""@drawable/connected03"" android:duration=""50"" /&gt;&lt;item android:drawable=""@drawable/connected04"" android:duration=""50"" /&gt;&lt;item android:drawable=""@drawable/connected05"" android:duration=""50"" /&gt;&lt;/animation-list&gt;</code></pre><p>I'm getting an error : ""unbound prefix""</p><p>Can someone say how this could be done ?</p>","593319","","","","","2011-01-27 12:18:17","Animation - GIF","<android><animation>","1","1","","",""
"4816170","1","","","2011-01-27 12:16:10","1","1487","<p>I m getting the error ""<em>couldn't Open assets/sample.xml</em>""</p><p>here is my code:</p><pre><code>try {            // creates and returns new instance of SAX-implementation:            SAXParserFactory factory = SAXParserFactory.newInstance();            // create SAX-parser...            SAXParser parser = factory.newSAXParser();            // .. define our handler:            SaxHandler handler = new SaxHandler();            // and parse:            parser.parse(""assets/sample.xml"", handler);        } </code></pre>","582788","","142162","","2011-01-27 12:19:06","2011-01-27 14:08:21","couldn't Open assets/sample.xml","<android>","2","1","","",""
"4816183","1","","","2011-01-27 12:17:41","1","1512","<p>I have an app made for the 1.6 version, and it works great till 2.2. Now I am making some updates and realize that onKeyListener won't work on 2.3, on previous versions is good. Check this</p><pre><code>etValue.setOnKeyListener(new View.OnKeyListener() {                public boolean onKey(View v, int keyCode, KeyEvent event) {                    // TODO Auto-generated method stub                    return false;                }            });</code></pre><p>etValue is EditText.</p>","391770","","","","","2011-04-07 19:30:57","Android 2.3 problem with EditText onKeyListener","<android><edittext><android-sdk-2.3>","2","0","","",""
"4816185","1","4816246","","2011-01-27 12:17:50","2","2492","<p>I want to add a shake listener to my android application. What i want here, when i will shake my android device it will perform some action. How to do this ? Later i want when my deice will fall down it will produce a sound. How to do this?Please some body help!</p>","489762","","1471203","","2013-01-09 11:10:59","2013-07-04 10:59:55","Android shaking","<android>","1","0","","",""
"4816236","1","4816994","","2011-01-27 12:22:43","0","1456","<p>I have a LinearLayout which has  a gridview:</p><pre><code>public class ParentClass implements OnClickListener , OnFocusChangeListener{//instance variables.//constructors.//initialization method:public initMethod() {  //initializes gridview , set adapters, listeners etc.  //+ code for adding gridview to linear layout etc. }//other methods...}class Grid extends ViewGroup{        private GridView _gridView = null;              Grid()        {        super(MyActivity);        //code for grid-view initialization goes here        }        public void setAdapter(GridViewAdapter gridViewAdapter) {            // TODO Auto-generated method stub            _gridView.setAdapter(gridViewAdapter);        }        @Override         protected void onDraw(android.graphics.Canvas canvas) {             super.onDraw(canvas);         }        @Override        protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)        {            super.onMeasure(widthMeasureSpec, heightMeasureSpec);        }        @Override        protected void onLayout(boolean changed, int l, int t, int r, int b) {            // TODO Auto-generated method stub            int i = 0;        }    }}</code></pre><p>Now i expect that when i put a breakpint in overridden methods of my Grid class, it should hit! Why Breakpoint does not get hit?  Am i missing something fundamental here?</p>","340353","","79061","","2011-01-27 12:28:12","2011-01-27 13:35:19","onDraw, onmeasure does not gets called","<android>","1","9","","",""
"4816259","1","","","2011-01-27 12:25:34","0","2331","<p>I have an bitmap of 10*15 size now i want to create an bitmap from this existing bitmap with size 20*30 but the increased area should be transparent ,bitmap should not be translated/scaled.</p>","452349","","503900","","2011-01-27 14:55:09","2011-12-08 17:28:32","Creating Rectangle around Bitmap","<android><bitmap>","4","0","","",""
"4816385","1","","","2011-01-27 12:38:02","0","312","<p>I am using a bitmap image,initially i can easily get the pixels colors by using getpixel() method of Bitmap class.but when i zoom this image in ondraw() method of canvas then how will i use getpixel() method. I am not getting zoomed bitmap object?</p><p>Thanks for your reply.</p>","474419","","","","","2011-01-27 12:54:29","how to use getpixel() after zooming a bitmap in android","<android>","1","1","","",""
"4816433","1","","","2011-01-27 12:42:53","0","618","<p>I am creating application in which we reply to sender of the text message automatically from our android device. I had check that number has only digits not letters for validation but some times while sending message it gives me error as:</p><p>Message sent using invalid number of digits. Please resend using 10 digit number or valid short code android</p><p>like that how can i avoid number formatting in android.  or is there another way avoid this error. If any one knows solution about this please let me know.</p><p>Thank You. Vikram </p>","395627","","","","","2011-01-27 12:52:34","Message sent using invalid number of digits. Please resend using 10 digit number or valid short code android 9230 in android","<android>","1","0","","",""
"4816458","1","4820380","","2011-01-27 12:44:16","0","1437","<p>hiI have added an app to the Gallery share menu. Selecting and sharing one image works fine and this code:</p><pre><code>if (Intent.ACTION_SEND.equals(action)) {</code></pre><p>in my onCreate is executed. </p><p>The problem is when i press back(destroy) and open the app againThe same Intent is received in the onCreate.</p><p>I use the :</p><pre><code> android:launchMode=""singleTop""&gt;</code></pre><p>and the </p><pre><code> protected void onNewIntent(Intent intent)</code></pre><p>The onNewIntent is not firing.I suspect i must clear out the Intent somehow.and been trying to find and answer but im stuck</p>","538837","","","","","2011-01-27 18:37:16","android Intent received to onCreate multiple times","<android>","2","0","","",""
"4816504","1","","","2011-01-27 12:50:21","0","158","<p>i have a listview L2 in a Linear layout L1, Now i think if the height of layout L1 containing the listview is less than the height of the Listview L2, and L1.height fits in the display i.e. L1.height &lt; display screen height then my list would scroll, But my list srolls only in 2.1 avd and not in 2.2 avd!  I am perplexed at this behaviour, anybody any idea, what could be causing this?</p><p>Thanks</p>","340353","","340353","","2011-01-27 13:13:17","2011-01-27 13:13:17","List Scroll issue 2.1 vs 2.2","<android>","0","3","","",""
"4816554","1","","","2011-01-27 12:55:16","0","192","<p>In how many ways we can find the current location of the user. Can we find the current                   location without using GPS?</p><p>Can anyone help me out.</p>","448250","","380579","","2011-01-27 12:58:30","2011-01-27 13:01:58","In How many ways we can find the location in Android...?","<android>","1","0","","",""
"4816571","1","4816652","","2011-01-27 12:56:14","0","10262","<p>I'm trying to find my way into Android development. I'm using Eclipse Helios. The GUI design software seems to make it impossible to design certain element hierarchies. For example:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;ScrollView android:id=""@+id/ScrollView01""        android:layout_width=""fill_parent"" android:layout_height=""110px""&gt;        &lt;LinearLayout android:id=""@+id/LinearLayout02""            android:layout_width=""wrap_content"" android:layout_height=""30px""            android:orientation=""vertical""&gt;        &lt;/LinearLayout&gt;    &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre><p>I have not been able to design this structure in the GUI designer. I drag a LinearLayout to the design frame, drag a ScrollView over it, then drag a LinearLayout on top. Always, this will be inserted as a child of the first LinearLayout, not of the ScrollView. However, in <a href=""http://www.androidpeople.com/android-scrollview-example/"" rel=""nofollow"">this example</a> for ScrollViews, this seems to be right.</p><p>Am I doing something wrong? How would I design this structure using the GUI designer? Or is this only possible by direct XML manipulation?</p><p>Thanks.</p>","494501","","","","","2011-11-10 07:18:25","Android, GUI design w/ Eclipse, Layout->View->Layout","<android><android-layout><scrollview>","2","1","","",""
"4816589","1","4816867","","2011-01-27 12:57:19","0","951","<p>I have seen questions similar to my issue on this forum but none that answer directly.</p><p>Essentially I have a broadcast receiver listening for an android action, the receiver is registered within one of my classes and, currently, calls a class.I would like for it to call a method within that class, without creating a second broadcast receiver (it seems pretty inefficient and poor coding practice to do so).</p><p>A lot of people have mentioned simply creating a broadcast receiver for that class but I dont want to use a broadcast receiver to call another broadcast receiver, any ideas?</p><p>I appreciate any help on the matter.</p><p>Thanks guys!</p>","528258","","","","","2011-01-27 13:25:27","Android: Using an Intent to call a method, instead of a class?","<java><android><android-intent><broadcastreceiver>","2","3","","",""
"4816643","1","","","2011-01-27 13:04:17","0","942","<p>I am including a large flv file in an AIR project for Android.</p><p>I succeed in installing the application on the sd card (with Astro file browser)Now when I play an flv file (residing in the application directory) of 5mb everything works just fine. When I use a larger flv file (300mb) nothing happens...</p><p>When putting the files on the sd card directly it does work, but I want to avoid this because my files are exposed like this. I tried en/decrypting of the flv file but that is painfully slow...</p><p>Does anyone know how to handle this?</p><p>Thanks a lot in advance.</p>","520340","","","","","2011-01-31 10:18:44","AIR on Android || playing large flv files from Application directory","<android><air><adobe><flv>","3","0","","",""
"4816683","1","4816772","","2011-01-27 13:07:46","12","23082","<p>im passing to a activity the number to call by a bundle</p><p>and then, in such activity, i have a button to call to that number, this is the code:</p><pre><code>callButton.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(bundle.getString(""mobilePhone"")));            }        }); </code></pre><p>something is wrong, because when i press the button nothing happens.....</p><p>what i am doing wrong?</p><p>PD: i'm using Android 1.5 compatible project... maybe phone call is incompatible to 1.5?</p>","479886","","","","","2014-03-20 06:47:49","How to make a phone call programatically?","<android><call>","6","1","11","",""
"4816749","1","","","2011-01-27 13:13:33","5","1902","<p>I have Activity, which is to save its data in case system decides to kill it while it is in the background.So, I’ve got onSaveInstanceState:</p><pre><code>@Overrideprotected void onSaveInstanceState(Bundle outState){    outState.putString(""value"", ""some_value"");}</code></pre><p>I check whether Bundle object is null in onCreate:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    isRestarted=(savedInstanceState==null);</code></pre><p>How do I write test method? I tried</p><pre><code>    public void testRecreate(){    Instrumentation mInstr=this.getInstrumentation();    mInstr.callActivityOnSaveInstanceState(mActivity, null);    mActivity.finish();    mActivity=this.getActivity();    assertEquals(false, mActivity.isRestarted);}</code></pre><p>but it seems to be wrong.</p>","468311","","","","","2013-06-18 17:21:06","Android Activity lifecycle testing","<android><unit-testing>","4","0","1","",""
"4816768","1","","","2011-01-27 13:15:58","1","491","<p>Hi  M new to android.I faced a problem i.e in landscape mode i need a layout view which doesnot have  some feilds which are present in the portrait mode.I have created a layout for landscape view in such a way.In the activity i have given the conditions like if portrait display some feilds some hide.its working properly actually...first when i go from portrait to landscape it is giving what i want...but when i go to portrait mode its stopping the application.please help me.Thanks in advance </p>","588627","","","","","2011-01-28 07:39:14","screen orientation","<android><landscape><portrait>","2","1","","",""
"4816771","1","4817005","","2011-01-27 13:16:28","0","2347","<p>I want to encrypt/decrypt some passwords in the SQLite database of my application. To do that I have searched on the internet and I have found the AES algorithm.I have this code:</p><pre><code>public String encript(String dataToEncrypt)        throws NoSuchAlgorithmException, NoSuchPaddingException,        InvalidKeyException, IllegalBlockSizeException, BadPaddingException {    // I'm using AES encription    if(!dataToEncrypt.equals("""")){        String key = ""FMVWf8d_sm#fz"";        Cipher c = Cipher.getInstance(""AES"");        SecretKeySpec k;        try {            k = new SecretKeySpec(key.getBytes(), ""AES"");            c.init(Cipher.ENCRYPT_MODE, k);        } catch (UnsupportedEncodingException e) {            e.printStackTrace();        }        return new String(c.doFinal(Base64.decode(dataToEncrypt)));    }    return """";}public String decript(String encryptedData)        throws NoSuchAlgorithmException, NoSuchPaddingException,        InvalidKeyException, IllegalBlockSizeException, BadPaddingException {    if(!encryptedData.equals("""")){        String key = ""FMVWf8d_sm#fz"";        Cipher c = Cipher.getInstance(""AES"");        SecretKeySpec k = new SecretKeySpec(Base64.decode(key), ""AES"");        c.init(Cipher.DECRYPT_MODE, k);        return new String(c.doFinal(Base64.decode(encryptedData)));    }    return """";}</code></pre><p>After running this I get this error on encrypt method:</p><p>01-27 14:50:51.698: ERROR/ACTIVITY(782): java.security.InvalidKeyException: Key length not 128/192/256 bits. </p><p>I have seen some other cases here on stackoverflow but I want to give the key to the AES not to generate it...</p><p>Can somebody help me with this? If there is other encryption method to use but without using another jars or external classes and to let me give the key.</p><p>Thank you very much!  </p>","449310","","580556","","2011-01-27 14:23:00","2011-01-27 14:24:32","android encryption","<android><encryption>","2","0","","",""
"4816930","1","4817202","","2011-01-27 13:30:48","0","873","<p>I followed instructions at <a href=""http://source.android.com/source/download.html"" rel=""nofollow"">http://source.android.com/source/download.html</a> to build android source code on Mac OS X. Created case-sensitive image of size 8.5 GB and gave make for 'full-eng' target in lunch command, After sometime got this error complaining about insufficient disk space :</p><pre><code>prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-ar: out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/libwebcore.a: No space left on devicemake: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/libwebcore.a] Error 1make: *** Deleting file `out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/libwebcore.a'</code></pre><p>Is 8.5GB not sufficient to build, instructions say 8Gig is enough.Did i miss something.?</p><p>Now I want to create another case-sensitive image of size say 12GB and build it, can simple copy of files from 8.5GB volume to 12GB volume work? Or is there any special command (git clone or something.. sorry noob to git) to copy the entire repo so that all git projects will copy safely.</p>","110024","","","","","2011-01-27 13:56:57","Cloning android source code repo into a different directory","<android>","1","0","","",""
"4816940","1","","","2011-01-27 13:31:26","2","1017","<p>I am using a custom adapter with a ListView and using a custom layout to supply the list itemviews. My layout is like this</p><pre><code>&gt; LinearLayout    &gt; TableView        &gt; TableRow            &gt; TextView            &gt; TextView</code></pre><p>This results in list items that do not respond to clicks but if I edit the layout to the following it works</p><pre><code>&gt; LinearLayout    &gt; TextView    &gt; TextView</code></pre><p>So I know that there is nothing wrong with my Adapter and Activity.</p><p>I have tried adding <code>android:descendantFocusability=""blocksDescendants""</code> to the top level linear layout as suggested in this question <a href=""http://stackoverflow.com/questions/2985890/listview-items-not-clickable-with-horizontalscrollview-inside"">ListView items not clickable with HorizontalScrollView inside</a></p><p>I have also tried adding <code>android:clickable=""true""</code> and <code>android:focusable=""true""</code> to the <code>TableView</code> but this does not work either.</p><p>Any ideas?</p><hr><p>EDIT </p><p>layout XML source 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:layout_width=""fill_parent""     android:layout_height=""wrap_content""&gt;    &lt;TableLayout      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:stretchColumns=""1""    &gt;        &lt;TableRow             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:clickable=""true""            android:paddingTop=""10dp""            android:paddingBottom=""10dp""            android:gravity=""center_vertical""&gt;            &lt;TextView                 android:id=""@+id/ITEMVIEW_TEXT2_lblText""                 android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textSize=""20sp""                 android:paddingRight=""5dp""                android:paddingLeft=""15dp""                /&gt;            &lt;TextView                 android:id=""@+id/ITEMVIEW_TEXT2_lblText2""                 android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textSize=""20sp""                android:textColor=""#ff385487""                android:gravity=""right""                android:paddingRight=""15dp""                /&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;/LinearLayout&gt;</code></pre><hr><p>EDIT</p><p>I have tried adding <code>android:focusable=""false""</code> as suggested <a href=""http://stackoverflow.com/questions/1121192/android-custom-listview-unable-to-click-on-items"">here</a> and <a href=""http://stackoverflow.com/questions/3611551/textview-and-button-in-each-row-and-onlistitemclick"">here</a> but that does not work either.</p><hr><p>EDIT</p><p>All I really wanted to achieve here was laying out two columns of text one aligned left and the other right. I figured out a better layout to achieve this that does not use TableView so my ListView items remain clickable, it also uses less views so it will also be more efficient, this is it</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;TextView                 android:id=""@+id/ITEMVIEW_TEXT2_lblText""                 android:layout_width=""0dp""                android:layout_weight=""1""                android:layout_height=""wrap_content""                android:textSize=""20sp""                 android:paddingRight=""5dp""                android:paddingLeft=""15dp""                /&gt;            &lt;TextView                 android:id=""@+id/ITEMVIEW_TEXT2_lblText2""                 android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textSize=""20sp""                android:textColor=""#ff385487""                android:gravity=""right""                android:paddingRight=""15dp""                /&gt;&lt;/LinearLayout&gt;</code></pre><p>This is not a solution to the problem of TableView making ListView items non clickable but I have noted it here in case anyone else is looking to figure out how to do a similar layout.</p>","379115","","379115","","2011-01-28 12:25:55","2011-11-09 11:35:03","Android TableView as itemview in ListView not clickable","<android><android-listview>","1","1","","",""
"4817014","1","","","2011-01-27 13:36:44","37","22668","<p>I'm trying to have a custom dialog appear as though it's sliding down from a text view. Is this possible? I can't seem to apply any animation to dialog class. I've tried this line in the constructor, but it has no effect:</p><p>this.getWindow().setWindowAnimations(R.anim.paranimation);</p><p>I'm not even sure if the animation is correct, but I will be able adjust it once I see what it's doing. I'll list it below for the sake of completeness. I'm not looking for help on the actual animation, just the application to the dialog.</p><p>paranimation.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;translatexmlns:android=""http://schemas.android.com/apk/res/android""android:fromXDelta=""-200%""    android:toXDelta=""0%""    android:fromYDelta=""200%""    android:toYDelta=""0%""    android:duration=""3000""    android:zAdjustment=""top""&gt;&lt;/translate&gt;</code></pre>","592264","","321697","","2011-01-27 14:27:52","2012-09-28 10:10:50","Animate a custom Dialog","<android><animation><dialog><alert>","2","1","31","",""
"4817065","1","4819413","","2011-01-27 13:42:45","2","2539","<p>I have a problem using implicit intent to launch activity within my application.</p><p>I have created activities RecordList (lists all the albums), RecordEditor (used to add/edit tracks of record) and TrackEditor. I've managed to get the RecordEditor to launch when user selects new or edit from the RecordList. Problem occurs when I try to add new track to the the record (launch the TrackEditor activity).</p><p>Here is how I have defined the activities in manifest:<br><strong>RecordList</strong></p><pre><code>&lt;activity android:name=""RecordList""&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;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;data android:mimeType=""vnd.android.cursor.item/vnd.example.record"" /&gt;    &lt;/intent-filter&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.GET_CONTENT"" /&gt;        &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;data android:mimeType=""vnd.android.cursor.item/vnd.example.record"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p><strong>RecordEditor</strong>  </p><p>                                        </p><pre><code>&lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.GET_CONTENT"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;data android:mimeType=""vnd.android.cursor.item/vnd.example.track"" /&gt;&lt;/intent-filter&gt;&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=""com.example.records.action.EDIT_RECORD"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;data android:mimeType=""vnd.android.cursor.item/vnd.example.record"" /&gt;&lt;/intent-filter&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.example.record"" /&gt;&lt;/intent-filter&gt;</code></pre><p></p><p><strong>TrackEditor</strong></p><pre><code>&lt;activity android:name=""TrackEditor""&gt;    &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=""com.example.records.action.EDIT_TRACK"" /&gt;        &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;data android:mimeType=""vnd.android.cursor.item/vnd.example.track"" /&gt;    &lt;/intent-filter&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.example.track"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>And here is the exception I keep getting when trying to add new track to Record:</p><pre><code>android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.INSERT dat=content://com.example.provider.Track/tracks }</code></pre><p>I've used the NotePad example as base for this but I am unable to figure out where I am doing wrong. Any help would be appreciated. :)</p>","592134","","","","","2011-01-27 17:01:01","Using implicit intent to launch activity?","<android><android-manifest><android-intent>","1","0","","",""
"4817131","1","","","2011-01-27 13:49:16","2","441","<p>I have a big C++ application developed on windows,I need to port it to Android to run it as galaxy tab application.</p><p>I read many tutorials about NDK but it seems difficult to embed C++ files into Android.</p><p>Can I develop ""DLL"" using NDK? and invoke DLL from DLL?</p><p>any help would be  highly appreciated .</p>","499858","","","","","2011-01-27 13:53:38","Porting C++ Project to Android","<c++><android>","1","0","","",""
"4817146","1","4817182","","2011-01-27 13:50:42","1","403","<p>I'm having trouble when showing a button next to the search box. I'm using an auto complete text view and i don't know if this is due to the auto complete text view. How can i fix this. Here's what i got so far:</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;AutoCompleteTextView         android:id=""@+id/autocomplete""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:inputType=""text""        /&gt;    &lt;Button        android:id=""@+id/search_button""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Go""        /&gt;&lt;/LinearLayout&gt;</code></pre>","526924","","","","","2011-01-27 13:56:16","cannot see button next to search box android","<android>","2","0","","",""
"4817256","1","","","2011-01-27 14:02:11","1","1775","<p>HI all,</p><p>I am working on playing audio from URI using ffmpeg shared library in android. </p><p>I configured android-ndk and added ffmpeg shared library to project and able to compile the project using cygwin.</p><p>In ffmpeg library i see ffmpeg.c file, i donot know how i can use this file to implement audio player in my activity.</p><p>Please help me on this issue.  </p><p>Thank you in advance</p>","341443","","","","","2012-01-03 13:41:50","How to play audio file from URI using ffmpeg files in android","<android><ffmpeg><android-ndk>","1","0","","",""
"4817299","1","4819381","","2011-01-27 14:05:25","0","476","<p><strong>GOAL</strong>Hi,    I plan to include in all my aps a ""credits"" button that will display my logo, URL, etc.</p><p><strong>PREFERRED SOLUTION</strong>In order to be more effective I would like to have it as an independent app, so that if I later modify it, all the apps calling it would get updated to the same credits display, instead of modifying each of them.</p><p><strong>ALTERNATIVES</strong>*<em>(a)</em>* Of course the easy solution is to copy it within each of my apps and update manually each of them. I think this is not so effective when the number grows.<strong>(b)</strong> Having a kind of external resource like a mobile adapted webpage which would always be called. I would only need to change it. But I open then the workfield out of android.</p><p>My first idea is to have to define it as an independent activity and get it called from each of the apps.I have <strong>two related questions</strong>:  1. How do I ensure this ""credits"" activity gets installed with an application (is there a kind of dependency which can be defined?)  2. Is this a reasonable way of doing it within Android context?</p><p>Thanks.</p>","567103","","","","","2011-01-27 16:58:59","Best way to display credits from an android application","<android><activity>","1","2","","",""
"4817306","1","13483784","","2011-01-27 14:05:50","1","4567","<p>I am stress testing an app that consists of a bunch of custom views (3 in fact) that are held in a frameLayout.</p><p>Only two are held at a time though. I have view 1, add view two, animate out 1 and animate in 2, then remove 1, and vice versa if I go bacward throug hthe views.</p><p>Each view then loads a large amount of image data when it is created using the following method:</p><pre><code>mBmp[background] = BitmapFactory.decodeStream(context.getAssets().open(""view1_background.png""));</code></pre><p>Below is an example of my View switching code, this switching forward, to the nextView.</p><pre><code>currView.startAnimation(AnimClass.outToLeftAnimation(null));    intView++;    nextView = ViewFactory.getInstance(this, intView, viewInitializer);    mainLayout.addView(nextView, 0);    nextView.startAnimation(AnimClass.inFromRightAnimation(this));    mainLayout.removeViewInLayout(currView);    currView = nextView;    nextView = null;</code></pre><p>viewInitializer calls a Custom view depending on the intView and instantiates it which then loads the images using the above method.</p><p>The problem is that if I switch the views fast enough I can cause it to stop keeping up (even though i'm disabling the buttons until the slide out animation is finished) and after a few switches I will lose most of the images in a view and just end up with one or two of the smallest images still there. It does not show any errors when this happens except the following messages (one per image in that view):</p><pre><code>01-27 13:52:00.730: DEBUG/skia(23064): ------- imageref_ashmem create failed &lt;(null)&gt; 13926401-27 13:52:01.011: DEBUG/skia(23064): ------- imageref_ashmem create failed &lt;(null)&gt; 42598401-27 13:52:01.011: DEBUG/skia(23064): ------- imageref_ashmem create failed &lt;(null)&gt; 118784001-27 13:52:01.011: DEBUG/skia(23064): ------- imageref_ashmem create failed &lt;(null)&gt; 13926401-27 13:52:01.093: DEBUG/skia(23064): ------- imageref_ashmem create failed &lt;(null)&gt; 13926401-27 13:52:01.128: DEBUG/skia(23064): ------- imageref_ashmem create failed &lt;(null)&gt; 42598401-27 13:52:01.144: DEBUG/skia(23064): ------- imageref_ashmem create failed &lt;(null)&gt; 118784001-27 13:52:01.179: DEBUG/skia(23064): ------- imageref_ashmem create failed &lt;(null)&gt; 13926401-27 13:52:01.245: DEBUG/skia(23064): ------- imageref_ashmem create failed &lt;(null)&gt; 42598401-27 13:52:01.261: DEBUG/skia(23064): ------- imageref_ashmem create failed &lt;(null)&gt; 13926401-27 13:52:01.277: DEBUG/skia(23064): ------- imageref_ashmem create failed &lt;(null)&gt; 118784001-27 13:52:01.343: DEBUG/skia(23064): ------- imageref_ashmem create failed &lt;(null)&gt; 13926401-27 13:52:01.363: DEBUG/skia(23064): ------- imageref_ashmem create failed &lt;(null)&gt; 42598401-27 13:52:01.409: DEBUG/skia(23064): ------- imageref_ashmem create failed &lt;(null)&gt; 118784001-27 13:52:01.429: DEBUG/skia(23064): ------- imageref_ashmem create failed &lt;(null)&gt; 13926401-27 13:52:01.511: DEBUG/skia(23064): ------- imageref_ashmem create failed &lt;(null)&gt; 139264</code></pre><p>If I switch views, it does the same on every view. It seems to me that my view switching code isn't deallocating the views when they or removed, or the images (bitmaps) arent being deallocated once the view is removed.</p><p>If I then use an intent to return to my main activity I get the following:</p><pre><code>Surface  E  Surface (identity=4810) requestBuffer(0, 00000033) returneda buffer with a null handleSurface  E  getBufferLocked(0, 00000033) failed (Out of memory)Surface  E  dequeueBuffer failed (Out of memory)ViewRoot  E  OutOfResourcesException locking surfaceViewRoot  E  android.view.Surface$OutOfResourcesExceptionViewRoot  E     at android.view.Surface.lockCanvasNative(Native Method)ViewRoot  E     at android.view.Surface.lockCanvas(Surface.java:314)ViewRoot  E     at android.view.ViewRoot.draw(ViewRoot.java:1363)ViewRoot  E     at android.view.ViewRoot.performTraversals(ViewRoot.java:1172)ViewRoot  E     at android.view.ViewRoot.handleMessage(ViewRoot.java:1749)ViewRoot  E     at android.os.Handler.dispatchMessage(Handler.java:99)ViewRoot  E     at android.os.Looper.loop(Looper.java:123)ViewRoot  E     at android.app.ActivityThread.main(ActivityThread.java:4627)ViewRoot  E     at java.lang.reflect.Method.invokeNative(Native Method)ViewRoot  E     at java.lang.reflect.Method.invoke(Method.java:521)ViewRoot  E     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871)ViewRoot  E     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)ViewRoot  E     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Can anyone suggest where I might have gone wrong?</p><p><strong>EDIT: Didn't find the exact cause, but I solved the problem by performing a garbage collect between switching views.</strong></p>","353674","","353674","","2011-02-07 17:30:43","2012-11-20 23:08:32","Android, out of memory in custom View","<android><image><memory><memory-deallocation>","2","2","0","",""
"4817330","1","4817423","","2011-01-27 14:08:22","3","1557","<p>I am trying to create an app which periodically samples an image in the camera(preview?) and then does some processing on this image (i.e. face detection). I think this is the way to go about this., I have looked into OpenCV but don't think my knowledge is quite up to scratch to get it implemented well enough. My idea is to sample the image (raw format?), convert this to a bitmap image which then a FaceDetector object can detect the faces in the image and indicate this on screen. </p><p>Very much like the Native Camera app on the HTC Desire, which puts a grey square around the faces it sees before taking the picture. </p>","400406","","","","","2011-01-27 14:15:56","Sample camera images as bitmap Android","<android><camera><face-detection><android-camera>","1","0","","",""
"4817413","1","","","2011-01-27 14:14:29","0","828","<p>I am a new bie on android and java platform. I am using eclipse IDE, Android SDK 2.2, JDK 6.0.2, mysql 6.54 and mySQL-Connector-java-5.1.7.bin.jar. When I am trying to connect to DB then I am getting error ""com.mysql.jdbc.CommunicationException: Communications link failure"". Can you please guide me in this context. I would appreciate if any one can tell me the steps to connect. OR if I am using some wrong JDK or Connector in order to connect to mySql. </p><p>Thanks in advance.</p><p>-Krishna</p>","591812","","591812","","2011-01-27 14:29:34","2012-02-12 21:21:13","Having trouble creating Android based application using eclipse for mySql connection","<java><android><mysql><eclipse>","1","1","","",""
"4817443","1","4817564","","2011-01-27 14:17:52","6","602","<p>Developping games for android devices, I need to target devices that have no JIT at all, and only rely on bytecode optimizations. I wonder if the set of these optimization is empty or not...</p><p>Actually, does the java compiler (the hard one, javac, not a JIT) makes any optimization like transforming a / 4 into a >> 2 ? Or is every optimization a work for the JIT ?</p>","294918","","","","","2011-01-27 14:52:40","Java optimizations : bytecode-only vs JIT","<java><android><jit><bytecode>","2","1","1","",""
"4817446","1","","","2011-01-27 14:18:07","2","2301","<p>How can I show a status bar notification with MonoDroid using C#?</p><p>Can someone give me an example?</p><p>Thanks.</p>","590353","","321697","","2011-01-27 14:49:25","2013-06-05 10:45:06","Show Status Bar Notification with MonoDroid C#","<c#><android><notifications><monodroid>","3","0","1","",""
"4817449","1","5524749","","2011-01-27 14:18:19","25","19306","<p>I want to display <code>TEXT</code> and <code>Icon</code> on a Button.  </p><pre><code>+----------------------------+|          Icon TEXT         |+----------------------------+</code></pre><p>I tried with </p><pre><code>&lt;Button       android:id=""@+id/Button01""       android:layout_width=""fill_parent""      android:layout_height=""wrap_content""       android:paddingLeft=""40dip""      android:text=""TEXT""      android:drawableLeft=""@drawable/Icon"" /&gt;</code></pre><p>But <code>Text</code> and <code>Icon</code> is not in center.<br>My <code>Text</code> size varies, according to text size <code>Icon</code> and <code>Text</code> should get adjusted to center.  </p><p>How should i do it? </p>","314247","","1730272","","2012-10-31 18:12:25","2014-04-13 08:58:08","How to have Image and Text Center within a Button","<android>","9","4","8","",""
"4817558","1","5021347","","2011-01-27 14:28:10","0","379","<p>I have been trying to make my application a pre-loaded application on the Android OS Kernel. Within these two makefiles: <code>generic.mk</code> and <code>core.mk</code>, I added my application to the list of pre-loaded applications found under <code>PRODUCT_PACKAGES:=</code>, but when I load my custom kernel my application is not installed. Am I doing something wrong?</p>","548852","","","","","2011-02-16 19:46:36","Android: How to add Pre-loaded Application?","<android><kernel-programming>","1","0","","",""
"4817580","1","4817678","","2011-01-27 14:29:26","0","640","<p>I created an application but I want to add a password authentication every time the user open it. When it's the first time to open the application, the user must first input a password and the application should have a settings for changing the password. Does anyone can suggest me how to do this? Thanks</p>","516160","","","","","2011-01-27 14:37:28","Password authentication every time the application is opened","<java><android><eclipse><passwords><password-protection>","1","2","","",""
"4817584","1","8740821","","2011-01-27 14:29:38","10","1171","<p>Here is my layout:</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;SeekBar         android:id=""@+id/seekBar1""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         /&gt;    &lt;TextView         android:id=""@+id/textView1""         android:layout_width=""fill_parent""         android:layout_height=""60dip""&gt;        &lt;/TextView&gt;    &lt;SeekBar         android:id=""@+id/seekBar2""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         /&gt;&lt;/LinearLayout&gt;</code></pre><p>I want to be able to move the two SeekBars (which I will be using as sliders) at the same time, each with a different finger but at the same time.</p><p>How would I achieve this?</p>","67419","","991737","","2012-01-11 15:42:34","2012-08-02 08:39:45","Touch two views at once on android","<android><android-layout><view>","4","5","1","",""
"4817622","1","","","2011-01-27 14:32:46","0","1425","<p>This is my first post . I am making android php login system, Basically i am making hybrid app . So i will be calling php page in the android app . so wht i want to do is tht using android screen and php page finger print login system .At the php side i have an idea of everything but i dont knw to capture android screen and send image finger print image to server .Thanks in advance</p>","592344","","","","","2011-04-18 10:10:51","Android php login system","<php><android><mysql><database>","1","3","","",""
"4817649","1","","","2011-01-27 14:35:00","1","1411","<p>I am using <code>GridView</code> for display icon in my application's home screen,I am using list selector in <code>GridView</code> using <code>android:listSelector=""@drawable/corner_orange""</code> ,</p><p>corner_orange.xml code:</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=""#777777"" /&gt;    &lt;corners android:radius=""5px"" /&gt;    &lt;padding android:left=""5dp""        android:top=""3dp""        android:right=""5dp""        android:bottom=""3dp"" /&gt;&lt;/shape&gt;</code></pre><p>but my selector display rectangle on icon like </p><p>![enter image description here][1]</p><p>I don't need this kind of selector. I want to display list selector's width and height equal to the icon's width and height.</p><p>How can I achieve that?</p>","500595","","424413","","2011-04-21 14:55:27","2011-04-21 14:55:27","How to customize listselector for GridView icon?","<android><gridview>","0","0","1","",""
"4817687","1","","","2011-01-27 14:37:57","1","1286","<p>I asked this question before, but I think I worded it badly and thus did not get any response. I am trying to make an app for android that draws the path of an object in projectile motion. I have the equations to make this work, but for some reason, when I run my program, all I get is 2 connected lines instead of the proper arc. I've been staring at this for hours, can anyone tell me what is happening and what I need to do to fix it? Here is my code:(It also draws the ground, but that part seems to work. It is included because some of the variables used to create the ground are also used in the arc.)</p><pre><code>float constx = 400;    float consty = 375;    float deltx = (float) ProjectileMotionDrawingActivity.dx;    float delty = (float) ProjectileMotionDrawingActivity.dy;    float maxDrawingHeight;    float totwidth;    float totheight;    float starty;    float ydist;    float cx = canvas.getWidth()/2;    float cy = 210;    boolean limiter;    float vin = (float) ProjectileMotionDrawingActivity.vin;    float vxd = (float) ProjectileMotionDrawingActivity.vxd;    float acc = (float) ProjectileMotionDrawingActivity.ac;    float scaleda;    float scaledv;    float scaledvi;    //Set background color and get paint ready    canvas.drawColor(Color.WHITE);    Paint linePaint = new Paint(Paint.ANTI_ALIAS_FLAG);    linePaint.setColor(Color.BLACK);    //Define maxDrawingHeight    if(delty &gt;= 0){        maxDrawingHeight = (float) ProjectileMotionDrawingActivity.mhe;    }else{        maxDrawingHeight = (float) (ProjectileMotionDrawingActivity.mhe + Math.abs(delty));    }    // Determine whether x or y is limiting factor (true=x, false =y) (For future use if needed)    if(Math.abs(maxDrawingHeight/deltx) &gt;=consty/constx){        limiter = false;    }else{        limiter = true;    }    //set width and height of projectile motion    if(limiter){        totwidth = constx;        totheight = constx*maxDrawingHeight/deltx;        scaleda = acc*constx/deltx;        scaledvi = vin*constx/deltx;        scaledv = vxd*constx/deltx;    }else{        totheight = consty;        totwidth = consty*deltx/maxDrawingHeight;        scaleda = acc*consty/maxDrawingHeight;        scaledvi = vin*consty/maxDrawingHeight;        scaledv = vxd*consty/maxDrawingHeight;    }    //height of cliff    ydist = delty*totheight/maxDrawingHeight;    //start height    starty = cy+(totheight/2);    canvas.drawLine(0, starty, totwidth+35, starty, linePaint);    canvas.drawLine(totwidth+35, starty, totwidth+35, starty-ydist, linePaint);    canvas.drawLine(totwidth+35, starty-ydist, 2*cx, starty-ydist, linePaint);    //Parabola    float porabx = 35;    float poraby = starty;    float porabx2 = 35 + totwidth/50;    float poraby2 = (float) (starty - scaledvi*porabx2/scaledv-.5*scaleda*Math.pow(porabx2/scaledv,2));    for(int i=0;i&lt;50;i++){        canvas.drawLine(porabx, poraby, porabx2, poraby2 , linePaint);        porabx = porabx2;        poraby = poraby2;        porabx2 += totwidth/50;        poraby2 = (float) (starty - scaledvi*porabx2/scaledv-.5*scaleda*Math.pow(porabx2/scaledv,2));    }}</code></pre><p>Update: After looking at this for a while and trying different numbers, I believe that the first line being drawn is the correct first (1/50) of the arc. For some reason it seems like the there is a problem with the poraby2 variable in the loop.</p>","583082","","583082","","2011-01-27 15:03:49","2011-01-30 08:46:49","Drawing a Projectile Motion Path in Android","<android><physics><draw><gravity><geometric-arc>","2","1","1","",""
"4817770","1","","","2011-01-27 14:44:04","9","8165","<p>I have a the following ListActivity:</p><pre><code>public class ShowDayActivity extends ListActivity implements OnItemClickListener {    private GestureDetector gestureDetector;    private View.OnTouchListener gestureListener;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.day);        registerForContextMenu(getListView());        gestureDetector = new GestureDetector(new MyGestureDetector());        gestureListener = new View.OnTouchListener() {            @Override            public boolean onTouch(View v, MotionEvent event) {                return gestureDetector.onTouchEvent(event);            }        };        getListView().setOnItemClickListener(this);        getListView().setOnTouchListener(gestureListener);    }    @SuppressWarnings(""static-access"")    @Override    public boolean onOptionsItemSelected(MenuItem item) {        ...        return super.onOptionsItemSelected(item);    }    @Override    public boolean onContextItemSelected(MenuItem item) {        ...        return super.onContextItemSelected(item);    }    Override    public void onItemClick(AdapterView&lt;?&gt; parent, View v, int pos, long id) {        editEvent(pos);    }    class MyGestureDetector extends SimpleOnGestureListener {        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;        @Override        public boolean onFling(MotionEvent e1, MotionEvent e2,                                float velocityX, float velocityY) {            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) {                Log.d(""ICS-Calendar"", ""Fling left"");                return true;            } else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                Log.d(""ICS-Calendar"", ""Fling right"");                return true;            }            return false;        }    }   } </code></pre><p>The contextListener (long-click) on the listItems works perfectly. Today i added the gestureListener and Detector, which works too, BUT:</p><p>The GestureDetector detects a fling all right, but after it's done with its logic, the context menu opens, which is obviously not what i want. Any ideas what i'm doing wrong, or what i might do about it?</p>","592359","","1417267","","2013-01-06 07:56:52","2013-01-06 08:15:26","Android ListView with OnItemClickListener AND GestureDetector","<android><listview><gesturedetector>","2","0","2","",""
"4817791","1","4817922","","2011-01-27 14:45:14","0","6904","<p>I'm a newbie of android. I already designed my application consists of many pages.Anyone have a source code or anything which can let me know how to build it.For example : When I click a button, I want it changes page to next page.Thank you ka :)</p>","538788","","21234","","2011-01-27 14:52:06","2011-12-20 22:11:23","How to change page on android application?","<android><button><activity>","2","0","","",""
"4817900","1","4819665","","2011-01-27 14:55:00","83","58213","<p>How should you implement the sort of sliding that for example the Honeycomb Gmail client uses?</p><p>Can <code>TransactionManager</code> handle this automatically by adding and removing the Fragments, it's kind of difficult to test this due to the emulator being a slideshow :)</p>","253583","","750987","","2011-05-29 06:48:41","2014-03-20 01:18:09","Android Fragments and animation","<android><android-fragments><android-3.0-honeycomb>","3","0","98","",""
"4817933","1","4819256","","2011-01-27 14:58:02","18","8382","<p>Can anyone tell me if an equivalent for setInterval/setTimeout exists for android? Does anybody have any example about how to do it?</p><p>Thanks in advance!</p>","591452","","633239","","2012-01-16 14:50:16","2013-12-15 03:25:32","What is the equivalent to a JavaScript setInterval/setTimeout in Android/Java?","<java><javascript><android><settimeout>","5","0","","",""
"4818047","1","4818258","","2011-01-27 15:08:00","0","9294","<p>HI i want to play a .3GP video file in android phone. i tried below code but it shows cant play video.so please tell me what i will do</p><p>This is my code</p><pre><code> public class VideoPlay extends Activity {private String path ;private VideoView mVideoView;@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.videoplay);    path=""http://www.boodang.com/api/videobb/101009_Pure.3gp"";    mVideoView = (VideoView) findViewById(R.id.video);    if (path == """") {        // Tell the user to provide a media file URL/path.        Toast.makeText(                VideoPlay.this,                ""Please edit VideoViewDemo Activity, and set path""                        + "" variable to your media file URL/path"",                Toast.LENGTH_LONG).show();    } else {        /*         * Alternatively,for streaming media you can use         * mVideoView.setVideoURI(Uri.parse(URLstring));         */        mVideoView.setVideoPath(path);        mVideoView.setMediaController(new MediaController(this));        mVideoView.requestFocus();    }}}</code></pre><p>The XML layout is</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;VideoView  android:id=""@+id/video""   android:layout_width=""320px""   android:layout_height=""240px""&gt;   &lt;/VideoView&gt;   &lt;/FrameLayout&gt;</code></pre>","745367","","745367","","2011-01-27 15:46:44","2012-08-29 10:05:19","how to play .3GP video file in android","<android><videoview>","3","0","","",""
"4818118","1","4818164","","2011-01-27 15:14:30","87","56543","<p>I have one image stored in <code>res/drawable/icon.png</code> (R.drawable.icon).<br>I want to pass this image to an function which accepts <code>Drawable</code><br>(e.g. <code>mButton.setCompoundDrawables()</code>) </p><p>So how to convert a image resource to an <code>Drawable</code>?</p>","314247","","314247","","2012-12-27 06:13:41","2013-07-24 10:51:09","How to create Drawable from resource","<android><drawable>","2","0","12","",""
"4818157","1","","","2011-01-27 15:17:39","1","947","<p>I developed a web application and I tried to use it webview. everythig works fine except the geolocation (wich works perfect in web)Does anybody have an example of a webview with geolocation??</p><p>Thankyou...</p><p>This is the code for webview:</p><blockquote>  <p>package com.androidpeople.view;</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.webkit.WebView;public class WebViewExample extends Activity {@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);WebView webView = (WebView) findViewById(R.id.webview);webView.getSettings().setJavaScriptEnabled(true);webView.loadUrl(""http://myweb.com"");webView.setWebViewClient(new HelloWebViewClient());}}</code></pre></blockquote>","592376","","","","","2012-07-02 19:31:21","geolocation in webview for android","<android><geolocation><webview>","2","0","2","",""
"4818224","1","4818518","","2011-01-27 15:22:33","0","877","<p>HI friends I am implemented tablayout but it properly working in emulator .the height is not coming proper in device can anybody tell what is the problem</p><p><strong>this is my layout file</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=""fill_parent""&gt; &lt;TabHost     android:id=""@android:id/tabhost""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:background=""@color/black""        &gt;    &lt;RelativeLayout            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_alignParentTop=""true""               android:layout_above=""@android:id/tabs"" /&gt;     &lt;TabWidget android:id=""@android:id/tabs""              android:layout_width=""fill_parent""               android:layout_height=""wrap_content""               android:layout_alignParentBottom=""true""                       /&gt;           &lt;/RelativeLayout&gt;     &lt;/TabHost&gt;    &lt;/LinearLayout&gt;</code></pre><p>this is my java code setting height and width</p><pre><code>for (int i =0; i&lt;tabWidget.getChildCount(); i++) {         //tabWidget.getChildAt(i).setBackgroundColor(R.color.black);          tabWidget.getChildAt(i).getLayoutParams().height = height;   tabWidget.getChildAt(i).getLayoutParams().width = width;   RelativeLayout relLayout = (RelativeLayout)tabWidget.getChildAt(i);    TextView tv = (TextView)relLayout.getChildAt(1);    tv.setTextSize(10.0f);   tv.setTypeface(myTypeface1);}</code></pre><p>can anybody tell how to set height and width for tab bar give sample code</p><p>Thanks</p>","426344","","","","","2011-01-27 15:49:06","tab height is not coming properly in android device","<android>","1","1","1","",""
"4818273","1","4826387","","2011-01-27 15:26:28","3","2102","<p>The library <a href=""http://code.google.com/p/libphonenumber/"" rel=""nofollow"">libphonenumber</a> doesn't work on Android and the exception says:""Caused by: java.lang.UnsupportedOperationException: CANON_EQ flag not supported""</p><p>The description in the webpage says that the lib is for ""Smartphones"" but Android doesn't support CANON_EQ reg_ex flag..</p><p>Am I missing something?</p>","178016","","40342","","2013-01-23 16:11:36","2013-01-23 16:11:36","Using LibPhoneNumber google lib in Android","<android><numbers><contacts><libphonenumber>","5","0","1","",""
"4818415","1","4833708","","2011-01-27 15:39:33","1","972","<p>I'm working on an application , I currently I have a database the rows are transferred to arrays then displayed in a datatable.</p><p>I'm a novice with this, I'd just like to know what is the best way to edit these rows. I can retrieve a row by the id in some edittext boxes then edit and update. But is there a more intuitive way to do this for the user? like an alternative to a datatable where the table itself its editable?</p><p>Hopefully I explained that well enough</p><p>Advice would be great, thanks</p>","590672","","","","","2011-01-28 22:33:34","Android Datatable","<android><sql><database>","1","4","","",""
"4818568","1","6334466","","2011-01-27 15:52:56","2","3297","<p>I have a linear layout with a couple text boxes, vertical.  I want to add/remove one more text box (more specifically, set it to visible/gone).  When this happens, I'd like to resize the parent view with an animation rather than just having it jump up and down.  I've put a layout animation on the parent linear layout, and it animates the box in/out, but it appears to resize first, then animate the child, but that doesn't really solve the problem I'm having (looks nice, but you know).</p><p>Any thoughts?</p>","227313","","","","","2011-06-13 18:16:52","Android resize container with animation","<android><animation>","2","0","1","",""
"4818609","1","6973411","","2011-01-27 15:56:13","0","657","<p>I'm writing my own Authenticator and AuthenticationService and want to manage/maintain a http-session, consisting of two cookies and one sessionid, per account in the Authenticator-System of android. So that other apps/activity can reuse the session/account and (nearly) don't have to care about sessionmanagement.</p><p>I think the right way is to use the AuthenticationToken, which every other app with the appropriate permissions can request. But my problem is, that this AuthenticationToken is only one String, but as I said I need three to maintain my session.</p><p>So what I'm searching for is a way to ask the system for three Strings which I then could append to the HTTP-Request and that on a per account base.</p><p>Hopefully someone can point me in the right direction or has another idea how a http-session can be maintained inside the Authenticator.</p><p>Every hint is highly appreciated!</p><p>Cheeres  L0rdAli3n</p>","539884","","","","","2011-08-07 14:35:44","Maintain http-session via AuthenticationToken and Authenticator","<android><session><account-management>","1","0","","",""
"4818625","1","4819392","","2011-01-27 15:57:46","0","898","<p>In my code I start a new activity for street view.</p><pre><code>Intent streetView = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri));startActivity(streetView);</code></pre><p>It Launches the street view just fine. If I don't do much, I can hit the back button and my App is sitting there waiting like nothing had changed.</p><p>However, if I use street view for a bit and look around and move the view around, I see this in the logcat:</p><p>01-27 10:53:27.526: INFO/ActivityManager(1079): Low Memory: No more background processes.</p><p>01-27 10:53:27.636: DEBUG/dalvikvm(32218): GC_FOR_MALLOC freed 3054 objects / 198608 bytes in 655ms</p><p>01-27 10:53:27.831: DEBUG/dalvikvm(32164): GC_FOR_MALLOC freed 1054 objects / 51664 bytes in 342ms</p><p>01-27 10:53:27.862: INFO/dalvikvm-heap(32164): Grow heap (frag case) to 3.656MB for 87396-byte allocation</p><p>01-27 10:53:27.878: INFO/ActivityManager(1079): Process com.favorite.me (pid 32135) has died.</p><p>01-27 10:53:27.878: INFO/ActivityManager(1079): Low Memory: No more background processes.</p><p>01-27 10:53:27.482: INFO/ActivityManager(1079): Process com.myapp.app (pid 31481) has died.</p><p>01-27 10:53:27.490: INFO/WindowManager(1079): WIN DEATH: Window{44c68ba8 com.myapp.app/com.myapp.app.MyLocation paused=false}</p><p>Then when I hit the back button to return to my app, it seems like all the variable have been reset to null, like I've lost my app's state. The only way to fix it is to hit the back button again and relaunch that activity.</p><p>From what I can tell, its not calling the onpause() or the onSaveInstanceState() methods and the OS is killing off my App for memory to run streetview.</p><p>Is there something I need to do differently?</p><p>Here is my oncreate, onRestoreInstanceState and onSaveInstanceState methods:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);</code></pre><hr><pre><code>        @Override    public void onRestoreInstanceState(Bundle savedInstanceState) {      super.onRestoreInstanceState(savedInstanceState);        sLong = savedInstanceState.getDouble(""sLong"");        sLat = savedInstanceState.getDouble(""sLat"");        sMapStyle = savedInstanceState.getBoolean(""sMapStyle"");        sMapUpdate = savedInstanceState.getBoolean(""sMapUpdate"");        sMapStreet = savedInstanceState.getBoolean(""sMapStreet"");        sFirstTime = savedInstanceState.getBoolean(""sFirstTime"");        locationAvailable = savedInstanceState.getBoolean(""locationAvailable"");        sGPSFlag = savedInstanceState.getBoolean(""sGPSFlag"");        sMessage = savedInstanceState.getString(""sMessage"");        sMap = savedInstanceState.getString(""sMap"");        sGPS = savedInstanceState.getString(""sGPS"");        sAddressIn = savedInstanceState.getString(""sAddressIn"");        sGPSLat = savedInstanceState.getString(""sGPSLat"");        sGPSLong = savedInstanceState.getString(""sGPSLong"");    }    @Override    public void onSaveInstanceState(Bundle savedInstanceState) {      super.onSaveInstanceState(savedInstanceState);        savedInstanceState.putDouble(""sLong"",sLong);        savedInstanceState.putDouble(""sLat"",sLat);        savedInstanceState.putBoolean(""sMapStyle"",sMapStyle);        savedInstanceState.putBoolean(""sMapUpdate"",sMapUpdate);        savedInstanceState.putBoolean(""sMapStreet"",sMapStreet);        savedInstanceState.putBoolean(""sFirstTime"",sFirstTime);        savedInstanceState.putBoolean(""locationAvailable"",locationAvailable);        savedInstanceState.putBoolean(""sGPSFlag"",sGPSFlag);        savedInstanceState.putString(""sMessage"",sMessage);        savedInstanceState.putString(""sMap"",sMap);        savedInstanceState.putString(""sGPS"",sGPS);        savedInstanceState.putString(""sAddressIn"",sAddressIn);        savedInstanceState.putString(""sGPSLat"",sGPSLat);        savedInstanceState.putString(""sGPSLong"",sGPSLong);    }</code></pre><p>I think I may have a lead on why this is happening. Still not sure how correct it yet.I set some debugging messages and I am seeing the <code>onRestoreInstanceState()</code> and <code>onSaveInstanceState()</code> methods run.</p><p>The problem is, it is not restoring my saved instance until <em>after</em> my <code>onCreate()</code> method finishes. But it is during the <code>onCreate()</code> method that I am needing these variables which are still null at this point. How can I get my code to run after the <code>onCreate()</code> but without requiring any user input? or How can I get the <code>onRestoreInstanceState()</code> to run before my code?</p>","412396","","412396","","2011-01-27 21:16:29","2011-04-30 02:49:30","Main App is killed after launching a streetview activity","<android><memory><null><activity>","3","2","1","",""
"4818725","1","5891784","","2011-01-27 16:06:58","1","3484","<p>I was working through a tutorial at <a href=""http://fszlin.blogspot.com/2010/05/comsuming-wcf-services-with-android.html"" rel=""nofollow"">http://fszlin.blogspot.com/2010/05/comsuming-wcf-services-with-android.html</a> and am having a problem.  The author of the tutorial doesn't look responsive so I figured I'd ask here.</p><p>I have the WCF service up and running.  If I run the WCF Test application that comes with Visual Studio, I can access it no problem.  My problem comes running it from the application, or even trying to hit it through the browser, nothing gets returned.  </p><p>Here's what I've tried:</p><p>Setting a breakpoint in the WCF service and running the WCF Test application, when I make a call, it hits the breakpoint.  Makes sense.</p><p>Putting the URL in a browser returns nothing (no error, no data) and the breakpoint never gets hit.</p><p>Putting the URL in the Android application and running it in the Android emulator returns nothing (no error, no data) and the breakpoint never gets hit.</p><p>Thinking that it might not be connecting from the browser or the Android app, I put in a bad URL into the browser (like changing it from <a href=""http://localhost/hello.svc/GetPlates"" rel=""nofollow"">http://localhost/hello.svc/GetPlates</a> to <a href=""http://localhost/hellotest.svc/GetPlates"" rel=""nofollow"">http://localhost/hellotest.svc/GetPlates</a>) returns an error, same in Android application.</p><p>So to me it seems like it's hitting the service properly, just for some reason not executing the code.  I have no idea how to further test this.  Aren't SOAP services supposed to be able to be hit from the browser?  Especially when the function in the service you're calling takes no parameters and only returns data?</p><p>Again, it all works in the WCF test app, just can't seem to reach the goal of ultimately calling the service from the Android application.</p><p>Much thanks in advance!</p><p>Mike</p>","294497","","","","","2012-06-25 11:27:18","Consuming WCF/Rest from an Android app","<android><rest><android-emulator><wcf>","2","0","","",""
"4818851","1","4844269","","2011-01-27 16:16:58","4","2158","<p><em><strong>Edit: I was actually able to get this to work and form, in my oppinion, a good example. The accepted answer is my example and feel free to leave comments if you need assistance or have advice.</em></strong></p><p>I am very new to java and have just been introduced to events, handlers and listeners. I have found 3 good references online, however, i am still not seeing how i can implement this to solve my problem. (Also, this is being developed on the android. I doubt that will change the example, but thought i would let you know)</p><p><em><strong>Links to sites i found helpful:</em></strong><br><a href=""http://www.javaworld.com/javaqa/2002-03/01-qa-0315-happyevent.html"" rel=""nofollow"">happy object</a><br><a href=""http://www.exampledepot.com/egs/java.util/custevent.html"" rel=""nofollow"">example depot</a><br><a href=""http://www.javaworld.com/javaqa/2000-08/01-qa-0804-events.html"" rel=""nofollow"">java world</a>  </p><p>Here is what i need, using arbitrary names and examples instead of plopping my hundreds of lines of code in here:</p><p>Here are my class and their uses:<br><strong>MainUI</strong> - this creates the UI<br><strong>Connect</strong> - this class performs a connection to a socket and starts receiving data<br><strong>DataRobot</strong> - this class performs calculations on the data that is received and decides what to do with it<br><strong>DataBuilder</strong> - this class gathers the data from the datarobot and once a certain amount is reached it sends that chunk to a remote database<br><strong>DataSender</strong> - this class sends that data that is sent to it by the databuilder  </p><p><em>I was implementing this with threads... =(</em><br>Someone i know suggested i use events. He gave me a great explanation, however, it was within 30 minutes and i do not see how i can implement it without seeing some better examples (he was also speaking from a C# background). I was wondering if someone out there with some great experience in java could use what i have above and show me what i need to do.</p><p>Here are the events that i have planned out:<br><strong>dataReceived</strong> - this event happens in connect, this event fires when connect receives data when this event fires it sends the data to the data robots handler() function.<br><strong>dataAnalyzed</strong> - this event happens in datarobot, this event fires when datarobot is done handling the data that was given to it, when this event fires it sends the data to the databuilder<br><strong>dataBuilder</strong> - this event happens in databuilder, this event fires when databuilder has received a certain amount and is ready to send the data, when this event fires it sends the data to the datasender.  </p><p>I am looking for an example here or at least a discussion on what should be done. One of the examples i found was the ""happyfaceobject"" example and it was pretty good. However, i am still having trouble implementing it in my design, since i am VERY new to java and events. Please assist me when you can and it will be greatly appreciated. This example would also help the community as a whole as there is a lacking of great java events examples.</p><p>Thanks in advance, if you need more info let me know.</p>","427763","","427763","","2011-01-30 17:30:40","2011-02-05 21:08:53","java events,handlers and listeners question","<java><android><events>","2","4","3","",""
"4818869","1","","","2011-01-27 16:18:00","21","6610","<p>As I'm doing a research on commonalities/differences of various mobile platforms, one of the aspects under investigation is memory management. As such, I'm interested in more detailed technical information on the various mechanisms.</p><p>In specific, e.g. <strong>which garbage collector type does Android use</strong>?<br>(<a href=""http://groups.google.com/group/android-platform/browse_thread/thread/6ecb8ea2b18fa165/ce60a4781f41b786?lnk=raot&amp;pli=1"">[Google Groups Discussion]</a> suggests that it is using ""tracing"" mechanism - but I'd appreciate a ""more official"" source which I could possibly quote, plus hoping to find information there <em>which implications the type could have on the programmer</em>).</p><p>Also among my questions is <strong>in what way the GC in Android 3.0 (Honeycomb) has been tweaked specifically to utilize multiple processors</strong>?<br>[Android Devevelopers Guide] suggests that</p><blockquote>  <p>Android 3.0 is the first version of the platform designed to run on either single or multicore processor architectures. A variety of changes in the Dalvik VM, Bionic library, and elsewhere add support for symmetric multiprocessing in multicore environments. These optimizations can benefit all applications, even those that are single-threaded. For example, with two active cores, a single-threaded application might still see a performance boost if the Dalvik garbage collector runs on the second core. The system will arrange for this automatically.""</p></blockquote><p>As before, I'd rather find a source with more technical information to read upon this. Again, <em>what's the impact on the developer</em> (other than the obvious that increased performance could be hoped for)?</p><p>Any such input is appreciated.</p><p>Thanks!</p>","226480","","750987","","2011-05-29 06:48:10","2013-01-09 01:59:33","Technical details of Android Garbage Collector","<android><multithreading><garbage-collection><android-3.0-honeycomb>","1","0","9","",""
"4818889","1","4819277","","2011-01-27 16:19:52","5","15293","<p>If i set only margin for my textview, that is inside linear layout, everything works.If i set only gravity for my textview, it works. But if i set both attributes (gravity and margins), gravity remains left with margins set successfully.</p><p>My code for setting both attributes that doesnt work as expected:</p><pre><code>tv2=new TextView(this);tv2.setText(""Text"");LinearLayout.LayoutParams para=new LinearLayout.LayoutParams(    LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT );para.setMargins(0, 10, 0, 10); //left,top,right, bottomtv2.setLayoutParams(para);tv2.setGravity(android.view.Gravity.CENTER_HORIZONTAL);</code></pre><p>I must build my layout in code, can't use xml files.</p>","324417","","321697","","2011-01-27 16:51:41","2011-01-27 16:51:41","Setting margin and gravity of textview in code doesn't work","<android><layout><margin><gravity>","1","0","0","",""
"4818899","1","","","2011-01-27 16:20:30","2","1014","<p>I have a gridview with an adapter that loads and caches images from the web. What I'm trying to do is find a way to have individual progress spinners for each image. I like the indeterminate ProgressBar, and I'm trying to find a way to use it without a ViewSwitcher. I used the indeterminate drawable from the progress bar...</p><pre><code>row.setImageDrawable(new ProgressBar(c).getIndeterminateDrawable());</code></pre><p>...but it's too big and doesn't animate. Is there a simpler way to achieve the results I'm looking for? Or is there a way to tweak my approach to get the results that I'm looking for? Thanks!</p>","592259","","","","","2011-01-27 19:44:59","Android progressbar in image thumbnail","<android><progress-bar><thumbnails>","1","0","0","",""
"4818977","1","4819197","","2011-01-27 16:27:20","0","111","<p>i have write a custom view and i used the onSizeChanged() to take the width and height of the phone.when everything seems right in the emulator i installed on the phone(htc desire) and i don't have the same results!</p><p>what can i do to support different screens than one?onSizeChanged shouldn't give me the solution?</p>","587377","","","","","2011-01-27 16:44:31","display on multiple android screens","<android><screens>","1","1","","",""
"4819019","1","","","2011-01-27 16:30:47","0","506","<p>Is there any framework, similar to Android SDK, for developing (mobile) web apps? I mean something as simple, integrated and complete like Android SDK + Eclipse but not for Android platform but for browser platform. GWT seems to be quite close to what I am looking for.</p>","243225","","243225","","2011-01-27 17:08:12","2011-01-27 17:08:12","Framework similar to Android SDK for developing (mobile) web apps","<android><web-applications><gwt><frameworks>","1","4","","",""
"4819049","1","4826885","","2011-01-27 16:33:26","21","5935","<p>I have not found a way to do this. Is it possible?</p>","457378","","2171147","","2013-12-18 22:58:44","2013-12-18 22:58:44","How can I use TypefaceSpan or StyleSpan with a custom Typeface?","<android><text><span>","3","0","9","",""
"4819097","1","4819259","","2011-01-27 16:36:40","2","1939","<p>I have the following code that is a foundation for a listview.</p><p>The idea is to have a checkbox that is always aligned to the right of the screen. Should the text to the left of it be too long I would like it to be ellipsized ""..."" or cut off gracefully.</p><p>It works fine as long as the text is short but not as is when the text is long. Any advice?</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=""wrap_content""    android:layout_height=""wrap_content""&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:id=""@+id/name""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_marginLeft=""10dip""            android:textAppearance=""?android:attr/textAppearanceMedium""            android:text=""This is a very very long title 12345678""              /&gt;        &lt;CheckBox android:id=""@+id/checkbox""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""                /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;/LinearLayout&gt;</code></pre>","150398","","","","","2011-01-27 16:56:18","checkboxes in tablerow pushed off screen by textview","<android><listview><checkbox><android-layout>","1","0","","",""
"4819330","1","","","2011-01-27 16:55:40","23","2785","<p>I'm getting reports that, on some (not all) HTC Desire HD (FRF91, 2.2) and HTC EVO 4G ( PC36100|3.29.651.5, 2.2), the <code>TextToSpeech.OnInitListener.onInit(int)</code> is being called repeatedly (over 1500 times in the space of a few seconds) on the same object. This behaviour does not occur for any of my other users (or with other Desire HD users) AFAICT.</p><p>The code is:</p><pre><code>TextToSpeech tts = new TextToSpeech(context, new TextToSpeech.OnInitListener() {    private int mCallCount = 0; // trying to investigate potential infinite loops    @Override    public void onInit(int status) {        if ((mCallCount % 100) == 1) {            // report this        }        mCallCount++;    }});</code></pre><p>Anyone any ideas?</p><p>EDIT: I have also tried calling the <code>shutdown()</code> method (the first time multiple listener calls are detected) but this doesn't seem to help.</p>","444761","","168868","","2012-01-01 20:47:01","2012-01-03 06:38:33","TextToSpeech.OnInitListener.onInit(int) being called continuously","<android><text-to-speech>","3","8","1","",""
"4819341","1","4819379","","2011-01-27 16:56:01","0","592","<p>I'm writing an application for Android that retrieve data from the web and reformat it for the user. The user specify some input data, HttpClient connect to the site, and return objects representing the data asked by the user.</p><p>The network part is obviously too slow to be runt in the main thread, so I thought about splitting it in a different thread, maybe as a Service. So I have a design question:</p><p>1) Should I start a new HttpClient for each request in a new thread, or should I build a Service which deals with Http and return the data, to be runt in a separate thread?</p><p>2) Which is the easiest way to communicate between thread or activities for an application like mine?</p><p>Cheers</p>","269931","","","","","2011-01-27 16:58:54","Thread in a Service or Service in a Thread?","<android><multithreading><concurrency><service>","1","1","1","",""
"4819345","1","","","2011-01-27 16:56:14","2","239","<p>So I've gotten some great information from people on here pertaining to how to allow my application to receive text messages before the native messaging app catches them.</p><p>However, I'm looking for a little more specifics on how I can mold this to fit the needs of my application</p><p>What I'm ultimately looking to do, is to only have text messages pertaining to my application be the ones that are caught by my application before the native messaging app, while all other text messages just head to the normal spot</p><p>Is there any way to add extra data to a text message, or some sort of port, where text messages can be filtered into my app as opposed to the native messaging app, without losing out on my 160 character max? I'm really not looking for my application to replace the native messaging app for all text messages, and would only like to have it deal with text messages that are pertaining to my application, as it seems right now to be much easier to have them come into the application from an end-user standpoint, as there's no good way (at least on hTC phones) to copy or import individual text messages from the native messaging application to be brought into the application.</p><p>Any help would be very very appreciated... and if there's any wording in there that is hard to understand (as I'm sure it might be somewhat difficult to follow), please let me know and I will try to clarify! Thanks!</p>","588012","","","","","2011-01-29 03:45:50","Filtering SMS messages that only pertain to my application","<android><sms>","1","0","","",""
"4819405","1","4819562","","2011-01-27 17:00:31","2","8743","<p>I'm using a simple php API (that I wrote) that returns a JSON formatted string such as:</p><pre><code>[[""Air Fortress"",""5639""],[""Altered Beast"",""6091""],[""American Gladiators"",""6024""],[""Bases Loaded II: Second Season"",""5975""],[""Battle Tank"",""5944""]]</code></pre><p>I now have a String that contains the JSON formatted string but need to convert it into two String arrays, one for name and one for id. Are there any quick paths to accomplishing this?</p>","579059","","","","","2011-01-27 17:27:09","JSON formatted string to String Array","<java><android><json>","1","6","","",""
"4819419","1","4819516","","2011-01-27 17:01:27","0","473","<p>i have installed android sdk.i have also downloaded and installed the adt plugin in my eclipse ide.now when i go to preferences to set the path for android sdk, when i set the path and then press apply-- automatically the target api should be listed below. But they are not being listed below for some reason.what could be the problem?thank you in advance</p>","590849","","","","","2011-01-27 17:09:41","android target api not visible","<android>","1","0","","",""
"4819481","1","","","2011-01-27 17:07:10","3","728","<p>I'm populating a list of relatively complex list items including several textviews, a button, and an ImageView.  The images associated with each item are unique but have been prefetched from the internet so I do not need to wait for an HTTP request to download the image.</p><p>Still, I am wondering if it would still be prudent to lazy load the images from memory so that the list can be displayed as quickly as possible.  Android has this behavior in the manage applications list.  It fills the list with generic data and corrects each item as better data becomes available.</p><p>How big of a performance issue is loading several images from memory into a listview (especially considering fast scrolling of large lists (300+ items))?  What are the tradeoffs I need to consider?</p>","131871","","","","","2011-01-27 18:04:03","Should prefetched images still be lazy loaded into a ListView?","<android><listview>","1","0","1","",""
"4819491","1","","","2011-01-27 17:07:37","5","2544","<p>I have an activity that displays a <code>ListView</code>. Each item in the <code>ListView</code> is a <code>LinearLayout</code> consisting of one <code>WebView</code>. There are potentially hundreds of items in the list and each is a different height.</p><p>First problem is that when reusing a recycled view in <code>getView()</code>, the new view is always the height of the original view, even though I've set the <code>layout_height</code> for both the <code>LinearLayout</code> and the <code>WebView</code> to <code>wrap_content</code>.</p><p>Second problem is that <code>getView()</code> seems to be getting called for every item in the list even though only the first five or six fit on the screen. I haven't seen this when using other list item types. For example, in another place I a list of custom views that are all the same height and I only see <code>getView()</code> being called for the number of views that initially fit on the screen.</p><p>So... I need to figure out how to force recycled <code>WebViews</code> to render their new contents so their height can be calculated instead of just using the previous height. And I'd like to know why the system is asking me for ALL my items in this case.</p><p>Here's the requisite code snippets:</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/topPane""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:dividerHeight=""1.0px""        android:divider=""#FFFFFF""        android:smoothScrollbar=""false""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>Rows are built from:</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;WebView         android:id=""@+id/rowWebView""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:padding=""0.0px""        android:scrollbars=""none""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>This is getView() in my adapter. HTML snippets come from an array of Strings for now. </p><pre><code>    @Override    public View getView(int position, View convertView, ViewGroup parent)        {        String item = (String) getItem(position);        if (convertView == null)            {            convertView = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.rowview, parent, false);            }        WebView wv = (WebView) convertView.findViewById(R.id.rowWebView);        wv.loadDataWithBaseURL(null, item, ""text/html"", ""utf-8"", ""about:blank"");        return convertView;        }</code></pre>","422156","","227536","","2014-03-24 14:32:43","2014-03-24 14:32:43","ListView of WebViews - reusing items of different height fails; asks for all views before displaying any","<android><android-webview><android-listview><android-linearlayout>","4","2","5","",""
"4819532","1","5225660","","2011-01-27 17:11:18","2","1699","<p>I have developed the following class to retrieve the node-list of a xml document:</p><pre><code>public class XMLDownloader {    public static NodeList getNodeList(){           String url = ""http://localhost/xml/example.xml"";        DefaultHttpClient client = new DefaultHttpClient();        HttpGet method = new HttpGet(url);        HttpResponse res = null;        NodeList result = null;        try {            res = client.execute(method);        } catch (ClientProtocolException e1) {            e1.printStackTrace();        } catch (IOException e1) {            e1.printStackTrace();        }        try{            InputStream is = res.getEntity().getContent();            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();            DocumentBuilder db = dbf.newDocumentBuilder();            Document doc = db.parse(is);            doc.getDocumentElement().normalize();            result = doc.getElementsByTagName(""client"");                                     is.close();        }catch(Exception e){             Log.e(""log_tag"", ""Error converting result ""+e.toString());        }               return result;                  }}</code></pre><p>But this method returns <code>null</code>. Any ideas?</p><p>The xml file:</p><pre><code>&lt;status&gt;&lt;client type=""s"" name=""test1"" protocol=""1000""&gt;      &lt;/client&gt;&lt;client type=""r"" name=""test2"" protocol=""2000""&gt;       &lt;/client&gt;&lt;client type=""r"" name=""test3"" protocol=""3000""&gt;       &lt;/client&gt;&lt;client type=""h"" name=""test4"" protocol=""4000""&gt;       &lt;/client&gt;&lt;client type=""c"" name=""test5"" protocol=""5000""&gt;       &lt;/client&gt;&lt;/status&gt;</code></pre>","401025","","759866","","2013-11-06 21:25:14","2013-11-06 21:25:14","Get NodeList from xml document","<android><android-xml>","1","3","1","",""
"4819626","1","4838803","","2011-01-27 17:20:33","58","23526","<p>I've been trying to get my head around the Android orientation sensors for a while.I thought I understood it. Then I realised I didn't. Now I think (hope) I have a better feeling for it again but I am still not 100%. I will try and explain my patchy understanding of it and hopefully people will be able to correct me if I am wrong in parts or fill in any blanks.</p><p>I imagine I am standing at 0 degrees longitude (prime meridian) and 0 degrees latitude (equator). This location is actually in the sea off the coast of Africa but bear with me. I hold my phone in front of my face so that the bottom of the phone points to my feet; I am facing North (looking toward Greenwich) so therefore the right hand side of the phone points East towards Africa. In this orientation (with reference to the diagram below) I have the X-axis pointing East, the Z-axis is pointing South and Y-axis point to the sky.</p><p><img src=""http://developer.android.com/images/axis_device.png"" width=""150"" height=""150""></p><p>Now the sensors on the phone allow you to work out the orientation (not location) of the device in this situation. This part has always confused me, probably because I wanted to understand how something worked before I accepted that it did just work. It seems that the phone works out its orientation using a combination of two different techniques.</p><p>Before I get to that, imagine being back standing on that imaginary piece of land at 0 degrees latitude and longitude standing in the direction mentioned above. Imagine also that you are blindfolded and your shoes are fixed to a playground roundabout. If someone shoves you in the back you will fall forward (toward North) and put both hands out to break your fall. Similarly if someone shoves you left shoulder you will fall over on your right hand. Your inner ear has ""gravitational sensors"" <a href=""http://www.youtube.com/watch?v=mmBB2bu1gEQ&amp;feature=related"">(youtube clip)</a> which allow you to detect if you are falling forward/back, or falling left/right or falling down (or up!!). Therefore humans can detect alignment and rotation around the the same X, Y and Z axes as the phone. </p><p>Now imagine someone now rotates you 90 degrees on the roundabout so that you are now facing East. You are being rotated around the Y axis. This axis is different because we can't detect it biologically. We know we are angled by a certain amount but we don't know the direction in relation to the planet's magnetic North pole.Instead we need to use a external tool... a magnetic compass. This allows us to ascertain which direction we are facing. The same is true with our phone.</p><p>Now the phone also has a 3-axes accelerometer. I have <strong>NO</strong> idea how they actually work but the way I visualise it is to imagine gravity as constant and uniform 'rain' falling from the sky and to imagine the axes in the figure above as tubes which can detect the amount of rain flowing through. When the phone held upright all the rain will flow through the Y 'tube'. If the phone is gradually rotated so its screen faces the sky the amount of rain flowing through Y will decrease to zero while the volume through Z will steadily increase until the maximum amount of rain is flowing through. Similarly if we now tip the phone onto its side the X tube will eventually collect the max amount of rain. Therefore depending on the orientation of the phone by measuring the amount of rain flowing through the 3 tubes you can calculate the orientation. </p><p>The phone also has an electronic compass which behaves like a normal compass - its ""virtual needle"" points to magnetic north. Android merges the information from these two sensors so that whenever a <code>SensorEvent</code> of <code>TYPE_ORIENTATION</code> is generated the <code>values[3]</code> array has<br>values[0]: Azimuth - (the compass bearing east of magnetic north)<br>values[1]: Pitch, rotation around x-axis (is the phone leaning forward or back)<br>values[2]: Roll,  rotation around y-axis (is the phone leaning over on its left or right side)</p><p>So I think (ie I don't know) the reason Android gives the azimuth (compass bearing) rather than the reading of the third accelerometer is that the compass bearing is just more useful. I'm not sure why they deprecated this type of sensor as now it seems you need to register a listener with the system for <code>SensorEvent</code>s of type <code>TYPE_MAGNETIC_FIELD</code>. The event's <code>value[]</code> array needs to bepassed into <code>SensorManger.getRotationMatrix(..)</code> method to get a rotation matrix (see below) which is then passed into the <code>SensorManager.getOrientation(..)</code> method. Does anyone know why the Android team deprecated <code>Sensor.TYPE_ORIENTATION</code>? Is it an efficiency thing? That is what is implied in one of the comments to a similar <a href=""http://stackoverflow.com/questions/3514808/how-to-get-android-compass-reading/3515412#3515412"">question</a> but you still need to register a different type of listener in the <a href=""http://www.netmite.com/android/mydroid/cupcake/development/samples/Compass/src/com/example/android/compass/CompassActivity.java"">development/samples/Compass/src/com/example/android/compass/CompassActivity.java</a> example.</p><p><img src=""http://developer.android.com/images/axis_globe.png"" width=""150"" height=""150"" ><img src=""http://developer.android.com/images/axis_device.png"" width=""150"" height=""150""><img src=""http://developer.android.com/images/axis_globe_inverted.png"" width=""150"" height=""150""></p><p>I'd now like to talk about the rotation matrix. (This is where I am most unsure) So above we have the three figures from the Android documentation, we'll call them A, B and C.</p><p>A = SensorManger.getRotationMatrix(..) method figure and represents the World's coordinate system </p><p>B = <a href=""http://developer.android.com/reference/android/hardware/SensorEvent.html"">Coordinate system used by the SensorEvent API.</a></p><p>C= SensorManager.getOrientation(..) method figure</p><p>So my understanding is that A represents the ""world's coordinate system"" which I presume refers to the way  locations on the planet are given as a (latitude, longitude) couple with an optional (altitude). X is the <a href=""http://en.wikipedia.org/wiki/Easting_and_northing"">""easting""</a> co-ordinate, Y is the <a href=""http://en.wikipedia.org/wiki/Easting_and_northing"">""northing""</a> co-ordinate. Z points to the sky and represents altitude. </p><p>The phones co-ordinate system is shown in figure B is fixed. Its Y axis always points out the top. The rotation matrix is being constantly calculated by the phone and allows mapping between the two. So am I right in thinking that the rotation matrix transforms the coordinate system of B to C? So when you call <code>SensorManager.getOrientation(..)</code> method you use the <code>values[]</code> array with values that correspond to figure C.When the phone is pointed to the sky the rotation matrix is identity matrix (the matrix mathematical equivalent of 1) which means no mapping is necessary as the device is aligned with the world's coordinate system.</p><p>Ok. I think I better stop now. Like I said before I hope people will tell me where I've messed up or helped people (or confused people even further!)</p>","516286","","102937","","2011-07-27 17:08:35","2013-11-22 05:30:57","Android phone orientation overview including compass","<android><orientation><device-orientation><bearing><compass-geolocation>","4","5","34","",""
"4819672","1","4819943","","2011-01-27 17:24:33","0","686","<p>I'm creating an app which ask the first time user to input a password. However whenever I press the Submit button the application stops and I think it's because of the class I made for he SharedPreferences. I don't know what to put in the class. Need some help please. Thanks</p><pre><code>package com.android.steg;import android.app.Activity;import android.content.Intent;import android.content.SharedPreferences;import android.content.SharedPreferences.Editor;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;public class Password extends Activity implements OnClickListener{Button submitButton;EditText passwordEditText;private SharedPreferences SharedPreference;public static final String PREFS_PRIVATE = ""PREFS_PRIVATE"";public static final String KEY_PRIVATE = ""KEY_PRIVATE"";public static final String PREFS_READ = ""PREFS_READ"";public static final String KEY_READ = ""KEY_READ"";public static final String PREFS_WRITE = ""PREFS_WRITE"";public static final String KEY_WRITE = ""KEY_WRITE"";public static final String PREFS_READ_WRITE = ""PREFS_READ_WRITE"";public static final String KEY_READ_WRITE = ""KEY_READ_WRITE"";public void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.pass);    Button submitButton = (Button) findViewById(R.id.submitButton);    submitButton.setOnClickListener(this);}public void onClick(View v){     EditText passwordEditText = (EditText) findViewById(R.id.passwordEditText);    SharedPreferences prefs = this.getApplicationContext().getSharedPreferences(""prefs_file"",MODE_PRIVATE);    String password = prefs.getString(""password"","""");    if(password=="""")    {        Editor edit = prefs.edit();        edit.putString(""password"",passwordEditText.getText().toString());        edit.commit();        StartMain();    }    else    {        if(passwordEditText.getText().toString()== password)        {             StartMain();        }    }}public void StartMain(){     Intent intent = new Intent(this, MainActivity.class);     startActivity(intent);} }</code></pre><p>Whenever I press the submit button, it won't send me to the start the MainActivity class.</p>","516160","","516160","","2011-01-27 17:38:28","2011-01-28 09:56:23","SharedPreferences class","<java><android><eclipse><sharedpreferences>","1","11","","",""
"4819713","1","4819901","","2011-01-27 17:28:22","2","4636","<p>I'm writing an app that implements nested tabs. Because two sets of tabs occupy quite a bit of space and generally because the nature of the content I would like to place the whole inner TabHost into a scrollable structure. I can make tabcontent of the outer activity FrameLayout, LinearLayout, even ViewFlipper; when I try to make it ScrollView, the program crashes. </p><pre><code>&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;ScrollView            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>So apparently TabHost likes to live inside non-scrollable frames. Is there any way to go around this without creating a whole lot of a mess?</p>","573432","","","","","2011-04-15 13:10:23","Android - TabHost inside ScrollView","<android><scrollview><android-tabhost><tabwidget><android-xml>","1","0","1","",""
"4819777","1","4890029","","2011-01-27 17:33:56","5","4487","<p>Hi I'm trying to override IME action to show search on virtual keyboard. My <code>EditText</code> is in the control that is placed onto the activity.</p><p>Here is what I have:</p><pre><code>&lt;EditText android:id=""@+id/txtSearch""    android:textSize=""18dp""    android:textColor=""@color/main_text_black""    android:layout_width=""247dp""     android:layout_height=""fill_parent""    android:imeOptions=""actionSearch""    android:gravity=""center_vertical""    android:singleLine=""true""    android:background=""@null""    android:layout_alignParentLeft=""true""    android:layout_marginLeft=""38px"" /&gt;</code></pre><p>In Code I have this listener set on the <code>EditText</code>: </p><pre><code>@Overridepublic boolean onEditorAction(TextView view, int arg1, KeyEvent arg2) {    if((arg1 == EditorInfo.IME_ACTION_SEARCH) {        for(OnSearchListener listener : _listeners) {            listener.OnSearch(view, getSearchString());        }    }    InputMethodManager imm =         (InputMethodManager)_context.getSystemService(Context.INPUT_METHOD_SERVICE);    imm.hideSoftInputFromWindow(view.getWindowToken(), 0);    return false;}</code></pre><p><code>arg1</code> always comes back as <code>0</code> when I press the enter key, which is ""unidentified"". I also tried different keyboards like sendMessage and none of them work neither. What's going on?</p><p>Thank you in advance! </p>","538428","","418183","","2011-01-27 19:21:02","2014-02-18 02:23:26","android - controlling IME show search action instead of enter","<android>","2","1","1","",""
"4819813","1","4820247","","2011-01-27 17:37:38","12","13957","<p>i have an AutoCompleteTextView in my app which works. I have successfully created an onClickItemListener. The question is how to grab the text the user selected. And this is the thing: i have an ArrayList with words being passed to the Adapter to search for suggestions. As the user types a word the suggestions list gets shorter (in rows on the UI side) so when i want to get the word from the ArrayList at the index the user selected i get the wrong word because the indexes doesn't match. How can i get the text (String) the user chose without having to mess with the index? Here's my code:</p><pre><code>public class AutocompleteActivity extends BaseActivity {    private DBManager m_db;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.autocomplete);        m_db = new DBManager(this);        final ArrayList&lt;String&gt; words = m_db.selectAllWords();        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.listitem, words);        AutoCompleteTextView tv = (AutoCompleteTextView)findViewById(R.id.autocomplete);        tv.setThreshold(1);        tv.setAdapter(adapter);        tv.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {                Log.i(""SELECTED TEXT WAS-------&gt;"", words.get(arg2));            }        });    }}</code></pre>","526924","","932225","","2012-07-13 10:42:20","2012-07-13 10:42:20","how to get text from autocomplete textview android","<android><android-adapterview>","3","1","4","",""
"4819923","1","4819982","","2011-01-27 17:49:49","4","6305","<p>I want to achieve the same thing in code as it is in this xml (this imageview is inside relative layout):</p><pre><code>                          &lt;ImageView               android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_alignParentLeft=""true""            android:src=""@drawable/logo""/&gt;</code></pre><p>I know how to set layout width and height, but don't know how to set layout_alignParentLeft=""true"".</p><p>Is it possbile to do this in code?</p>","324417","","","","","2011-01-27 17:56:53","How to set android:layout_alignParentLeft attribute to imageview in code?","<android><layout>","2","0","1","",""
"4819937","1","","","2011-01-27 17:51:14","1","318","<p>As part of an app, I'm trying to add an icon to every listing in the contacts list depending on the contact's information. Getting / parsing the information is no problem - now how do I actually insert the icon into the contact listing? Is it even possible?</p>","146587","","","","","2011-01-27 17:51:14","android: adding an icon to the contacts list","<android><icons><android-contacts>","0","0","","",""
"4820021","1","4820327","","2011-01-27 17:58:46","0","106","<p>Im trying to send multiple data items over a tcp socket from an android client to a python server. The user on the client side can make multiple choices so im using a number sent as a character to differentiate between request types. I have to send the choice and specific data depending on the choice.For the current selection (choice no 1 in this case) I need the choice and 2 string fields and an image. I have the image transfer working on its own and the choice working on its own. The problem I am having now is that the buffer reading in the choice is also reading in the byte stream of the image straight after it. </p>","506892","","506892","","2011-02-01 19:21:34","2011-02-01 19:21:34","distinguishable socket input","<java><python><android><sockets>","1","0","","",""
"4820044","1","","","2011-01-27 18:02:11","1","3212","<p>There are some files in my app, but only 3 of them is important now. It's a reminder app with alarm sound and notifications.I hava a maincode.java file containing a checkbox and its listener. If user checks in the chechbox an AlarmManager sends an intent to AlarmReceiver.java, which starts MyService.java. MyService java contains code about playing sound. Code is partial.MyService.java:</p><pre><code>public void onCreate() {    Toast.makeText(this, ""My Service Created"", Toast.LENGTH_LONG).show();    Log.d(TAG, ""onCreate"");    player = MediaPlayer.create(this, R.raw.sound);    player.setLooping(false); // Set looping}@Overridepublic void onDestroy() {    Toast.makeText(this, ""My Service Stopped"", Toast.LENGTH_LONG).show();    Log.d(TAG, ""onDestroy"");    player.stop();}@Overridepublic void onStart(Intent intent, int startid) {    Toast.makeText(this, ""My Service Started"", Toast.LENGTH_LONG).show();    Log.d(TAG, ""onStart"");    player.start();}</code></pre><p>AlarmReceiver.java:</p><pre><code>public void onCreate() {    Toast.makeText(this, ""My Service Created"", Toast.LENGTH_LONG).show();    Log.d(TAG, ""onCreate"");    player = MediaPlayer.create(this, R.raw.sound);    player.setLooping(false); // Set looping</code></pre><p>Important part of maincode.java:</p><pre><code>    cb1 = (CheckBox) findViewById(R.id.CheckBox01);    cb1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){        @Override        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)         {                       if (cb1.isChecked())                 {                 if (GlobalVars.getHourOfDay() &gt;= 0)                  {                     Toast.makeText(maincode.this, ""ok"", Toast.LENGTH_SHORT).show();                     rem1.setText(GlobalVars.getReminder1name());                        Intent intent = new Intent(maincode.this, AlarmReceiver.class);                        PendingIntent pendingIntent = PendingIntent.getBroadcast(bInsulinReminder.this, 0,                          intent, PendingIntent.FLAG_UPDATE_CURRENT);                        AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);                        Calendar cal = Calendar.getInstance();                        cal.set(Calendar.HOUR_OF_DAY, GlobalVars.getHourOfDay());                        cal.set(Calendar.MINUTE, GlobalVars.getMinute());                        cal.set(Calendar.SECOND, 0);                        cal.set(Calendar.MILLISECOND, 0);                        alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis()+ 3000, 6000, pendingIntent);                 }                 Toast.makeText(maincode.this, ""Checked"", Toast.LENGTH_SHORT).show();                } else {                    rem1.setText(""No reminder set"");                    Toast.makeText(maincode.this, ""Not checked"", Toast.LENGTH_SHORT).show();                }        }        });</code></pre><p>(rem1 is the reminder button whose text depends on the name of anything the user wants)</p><p>Problem with the code is that if i start the alarm, i cannot stop it. I know there is the player.stop() command in MyService.java, but how can i call it from the end of maincode.java where the checkbox is unchecked?</p>","571648","","","","","2011-01-27 19:29:57","Android AlarmManager and Service question","<android><service><alarm>","1","0","","",""
"4820073","1","4820185","","2011-01-27 18:04:31","1","7326","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2271008/adb-cannot-find-my-device-for-android-debugging-why"">adb cannot find my device for Android debugging. Why?</a>  </p></blockquote><p>I'm trying to download my hello world Android app. to my Motorola backflip, it's connected to a USB port on the PC and I've previously downloaded the USB drivers for the phone.  adb devices does not seem to list the phone either.  What can I do to get this working?  I am running Windows 7.</p><p>TY,Fred</p>","258526","","258526","","2011-01-27 18:10:07","2012-05-15 01:58:56","Android adb install returns error:device not found - Windows 7","<android>","3","1","","2012-05-15 02:52:02",""
"4820125","1","4820389","","2011-01-27 18:09:59","0","437","<p>Ok, the other day I had trouble with the FileWriter notding the newline, but I got some help with that and solved it. Now, just like before, I cpoied some old code of mine (works perfectly in the old prgram) to read the file that's written. I use ""|"" as a delimiter (pieces.useDelimiter(""|"");). When I call pieces.next() it only teakes the next character, not the next string up to the delimiter. What am I missing?Code snippet:</p><pre><code>try{    mFile = new Scanner(newFile(loadPath));    while(mFile.hasNextLine()){        String input = mFile.nextLine();        Scanner pieces = new Scanner(input);        pieces.useDelimiter(""|"");        while(pieces.hasNext()){            int row = Integer.valueOf(pieces.next());            int col = Integer.valueOf(pieces.next());            String pullPath = pieces.next();            ......</code></pre><p>}}</p>","589101","","21234","","2011-05-15 13:17:58","2011-05-15 13:17:58","Android Scanner Delimiter Issues","<android><string><text><java-util-scanner><delimiter>","1","1","","",""
"4820256","1","4820273","","2011-01-27 18:24:10","0","349","<p>In my android application I have a listview with a bunch of items with checkboxes. If the checkboxes are checked, a value is calculated. However, after the application is terminated, the listview resets itself, with all checkboxes being unticked again. How would I have it so when the application is completely terminated, the checkboxes checked/unchecked states are saved? I've looked up various methods but all seem rather complicated for a beginner :(</p>","568942","","","","","2011-01-27 19:27:02","Saving after termination","<android><listview><state><saving>","3","0","","",""
"4820285","1","4820411","","2011-01-27 18:27:04","2","5231","<p>I am playing around with <a href=""http://code.google.com/p/smali/"" rel=""nofollow"">smali and baksmali</a> on a small Hello World Android application I have written. My source code is:</p><pre><code>package com.hello;import android.app.Activity;import android.os.Bundle;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);    }}</code></pre><p>which was then disassembled to:</p><pre><code>.class public Lcom/hello/Main;.super Landroid/app/Activity;.source ""Main.java""# direct methods.method public constructor &lt;init&gt;()V    .locals 0    .prologue    .line 6    invoke-direct {p0}, Landroid/app/Activity;-&gt;&lt;init&gt;()V    return-void.end method# virtual methods.method public onCreate(Landroid/os/Bundle;)V    .locals 1    .parameter ""savedInstanceState""    .prologue    .line 10    invoke-super {p0, p1}, Landroid/app/Activity;-&gt;onCreate(Landroid/os/Bundle;)V    .line 11    const/high16 v0, 0x7f03    invoke-virtual {p0, v0}, Lcom/hello/Main;-&gt;setContentView(I)V    .line 12    return-void.end method</code></pre><p>I understand that this is some kind of Intermediate Representation but am not sure what it is. As I understand there must be some specification on how to understand this representation but am unable to figure out how to search for it. So given an apk file, can someone explain in layman terms on how the <a href=""http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html"" rel=""nofollow"">Dalvik opcode specification</a> is used to arrive at this representation? My current understanding is this:</p><ul><li>Given an APK, I could extract theAndroidManifest.xml in a Binary XMLformat and use a tool such as<a href=""http://code.google.com/p/android-random/source/browse/trunk/axml2xml/axml2xml.pl"" rel=""nofollow"">axml2xml.pl</a> to get a ""textual""version of the manifest that is notcomplete OR I could use the<a href=""http://code.google.com/p/android-apktool/"" rel=""nofollow"">apktool</a> to get a more readableform. But I am still not sure whatspecification they are using toconvert the binary XML into text. </li><li>Thedisassemblers are <strong>somehow</strong> utilizingthe Dalvil opcode specification toread the dex files and convert itinto the above representation.</li></ul><p>Any information (perhaps with some simple examples) on the above two steps would help me in a great way in getting the concepts right. </p><p><strong>Update 1 (posted after the reply from Chris):</strong></p><p>So essentially, I would do the following to arrive at the Dalvik bytecode:</p><ul><li>Take an apk and extract it to get the classes.dex files.</li><li><p>Then the disassembler reads the classes.dex file and determines all the classes present in the apk. Can you provide me some information on how this is done? Does it parse the file in hex mode and lookup the Dalvik specification and then resolve appropriately? Or is something else happening? For instance, when I used hexdump on classes.dex, it gave me something like this:</p><p>64 65 78 0a 30 33 ...</p></li></ul><p>Are these now used for Opcode lookups? </p><ul><li>Assuming that the tool was able to separate the incoming bytecode into separate classes, it then continues to scan the hex codes from the classes.dex file and uses the Davlik specification to output the appropriate Opcode name from the table?</li></ul><p>Actually, in short, I am interested in knowing how all this ""magic"" is done. So for instance, if I were to learn to write this tool, what is the high-level roadmap I should follow? </p>","184046","","184046","","2011-01-27 19:01:38","2012-08-21 12:12:27","Understanding disassembly of Dalvik code?","<java><android><reverse-engineering><disassembling><dalvik>","2","0","2","",""
"4820294","1","4856368","","2011-01-27 18:28:19","1","1066","<p>I'm currently developing an Android application that plays a sound to the user at various intervals. I have working code (included below) which functions exactly as expected on my Hero (running 2.2) and on the 1.6 emulator. However, it doesn't work on my friends Xperia x8 -- no sound is played. He has a notification tone set, which plays fine when he receives a text and so on.</p><pre><code>private void prepareAudio(){    alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);     mp = new MediaPlayer();    if(alert != null){        try {            mp.setDataSource(ctx, alert);        } catch (IllegalArgumentException e) {            Log.i(""Prepare Audio"", e.getMessage());        } catch (SecurityException e) {            Log.i(""Prepare Audio"", e.getMessage());        } catch (IllegalStateException e) {            Log.i(""Prepare Audio"", e.getMessage());        } catch (IOException e) {            Log.i(""Prepare Audio"", e.getMessage());        }    }    am = (AudioManager)ctx.getSystemService(Context.AUDIO_SERVICE);}private void notifyUser(){    if(alert != null){        if (am.getStreamVolume(AudioManager.STREAM_ALARM) != 0) {            mp.setAudioStreamType(AudioManager.STREAM_ALARM);            mp.setLooping(false);            try {                mp.prepare();            } catch (IllegalStateException e) {                Log.i(""Notify User"", e.getMessage());            } catch (IOException e) {                Log.i(""Notify User"", e.getMessage());            }            mp.start();        } else {            Log.i(""Notify User"", ""Alarm volume zero"");        }    } else {        Log.i(""Notify User"", ""Uri is null"");    }    long[] pattern = {0,200,300,600};     v.vibrate(pattern, -1);}</code></pre><p>PrepareAudio is called on initialising the class, and notifyUser every time we want to play the sound. The phone always vibrates when it should, so notifyUser is definitely being called.</p><p>The version my friend has installed uses e.printStackTrace rather than Log.i, so there's nothing being spat out in logcat. I'm going to try and get hold of his phone to update it to a version with Log.i, but in the meantime is there anything obviously wrong with the code that could cause such an intermittent problem?</p><p>Thanks,</p>","586734","","491044","","2011-03-11 12:56:04","2011-03-11 12:56:04","Android MediaPlayer not playing sound on some platforms","<android><audio><media-player><audiomanager>","2","0","","",""
"4820304","1","4820331","","2011-01-27 18:28:55","0","463","<p>I would like to develop an Android app to access our web site. How can I do this?</p>","519750","","503900","","2011-01-27 19:49:53","2011-01-27 19:49:53","Need some basic info to develop mobile website in Android","<android><web-applications>","3","0","","",""
"4820353","1","5096054","","2011-01-27 18:35:09","13","7683","<p>I would like to know the amount of heap space used by my android application in two ways:  - programmatically - through DDMS.</p><p>I have referred to <a href=""http://stackoverflow.com/questions/2630158/detect-application-heap-size-in-android"">this</a> post, prior to posting here. In that post, it is mentioned that, <code>Debug.getNativeHeapSize()</code> returns the heapsize. Is this the exact method I should use, in order to programmatically detect the heap size? If so, where should I log it in order to get the correct heapsize usage of my application?</p>","264953","","110028","","2011-01-27 18:42:50","2013-01-31 00:41:45","How do I detect the heap size usage of an android application","<java><android><android-emulator><android-widget>","2","1","8","",""
"4820383","1","5377864","","2011-01-27 18:37:32","0","865","<p>I'm trying to show an alert dialog with my application from a non-activity.</p><p>So the hard thing here is that I want to do it not in an activity but in my general application class.</p><pre><code>public class AppName extends com.github.droidfu.DroidFuApplication {    public static long TIME_CONTENT_UPDATE = 60;  //half hour    Handler mHandler = new Handler();    @Override    public void onCreate() {        super.onCreate();           intent = new Intent(this, VSSyncController.class);        setupTimer();    }    private void setupCatalogTimer() {        final Context con = this;        //A handler runs on a separate thread        mHandler = new Handler(new Handler.Callback() {             public boolean handleMessage(Message msg) {                 showMyAlertDialog(con)                 mHandler.sendEmptyMessageDelayed(0, TIME_CONTENT_UPDATE);                 return true;            }        });     }}  </code></pre><p>Basically I want to show an alert dialog from there, but I need to have a way to figure out which and IF there is any activity in the foreground, so I can call it from there.</p><p>How can I possible do it?</p><p>Thanks!</p>","508479","","508479","","2011-01-27 18:42:59","2011-03-21 12:56:43","Show an Alert Builder from a non-activity","<android><alertdialog>","2","2","","",""
"4820392","1","","","2011-01-27 18:38:13","3","813","<p>With the following lines we can set the orientation with in the application..</p><p>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);</p><p>If I want to set the orientation to every screen(not only with in application). how can i do this?Any help..</p><p>Thanks in advance</p>","399046","","","","","2011-01-27 19:52:47","Orientation in android","<android>","1","5","2","",""
"4820547","1","4821076","","2011-01-27 18:54:56","2","2317","<p>I'm trying to find the buildinfo.sh and I didn't find it.Does anyone know where is it and how can I access it. </p>","586720","","244296","","2011-01-27 18:59:16","2013-09-13 18:18:44","Where can I find the buildinfo.sh file?","<android><linux>","2","2","","",""
"4820554","1","","","2011-01-27 18:55:22","57","42434","<p>I recently published an app to the market and I'm now getting an error by some user, the app presumably crashes right when it starts. Unfortunately I can't contact him directly and the app works fine in the emulator as well as on my phone (and some friends' phones).<br />EDIT: I guess that this happens to more than one user as I received comments in the market like ""crashes on start"" or ""doesn't work"". I only received this one stacktrace but there's no info about the configuration, device, Android version, etc.</p><p>The app is a simple soundboard, so there's really no magic involved, but I can't get why it fails on some phones. Here's the stack trace I'm getting, I hope anybody can help me out:</p><pre><code>java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.my.app/com.my.app.SoundMachine}: java.lang.ClassNotFoundException: com.my.app.SoundMachine in loader dalvik.system.PathClassLoader[/mnt/asec/com.my.app-1/pkg.apk]at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)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:876)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)at dalvik.system.NativeStart.main(Native Method)Caused by: java.lang.ClassNotFoundException: com.my.app.SoundMachine in loader dalvik.system.PathClassLoader[/mnt/asec/com.my.app-1/pkg.apk]at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)at java.lang.ClassLoader.loadClass(ClassLoader.java:573)at java.lang.ClassLoader.loadClass(ClassLoader.java:532)at android.app.Instrumentation.newActivity(Instrumentation.java:1021)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)... 11 more</code></pre><p>These are the first couple of lines from my activity:</p><pre><code>public class SoundMachine extends Activity {  private SoundManager mSoundManager;  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);</code></pre><p>EDIT: This is the (almost) complete onCreate:</p><pre><code>  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mSoundManager = new SoundManager();    mSoundManager.initSounds(getBaseContext());    int counter = 0;    for (Integer soundFile : soundFiles) {      counter++;      mSoundManager.addSound(counter, soundFile);    }    ImageButton SoundButton1 = (ImageButton) findViewById(R.id.sound1);    SoundButton1.setOnClickListener(new OnClickListener() {      public void onClick(View v) {        mSoundManager.playSound(1);      }    });    SoundButton1.setOnLongClickListener(new OnLongClickListener() {      public boolean onLongClick(View v) {        saveSoundChoice(soundFiles[0], soundNames[0]);        return true;      }    });(...more of this...)    Button StopButton = (Button) findViewById(R.id.stopbutton);    StopButton.setOnClickListener(new OnClickListener() {      public void onClick(View v) {        mSoundManager.stopAll();      }    });  }</code></pre><p>And here's my 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.my.app"" android:installLocation=""preferExternal""    android:versionCode=""9"" android:versionName=""1.2""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".SoundMachine"" android:label=""@string/app_name""            android:screenOrientation=""portrait""&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.WRITE_EXTERNAL_STORAGE"" /&gt;    &lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""8"" /&gt;&lt;/manifest&gt;</code></pre><p>So all possible errors I already read about here and in some forums don't apply to my app.</p><ul><li>The activity is present in the manifest.</li><li>The super-method is called in the overriden method.</li><li>The ContentView is set before accessing elements in the view.</li></ul><p>I know it's hard to pinpoint the source of an error without being able to reproduce it, but maybe somebody has a bright idea and can help me out.</p><p>Some questions:</p><ul><li><strike>Do I need the ""intent""-part in the manifest? Eclipse created it when I created the project.</strike> (Yes, according to Mayra)</li><li><strike>Should the super-method be called where it is?</strike> (Yes, according to Mayra)</li></ul><p>EDIT: The main question that remains now is: How come the path in PathClassLoader is different from my package-name? The page John J Smith posted seems to deal with the same problem, but I don't understand the fix that was applied there.</p><p>Thanks, Select0r</p>","255905","","255905","","2011-02-01 20:16:07","2013-12-13 21:01:07","Android: Unable to instantiate activity / ClassNotFoundException","<android><exception>","28","8","16","",""
"4820556","1","5436960","","2011-01-27 18:55:47","4","5532","<p>My app has a hierarchy of Activities, A -launches- B -launches- C</p><p>In the third Activity 'C' I have a button.</p><p>In the onClickListener of this button I launch an Intent as follows:</p><pre><code>Intent intent = new Intent(Intent.ACTION_DIAL);intent.setData(Uri.parse(uri));startActivity(intent);//I don't call finish()</code></pre><p>It brings up the phone dialling dialog fine. If I hit the back button at this point I get the ""Sorry!"" popup saying my app stopped unexpectedly. On hitting the ""Force Close"" button my app reverts to the Activity 'B' rather then the expected 'C' (Assuming no crash).</p><p>Activity 'B' does use the SQL query shown in the exception however I don't know why it is causing the exception when I hit 'Back' as it has nothing to do with Activity 'C'. My database has been closed and I don't get an Leak warnings. </p><p>In Activity 'B' the database is opened immediately prior to executing the query and closed afterward. Struggling with this all day so would appreciate any comments.</p><pre><code> Uncaught handler: thread main exiting due to uncaught exception java.lang.IllegalStateException: mQuery SELECT islocal, packageid, Name, mapradius FROM categories WHERE islocal=? 1      at android.database.sqlite.SQLiteQuery.requery(SQLiteQuery.java:162)     at android.database.sqlite.SQLiteCursor.requery(SQLiteCursor.java:536)     at android.app.Activity.performRestart(Activity.java:3740)     at android.app.ActivityThread.handleWindowVisibility(ActivityThread.java:3312)     at android.app.ActivityThread.access$2600(ActivityThread.java:123)     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1890)     at android.os.Handler.dispatchMessage(Handler.java:99)     at android.os.Looper.loop(Looper.java:123)     at android.app.ActivityThread.main(ActivityThread.java:4370)     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: android.database.sqlite.SQLiteMisuseException: library routine called out of sequence: handle 0x0     at android.database.sqlite.SQLiteProgram.native_bind_string(Native Method)     at android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:178)     at android.database.sqlite.SQLiteQuery.requery(SQLiteQuery.java:153)     ... 13 moreERROR/SemcCheckin(17282): Get crash dump level : java.io.FileNotFoundException: /data/semc-checkin/crashdump</code></pre>","369479","","135152","","2011-05-25 02:59:55","2011-05-25 02:59:55","SQLite Exception on Resuming Android Activity","<android><sqlite><activity><android-intent>","2","0","","",""
"4820624","1","4821522","","2011-01-27 19:02:52","0","554","<p>i have a list with rss feed.if i write this:</p><pre><code>List&lt;String&gt; titles = new ArrayList&lt;String&gt;(messages.size());        for (Message msg : messages){            titles.add(msg.getDate());            titles.add(msg.getTitle());</code></pre><p>i get the title and the date in saperate strings.I tried to change it to</p><pre><code>titles.add(msg.getDate()+msg.getTitle());</code></pre><p>but this returns date and titles with no space.</p><p>i would like to have date and below it the title.Something like:</p><pre><code>Thu 27 Jan 2011Bla bla bla..</code></pre><p>How could i do it?also,may i have another text color or size in the date and other in the title?</p><p>thanks!!</p>","519526","","","","","2011-01-31 16:11:08","ListView customization","<android><listview>","2","1","","",""
"4820695","1","4821454","","2011-01-27 19:12:30","0","457","<p>Suppose I wanted to target a specific few Android devices (e.g. tablet), is there any means for an app to know which device its installed in? I mean I would like the app to know what kinds of features the device has, for example, front facing camera, screen resolution, etc. It would be best to be able to know the exact device the app is working in as it would help make the app actually usuable ;).</p><p>If that sounds ridiculous, as an Android developer can you specify when you publish your app which device(s) you want the app available in? </p><p>I guess ultimately I could write in capitals EXCLUSIVE TO or AVAILABLE IN ""insert device name"" in the app description.</p><p>Thanks in advance.</p>","482994","","","","","2011-01-27 20:26:24","Is there any way for an android app to know which device its installed on?","<android><tablet>","2","0","","",""
"4820715","1","4826202","","2011-01-27 19:14:33","2","475","<p>How can i make the Augmented Reality applcation on Android mobile phone (HTC Nexus One) that i have developed using the flash platform faster, since flash doesnt support OpenGL for 3D graphics.</p><p>Can I make it faster using GPU Acceleration? </p><p>Or there is any way to combine Flash and OpenGL?</p><p>Any online sources talking about this subject will be very useful..</p><p>Please help me to understand if this is possible to be done.</p>","495296","","495296","","2011-01-28 00:28:13","2011-01-28 08:21:32","Adobe Flash 10 GPU and Adobe AIR for Android","<android><flash><opengl><air><flash-cs5>","1","2","","",""
"4820784","1","4820823","","2011-01-27 19:20:08","0","265","<p>i'm a little blocked with this thing. I want to fill one edittext's password when the user type its login. I have the login and password on one database sqlite. I have read on android developers that it can be done with a AutocompleTextView, but i only want to fill the edittext with its password, nothing else. It Anyone knows how can i do this?¿ </p><p>Cheers</p>","276421","","","","","2012-03-29 09:48:55","autofill password on edittext","<android><programming-languages>","1","0","","",""
"4820816","1","4820905","","2011-01-27 19:22:45","29","51990","<p>I have been trying to get the URI path for an asset file. </p><pre><code>uri = Uri.fromFile(new File(""//assets/mydemo.txt""));</code></pre><p>When I check if the file exists I see that file doesn't exist</p><pre><code>File f = new File(filepath);   if (f.exists() == true) {    Log.e(TAG, ""Valid :"" + filepath);   } else {    Log.e(TAG, ""InValid :"" + filepath);   }</code></pre><p>Can some one tell me how I can mention the absolute path for a file existing in the asset folder</p>","592773","","300863","","2011-01-27 19:27:19","2014-02-21 01:42:18","How to get URI from an asset File?","<android><uri><filepath><asset>","5","0","7","",""
"4820836","1","4821002","","2011-01-27 19:24:14","0","1373","<p>I am experimenting with the android FaceDetector.I need to use a bitmap file (faces.bmp is from a group photo) since I have not found a way to use the android camera in the android emulator.But BitmapFactory.decodeFile returns null and the documentation only says it returns null if the bitmap could not be decoded. It is just a 24 bit .bmp file. I am using Eclipse on Windows 7. Did I specify pathName incorrectly? Do I need to use something other than a 24 bit .bmp file?</p><pre><code>public class MyFaces extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final int width = 600;        final int height = 600;        final int maxFaces = 8;        FaceDetector faceDetector = new FaceDetector(width, height, maxFaces);        String pathName = ""../res/drawable-hdpi/faces.bmp"";        try {         Bitmap bitmap = BitmapFactory.decodeFile(pathName);         Face faces[] = new Face[maxFaces];            int nFaces = faceDetector.findFaces(bitmap, faces);            Log.d(this.getClass().toString(), ""Faces: "" + nFaces);  } catch (Exception e) {   Log.e(this.getClass().toString(), e.getMessage(), e);  }    }}</code></pre>","398460","","","","","2011-01-27 19:40:04","Why does BitmapFactory.decodeFile return null?","<java><android><bitmapfactory>","1","0","","",""
"4820881","1","4820965","","2011-01-27 19:28:44","0","351","<p>i'm following the suggestion in this post: <a href=""http://stackoverflow.com/questions/3791164/drawing-a-gameboard-like-checkers-in-android"">Drawing a gameboard like checkers in Android</a></p><p>basically, the suggestion in the other thread is that the snake demo in the android SDK has a custom view that display a grid of images suitable for a tile based game, such as snake or checkers, and to base the done on that.</p><p>if i just wanted to use this code, how would i do so? i'm using the eclipse IDE with the android toolkit installed.</p>","94475","","","","","2011-01-27 19:36:38","include class from another android project","<android>","1","0","","",""
"4821001","1","","","2011-01-27 19:39:53","1","496","<p>In Android, my understanding is that an application declares a list of permissions that it needs in the manifest file and during runtime, it makes a request to perhaps the Reference monitor which then decides whether this application has that permission. </p><p>Is it possible (without having root or having to modify Android's source code) to write a third-party application that can just intercept these requests (the requests that an application queries the Reference monitor with to check if it has the permission or not)? If yes, can someone give me some pointers on how to go about doing this?</p>","184046","","","","","2011-01-29 01:18:10","Intercepting method calls to the Reference monitor?","<java><android><security><permissions><intercept>","1","2","","",""
"4821029","1","","","2011-01-27 19:42:38","0","146","<p>I'm writing an app for android and I have a class setup that extends View. Inside that class I'm overwriting onDraw. </p><p>I have another class where I'm doing a lot of the processing. I was wondering if there was a way I can use the onDraw method inside the 2nd class too? The 2nd class isn't extending anything.</p>","592797","","","","","2011-01-27 20:16:32","Share canvas across classes?","<android><graphics><canvas><ondraw>","1","0","","",""
"4821043","1","5346074","","2011-01-27 19:44:15","11","5350","<p>""includeAntRuntime"" was not set to false in the android ant script, and it gives me the annoying warning every time I build my app. </p><pre><code>[javac] /Users/dwang/Library/android/android-sdk-mac_x86/tools/ant/main_rules.xml:361: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds</code></pre><p>Look at the line 354 of file android-sdk-*/tools/ant/main_rules.xml</p><pre><code>            &lt;javac encoding=""${java.encoding}""                    source=""${java.source}"" target=""${java.target}""                    debug=""true"" extdirs=""""                    destdir=""${out.classes.absolute.dir}""                    bootclasspathref=""android.target.classpath""                    verbose=""${verbose}""                    classpath=""${extensible.classpath}""                    classpathref=""jar.libs.ref""&gt;                &lt;src path=""${source.absolute.dir}"" /&gt;                &lt;src path=""${gen.absolute.dir}"" /&gt;                &lt;src refid=""project.libraries.src"" /&gt;                &lt;classpath&gt;                    &lt;fileset dir=""${extensible.libs.classpath}"" includes=""*.jar"" /&gt;                &lt;/classpath&gt;            &lt;/javac&gt;</code></pre><p>And it seems I can not easily fix it without modifying that file directly? Android team, please fix it maybe?</p>","428024","","","","","2012-01-13 03:30:53","""includeAntRuntime"" was not set for android ant script?","<android><ant><sdk>","2","2","3","",""
"4821054","1","4828177","","2011-01-27 19:45:01","0","369","<p>I'm trying to create an Android application that uses <a href=""http://crest.codegist.org/index.html"" rel=""nofollow"">CRest</a> to interface with a RESTful web service.</p><p>The issue I am having is with the creation of a Service.  In the twitter examples the EndPoint is set to a static url (api.twitter.com) but in my case I need it to be configurable since we won't know the endpoint until the user specifies it.</p><p>What I would like to do is something along the lines of this:</p><pre><code>@EndPoint(""http://%s.somedomain.com"")@ContextPath(""/admin"")public interface ProductService {    @Path(""/products.json"")    InputStream getProducts();    @Path(""/products/{0}.json"")    InputStream getProduct(int id);}</code></pre><p>Is there a way I can specify on the creation of the service where the EndPoint </p>","480475","","","","","2014-01-26 22:58:48","Configurable Endpoints using CRest","<java><android><rest>","2","0","","",""
"4821082","1","","","2011-01-27 19:48:02","0","2078","<p>I've got an activity which should have two rather different layouts depending on whether the user holds it in landscape or portrait mode.</p><p>In onRetainNonConfigurationInstance(), I store a lot of information and extract this in onCreate() if it exists, to restore the user data.</p><p>I've got a method to determine if the phone is currently in portrait or landscape mode - if getWindowManager().getDefaultDisplay().getWidth() is larger than getWindowManager().getDefaultDisplay().getHeight(), then it's in landscape.</p><p>In my portrait layout xml file, I have a few image views which are not present in the landscape layout xml file. In onCreate(), I check if we're in portrait, then initialise and modify these if so. If we're in landscape mode, I don't.</p><p>This all works fine for switching from portrait to landscape, but then when switching back into portrait, my code that is executed only for portrait mode gives a null pointer exception - it can't find the view elements.</p><p>Stack trace:</p><pre><code>E/AndroidRuntime( 4800): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.apps.hyperview/com.apps.hyperview.PopUp}: java.lang.NullPointerExceptionE/AndroidRuntime( 4800):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)E/AndroidRuntime( 4800):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)E/AndroidRuntime( 4800):        at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3278)E/AndroidRuntime( 4800):        at android.app.ActivityThread.access$1900(ActivityThread.java:112)E/AndroidRuntime( 4800):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)E/AndroidRuntime( 4800):        at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime( 4800):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 4800):        at android.app.ActivityThread.main(ActivityThread.java:3948)E/AndroidRuntime( 4800):        at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 4800):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 4800):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)E/AndroidRuntime( 4800):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)E/AndroidRuntime( 4800):        at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime( 4800): Caused by: java.lang.NullPointerExceptionE/AndroidRuntime( 4800):        at com.apps.hyperview.PopUp.onCreate(PopUp.java:147)E/AndroidRuntime( 4800):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)E/AndroidRuntime( 4800):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)</code></pre><p>Does anyone have any ideas what I'm doing wrong?</p><p>Thanks!!r3mo</p><p><strong>EDIT:</strong></p><p>Popup.java section causing problems:</p><pre><code>// Check orientation. If we're in portrait...if( isInPortrait() ){        spacer_above = (ImageView) findViewById(R.id.image_display_popup_spacer_above);        spacer_above.setVisibility(View.INVISIBLE);    // THIS IS CAUSING THE NULLPOINTER        spacer_below = (ImageView) findViewById(R.id.image_display_popup_spacer_below);        spacer_below.setVisibility(View.INVISIBLE);}else;</code></pre><p>The portrait version of the layout file contains these 'spacers', but the landscape version does not. Is this how orientation changes and different layouts should be handled when using onRetainNonConfigurationInstance()? The code all works fine going from portrait to landscape, but when going back to portrait, I get the NullPointerException.</p><p>EDIT 2:</p><p>isInPortrait() seems to be working fine - I will change this however. The reason I'm not just making the views invisible is that the structure of the layout is significantly different in landscape. Obviously, this landscape layout is working fine - the error occurs when going from portrait to landscape and then back to portrait.</p><p>All help is appreciated!</p><p>EDIT 3:</p><p>I've now changed how I'm doing this to have the same layout file in layout-port/ and layout-land/, and making the view elements that I don't want in landscape View.GONE. It would certainly still be good to get input on this problem - it seems like a very powerful feature of android to be able to have <em>completely</em> different layouts for landscape and portrait.</p><p>Thanks!</p>","421636","","421636","","2011-01-28 10:11:59","2011-01-28 10:11:59","Android: onRetainNonConfigurationInstance() and orientation changes with different layouts","<android><android-layout><screen-orientation>","1","4","","",""
"4821168","1","4821808","","2011-01-27 19:57:18","0","850","<p>What I have is a photo uploading activity with the photo as the main background and an edittext and a set of buttons on the bottom. When I click on the edittext, I want the soft keyboard to push the edittext and buttons up (so they are still viewable) and keep the background image the same. However, right now it only pushes it up enough to see the first line of the edittext and all my buttons are hidden.</p><p>I basically want to somehow attach a view to the softkeyboard and leave the rest of the activity alone. I've tried setting the windowSoftInputMode flag in the manifest but none of the options produce the effect I want (I don't want the layout resized and pan appears to have no affect). How do I achieve something like this?</p>","291827","","","","","2011-01-27 20:59:50","In Android, how do I attach a view to the soft keyboard?","<java><android><android-manifest><android-softkeyboard>","1","0","","",""
"4821194","1","","","2011-01-27 20:00:04","0","734","<p>I'm writing a small 3d app and, simply put, the emulator doesn't show what it should while my phone (HTC Desire) does, here are two screenshots (taken via the debug monitor) to show the difference:</p><p>Left is on emulator, right is on actual phone:<a href=""http://www.virtualalbum.eu/fu/39/aris139110127203644.jpg"" rel=""nofollow"">http://www.virtualalbum.eu/fu/39/aris139110127203644.jpg</a></p><p>First of all the emulator seems to have some kind of z-fighting issue (at least that's what it looks like), so that only sometime I'm barely able to see the top of the walls.The whole maze size is 10 per side, the far plane is at 50, so I would exclude precision issues, the floor is the first thing to be drawn and I'm using <code>gl.glDepthFunc(GL10.GL_LEQUAL);</code> (before I had <code>GL_LESS</code> but it gave me issues on the phone too at wall/floor intersection, you can search my previous question about that issue). If I skip drawing the floor then I can see the walls fine (even though the textures looks worst than on the phone).</p><p>The second issue I'm having is with lighting, I'm using four positional lights which don't appear on the emulator, I create them with <code>gl.glLightfv(lightId, GL10.GL_POSITION, lightPosition, 0);</code> where lightPosition is a float[4] with the 4th value set to 1.0f.On the phone I used to have <code>gl.glLightModelfv(GL10.GL_LIGHT_MODEL_AMBIENT, new float[]{0, 0, 0, 0}, 0);</code> but that would just render a black screen on the emulator (while working fine on the phone), I had to increase the ambient light just to take the screenshot you saw above.</p><p>Thanks for your answers.</p>","586545","","586545","","2011-01-27 20:05:18","2011-01-27 20:05:18","Android emulator opengl-es inconsistencies","<android><opengl-es>","0","3","","",""
"4821210","1","4821300","","2011-01-27 20:01:43","1","877","<p>Hi<br>I need to create a gallery type application. Where i need display many image and give the zooming and sliding effects.<br>Now I am using <code>android.widget.Gallery</code> and setting the image to <code>imageview</code> in the <code>getview</code> of my gallery <code>Adapter</code> class (<code>extends BaseAdapter</code>). Me set image using bitmap, which is set by the following code  </p><pre><code>Bitmap  mBitmap = BitmapFactory.decodeFile(imagePathArray.get(position));imageview.setImageBitmap(mBitmap);</code></pre><p>It works fine at first, but after moving to third or fourth image the application crash with the following error </p><pre><code>  ERROR/AndroidRuntime(12184):  FATAL EXCEPTION: main  ERROR/AndroidRuntime(12184):  java.lang.OutOfMemoryError: bitmap size exceeds VM budget </code></pre><p>at the decodeFile statement.  </p><p>When i searched for <code>bitmap size exceeds VM budget</code>, i got a lot of solutions like <a href=""http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue"">android-strange-out-of-memory-issue</a>. But all solutions are reducing the image quality.<br><strong>What is the best method to display image in good quality and with less memory, that will not cause <code>bitmap size exceeds VM budget</code>?</strong><br>Any suggestion?<br>Thank you </p>","477754","","","","","2011-01-27 20:11:07","Display image with quality - bitmap size exceeds VM budget Error","<android><image><bitmap><out-of-memory>","1","0","","",""
"4821272","1","","","2011-01-27 20:07:37","0","2167","<p>I'm trying to add an image / icon to certain entries of a ListPreference alongside the text. </p><p><strong>I would like achieve this programmatically</strong>.</p><p>Here's an excerpt of the preferences.xml</p><p>  </p><pre><code>&lt;ListPreference  android:key=""prefGameMode""  android:title=""@string/pref_game_mode""  android:summary=""@string/pref_game_mode_desc""  android:defaultValue=""fourChallenge""  android:entries=""@array/arrGameMode""  android:entryValues=""@array/arrGameModeValues""   android:negativeButtonText=""@string/cancel"" /&gt;...</code></pre><p>The goal here is to illustrate that some of the options listed are unavailable/ locked in the current version of the app.  However, the code-base is used as a library, so I would like the solution to work via code, rather than xml.</p><p>Any ideas how to do this? Thanks.</p>","478044","","","","","2011-01-27 21:09:00","ListPreference - Custom items possible?","<android><listpreference>","2","0","","",""
"4821296","1","4821349","","2011-01-27 20:10:30","4","5810","<p>Hi i would like to set some transparency to my listview ,  i've alredy see some examples of that , but all of than were a 100% transparent .</p><p>as this topic :How to make the ListView transparent in android?</p><p>As Jacky mentioned, setting attributes for list view will do the job.</p><pre><code>android:background=""#00000000""android:cacheColorHint=""#00000000""</code></pre><p>But in my case i just want to make it half transparent , some sort of alpha 50  and stuff.My goal here is that the user could see the background of the UI through listview but also see the background of my listView with a bit of transparecy.</p><p>How can i achieve that ?</p><p>Thanks.</p>","569873","","142162","","2011-01-27 20:13:06","2012-09-26 12:29:02","Setting alpha transparency at a listView android","<java><android><listview><alpha-transparency>","3","1","1","",""
"4821324","1","","","2011-01-27 20:13:18","1","589","<p>Not a bits, bytes, algorithm and syntax question... but a technology development and business one.  Hope that's ok.</p><p>At CES 2011, mips.com unveiled new MIPS-processor based smart phones running Android.  By what I've read, it sounds like these either might be Chinese-market only (which, lets face it... is huge) or part of a big push by MIPS to elbow into ARM's territory.</p><p>Here are problems I see:<br>- Google only provide first-class support for ARM.  Their SDKs are ARM-only.  Does anyone know if they have plans to adopt MIPS?<br>- The Android Market is ARM-only, as far as I can tell.  It looks like companies like Velocity Micro (and their little MIPS-based Cruz tablet) have their own ""Cruz Market"".  I think that's awful.  Is the Android Market going to be the one-stop shop for Android, or are things fragmenting even more?<br>- The JNI breaks the processor-independence of the VM.  Can multiple processor-specific JNI libraries be packaged into a single app?  MIPS binaries aren't exactly small.</p><p>Does anyone out there have a crystal ball on these things?  Let the assumption be: MIPS won't just go away.</p><p>TL;DR: Anyone know WTF is going on with MIPS?</p>","592828","","","","","2011-01-27 20:32:14","MIPS, the Android Market, 3.0 SDK and JNI","<android>","1","1","1","",""
"4821488","1","4822358","","2011-01-27 20:29:37","26","25482","<p>I'm writing a card game and need my cards to be different sizes in different circumstances. I am storing my images as bitmaps so that they can be quickly drawn and redrawn (for animation).</p><p>My problem is that no matter how I try and scale my images (whether through a matrix.postScale, a matrix.preScale, or a createScaledBitmap function) they always come out pixelated and blurry. I know that its the scaling thats causing the problem because the images look perfect when drawn without resizing. </p><p>I have worked through every solution described in these two threads:<br><a href=""http://stackoverflow.com/questions/2041207/android-quality-of-the-images-resized-in-runtime"">android quality of the images resized in runtime</a><br><a href=""http://stackoverflow.com/questions/4231817/quality-problems-when-resizing-an-image-at-runtime"">quality problems when resizing an image at runtime</a></p><p>but still haven't gotten anywhere. </p><p>I store my bitmaps (into a hashmap) with this code:</p><pre><code>cardImages = new HashMap&lt;Byte, Bitmap&gt;();cardImages.put(GameUtil.hearts_ace, BitmapFactory.decodeResource(r, R.drawable.hearts_ace));</code></pre><p>and draw them with this method (in a Card class):</p><pre><code>public void drawCard(Canvas c){    //retrieve the cards image (if it doesn't already have one)    if (image == null)        image = Bitmap.createScaledBitmap(GameUtil.cardImages.get(ID),             (int)(GameUtil.standardCardSize.X*scale), (int)(GameUtil.standardCardSize.Y*scale), false);        //this code (non-scaled) looks perfect        //image = GameUtil.cardImages.get(ID);    matrix.reset();    matrix.setTranslate(position.X, position.Y);    //These methods make it look worse    //matrix.preScale(1.3f, 1.3f);    //matrix.postScale(1.3f, 1.3f);    //This code makes absolutely no difference    Paint drawPaint = new Paint();    drawPaint.setAntiAlias(false);    drawPaint.setFilterBitmap(false);    drawPaint.setDither(true);    c.drawBitmap(image, matrix, drawPaint);}</code></pre><p>Any insight would be greatly appreciated. Thanks</p>","577826","","21234","","2011-01-28 08:21:12","2014-03-06 14:23:35","Bad image quality after resizing/scaling bitmap","<android><image-manipulation>","7","2","20","",""
"4821559","1","","","2011-01-27 20:36:24","2","551","<p>The Activity screen that I'm working on uses a relative layout to include several local controls along with an embedded activity in the middle.  Ideally, I'd like to configure the relative layout and contained controls within a layout file rather than having to code it manually.  The idea is then to get the placeholder view (via Id) and ""fill"" it with the content of the activity.  </p><p>Is there a control or technique for this already?  Any suggestions are welcome.</p><p>Thanks,</p><p>J</p>","512309","","","","","2011-01-27 20:41:01","How To: View placeholder for embedded activities","<android>","1","4","","",""
"4821717","1","4822095","","2011-01-27 20:52:21","7","582","<p>Working on my first Android application. I'm wondering if there's a way to use the xmlns in the markup in any way. In Flex, for example, I can define a namespace:</p><pre><code>&lt;mx:VBox xmlns:mx=""http://www.adobe.com/2006/mxml""    xmlns:cb=""com.typeoneerror.apps.app.views.components.*""&gt;    &lt;cb:CustomComponent paramName=""demo""&gt;&lt;/cb:CustomComponent&gt;&lt;/mx:VBox&gt;</code></pre><p>Android seems to be slightly different. You use the namespace when defining params but not the tag itself. This is a bit wordy to me, so I'm wondering if there's a way to configure or change this:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    xmlns:cb=""http://schemas.android.com/apk/res/com.typeoneerror.apps.app""&gt;    &lt;com.typeoneerror.apps.app.views.components.CustomComponent cb:paramName=""demo""/&gt;&lt;/LinearLayout&gt;</code></pre><p>I'd like to use </p><pre><code>&lt;cb:CustomComponent cb:paramName=""demo""&gt;&lt;/cb:CustomComponent&gt;</code></pre><p>Possible?</p>","53653","","56285","","2013-11-07 12:07:53","2013-11-07 12:07:53","Define custom Android components using short namespace?","<android>","1","2","4","",""
"4821845","1","","","2011-01-27 21:03:35","12","22023","<p>In my code I have this</p><pre><code>        Log.d(""WFlog (executeRequest)"", request.toString()) ;        httpResponse = client.execute(request);          Log.d(""WFlog (execute)"", request.toString()) ;</code></pre><p>running the app using Android 2.2 is going fine and in logcat I see both log lines.</p><p>Now running the app using HonyComb for the same piece of code it seems I never get passed the client.execute correctly. The last log line I get is the one having ""WFlog (executeRequest)"".</p><p>After this I see the following:</p><pre><code>01-27 21:54:45.169: WARN/System.err(390): android.os.NetworkOnMainThreadException01-27 21:54:45.196: WARN/System.err(390):     at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1069)01-27 21:54:45.196: WARN/System.err(390):     at dalvik.system.BlockGuard$WrappedNetworkSystem.connect(BlockGuard.java:368)01-27 21:54:45.205: WARN/System.err(390):     at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:208)01-27 21:54:45.215: WARN/System.err(390):     at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:431)01-27 21:54:45.237: WARN/System.err(390):     at java.net.Socket.connect(Socket.java:901)</code></pre><p>Any idea what I should look for?</p>","592875","","21234","","2011-01-27 21:04:33","2012-07-25 11:05:21","HonyComb and DefaultHttpClient","<android><httpclient><httpresponse>","4","0","4","",""
"4821849","1","4821963","","2011-01-27 21:03:59","2","777","<p>I'm trying to build my abstract implementation of AsyncTask and I would like to insert a custom ProgressDialog. How can I get the context outside of an Activity Class?</p><pre><code>   abstract public class DataPoller extends AsyncTask&lt;Void, Void, Void&gt; { Context mContext = getApplicationContext(); ProgressDialog dialog = new ProgressDialog(mContext); @Override protected void onPreExecute() {  dialog.setMessage(""Polling data..."");  dialog.show(); } @Override protected void onPostExecute(Void unused) {  if ( dialog.isShowing() ) {   dialog.dismiss();  } } @Override protected Void doInBackground(Void... params) {  int tmp=0;  for (int ii = 0; ii&lt;1000; ii ++) {   for (int jj = 0; jj&lt;1000; jj ++) {    tmp = ( tmp + 3 ) % 167;        }  }  return null; }</code></pre><p>}</p>","269931","","269931","","2011-01-27 21:09:02","2011-01-27 21:15:51","Retrieve context in an abstract, non activity class","<java><android><context>","1","0","","",""
"4821945","1","4821977","","2011-01-27 21:13:58","6","9711","<p>Is there a way to have a TextView pick a font size such that it fills whatever space it has available? For example:</p><pre><code>&lt;LinearLayout  layout_width=""fill_parent""  layout_height=""50dip"" &gt;  &lt;TextView    layout_width=""fill_parent""    layout_height=""fill_parent""    textSize=""scale?"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Thanks</p>","291701","","","","","2013-09-30 16:35:32","Have TextView scale its font size to fill parent?","<android>","2","1","2","",""
"4821967","1","","","2011-01-27 21:16:35","0","789","<p>I'm using the Java Google APIs for an Android application.  I followed the usage pattern described here for Authenication and API use: <a href=""http://goo.gl/rPZ9Z"" rel=""nofollow"">http://goo.gl/rPZ9Z</a> </p><p>The problem I'm having is that the call to GoogleTransport.create() throws a NoClassDefFoundException.  I looked at the log and the HttpHeaders class is not linking properly.  I attached the Google API JAR file using the normal method in eclipse and all other classes I'm using are working correctly.  Problem is that this one class in particular is not linked correctly.  Here are some logs of the app running but not calling the class:</p><p>01-27 14:04:34.390: WARN/dalvikvm(422): Link of class 'Lcom/google/api/client/http/HttpHeaders;' failed</p><p>01-27 14:04:34.400: WARN/dalvikvm(422): Unable to resolve superclass of Lcom/google/api/client/googleapis/GoogleHeaders; (43)</p><p>Log of direct call to GoogleTransport.create():</p><p>01-27 16:13:11.882: ERROR/AndroidRuntime(16086): java.lang.NoClassDefFoundError: com.google.api.client.http.HttpHeaders01-27 16:13:11.882: ERROR/AndroidRuntime(16086):     at com.google.api.client.http.HttpTransport.(HttpTransport.java:145)01-27 16:13:11.882: ERROR/AndroidRuntime(16086):     at com.google.api.client.googleapis.GoogleTransport.create(GoogleTransport.java:58)</p><p>Thanks in advance!</p>","592897","","","","","2011-01-27 21:22:38","Failed Linking Google API in Android Application","<android><eclipse>","1","2","","",""
"4821969","1","5144299","","2011-01-27 21:16:37","0","1568","<p>I have a preference activity which gets it's layout from the following XML. This makes a button appear at the bottom of the preferences.</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    xmlns:myapp=""http://schemas.android.com/apk/res/com.stealthcopter.nexus.nexusgl""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""&gt;&lt;ListView android:id=""@android:id/list""    android:layout_weight=""1""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" /&gt;&lt;Button android:text=""This is a button on top of all preferences.""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    /&gt;         &lt;/LinearLayout&gt;</code></pre><p>However when open a nested PreferenceScreen inside it reverts to the showing just a listview, is there a simple way to keep the layout the same between the preference screens?</p><p>I tried PreferenceScreen.setLayoutResource(R.id.layout.main); but that just changes the view displayed before it is opened</p><p><strong>Update</strong></p><p>I fixed (Kludged) this by changing the nested PreferenceScreens into normal preferences and overriding their onclick methods to clear the preferences from the listview and reload the preferences from an appropriate XML file.</p>","315998","","315998","","2011-02-16 22:57:10","2011-02-28 15:58:54","Custom PreferenceActivity Layout is lost for nested PreferenceScreens","<android><preferences><preferencescreen>","2","0","","",""
"4822144","1","","","2011-01-27 21:34:54","0","159","<p>I have a ContenView with a LinearLayout containing a few TextViews and then a TabHost.The TabHost has 3 tabs which may contain a ListActivity with many items, and thus require scrolling.</p><p>Currently the FrameLayout automatically gets a vertical scrollbar, but I want to have a scrollbar on the main view.</p><p>Ie. when I scroll down to view the rest of the ListActivity in my current tab I want the TextView above the tab to scroll out of sight.</p><p>Any ideas?</p><p>Take a look at this screenshot I made to clarify.The left screen is how it currently is. The right one is photoshopped to what I want to achieve.<img src=""http://i.stack.imgur.com/G2sIX.png"" alt=""enter image description here""></p>","534386","","534386","","2011-01-27 23:01:03","2011-01-28 04:36:57","Tab without internal scroll","<android>","1","0","1","",""
"4822154","1","4831108","","2011-01-27 21:35:54","21","14757","<p>Just updated SDK and SDK tools in Eclipse, tried to run my application on Honeycomb and got the following:</p><pre><code>[2011-01-28 00:22:12 - Androzic] Uploading Androzic.apk onto device 'emulator-5554'[2011-01-28 00:22:13 - Androzic] Installing Androzic.apk...[2011-01-28 00:24:19 - Androzic] Failed to install Androzic.apk on device 'emulator-5554![2011-01-28 00:24:19 - Androzic] (null)[2011-01-28 00:24:19 - Androzic] Failed to install Androzic.apk on device 'emulator-5554': EOF[2011-01-28 00:24:19 - Androzic] com.android.ddmlib.InstallException: EOF[2011-01-28 00:24:19 - Androzic] Launch canceled!</code></pre><p>Other avd's are operating normally. Has anyone succeeded? What am I doing wrong?</p>","488489","","","","","2012-11-23 09:45:45","Honeycomb preview - can not install my app on emulator under Eclipse","<android><eclipse><sdk>","6","1","2","",""
"4822163","1","4853297","","2011-01-27 21:36:52","1","417","<p>I have android 2.1 SDK and I am trying to use AndEngine android gaming engine which requires android 1.6. Despite having higher SDK, I can't get AndEngine get to work with bunch of errors I am getting saying particular game example activity has not extended org.android.Activity class.  How can I target Android 1.6 from Android 2.1? I can't even download android 1.6 SDK now.</p>","203018","","","","","2011-01-31 16:26:55","Targetting Android 1.6 platform from Android 2.1","<java><android><andengine>","1","5","","",""
"4822236","1","4853770","","2011-01-27 21:43:25","1","1072","<p>Ok I couldn't figure out how to word this in a decent fashion so I will propose it as a ""How would you?"".</p><p>I have an app that connects to a service that interfaces all of the data to one main activity. The activity is split in two by a sliding drawer. To top part of the drawered activity is just some buttons that help set up the app and act as a main menu to quickly get anywhere.</p><p>The bottom (revealed by drawer click) is the heart of the app, a gl window that display 9 benches that hold 6 widgets each. The widgets display useful data and must be able to be moved around freely and longclicked to open an options menu.</p><p>This is where my problem is, I was using a gridview to hold the widgets, but now that I'm using GL for the benches and the touch listener, I don't know how to overlay the gridview to the benches and still keep the touch movement alive for the the GL window AND still be able to interact with the gridview.</p><p>This leaves me asking for anyone's oppinion on how to go about this. At this point the only option I have is to figure out how to make ALL of the widgets (even though some may even be a bar graph) in gl. I would rather not do that since gl and I don't work nicely with one another. But I really can't figure out how to integrate these features and still make it functional. Any Ideas?!</p><p>CONVERTING GRIDVIEW TO BITMAP</p><p>This method is in my extension of gridview (WorkBench). Essentially what I'm doing is walking through an array of gridviews collecting the bitmaps of each view and then setting the bitmap as the texture to the panels.</p><p>The toBitmap from the WorkBench class</p><pre><code>public Bitmap toBitmap() {    int x = getWidth();    int y = getHeight();    Bitmap b = Bitmap.createBitmap(x, y, Bitmap.Config.ARGB_8888);    Canvas canvas = new Canvas();    canvas.setBitmap(b);    draw(canvas);    return b;}</code></pre><p>And here is where I init the WorkBenches</p><pre><code>LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);for (int i = 0; i &lt; mWB.length; i++) {    mWB[i] = mBoundService.createBench(ARMHomescreen.this, i+"""");    mWB[i].setLayoutParams(lp);}</code></pre><p>Whats happening is the WorkBenches dimensions are never being set, regardless of whether I use a LayoutParam or set the size in the toBitmap method...</p>","480691","","480691","","2011-02-03 00:01:02","2011-02-03 12:06:47","How to design a gridview in gl","<android><design><opengl-es><view>","1","0","1","",""
"4822264","1","4822440","","2011-01-27 21:46:11","1","598","<p>I have an application that I'd like to have multiple icons in the launcher's main menu grid but only under certain conditions. For instance, I want to show icon A and icon B but only if the phone is running Android 2.2 because icon B uses a Froyo feature, so I don't want icon B showing up if on a pre-Froyo device.</p><p>Is there a way in Java to programmatically add the main menu icon? I don't want it in the manifest file as this isn't flexible at run time... at least not as far as I am aware. This would allow me to either check for some functionality, API, user preference, or a flag in the app. </p>","592943","","","","","2011-01-27 22:04:30","How can I dynamically add new icons to Android's main menu grid from Java?","<android><android-manifest><android-intent><android-ui>","2","3","1","",""
"4822338","1","","","2011-01-27 21:52:31","0","712","<p>its my first 'helloWorld' type app on android, and also in java so please be patient :)</p><p>I want to obtain cell ID in W-CDMA, so i make that app:</p><pre><code>    package helloWorld.w;//package com.eepyaj.cellID;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.telephony.TelephonyManager;import android.telephony.cdma.CdmaCellLocation;import android.view.View;import android.widget.Button;import android.widget.TextView;public class w extends Activity {   CdmaCellLocation location;   int cellID, lac;   private Context context;   /** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      context = (Context) this;      TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);      location = (CdmaCellLocation) tm.getCellLocation();      cellID = location.getBaseStationId();      String tx;      tx = String.valueOf(cellID);      TextView tv = new TextView(this);      tv.setText(""Cell ID "" + tx);      setContentView(tv);   }}</code></pre><p>Unfortunately application exits with message:</p><p>""Application helloWorld (process helloWorld.w) has stopped unexpectedly. Please try again"" (both on HTC and on emulator)</p><p>I made that app under eclpise, typcial 'hello World' works (on htc and on emulator), so i think that problem is in obtaining that 'cellID'</p><p>thx in advance for any help</p>","592952","","","","","2011-01-27 21:52:31","htc android 2.2 obtaining cellID wcdma","<android>","0","2","","",""
"4822496","1","","","2011-01-27 22:09:26","0","437","<p>I have both the Motodev Android Eclipse and a PHP Eclipse installation running on my windows system. They share the workspace and both PHP and Android projects appear in both, however each instance is configured for only one language/environment.</p><p>Is there any way to integrate the two IDEs so I don't have to switch between them. Can I add PHP support to Motodev Eclipse?</p>","592969","","","","","2011-01-31 04:15:47","Eclipse Android Motodev and PHP integration","<php><android><eclipse>","2","0","","",""
"4822586","1","4985855","","2011-01-27 22:18:55","1","4111","<p>I'm trying to request a single location update using the new LocationManager.requestSingleUpdate() method, but once the device gets an update from the GPS the OS crashes and seems to try to reboot. At least I get the usual Android boot screen, but it never finishes booting.</p><p>I've tried running the code on a 2.3, 2.3.1, 2.3.3 and 2.2 AVD, with the same result on all.</p><p>***** <strong>Update</strong> *****</p><p>I tried an old location based app that I have made, and that is running just fine  on a few hundred units, and this also crashes the AVD when sending it a location update. I guess this is turning out be more a case of understanding what is going wrong with location updates to the AVD than spotting an error in my code..?  </p><p>Below follows the code I thought was at fault, in case it might be relevant:</p><p>***** <strong>End update</strong> *****</p><pre><code>public class LocationHelper {    public static void getLocation(Context context) {        LocationListener locationListener = new LocationListener() {            @Override            public void onStatusChanged(String provider, int status, Bundle extras) {                Log.v(""LocationListener"", ""onStatusChanged"");            }                @Override            public void onProviderEnabled(String provider) {                Log.v(""LocationListener"", ""onProviderEnabled"");                            }            @Override            public void onProviderDisabled(String provider) {                Log.v(""LocationListener"", ""onProviderDisabled"");            }            @Override            public void onLocationChanged(Location location) {                Log.v(""LocationListener"", ""onLocationChanged"");            }        };        LocationManager locationManager = (LocationManager)context.getSystemService(Service.LOCATION_SERVICE);        Criteria criteria = new Criteria();        criteria.setAccuracy(Criteria.ACCURACY_FINE);        String provider = locationManager.getBestProvider(criteria, true);        Log.v(""Provider"", provider);        // FIXME: Something crashes the emulator when a GPS fix is sent through DDMS        locationManager.requestSingleUpdate(provider, locationListener, Looper.myLooper());    }}</code></pre><p>I might also mention that the <code>provider</code> variable gets set to ""gps"", according to the logs. None of the log statements in the LocationListener are triggered.</p><p>Below is the output from logcat. The first line shows that my getLocation() function was called. I then submit a gps fix through DDMS, and the phone proceeds to reboot. I cut the log a little short, since I was going over the 30k chars boundary, but I guess the first lines are the most relevant.</p><pre><code>V/Provider(  430): gpsI/DEBUG   (   31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***I/DEBUG   (   31): Build fingerprint: 'generic/google_sdk/generic:2.3/GRH55/79397:eng/test-keys'I/DEBUG   (   31): pid: 68, tid: 163  &gt;&gt;&gt; system_server &lt;&lt;&lt;I/DEBUG   (   31): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000I/DEBUG   (   31):  r0 00000000  r1 40685948  r2 4128fcbc  r3 459e1c74I/DEBUG   (   31):  r4 0000012d  r5 00000000  r6 40685948  r7 4128fcbcI/DEBUG   (   31):  r8 84301321  r9 84302240  10 00100000  fp 00000001I/DEBUG   (   31):  ip 82f0e7d4  sp 459e1c60  lr 82f0ab37  pc 82f07d0e  cpsr 00000030I/DEBUG   (   31):          #00  pc 00007d0e  /system/lib/libandroid_servers.soI/DEBUG   (   31):          #01  pc 0000ab32  /system/lib/libandroid_servers.soI/DEBUG   (   31):          #02  pc 000012ca  /system/lib/hw/gps.goldfish.soI/DEBUG   (   31):          #03  pc 000014ae  /system/lib/hw/gps.goldfish.soI/DEBUG   (   31):          #04  pc 00011a7c  /system/lib/libc.soI/DEBUG   (   31):          #05  pc 00011640  /system/lib/libc.soI/DEBUG   (   31): I/DEBUG   (   31): code around pc:I/DEBUG   (   31): 82f07cec ab04b082 9301cb04 6f646804 b00247a0 I/DEBUG   (   31): 82f07cfc bc08bc10 4718b002 b510b40c ab04b082 I/DEBUG   (   31): 82f07d0c 6804cb04 34f89301 47a06824 bc10b002 I/DEBUG   (   31): 82f07d1c b002bc08 46c04718 b510b40c ab04b082 I/DEBUG   (   31): 82f07d2c 9301cb04 34986804 47a06824 bc10b002 I/DEBUG   (   31): I/DEBUG   (   31): code around lr:I/DEBUG   (   31): 82f0ab14 91099008 f7fb6aa0 900aeb14 1c3a910b I/DEBUG   (   31): 82f0ab24 6b646b23 930c1c28 1c31940d f7fd9b0f I/DEBUG   (   31): 82f0ab34 4906f8e7 44791c28 f7ff3150 b011fe1d I/DEBUG   (   31): 82f0ab44 46c0bdf0 0000454c 000042c8 00000786 I/DEBUG   (   31): 82f0ab54 f7fbb510 bd10ec7c 4802b510 f7fb4478 I/DEBUG   (   31): I/DEBUG   (   31): stack:I/DEBUG   (   31):     459e1c20  ac710cb3  I/DEBUG   (   31):     459e1c24  40b38d0b  I/DEBUG   (   31):     459e1c28  00000009  I/DEBUG   (   31):     459e1c2c  00000000  I/DEBUG   (   31):     459e1c30  0000ab90  [heap]I/DEBUG   (   31):     459e1c34  81d48bd3  /system/lib/libdvm.soI/DEBUG   (   31):     459e1c38  0000ab90  [heap]I/DEBUG   (   31):     459e1c3c  459e1c6c  I/DEBUG   (   31):     459e1c40  00010004  [heap]I/DEBUG   (   31):     459e1c44  81d3761b  /system/lib/libdvm.soI/DEBUG   (   31):     459e1c48  00000000  I/DEBUG   (   31):     459e1c4c  afd0dcc4  /system/lib/libc.soI/DEBUG   (   31):     459e1c50  00000000  I/DEBUG   (   31):     459e1c54  459e1e00  I/DEBUG   (   31):     459e1c58  df002777  I/DEBUG   (   31):     459e1c5c  e3a070ad  I/DEBUG   (   31): #00 459e1c60  00000001  I/DEBUG   (   31):     459e1c64  8053bf25  /system/lib/libandroid_runtime.soI/DEBUG   (   31):     459e1c68  0000012d  I/DEBUG   (   31):     459e1c6c  82f0ab37  /system/lib/libandroid_servers.soI/DEBUG   (   31):     459e1c70  4128fcbc  /dev/ashmem/dalvik-LinearAlloc (deleted)I/DEBUG   (   31):     459e1c74  00000003  I/DEBUG   (   31): #01 459e1c78  4284dfce  /system/usr/icu/icudt44l.datI/DEBUG   (   31):     459e1c7c  4042b604  /dev/ashmem/dalvik-heap (deleted)I/DEBUG   (   31):     459e1c80  92023d3a  I/DEBUG   (   31):     459e1c84  40490ac3  /dev/ashmem/dalvik-heap (deleted)I/DEBUG   (   31):     459e1c88  00000000  I/DEBUG   (   31):     459e1c8c  00000000  I/DEBUG   (   31):     459e1c90  00000000  I/DEBUG   (   31):     459e1c94  00000000  I/DEBUG   (   31):     459e1c98  00000000  I/DEBUG   (   31):     459e1c9c  00000000  I/DEBUG   (   31):     459e1ca0  00000000  I/DEBUG   (   31):     459e1ca4  00000000  I/DEBUG   (   31):     459e1ca8  c4571f00  I/DEBUG   (   31):     459e1cac  0000012d  I/DEBUG   (   31):     459e1cb0  459e1e56  I/DEBUG   (   31):     459e1cb4  00000003  I/DEBUG   (   31):     459e1cb8  0000000a  I/DEBUG   (   31):     459e1cbc  459e1de8  I/DEBUG   (   31):     459e1cc0  00000000  I/DEBUG   (   31):     459e1cc4  459e1e6b  I/DEBUG   (   31):     459e1cc8  00000001  I/DEBUG   (   31):     459e1ccc  843012cd  /system/lib/hw/gps.goldfish.soI/StatusBarManagerService(   68): registerStatusBar bar=com.android.internal.statusbar.IStatusBar$Stub$Proxy@40692170D/VoldCmdListener(   29): share status umsD/StorageNotification(  278): Startup with UMS connection false (media state mounted)I/StorageNotification(  278): UMS connection changed to false (media state mounted)D/dalvikvm(  278): GC_CONCURRENT freed 501K, 55% free 2668K/5831K, external 897K/1038K, paused 9ms+6msI/ActivityManager(   68): Process com.android.defcontainer (pid 218) has died.D/Zygote  (   33): Process 68 terminated by signal (11)I/Zygote  (   33): Exit zygote because system server (68) has terminatedI/ActivityThread(  415): Removing dead content provider: settingsI/ServiceManager(   28): service 'batteryinfo' diedI/ServiceManager(   28): service 'usagestats' diedI/ServiceManager(   28): service 'SurfaceFlinger' diedI/ServiceManager(   28): service 'package' diedI/ServiceManager(   28): service 'sensorservice' diedI/ServiceManager(   28): service 'cpuinfo' diedI/ServiceManager(   28): service 'entropy' diedI/ServiceManager(   28): service 'power' diedI/ServiceManager(   28): service 'account' diedI/ServiceManager(   28): service 'telephony.registry' diedI/ServiceManager(   28): service 'appwidget' diedI/ServiceManager(   28): service 'backup' diedI/ServiceManager(   28): service 'permission' diedI/ServiceManager(   28): service 'activity' diedI/ServiceManager(   28): service 'meminfo' diedI/ServiceManager(   28): service 'diskstats' diedI/ServiceManager(   28): service 'content' diedI/ServiceManager(   28): service 'battery' diedI/ServiceManager(   28): service 'hardware' diedI/ServiceManager(   28): service 'vibrator' diedI/ServiceManager(   28): service 'alarm' diedI/ServiceManager(   28): service 'window' diedI/ServiceManager(   28): service 'device_policy' diedI/ActivityThread(  278): Removing dead content provider: settingsI/ActivityThread(  125): Removing dead content provider: settingsI/ActivityThread(  122): Removing dead content provider: settingsI/ActivityThread(  430): Removing dead content provider: settingsE/installd(   35): eofE/installd(   35): failed to read sizeI/installd(   35): closing connectionD/qemud   (   38): fdhandler_event: disconnect on fd 11I/ServiceManager(   28): service 'statusbar' diedI/ServiceManager(   28): service 'clipboard' diedI/ServiceManager(   28): service 'network_management' diedI/ServiceManager(   28): service 'input_method' diedI/ServiceManager(   28): service 'netstat' diedI/ServiceManager(   28): service 'wifi' diedI/ServiceManager(   28): service 'connectivity' diedI/ServiceManager(   28): service 'throttle' diedI/ServiceManager(   28): service 'accessibility' diedI/ServiceManager(   28): service 'mount' diedI/ServiceManager(   28): service 'notification' diedI/ServiceManager(   28): service 'devicestoragemonitor' diedI/ServiceManager(   28): service 'location' diedI/ServiceManager(   28): service 'search' diedI/ServiceManager(   28): service 'dropbox' diedI/ServiceManager(   28): service 'wallpaper' diedI/ServiceManager(   28): service 'audio' diedI/ServiceManager(   28): service 'uimode' diedI/ServiceManager(   28): service 'isms' diedI/ServiceManager(   28): service 'simphonebook' diedI/ServiceManager(   28): service 'iphonesubinfo' diedI/ServiceManager(   28): service 'phone' diedI/ServiceManager(   28): service 'media.audio_flinger' diedI/ServiceManager(   28): service 'media.audio_policy' diedI/ServiceManager(   28): service 'media.player' diedI/ServiceManager(   28): service 'media.camera' diedI/Netd    (  445): Netd 1.0 startingD/AndroidRuntime(  446): D/AndroidRuntime(  446): &gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START com.android.internal.os.ZygoteInit &lt;&lt;&lt;&lt;&lt;&lt;D/AndroidRuntime(  446): CheckJNI is ONI/        (  444): ServiceManager: 0xad50D/AudioHardwareInterface(  444): setMode(NORMAL)I/CameraService(  444): CameraService started (pid=444)I/AudioFlinger(  444): AudioFlinger's thread 0xc650 ready to runI/SamplingProfilerIntegration(  446): Profiler is disabled.I/Zygote  (  446): Preloading classes...D/dalvikvm(  446): GC_EXPLICIT freed 47K, 78% free 232K/1024K, external 0K/0K, paused 33msD/dalvikvm(  446): GC_EXPLICIT freed 1K, 73% free 282K/1024K, external 0K/0K, paused 17msD/dalvikvm(  446): GC_EXPLICIT freed 22K, 70% free 316K/1024K, external 0K/0K, paused 19msD/dalvikvm(  446): GC_EXPLICIT freed 17K, 66% free 353K/1024K, external 0K/0K, paused 8msD/dalvikvm(  446): GC_EXPLICIT freed 26K, 63% free 382K/1024K, external 0K/0K, paused 19msD/dalvikvm(  446): GC_EXPLICIT freed 20K, 58% free 439K/1024K, external 0K/0K, paused 20msW/MediaProfiles(  446): could not find media config xml fileD/dalvikvm(  446): GC_EXPLICIT freed 99K, 47% free 545K/1024K, external 0K/0K, paused 24msD/dalvikvm(  446): GC_EXPLICIT freed 272K, 28% free 884K/1219K, external 0K/0K, paused 45msD/dalvikvm(  446): GC_EXPLICIT freed 21K, 24% free 931K/1219K, external 0K/0K, paused 41msD/RenderScript_jni(  446): RenderScript JNI library not found!D/dalvikvm(  446): GC_EXPLICIT freed 25K, 19% free 998K/1219K, external 0K/0K, paused 51msD/dalvikvm(  446): GC_EXPLICIT freed 47K, 5% free 1281K/1347K, external 0K/0K, paused 64msD/dalvikvm(  446): GC_EXPLICIT freed 24K, 3% free 1310K/1347K, external 0K/0K, paused 72msD/dalvikvm(  446): GC_EXPLICIT freed 28K, 6% free 1336K/1411K, external 0K/0K, paused 63msD/dalvikvm(  446): GC_EXPLICIT freed 14K, 3% free 1376K/1411K, external 0K/0K, paused 75msD/dalvikvm(  446): GC_EXPLICIT freed 28K, 5% free 1402K/1475K, external 0K/0K, paused 64msD/dalvikvm(  446): GC_EXPLICIT freed 28K, 3% free 1439K/1475K, external 0K/0K, paused 78msD/dalvikvm(  446): GC_EXPLICIT freed 38K, 6% free 1456K/1539K, external 0K/0K, paused 77msD/dalvikvm(  446): GC_EXPLICIT freed 40K, 5% free 1471K/1539K, external 0K/0K, paused 76msD/dalvikvm(  446): GC_EXPLICIT freed 55K, 8% free 1485K/1603K, external 0K/0K, paused 75msD/dalvikvm(  446): GC_FOR_MALLOC freed 2956K, 58% free 2166K/5123K, external 0K/0K, paused 273msD/dalvikvm(  446): GC_EXPLICIT freed 1401K, 55% free 2309K/5123K, external 0K/0K, paused 162msD/dalvikvm(  446): GC_EXPLICIT freed 141K, 55% free 2355K/5123K, external 0K/0K, paused 146msD/dalvikvm(  446): GC_EXPLICIT freed 73K, 54% free 2380K/5123K, external 0K/0K, paused 162msD/dalvikvm(  446): GC_EXPLICIT freed 36K, 54% free 2398K/5123K, external 0K/0K, paused 139msD/dalvikvm(  446): GC_EXPLICIT freed 30K, 53% free 2421K/5123K, external 0K/0K, paused 140msD/dalvikvm(  446): GC_EXPLICIT freed 38K, 53% free 2444K/5123K, external 0K/0K, paused 141msI/Zygote  (  446): ...preloaded 1830 classes in 23652ms.E/Zygote  (  446): setreuid() failed. errno: 17D/dalvikvm(  446): GC_EXPLICIT freed 18K, 53% free 2442K/5123K, external 0K/0K, paused 153msI/Zygote  (  446): Preloading resources...D/dalvikvm(  446): GC_EXTERNAL_ALLOC freed &lt;1K, 53% free 2444K/5123K, external 0K/0K, paused 141msW/Zygote  (  446): Preloaded drawable resource #0x1080093 (res/drawable-mdpi/sym_def_app_icon.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080002 (res/drawable-mdpi/arrow_down_float.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x10800b4 (res/drawable/btn_check.xml) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x10800b7 (res/drawable-mdpi/btn_check_label_background.9.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x10800b8 (res/drawable-mdpi/btn_check_off.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x10800bd (res/drawable-mdpi/btn_check_on.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080004 (res/drawable/btn_default.xml) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080005 (res/drawable/btn_default_small.xml) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080006 (res/drawable/btn_dropdown.xml) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080008 (res/drawable/btn_plus.xml) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080007 (res/drawable/btn_minus.xml) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080009 (res/drawable/btn_radio.xml) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x108000a (res/drawable/btn_star.xml) that varies with configuration!!D/dalvikvm(  446): GC_EXPLICIT freed 25K, 52% free 2481K/5123K, external 408K/521K, paused 128msW/Zygote  (  446): Preloaded drawable resource #0x1080132 (res/drawable/btn_toggle.xml) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080196 (res/drawable-mdpi/ic_emergency.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080012 (res/drawable-mdpi/divider_horizontal_bright.9.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080014 (res/drawable-mdpi/divider_horizontal_dark.9.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080016 (res/drawable/edit_text.xml) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080170 (res/drawable/expander_group.xml) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080062 (res/drawable/list_selector_background.xml) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x108022a (res/drawable-mdpi/menu_background.9.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x108022b (res/drawable-mdpi/menu_background_fill_parent_width.9.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x108022c (res/drawable/menu_selector.xml) that varies with configuration!!D/dalvikvm(  446): GC_EXTERNAL_ALLOC freed 16K, 52% free 2494K/5123K, external 516K/521K, paused 135msW/Zygote  (  446): Preloaded drawable resource #0x108023a (res/drawable-mdpi/panel_background.9.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080242 (res/drawable-mdpi/popup_bottom_bright.9.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080243 (res/drawable-mdpi/popup_bottom_dark.9.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080244 (res/drawable-mdpi/popup_bottom_medium.9.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080245 (res/drawable-mdpi/popup_center_bright.9.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080246 (res/drawable-mdpi/popup_center_dark.9.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080249 (res/drawable-mdpi/popup_full_dark.9.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x108024c (res/drawable-mdpi/popup_top_bright.9.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x108024d (res/drawable-mdpi/popup_top_dark.9.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x108006d (res/drawable/progress_indeterminate_horizontal.xml) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080253 (res/drawable/progress_small.xml) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080254 (res/drawable/progress_small_titlebar.xml) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080274 (res/drawable-mdpi/scrollbar_handle_horizontal.9.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080275 (res/drawable-mdpi/scrollbar_handle_vertical.9.png) that varies with configuration!!D/dalvikvm(  446): GC_EXPLICIT freed 15K, 52% free 2506K/5123K, external 585K/1038K, paused 142msW/Zygote  (  446): Preloaded drawable resource #0x1080071 (res/drawable/spinner_dropdown_background.xml) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080304 (res/drawable-mdpi/text_select_handle_left.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080305 (res/drawable-mdpi/text_select_handle_middle.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080306 (res/drawable-mdpi/text_select_handle_right.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x1080327 (res/drawable-mdpi/title_bar_shadow.9.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x10801d8 (res/drawable-mdpi/indicator_code_lock_drag_direction_green_up.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x10801d9 (res/drawable-mdpi/indicator_code_lock_drag_direction_red_up.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x10801da (res/drawable-mdpi/indicator_code_lock_point_area_default.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x10801db (res/drawable-mdpi/indicator_code_lock_point_area_green.png) that varies with configuration!!W/Zygote  (  446): Preloaded drawable resource #0x10801dc (res/drawable-mdpi/indicator_code_lock_point_area_red.png) that varies with configuration!!I/Zygote  (  446): ...preloaded 51 resources in 2898ms.I/Zygote  (  446): ...preloaded 15 resources in 64ms.D/dalvikvm(  446): GC_EXPLICIT freed 23K, 51% free 2514K/5123K, external 716K/1038K, paused 134msD/dalvikvm(  446): GC_EXPLICIT freed 6K, 52% free 2508K/5123K, external 716K/1038K, paused 128msD/dalvikvm(  446): GC_EXPLICIT freed &lt;1K, 52% free 2508K/5123K, external 716K/1038K, paused 224msI/dalvikvm(  446): System server process 453 has been createdI/Zygote  (  446): Accepting command socket connectionsE/BatteryService(  453): usbOnlinePath not foundE/BatteryService(  453): batteryVoltagePath not foundE/BatteryService(  453): batteryTemperaturePath not foundI/sysproc (  453): Entered system_init()I/sysproc (  453): ServiceManager: 0x8fbe8I/SurfaceFlinger(  453): SurfaceFlinger is startingI/SurfaceFlinger(  453): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...E/SurfaceFlinger(  453): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wakeI/gralloc (  453): using (fd=27)I/gralloc (  453): id           = I/gralloc (  453): xres         = 320 pxI/gralloc (  453): yres         = 480 pxI/gralloc (  453): xres_virtual = 320 pxI/gralloc (  453): yres_virtual = 960 pxI/gralloc (  453): bpp          = 16I/gralloc (  453): r            = 11:5I/gralloc (  453): g            =  5:6I/gralloc (  453): b            =  0:5I/gralloc (  453): width        = 49 mm (165.877548 dpi)I/gralloc (  453): height       = 74 mm (164.756760 dpi)I/gralloc (  453): refresh rate = 60.00 HzD/libEGL  (  453): egl.cfg not found, using default configD/libEGL  (  453): loaded /system/lib/egl/libGLES_android.soI/SurfaceFlinger(  453): EGL informations:I/SurfaceFlinger(  453): # of configs : 8I/SurfaceFlinger(  453): vendor    : AndroidI/SurfaceFlinger(  453): version   : 1.4 Android META-EGLI/SurfaceFlinger(  453): extensions: EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_ANDROID_image_native_buffer EGL_ANDROID_swap_rectangle I/SurfaceFlinger(  453): Client API: OpenGL ESI/SurfaceFlinger(  453): EGLSurface: 5-6-5-0, config=0x0I/SurfaceFlinger(  453): OpenGL informations:I/SurfaceFlinger(  453): vendor    : AndroidI/SurfaceFlinger(  453): renderer  : Android PixelFlinger 1.4I/SurfaceFlinger(  453): version   : OpenGL ES-CM 1.0I/SurfaceFlinger(  453): extensions: GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_draw_texture GL_OES_matrix_get GL_OES_query_matrix GL_OES_EGL_image GL_OES_compressed_ETC1_RGB8_texture GL_ARB_texture_compression GL_ARB_texture_non_power_of_two GL_ANDROID_user_clip_plane GL_ANDROID_vertex_buffer_object GL_ANDROID_generate_mipmap I/SurfaceFlinger(  453): GL_MAX_TEXTURE_SIZE = 4096I/SurfaceFlinger(  453): GL_MAX_VIEWPORT_DIMS = 4096I/SurfaceFlinger(  453): flags = 000c0000D/SensorService(  453): nuSensorService starting...E/SensorService(  453): couldn't open device for module sensors (Invalid argument)I/sysproc (  453): System server: starting Android runtime.I/sysproc (  453): System server: starting Android services.</code></pre><p>I'm requesting the following permissions in my manifest:</p><pre><code>&lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;</code></pre>","543617","","543617","","2011-02-13 09:32:58","2011-02-13 18:01:48","Requesting single location update, AVD crashes","<android><geolocation><location><android-sdk-2.3>","1","4","","",""
"4822669","1","","","2011-01-27 22:27:04","0","411","<p>Once pressed, I would like an ImageButton to continue to draw as if it was pressed until something else is touched.  Is there a way to do this short of extending the ImageButton to control how it is drawn, and adding a focus listener to monitor if it loses focus?</p><p>Thanks you.</p>","426493","","","","","2011-01-27 22:43:50","Android: how to draw ImageButton as pressed until it loses focus?","<android><imagebutton>","1","0","","",""
"4822778","1","4822814","","2011-01-27 22:39:50","0","417","<p>Firstly what views should I use in order to be able to add ads like <a href=""http://phandroid.com/wp-content/uploads/2011/01/ad-clicks-accidental-small.png.pagespeed.ce_.7SsVPkAqEA.png"" rel=""nofollow"">this</a> (angry birds).</p><p>Secondly how do I add the views in the code.</p>","280240","","","","","2011-01-27 22:49:40","Placing Ads in Android","<android><layout><admob>","2","0","1","",""
"4822877","1","4822906","","2011-01-27 22:49:50","38","17954","<p>I've started to really like using C# and Java enums in my code for several reasons:</p><ul><li>They are much more type-safe than integers, strings, or sets of boolean flags.</li><li>They lead to more readable code.</li><li>It's more difficult to set an enum to an invalid value than an int or string.</li><li>They make it easy to discover the allowed values for a variable or parameter.</li><li>Everything I've read indicates that they perform just as well as integers in C# and most JVMs.</li></ul><p>However, the Android framework has numerous cases where flags of various types need to be passed around, but none of them seem to use enums.  A couple of examples where I would think their use would be beneficial are <code>Toast.LENGTH_SHORT</code> / <code>Toast.LENGTH_LONG</code> and <code>View.GONE</code>, <code>View.VISIBLE</code>, etc.</p><p>Why is this?  Do enums perform worse than simple integer values in Dalvik?  Is there some other drawback I'm not aware of?</p>","106302","","","","","2012-09-06 10:00:47","Why doesn't Android use more enums?","<android><enums>","3","2","11","",""
"4823014","1","","","2011-01-27 23:04:01","2","298","<p>so I have a 3 <code>CountDownTimers</code>. 2 of the timers have the same time set. 1 has a different time set. After all timers reach 0, they restart again.</p><p>Well after about 3 restarts, the timers catch up with each other.. which is fine... however, I have it set so that at the 20 second mark, Timers 1 &amp; 2 say something in text to speech. And Timer 3 also says something at the 20 second mark. The problem is that the whole phrase is not spoken because they are cutting each other off.</p><p>Currently, in all 3 of the countdowns i'm using:</p><pre><code>tts.speak(""20 seconds remaining."", TextToSpeech.QUEUE_FLUSH, null);</code></pre><p>is this problem occuring because i'm using the same <code>TextToSpeech</code> (<code>tts</code>) ?or maybe it has something to do with <code>QUEUE_FLUSH</code> and <code>null</code>?</p><p>And also if I change <code>QUEUE_FLUSH</code> to <code>QUEUE_ADD</code> the text just keeps repeating so that won't work</p>","533049","","881286","","2013-08-18 02:14:06","2013-08-18 02:14:06","Android text to speech cuts off another text to speech","<android><eclipse>","0","0","","",""
"4823044","1","","","2011-01-27 23:07:51","0","854","<p>I have a DataHelper, and I want to <code>getWritableDatabase()</code>, but it won't let me. <strong>I will need a code example (newbie to java).</strong> Here is my main .java:</p><pre><code>public class ShoppingList extends ListActivity {    private SQLiteDatabase db;    /** Called when the activity is first created. */    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button button1main = (Button) findViewById(R.id.add);        button1main.setOnClickListener(new OnClickListener()  {            @Override            public void onClick(View v)  {            final Dialog additem = new Dialog(ShoppingList.this);            additem.setContentView(R.layout.maindialog);            final EditText et = (EditText)additem.findViewById(R.id.edittext);            additem.setTitle(""Type your item"");            additem.setCancelable(true);            et.setHint(""Type the name of an item..."");            Button button = (Button) additem.findViewById(R.id.cancel);            button.setOnClickListener(new OnClickListener()  {                @Override                public void onClick(View v)  {                    additem.dismiss();                }            });            additem.show();            Button ok = (Button) additem.findViewById(R.id.ok);            ok.setOnClickListener(new OnClickListener() {                @Override                public void onClick(View v) {                    final String text = et.getText().toString();                    additem.dismiss();                    et.setText("""");                }            });       }        });    }}</code></pre><p>My DataHelper.java:</p><pre><code>public class DataHelper {    private static final String DATABASE_NAME = ""items.db"";    private static final int DATABASE_VERSION = 1;    private static final String TABLE_NAME = ""table1"";    private Context context;    private SQLiteDatabase db;    private SQLiteStatement insertStmt;    private static final String INSERT = ""insert into ""        + TABLE_NAME + ""(name) 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 name) {            this.insertStmt.bindString(1, name);            return this.insertStmt.executeInsert();        }        public void deleteAll() {            this.db.delete(TABLE_NAME, null, null);        }        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[] { ""name"" },                    null, null, null, null, ""name desc"");            if (cursor.moveToFirst()) {                do {                    list.add(cursor.getString(0));                } while (cursor.moveToNext());            }            if (cursor !=null &amp;&amp; !cursor.isClosed()) {                cursor.close();            }            return list;        }        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, name 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);            }            @SuppressWarnings(""unused"")            public void doInsert(String name) {                final SQLiteDatabase db = getWritableDatabase();                SQLiteStatement insert_stmt = null;                try {                    insert_stmt = db.compileStatement(INSERT);                    insert_stmt.bindString(0, name);                    insert_stmt.executeInsert();                }                finally {                    if (insert_stmt !=null) insert_stmt.close();                }            }        }}</code></pre>","560096","","244296","","2011-01-27 23:11:39","2011-01-27 23:11:39","Eclipse Won't Let Me getWritableDatabase()","<android><sqlite><cursor>","0","2","","",""
"4823057","1","","","2011-01-27 23:10:09","0","647","<p>I have a <code>MapView</code> acitivty and it download some maps data from google. How can I cache these data and how can I load them again to use offline?</p><p>I need these maps cached to use them when there is no way to download them (neither 3G nor Wifi connection). GPS gets localization, but if there's no map, it is not helpful for user.</p><p>Note: Some comment in this post, said that is violation to Google Maps TOS, and it will not be possible to upload to Android Market, but It does not matter because It will not be published, it is only for academic and research purposes.</p><p>Thank you very much.</p>","576931","","576931","","2011-01-28 01:36:28","2011-01-28 01:36:28","How to cache downloaded google maps data on an Android activity?","<android><google-maps><android-mapview>","1","0","","",""
"4823065","1","4823669","","2011-01-27 23:11:47","1","678","<p>I'm on a MAC, trying to run the Android layoutopt tool, and when I run the tool on any of my layout files I get the following error:</p><pre><code>syntax error near unexpected token `newline'  `&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;'</code></pre><p>Anyone else run into this problem? Any ideas on how to fix it?</p>","413414","","413414","","2011-01-27 23:35:45","2011-03-04 21:05:16","Android: layoutopt error - syntax error near unexpected token `newline'","<android><optimization><layout>","1","1","","",""
"4823075","1","4823136","","2011-01-27 23:12:33","1","2191","<p>I have a list of reviews that I have put into a list, but I would like it to just show a snippet of the text and when the user clicks on the item it resizes and shows the rest of the review.</p><p>Any ideas?</p>","425459","","","","","2014-01-28 05:57:38","Android list view dynamic resizing","<android><listview>","3","0","","",""
"4823131","1","4823215","","2011-01-27 23:20:08","0","92","<p>I have Activity A. It opens Activity B that is a dialog Activity with a listview.I want on a click of an item in the list view, the following will happen:</p><ol><li>Window C will open</li><li>Window B will be closed</li><li>Window A will be closed</li></ol><p>What is the most efficient way to do that?(I do know that number 2 is easy (just add finish after opening activity C. Not sure about the rest).</p>","380490","","","","","2011-01-27 23:33:53","Closing 2 Activities","<android><activity>","1","1","","",""
"4823133","1","","","2011-01-27 23:20:54","3","2725","<p>I have an activity that creates an intent, puts some extras with putExtra() and calls the startService(intent) to start a service.</p><p>This service calculates some stuff based on the extras and then I want to send the result back to the activity. </p><p>In which way can I do this? </p><p>I tried to create an intent on my service and broadcast it using sendBroadcast(). I have a broadcastReceiver on the activity but Im not sure if I register it correctly. Im confused! </p><p>Is there any other way to do so? Something like StartActivityForResult but for services (something like StartServiceForResult or something)?</p>","510492","","750987","","2011-05-28 10:32:46","2011-07-14 13:58:32","Send data from Service back to my activity","<android><service><activity><android-intent><communication>","2","1","2","",""
"4823138","1","4823176","","2011-01-27 23:21:35","1","1054","<p>I have a listView with some data coming from a server.I want to do an activity every time i press one of the list items.any idea please?</p><pre><code>public void Status1() {        setContentView(R.layout.status);        update = (Button) findViewById(R.id.update);        refresh = (Button) findViewById(R.id.refresh);        update.setOnClickListener(update_btn);        refresh.setOnClickListener(refresh_btn);        lv1 = (ListView) findViewById(R.id.ListView);        // By using setAdpater method in listview we an add string array in        // list.        lv1.setAdapter(new ArrayAdapter&lt;String&gt;(this,                android.R.layout.simple_list_item_1, lv_arr));         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();                }              });        final EditText username2 = (EditText) findViewById(R.id.username1);        //String a = username1.getText().toString();        //username2.setText(a);        username2.setOnKeyListener(new OnKeyListener() {            public boolean onKey(View v, int keyCode, KeyEvent event) {                // If the event is a key-down event on the ""enter"" button                if ((event.getAction() == KeyEvent.ACTION_DOWN)                        &amp;&amp; (keyCode == KeyEvent.KEYCODE_ENTER)) {                    // Perform action on key press                    // Editable a=findViewById(R.id.username).getText();                    // username2.setText(a);                    Toast.makeText(yassou.this, username2.getText(),                            Toast.LENGTH_SHORT).show();                    return true;                }                return false;            }        });    }</code></pre><p>i have tried this:EDIT1</p><pre><code> lv1.setOnItemClickListener(new OnItemClickListener() {                public void onItemClick(AdapterView&lt;?&gt; parent, View view,                    int position, long id) {                     startActivity(new Intent(""com.example.HelloGoogleMaps2""));                }              });</code></pre><p>and this:EDIT2</p><pre><code>lv1.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                Intent myIntent = new Intent(view.getContext(), HelloGoogleMaps2.class);                    startActivityForResult(myIntent, 0);                }              });</code></pre><p>but noone method is working...please help!!</p>","519526","","519526","","2011-01-27 23:49:27","2013-03-19 19:06:25","listView onclick activity","<android><listview><onclick>","1","3","1","",""
"4823203","1","","","2011-01-27 23:30:44","0","1235","<p>I'm not sure how to declare to destroy this activity. If I exit the application it crashes the whole phone because it's running in the background. I had an outline I was given in another question, but I'm ot sure how to implement that. I currently have:</p><pre><code>new Thread(new Runnable(){    @Override    public void run() {        while(true)        handler.sendEmptyMessage(FIRE);    }}).start();</code></pre><p>So how do I stop this. I cannot stop a thread, I'm reading that's dangerous. So how should I structure this so it's not crashing the system? Should I remove the <code>while</code> loop, make it a method, and kill the method at pause? Like: </p><pre><code>public void run() {    handlerMsg();}}).start():</code></pre><p>Then I could do:  </p><pre><code>onFinish() {    handlerMsg.stop}</code></pre><p>That feels wrong. Any assistance would be met with much gratitude.</p>","571866","","512958","","2011-01-28 00:58:44","2011-01-28 00:58:44","Stopping a threads activity in android","<android><multithreading>","3","0","","",""
"4823217","1","","","2011-01-27 23:34:26","0","1570","<p>I need a layout for a (list) row which contains two <code>ImageView</code> and one <code>TextView</code> (in the middle). Both images should be to the edges of the screen and the <code>TextView</code> is expected to fill the space between. My problem is, that the text can be set dynamically. Right now I'm working with a <code>TableLayout</code> and the attribute <code>android:stretchColumns</code>, but it could be that the text is longer then the available size, so both <code>ImageView</code> are moved out of the screen. </p><p>Can someone provide a layout for me, with is resistant for long textes ? </p><p>It should look like this:<img src=""http://i.stack.imgur.com/OyfMR.png"" alt=""Visualisation of desired layout""></p>","566904","","566904","","2011-01-28 11:32:56","2011-07-26 07:51:08","Row layout with text within two icons","<android><layout>","2","4","","",""
"4823272","1","","","2011-01-27 23:41:36","7","7874","<p>I am trying to figure out which phones have a Large screen size in terms of Android development. Going through the documentation it is a very confusing situation as the Large category also depends on the density of the pixels in the phones screen.<br>From what I've read it looks like both the EVO and Droid X (who have big screens) are classified as Normal screens with High Density.</p><p>Which phones are MDPI/HDPI but also Large Screens?</p><p>My endgame here is to support only HVGA and WVGA screens but I need to make sure I'm not cutting a large portion of the market out.</p>","413575","","","","","2013-09-01 08:54:23","Which Android phones have Large screen sizes","<android><size><screen>","3","2","","",""
"4823327","1","","","2011-01-27 23:53:09","1","131","<p>I've done some tiling but have very little experience in doing it properly and optimizing it.I've always created a 2d array within a nested for loop and updated as much as I could.The reason I updated so much was because I had to figure out a way to cull.Here is an example of some of my old code:</p><pre><code>public void createTiles(int x, int y) {    int index = 0;    int texIn = 0;    for (int i = x; i &lt; x + width; i++) {        for (int j = y; j &lt; y + height; j++) {            vertices[index + 0] = (i * 32);            vertices[index + 1] = (j * 32) + 32;            vertices[index + 2] = 0;            vertices[index + 3] = (i * 32);            vertices[index + 4] = (j * 32);            vertices[index + 5] = 0;            vertices[index + 6] = (i * 32) + 32;            vertices[index + 7] = (j * 32);            vertices[index + 8] = 0;            vertices[index + 9] = (i * 32);            vertices[index + 10] = (j * 32) + 32;            vertices[index + 11] = 0;            vertices[index + 12] = (i * 32) + 32;            vertices[index + 13] = (j * 32);            vertices[index + 14] = 0;            vertices[index + 15] = (i * 32) + 32;            vertices[index + 16] = (j * 32) + 32;            vertices[index + 17] = 0;            index += 18;        }    }</code></pre><p>Could anyone help me in creating a proper tiling engine?I was thinking I should create the WHOLE MAP before hand and draw only part of the map that is viewable. But that is where I get stuck. Any solution I come up with involves recreating the array or results in too many separate draw calls.</p>","507007","","44729","","2011-01-28 02:10:30","2011-01-28 02:10:30","Android opengles proper tiling","<android><opengl-es>","0","0","0","",""
"4823442","1","","","2011-01-28 00:12:06","13","7758","<p>I have a Preference activity which uses a List Preferences as defined by my XML file. How would I set the summary of the list activity to the value that is selected?</p><p>Thank you!</p>","439836","","","","","2014-01-22 15:00:51","Android List Preferences: have summary as selected value?","<java><android>","6","0","3","",""
"4823505","1","4823532","","2011-01-28 00:24:50","0","1758","<p>I am writing a small service in php to output a JSON string. The service is ultimately consumed by an Android JSONObject, if that helps. To keep it short, I have:</p><pre><code>&lt;?phpmysql_connect('localhost','myUser','myPwd') or die('Cannot connect to the DB');mysql_select_db('ctgscott_myDB') or die('Cannot select the DB');$query=mysql_query(""SELECT name FROM customers ORDER BY name ASC"");while($e=mysql_fetch_assoc($query))$output[]=$e;print(json_encode($output));    mysql_close();</code></pre><p>?></p><p>The problem is the output arrives in the form:</p><pre><code>[{""name"":""Client Number1""},{""name"":""Client Number2""}]</code></pre><p>'name' is the column header for the name field in the 'customer' table and it is unnecessary for me to repeat it... I am struggling to format the output like:</p><pre><code>{""name"":[""Client Number1"",""Client Number2""]}</code></pre><p>Any help would be greatly appreciated.  Thanks!</p>","593078","","593078","","2011-01-28 03:28:12","2011-02-17 07:08:00","formatting JSON array output via","<php><android><mysql><json>","2","0","","",""
"4823554","1","4823598","","2011-01-28 00:32:26","0","1134","<p>I have a fairly complex app -</p><p>The UI Activity launches a Service and sets up 2 way AIDL callbacks so the two can communicate.</p><p>The service runs forever (unless hits 'off' button in UI Activity).  </p><p>The problem is when the user exits the Activity, the Activity memory is not released.-The amount of memory used by my app is the same even if the UI Activity has been closed.-The heap still shows mapTiles and other UI crap on it even if the UI Activity has been closed.</p><p>So my guess is somehow the Service is holding references to the Activity.  I know the many articles warning about leaking the Activity Context.  The Service only references the Activity through a Weak Reference stored at Application scope. (a class that extends Application)</p><p>Is there any way to find what specifically is referencing the Activity?  The dominator tree shows mapTiles and ListView layouts eating all my memory... but I can't find the reference to the Activity which is keeping that stuff alive.</p><p>Also, <strong>is there a way to dump an HPROF heap dump thing if OutOfMemoryException occurs?</strong></p>","569246","","569246","","2011-01-28 00:54:52","2011-01-28 03:16:43","How to track down memory leak - Find living references","<android><memory-leaks><service><context><aidl>","2","0","","",""
"4823683","1","","","2011-01-28 00:51:08","0","3182","<p>I am new to Android and Java development.  I am trying to fill a list view using a string array.  I continue to get an error - The constructor ArrayAdapter(QuizMenuActivity, int, String[]) is undefined</p><p>Appreciate any help.  Code is posted below.</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.menu);         ListView menuList=(ListView) findViewById(R.id.ListView_Menu);    String [] items = new String[] { getResources().getString(R.string.menu_item_Play),            getResources().getString(R.string.menu_item_scores),            getResources().getString(R.string.menu_item_settings),            getResources().getString(R.string.menu_item_help)};    ArrayAdapter &lt;string&gt; adapt = new ArrayAdapter&lt;string&gt; (this,         R.layout.menu_item, items);    menuList.setAdapter(adapt)</code></pre>","593110","","750987","","2011-05-28 12:48:38","2012-03-13 11:46:24","Using string arrays to fill a list view in Android","<android><android-listview>","3","0","","",""
"4823721","1","4823815","","2011-01-28 00:56:32","5","3135","<p>I'm trying to create a 'fixed' time (midnight in 24 hour clock format, i.e., 00:00:00) to set as a string for a SQL SELECT query using the the following...</p><pre><code>SimpleDateFormat sdf = new SimpleDateFormat(""yyyy-MM-dd HH:mm:ss"");GregorianCalendar todayDate = new GregorianCalendar();Log.d(TAG, ""todayDate: "" + todayDate.getTime().toString());Log.d(TAG, ""formatted todayDate: "" + sdf.format(todayDate.getTime()));todayDate.clear(Calendar.HOUR);todayDate.clear(Calendar.MINUTE);todayDate.clear(Calendar.SECOND);todayDate.set(Calendar.HOUR, 0);todayDate.set(Calendar.MINUTE, 0);todayDate.set(Calendar.SECOND, 0);Log.d(TAG, ""formatted modified todayDate: "" + sdf.format(todayDate.getTime()));</code></pre><p>This is fine UNLESS the current time is PM. For example,</p><pre><code>todayDate: Fri Jan 28 23:34:34 GMT 2011formatted todayDate: 2011-01-28 23:34:34formatted modified todayDate: 2011-01-28 12:00:00 &lt;- THE hour is 12 not 00</code></pre><p>If I do this when the current time is between midnight and midday, (i.e., 00:00:00 -> 11:59:59 AM) then my hour in the formatted string is correctly set to 00. If I do it at any time after midday and before midnight then I get 12 for my hour and not 00.</p><p>Can anybody explain this and help me find a fix (or alternative way of doing things) please?</p>","488241","","","","","2011-01-28 01:11:57","GregorianCalendar / Calendar and setting the HOUR field oddity","<android><gregorian-calendar>","1","0","","",""
"4823851","1","4823934","","2011-01-28 01:18:05","7","5573","<p>In the app I've been working on, I would like to have a multiple-state (in my case, three) toggle button, instead of the two that <code>ToggleButton</code> provides. I've tried to start my own that extends <code>Button</code>, following the <code>CompoundButton</code> source, but quite honestly reading over its source got a bit overwhelming.</p><p>Is there a way to do a three-state toggle button using just a selector xml or something, or perhaps another method I haven't thought of? I'm rather at a loss of how to do this.</p>","551929","","1200","","2013-02-14 11:11:54","2014-01-29 15:04:54","Multi-State Toggle Button","<android><gui><button><togglebutton>","2","0","1","",""
"4823891","1","4824040","","2011-01-28 01:23:42","32","7145","<p>I'm currently developing some Android Apps in a team and we've used 2 different approaches during the last months (one that i personally prefere, and the other that the other developer prefers).</p><p>Although so far the results are the same, this got me wondering...should we: </p><ul><li>use AsyncTasks as private classes inside the Activities that use them. </li><li>or use AsyncTasks as separate public classes that receive the context of the activity</li></ul><p>Are any of the approachs recommended by Google? </p><p>What does your experience say about this (advantages, disadvantages, problems)?</p>","327011","","","","","2013-04-05 12:52:48","Android: AsyncTask recommendations: private class or public class?","<android><android-asynctask>","2","0","10","",""
"4823949","1","","","2011-01-28 01:33:47","0","207","<p>Users of my app are complaining that it is not saving state. I found out they are using task killers after finishing from the app. I know since Android 2.2 its ok. What can I implement to still save state in this scenario? Or are the task killers too brutally and we are unable to implement anything to mitigate this?</p>","583739","","","","","2011-01-29 04:07:28","Android Task Killers","<android><save><state><task>","2","2","","",""
"4823992","1","","","2011-01-28 01:42:08","12","29885","<p>I am trying to select an image file from the photo gallery and write to the sdcard. Below is the code that results in an exception.  It appears to throw this exception when trying to create the FileOutputStream.  I have the following line added to the manifest file nested inside the application element.  I can't find a solution to the problem:</p><p><code>&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;</code></p><pre><code>public boolean saveSelectedImage( Uri selectedImage, int imageGroup,        int imageNumber ){    boolean exception = false;    InputStream input = null;    OutputStream output = null;    if( externalStorageIsWritable() )    {        try        {            ContentResolver content = ctx.getContentResolver();            input = content.openInputStream( selectedImage );            if(input != null) Log.v( CLASS_NAME, ""Input Stream Opened successfully"");            File outFile = null;            File root = Environment.getExternalStorageDirectory(  );            if(root == null) Log.v(CLASS_NAME, ""FAILED TO RETRIEVE DIRECTORY"");            else Log.v(CLASS_NAME, ""ROOT DIRECTORY is:""+root.toString());            output = new FileOutputStream( root+""/Image""+ imageGroup + ""_"" + imageNumber + "".png"" );            if(output != null) Log.e( CLASS_NAME, ""Output Stream Opened successfully"");            //  output = new FileOutputStream            // (""/sdcard/Image""+imageGroup+""_""+imageNumber+"".png"");            byte[] buffer = new byte[1000];            int bytesRead = 0;            while ( ( bytesRead = input.read( buffer, 0, buffer.length ) ) &gt;= 0 )            {                output.write( buffer, 0, buffer.length );            }        } catch ( Exception e )        {            Log.e( CLASS_NAME, ""Exception occurred while moving image: "");            e.printStackTrace();            exception = true;        } finally        {            // if(input != null)input.close();            // if(output != null)output.close();            // if (exception ) return false;        }        return true;    } else        return false;}</code></pre>","593145","","593145","","2011-01-28 01:56:20","2013-03-07 18:35:24","java.io.FileNotFoundException (Permission denied) When trying to write to the Android sdcard","<android><permissions><sd-card><denied>","5","2","","",""
"4824068","1","4826575","","2011-01-28 01:54:27","0","510","<p>Hey all, so there is a rather small but annoying problem with the CountDownTimer.. Currently I have an interval set to 1000. And I am trying to detect the amount of milliseconds left in my </p><pre><code>onTick()</code></pre><p>method. So that I can use Text To Speech when there are 20 seconds left, 10 seconds left, etc. Well if I use:</p><pre><code>//Speak when 20 seconds leftif (millisUntilFinished == 20000) {    tts.speak(""You have 20 seconds left."", TextToSpeech.QUEUE_FLUSH, null);}</code></pre><p>The timer is not able to detect the 20000 milliseconds exactly.</p><p>So I have to resort to using:</p><pre><code>//Speak when 20 seconds leftif (millisUntilFinished &lt; 20999) {    if (millisUntilFinished &gt; 19999) {       tts.speak(""You have 20 seconds left."", TextToSpeech.QUEUE_FLUSH, null);     } }</code></pre><p>The problem with that is that sometimes the text to speech will come on twice during that interval. Is there any way to detect the milliseconds exactly so I dont have to use greater than or less than?</p>","533049","","168868","","2012-01-01 22:00:21","2013-06-12 23:32:36","How come millisUntilFinished cannot detect exact CountDownTimer intervals?","<android><text-to-speech>","3","1","","",""
"4824075","1","4862434","","2011-01-28 01:55:49","1","896","<p>I am writing a program that will encompass many thing but one being an interactive campus wide map.  Rather than rewriting the mapview for custom purposes and keeping in mind this style map is common for college campus's I've found webview to be nearly perfect to my plan of attack.</p><pre><code>final WebView myMapWebView = (WebView) findViewById(R.id.mapWebView);myMapWebView.getSettings().setJavaScriptEnabled(true);myMapWebView.setWebViewClient(new HelloWebViewClient(){});myMapWebView.loadUrl(""http://campusmaps.umn.edu/tc/campusviewer.html"");}private class HelloWebViewClient extends WebViewClient {    @Override    public boolean shouldOverrideUrlLoading(WebView view, String url) {        view.loadUrl(url);        return true;    }}</code></pre><p>This displays the loading bar the webpage shows as well, the header from the webpage (albeit scrunched) their navigation, compass, map location or what ever is at the bottom right of the map, and the radio buttons for map style but no map.  Anyone have any ideas on why this map is not loading into the webview?</p>","593154","","246246","","2012-05-13 07:29:07","2012-05-13 07:29:07","android webview displaying only partial webpage content","<javascript><android><html><android-webview><android-maps>","1","1","","",""
"4824084","1","4827614","","2011-01-28 01:57:29","0","413","<p>I want dismissDialog(ID) to be called whenever dialog is gone (disapears, get closed , ...), so it may happen when user press BACK button or any other scenario that may close the dialog.</p><p>which one is better approach? to call onCancelListener on dialog? or call OnKeyListener and assign <code>if (keyCode == KeyEvent.KEYCODE_BACK)// do smth</code></p><p>thanks.</p>","536853","","","","","2011-01-28 11:18:51","cancelListener vs keyListener","<android><dialog><keylistener>","2","0","","",""
"4824200","1","","","2011-01-28 02:16:44","0","2542","<p>New to Android, bad with layouts so this is probably a simple solution but I can't find it. I am adding an image to a ListView, the ListView is defined like this:</p><pre><code>&lt;ListView    android:id=""@+id/list""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""     android:layout_weight=""1""/&gt;</code></pre><p>Image is added like this:</p><pre><code>    ImageView image = new ImageView(context);    image.setScaleType(ImageView.ScaleType.FIT_CENTER);    image.setAdjustViewBounds(true);    image.setImageDrawable(drawable);    return image;</code></pre><p>in the ListAdapter. I want the Image to scale so the width fills the screen and the height adjust proportionally. What is happening is the image is scaling down so the height fills the list row but there is plenty of room for the width to be bigger. I had this working earlier but can't figure out what changed. Why is the image shrinking to some seemingly arbitrary height and how do I get it to fill the screen by width?</p><p>Edit:</p><p>So this happened when I started building for 1.6 instead of 1.5, probably a resolution thing. I guess the image is a bit sharper when it's small but I want it larger, it's almost unusable smaller and I am not able to get a larger image, it's from the web.</p>","79307","","79307","","2011-01-28 06:56:18","2011-01-28 10:02:41","android image view in list will not scale to width","<android><android-layout>","2","0","","",""
"4824235","1","4824324","","2011-01-28 02:25:03","0","2438","<p>I don't know the problem of my code.</p><p>Please help.</p><p>Password.java</p><pre><code>package com.android.steg;import android.app.Activity;import android.content.Intent;import android.content.SharedPreferences;import android.content.SharedPreferences.Editor;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;public class Password extends Activity implements OnClickListener{Button submitButton;EditText passwordEditText;public static final String PREFS_PRIVATE = ""PREFS_PRIVATE"";public static final String KEY_PRIVATE = ""KEY_PRIVATE"";public static final String PREFS_READ = ""PREFS_READ"";public static final String KEY_READ = ""KEY_READ"";public static final String PREFS_WRITE = ""PREFS_WRITE"";public static final String KEY_WRITE = ""KEY_WRITE"";public static final String PREFS_READ_WRITE = ""PREFS_READ_WRITE"";public static final String KEY_READ_WRITE = ""KEY_READ_WRITE"";public void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.pass);    Button submitButton = (Button) findViewById(R.id.submitButton);    submitButton.setOnClickListener(this);}public void onClick(View v){     EditText passwordEditText = (EditText) findViewById(R.id.passwordEditText);    SharedPreferences prefs = this.getApplicationContext().getSharedPreferences(""prefs_file"",MODE_PRIVATE);    String password = prefs.getString(""password"","""");    if("""".equals(password))    {        Editor edit = prefs.edit();        edit.putString(""password"",passwordEditText.getText().toString());        edit.commit();        StartMain();    }    else    {        if(passwordEditText.getText().toString().equals(password))        {             StartMain();        }    }}public void StartMain(){     Intent intent = new Intent(this, MainActivity.class);     startActivity(intent);}}</code></pre><p>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.android.steg""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""false"" android:testOnly=""false"" android:killAfterRestore=""true""&gt;    &lt;activity  android:name="".Password"" android:label=""@string/app_name"" android:clearTaskOnLaunch=""true""&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:exported=""true"" android:name="".EncodeActivity"" android:label=""@string/app_name""&gt;    &lt;/activity&gt;    &lt;activity android:exported=""true"" android:name="".DecodeActivity"" android:label=""@string/app_name""&gt;    &lt;/activity&gt;&lt;/application&gt;&lt;uses-sdk android:targetSdkVersion=""7"" android:minSdkVersion=""5""/&gt;&lt;uses-permission android:name=""android.permission.READ_CONTACTS"" /&gt;    &lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.WRITE_OWNER_DATA""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.READ_OWNER_DATA""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.CLEAR_APP_CACHE""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.CLEAR_APP_USER_DATA""&gt;&lt;/uses-permission&gt;   &lt;/manifest&gt; </code></pre><p>Pass.xml</p><p><img src=""http://i.stack.imgur.com/8SmwE.png"" alt=""enter image description here""></p><p>When the Submit button is pressed it should open the MainActivity.java</p><p>My problem is every time I pressed the Submit button the application forces to close. It should switch to another activity(MainActivity).</p>","516160","","516160","","2011-01-28 02:34:52","2011-01-28 02:40:53","Help with login activity using the sharedpreference","<android><eclipse><login><passwords><sharedpreferences>","1","5","","",""
"4824309","1","","","2011-01-28 02:38:12","0","196","<p>I am currently making a calendar app for android. I have this code that would display the day:</p><pre><code>for (int f = 0; f &lt; 7; ++f)       {      if (d &lt;= dom[mm])     { TextView v = new TextView(this); //Button v= (Button) findViewById(R.id.btn); // if you'll use button on display v.setText(Integer.toString(d)); row.addView(v, cellLp2); v.setOnClickListener(new View.OnClickListener()    {                  public void onClick(View v)        {         addEvents();                   }          });          row.setBackgroundColor(Color.rgb(2, 2, 2));        d++;      }      else      {        TextView btn = new TextView(this);          btn.setText("""");                 row.addView(btn, cellLp2);      }}</code></pre><p>My problem now is when I tried to get the value of the TextView/Button when clicked so that I can have the reference the day of the appointment to be stored into the DB, I am unable to do so. I cant use the getText() function. </p><p>I am stuck here for the moment. Can Anyone help me, please.</p>","584186","","445348","","2011-01-28 03:24:54","2011-01-28 03:24:54","Problem with TextView/Button in getting its value","<android><button><textview>","0","2","","",""
"4824446","1","","","2011-01-28 03:05:21","1","964","<p>I'm pretty new to Android development (especially UI aspects).  I'm trying to find a way to include a couple tabs in the header of my Activity.  I would like to put a logo image on the top left of the screen and two tabs to the right of the logo image.  The tabs contents are created from individual Activity's.  How can I go about doing this?</p><p>I have tried using a layout with the image on the left and the tabs on the right, but the result is the tab contents are only on the right of the screen (below the tabs and not the image).  I need the contents to use the full width of the screen, not just the space below the tabs.</p><p>I have researched creating custom tabs, but have only be able to find ways to customize the look and not the placement.  I need the tabs to be to the right of an image rather than take the full width of the screen.</p><p>The only idea I have is to create a custom class that extends ImageView and creates an image for the logo and two tabs.  If this is the best way to do it, how can I use an Activity for the tab contents?  It's easy to launch Activity's when using the standard Android tabs, but I'm not familiar with how to do it from a image.</p><p>Thanks in advance for any help.</p>","593202","","","","","2011-01-28 11:03:22","Android custom header with tabs","<android>","1","0","0","",""
"4824452","1","4824466","","2011-01-28 03:06:46","5","2379","<p>I've created an application which uses a shared preference in order for the user to login. The password of the user is saved in the preference. My problem is, how can I change the password in the preference if the user wants to change his/her password?</p>","516160","","","","","2011-01-28 03:08:50","How to change values in the shared preference","<java><android><eclipse><login><sharedpreferences>","1","0","","",""
"4824531","1","","","2011-01-28 03:20:35","17","41992","<p>I have the samsung galaxy tab, when I plug it into to eclipse to run and debug my apps. Eclipse doesn't recognize the device. When I try it with my friend's Droid 2 it still doesn't work. Can someone please help me?</p>","539282","","","","","2014-03-17 07:21:28","Eclipse Doesn't Recognize my Android Device","<eclipse><debugging><android>","16","3","5","",""
"4824585","1","4825181","","2011-01-28 03:32:27","1","667","<p>As the source of the ActivityThread class shows, it's a <code>final</code> class, and all the methods in this class is also <code>final</code>  methods. As the <code>final</code>  keyword definition in java, this class cannot be inherited, but why android developers keep those methods <code>final</code> ?</p><p>Maybe I didn't express the question clear, I fix it here.</p><p>ActivityThread is a <code>final</code>  class, it will not have any sub-class, and no method will be overridden, but you know that all the methods in this class is <code>final</code> , I want to know why they need these <code>final</code>  keywords, they can remove them with no impact.</p>","554788","","1129612","","2012-11-29 10:10:59","2012-11-29 10:10:59","A confuse about final keyword used in ActivityThread","<java><android><source-code><final>","2","0","","",""
"4824606","1","4841227","","2011-01-28 03:36:06","4","1310","<p>Just an interesting query here, is there a way to capture when a zoom animation sequence has ended when calling either:</p><pre><code>MapController.zoomIn() or MapController.zoomOut();</code></pre><p>I know that it does kick off an animation sequence to zoom in/out to the next level, however there is no known way I can find/google search, etc to find out when it finishes that sequence. I need to be able to run an update command when that is stopped so my map updates correctly.</p><p>I've found that by running the update command after calling the above function the Projection isn't from the zoom out level but somewhere inbetween (so I can't show all the data I need).</p>","593226","","244296","","2011-01-29 03:26:33","2011-01-31 13:38:40","How to capture the end of a Zoom In/Out animation from a MapController?","<android><zoom><android-mapview>","1","0","1","",""
"4824676","1","","","2011-01-28 03:52:25","0","9508","<p>I have an edit text. How can I make it non editable from the code. By giving  the tag <code>android:editable</code>  we can do in the layout.. But I need to do it in the code...Pls Help</p>","548218","","1765573","","2013-07-22 12:21:27","2013-07-22 12:21:27","Making not editable EditText component","<android><android-edittext>","4","0","","2013-02-16 23:08:40",""
"4824687","1","4824723","","2011-01-28 03:55:07","5","3439","<p>This is driving me crazy. I feel like I have tried everything and I get no results. How can I include a boolean conditional in a where clause in sql lite? </p><p>I have tried these</p><pre><code>""Select * from table where col = 1""""Select * from table where col = '1'""""Select * from table where col = true""""Select * from table where col = 'true'""""Select * from table where col = 'True'""""Select * from table where col is True""</code></pre><p>Nothing. I even tried including ""true"" as the whereArgs in a query function.</p><p>Anybody done this before?</p>","415422","","","","","2013-06-02 08:18:55","How to include a boolean in a sql lite where clause","<android><sqlite>","4","1","","",""
"4824739","1","","","2011-01-28 04:06:08","1","8304","<p>I want to store a timevalue in an SQLite database in Android.  My time value is in EditText, and when I click the save button I would like the time value to be stored in the database.  And also I want to review the already-stored value in the database.</p>","555910","","1001985","","2012-06-12 07:28:35","2012-06-12 07:28:35","how to store a time value in SQLite database in Android?","<android><sqlite>","2","2","1","",""
"4824875","1","","","2011-01-28 04:37:15","0","423","<p>Is this possible in Android, when i will say a name of place google map pointer will zoom to that place. i.e. I want to search Map by voiceif possible then how to do this? Though i have done so many apps in Google map, but din't try this before! Can any body help?</p>","489762","","1471203","","2013-01-09 11:10:47","2013-01-09 11:10:47","Android Google Map","<android>","3","0","","",""
"4825086","1","5845969","","2011-01-28 05:15:51","1","1037","<p>The documentation for HorizontalScrollView has the following:</p><blockquote>  <p>You should never use a  HorizontalScrollView with a ListView,  since ListView takes care of its own  scrolling. Most importantly, doing  this defeats all of the important  optimizations in ListView for dealing  with large lists, since it effectively  forces the ListView to display its  entire list of items to fill up the  infinite container supplied by  HorizontalScrollView.</p></blockquote><p>The reasoning here seems to apply to a (vertically scrolling) ScrollView, since ListView also scrolls vertically. But ScrollView doesn't have any such caveat. Did Google put this warning in the wrong class, or am I not understanding something?</p>","535871","","","","","2011-05-01 02:20:05","HorizontalScrollView with ListView--documentation bug?","<android><listview><scrollview><horizontalscrollview>","1","0","2","",""
"4825090","1","6771991","","2011-01-28 05:16:12","0","313","<p>I am trying to create the illusion of AI through automated clicking of buttons.</p><p>I know I can use the animation framework and use performClick on Button views, but can you recommend a way of adding a performClick() call into the animation sequence?</p><p>Thanks for any help you can give!</p>","354130","","","","","2011-07-21 06:13:32","Android animation and performClick to create Game AI","<android><gui><animation>","1","1","","",""
"4825140","1","4825166","","2011-01-28 05:27:14","0","797","<p>HI friends    I have edit text box with default value like to display to user like ""entername"". if user touch the edit box I want to clear the value of edittext box and show the virtual keypad to the user and if user press the enter key  only in edit text box  i have to start another activity how to do?</p><p>Hi in android:hint at the type of key pressing only it clear value I want to ontouh in edit text box clear value and show virtual keypad to user How to do?</p><p>Thanks</p>","426344","","426344","","2011-02-01 14:48:46","2011-02-01 14:48:46","edit text view problem","<android>","3","1","1","",""
"4825151","1","","","2011-01-28 05:28:33","0","326","<p>hii every buddy ,am not getting  how to load parsed data into an existing textview(existing layout) in android,insted of loading data to the new textview like how they r doing in the following tutorial(check the following link) </p><p><a href=""http://www.androidpeople.com/android-xml-parsing-tutorial-%E2%80%93-using-domparser/"" rel=""nofollow"">check this link for tutorial</a></p>","571256","","","","","2011-01-28 07:28:00","how to load parsed data into an existing textview(existing layout) in android","<android><parsing><textview>","3","0","1","",""
"4825214","1","","","2011-01-28 05:39:08","12","8700","<p>Thanks to <strong><em>Schermvlieger</em></strong> for asking <a href=""http://www.anddev.org/multimedia-problems-f28/optimal-use-of-bitmapfactory-options-insamplesize-for-speed-t11548.html#p36685"">this</a> question on <strong>anddev.org</strong>,  </p><p>I'm just copying his question to SO as nobody replied on the other site and I'm also facing the same problem.</p><p>I was wondering what would be the optimal use of <code>BitmapFactory.Options.inSampleSize</code> with regards to speed of displaying the image.<br>The documentation mentions using values that are a power of 2, so I am working with 2, 4, 8, 16 etc.  </p><p>The things I am wondering about are:  </p><ol><li>Should I resample down to the smallest size that is still larger than the screen resolution, or should I sample down to the size just enough to avoid an <code>OutOfMemoryError</code>?</li><li>How would one calculate the maximum size of an image that could still be displayed without running out of memory? Does the color-depth of the image play a role as well, and the depth of the display?</li><li>Is it efficient to display images via two mechanisms (<code>BitmapFactory</code> for large files, <code>setImageURI()</code> for smaller ones) I am using an <code>ImageSwitcher</code> by the way.</li><li>Would it help creating the <code>Bitmap</code>, <code>BitmapFactory.Options</code> and <code>inTempStorage</code> in the beginning of the application or creating them only on the fly, when needed?</li></ol>","477754","","383124","","2013-02-09 11:57:24","2013-02-14 06:51:46","Optimal use of BitmapFactory.Options.inSampleSize for speed","<android><bitmap><bitmapfactory>","3","0","3","",""
"4825232","1","4880165","","2011-01-28 05:42:25","2","3499","<p>At the moment it displays in a smaller window within the screen and makes most of the screen white. What I would like is for it to be stretched to fill the screen. Thanks for any help.</p>","569455","","569455","","2011-01-31 08:23:30","2011-02-02 21:39:26","How can I get my AIR (flash as3) app to display in full screen on Android?","<android><air><adobe>","1","0","2","",""
"4825256","1","4825336","","2011-01-28 05:48:20","1","347","<p>i have 6 edittext boxes i want to make a function for that 6 edittext boxes so that i can simply call that function instead of defining edittext boxes all the times. here is d code of edittext boxes ....</p><pre><code>TableLayout t1=(TableLayout)findViewById(R.id.table_layout01);                TableRow tr1=new TableRow(inventory.this);                tr1.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));                EditText ed6=new EditText(inventory.this);                ed6.setTextColor(Color.BLACK);                ed6.setText(""1"");                tr1.addView(ed6);                EditText ed7=new EditText(inventory.this);                ed7.setTextColor(Color.BLACK);                ed7.setText(""2"");                tr1.addView(ed7);                EditText ed8=new EditText(inventory.this);                ed8.setTextColor(Color.BLACK);                ed8.setText(""3"");                tr1.addView(ed8);.............(3 more edittext same like these)</code></pre>","591944","","473070","","2011-11-25 15:37:43","2011-11-25 15:37:43","i want to make function for 6 edittext boxes in android which includes all properties of edittext so that i can just simply call function","<java><android>","1","0","","",""
"4825319","1","","","2011-01-28 05:56:40","2","584","<p>I am doing project for Multimedia application in android technology.</p><p>First I will describe the process. whenever I click my installed apk it will show entire videos files from SD card, then by clicking any of the video file it will shows the video description with video thumbnails images. then by clicking thumbnail image it will play the video through my own multimedia application. </p><p>I finalized all the concept except to view the videos in thumbnails format. I will show the source-code which i used to view the thumbnail. </p><pre><code>Bitmap curThumb = MediaStore.Video.Thumbnails.getThumbnail(crThumb, imageID, MediaStore.Video.Thumbnails.MICRO_KIND, options);</code></pre><p>Here imageID is an integer, but I declared <code>getIntent().getStringExtra</code> for imageID in String varaible.    </p><p>can any one guide me how to access the thumbnail <code>ImageView</code> for video files?</p>","593348","","703851","","2011-09-13 12:41:15","2011-09-13 12:41:15","how to get Video Id in Android application","<android><video-thumbnails>","0","0","","",""
"4825353","1","4825429","","2011-01-28 06:04:50","2","239","<p>Hello allThanks for your previous replieshey i am unable to install the package Google API's, revision 2...whenevr i select the third party repository...all the add ons except Google API get selectedPlz help me out as i am working on a location based application....</p>","576605","","","","","2011-01-28 06:16:08","Why am i Unable to install packages for android","<android>","1","0","2","",""
"4825383","1","4826894","","2011-01-28 06:08:56","0","5023","<p>Can someone please provide a code to display GIF images in a webview ( I'm already able to display the same using frame animation of png images) Now I want a way to display the GIF images rather than loading the frames or drawing the images again and again!</p>","593319","","","","","2014-01-09 11:19:19","GIF Image display using WebView","<android><gif><android-webview>","3","0","2","",""
"4825398","1","4867603","","2011-01-28 06:11:40","1","1000","<p>I have an edittext and a listview in a linear layout.Suppose there are 5 results currently visible in the list out of total 10.When i scroll down from the edit text on to the listview, the 5th item in the listview(I suppose its always the last one) gets the focus,  instead of the first item! How should i solve this?</p>","340353","","","","","2011-02-01 20:28:15","The first item in listview does not gets the focus","<android>","1","0","1","",""
"4825399","1","4825448","","2011-01-28 06:11:59","2","192","<p>That's my codes for database</p><pre><code>public ArrayList&lt;SubCatInfo&gt; getSubCatByCatIdAndtypeName(int id,            String typeName) {ArrayList&lt;SubCatInfo&gt; list = new ArrayList&lt;SubCatInfo&gt;();        Cursor c = this.db.rawQuery(""SELECT * FROM "" + TB_SUBCAT                + "" WHERE cat_id='"" + id + "" AND typeName='"" + typeName,null);</code></pre><p>the logcat shows,</p><pre><code>01-28 12:28:46.693: ERROR/AndroidRuntime(260): Caused by: android.database.sqlite.SQLiteException: near ""1"": syntax error: , while compiling: SELECT * FROM tbl_subcategories WHERE cat_id='11 AND typeName='1</code></pre>","405219","","472375","","2011-01-28 06:16:01","2011-01-28 06:18:19","SQLite Error when try to get two fileds from database","<android><sqlite>","1","0","","",""
"4825427","1","13340542","","2011-01-28 06:15:41","2","3498","<p>According to this page, there are some encoders available in android framework:</p><p><a href=""http://developer.android.com/guide/appendix/media-formats.html"" rel=""nofollow"">http://developer.android.com/guide/appendix/media-formats.html</a></p><p>I'm interested in recording audio from mic and encoding it to AAC LC/LTP and AMR-WB, but I haven't found how to in the reference page.</p><p>Any pointer would be appreciated. Thanks in advance.</p><hr><p>Recently the reference page was updated:<a href=""http://developer.android.com/reference/android/media/MediaRecorder.AudioEncoder.html"" rel=""nofollow"">http://developer.android.com/reference/android/media/MediaRecorder.AudioEncoder.html</a></p><p>.. and it says that <code>MediaRecorder#setAudioEncoder(int)</code> with <code>MediaRecorder.AudioEncoder.AAC</code> and <code>MediaRecorder.AudioEncoder.AMR_WB</code> is the feature of API level 10.</p><p>So it looks like currently I have no devices to try with that. Sad.</p>","391106","","391106","","2011-02-11 13:45:55","2012-11-12 08:41:30","""Android Supported Media (Encoder) Format"" now includes AAC and AMR-WB, but how can we use them?","<android><audio><audio-recording><codec>","1","0","1","",""
"4825430","1","","","2011-01-28 06:16:09","0","163","<p>Sometime back I was working on XMPP protocol and implementing a chat messenger for Android, then I found a ambiguous condition in protocol, if i had not interpreted it incorrectly.</p><p>Actually there are two methods in Presence class(Presence class of XMPP protocol) to find out the status of your contact.isAvailable() and isAway();</p><p>Here are the definition of the methods:</p><blockquote>  <p>isAvailable():-<br>  Returns true if the presence type is available (online) and false if the user is unavailable (offline), or if this is a presence packet involved in a subscription operation. This is a convenience method equivalent to getType() == Presence.Type.available. Note that even when the user is available, their presence mode may be away, extended away or do not disturb. Use isAway() to determine if the user is away.</p>    <p>Returns:  true if the presence type is available.</p>    <p>isAway():-<br>  Returns true if the presence type is available and the presence mode is away, extended away, or do not disturb. False will be returned when the type or mode is any other value, including when the presence type is unavailable (offline). This is a convenience method equivalent to type == Type.available &amp;&amp; (mode == Mode.away || mode == Mode.xa || mode == Mode.dnd).</p>    <p>Returns:  true if the presence type is available and the presence mode is away, xa, or dnd.</p></blockquote><p>So my question is how to determine if an user is online but have explicitly set ""Invisible status""</p><p>In Gtalk also, there is no option for setting your status as invisible.(Gtalk uses same protocol).</p><p>Please correct me if I am interpreting something wrong.</p>","443387","","443387","","2011-01-28 06:57:04","2011-01-28 06:57:04","Is this ambiguous condition?","<java><android><xmpp>","0","3","","",""
"4825463","1","","","2011-01-28 06:20:21","0","996","<p>In my application I'm trying to display the list of videos in a list view in one <code>Activity</code> and I'm trying to display the thumbnail of selected video in another <code>Activity</code> for I got a code to display the thumbnail in <code>ImageView</code>,</p><pre><code>iv = (ImageView)findViewById(R.id.imagePreview);ContentResolver crThumb = getContentResolver();BitmapFactory.Options options=new BitmapFactory.Options();options.inSampleSize = 1;Bitmap curThumb = MediaStore.Video.Thumbnails.getThumbnail(crThumb, id, MediaStore.Video.Thumbnails.MICRO_KIND, options);iv.setScaleType(ScaleType.CENTER_CROP);iv.setImageBitmap(curThumb);</code></pre><p>in this it displays the thumbnail only if I specify a integer value for <code>id</code> in </p><pre><code>Bitmap curThumb = MediaStore.Video.Thumbnails.getThumbnail(crThumb, id, MediaStore.Video.Thumbnails.MICRO_KIND, options);</code></pre><p>but what I want is to get the <code>id</code> value for selected video so that I can display it new <code>Activity</code> as I wish.</p><p>Thanks.</p>","588901","","512958","","2011-01-28 10:40:40","2013-10-14 06:06:40","how to get unique ID of Video","<android>","2","0","","",""
"4825511","1","4825644","","2011-01-28 06:28:50","4","968","<p>I have 5 activities and the flow is like this </p><blockquote>  <p>1 ? 2 ? 3 ? 4 ? 5 </p></blockquote><p>at the 5th activity, upon pressing the back button, is it possible to get back to activity 2 or 3 wihtout finishing any activity? Currently I only get to the 4th one.</p>","487219","","1","","2011-01-28 08:12:41","2012-10-12 18:31:09","Android Activity","<android>","4","0","","",""
"4825519","1","","","2011-01-28 06:30:21","0","354","<p>i am developing an app which allows user to color the images.i have the color matrix of the color i want to apply,but the problem is instead of changing color of x y coordinates whole image gets colored.i don't know how to apply the colormatix to specified coordinates of the image.i am using </p><p>matrix = new float[] {                1, 0, 0, 0, 0,                0, 1, 0, 0, 0,                0, 0, 1, 0, 0,                0, 0, 0, 1, 0,        };</p><p>imageview.setColorFilter(new ColorMatrixColorFilter(matrix));</p><p>i am looking for something likeimageview.SetPixelColorMatrix(x,y,matrix);</p><p>can anyone help me?</p>","508309","","508309","","2011-01-28 09:02:39","2011-01-28 12:36:21","Changing colormatrix of x y co-ordinates of image","<android>","1","0","","",""
"4825545","1","4918226","","2011-01-28 06:34:06","0","728","<p>What happens in Android when an LTE attach happens? ConnectivityManager class tells about monitoring the network connections like, WIFI, UMTS etc. but not LTE. Also, it doesn't specifies a way to extract information from the Attach procedure that happens, it can be an LTE attach or a GPRS attach.When an attach procedure happens, a lot of information is passed to the mobile terminal, like the APNs, the proxy address etc. How do I extract that information to use in my application? </p>","138462","","","","","2011-02-07 05:07:49","LTE Attach procedure and android","<android><attach><gprs>","1","0","","",""
"4825607","1","4825730","","2011-01-28 06:46:00","4","6161","<p>I am developing an application in which i want to keep a track of that when an outgoing call ends.For example,If a mobile phone user dials a call and then i want to run a programming code when the call is ended.I want this only for outgoing calls.</p><p>Thanx</p>","548551","","","","","2011-01-28 07:05:02","Listener for Call end in Android","<android><call>","1","1","4","",""
"4825649","1","4825755","","2011-01-28 06:52:43","0","170","<p>Depending on webservice reponse i want to call activity.If response giving more list items then call activity1 ,if response giving only on list item call activity1.I want to decide this one in Home page only.Give me guidance?Presently iam using web service calling in activity1.But instead of that i want to use separate java(without activity)and depending on reponse calling suitable activity.Mean time i dont want to face any blank screen?Hope understand.Please help us.</p>","486216","","","","","2011-01-28 07:16:45","How to call activity dynamically depend on situation android?","<android><web-services>","1","0","","",""
"4825863","1","4825889","","2011-01-28 07:27:14","1","736","<p>I'm trying to create an Android application that reads the list of bookmarks from the built in Browser app. To access the ContentProvider, I need to have the <code>com.android.browser.permission.READ_HISTORY_BOOKMARKS</code> permission.</p><p>I'm deploying my application directly to my device using ADB. How do I grant this application the permission that I require?</p>","37481","","491044","","2011-05-13 09:31:16","2011-05-13 09:31:16","Granting permissions for ADB deployed applications in Android","<android><browser><permissions>","1","2","1","",""
"4825913","1","5344279","","2011-01-28 07:36:25","5","4975","<p>i am trying to put video as a live wallpaper.I am using media player for that. i can get SurfaceHolder and i can give that holder to the media player.But its not working for me, its giving me following exception</p><p><strong>LogCat Exception Detail</strong></p><pre><code>ERROR/AndroidRuntime(302): java.lang.UnsupportedOperationException: Wallpapers do not support keep screen on</code></pre><p>if i dont give holder to the media player it works, but i can hear only audio.I saw one application VideoLiveWallpaper , which set video as a live wallpaper, so it can be possible, may be i am missing something . I am pasting the code, any help on this will be appreciated.</p><p><strong>Code Snippet</strong></p><pre><code>public void surfaceCreated(SurfaceHolder holder) {  // TODO Auto-generated method stub holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);  mp=MediaPlayer.create(getApplicationContext(), R.raw.sample);  mp.setDisplay(holder);  mp.start(); }</code></pre>","593443","","1472665","","2012-07-15 05:19:49","2013-04-25 07:08:39","Android video as a live wallpaper","<android><live-wallpaper>","4","2","5","",""
"4825938","1","4827022","","2011-01-28 07:39:45","6","7880","<p>what is the difference between getHeight() and getLayoutParams().height of a view? I have a view (GoogleAdView) and I want to hide it, I set getLayoutParams().height to zero but the ad's height (ad.getHeight()) it's not zero. Is there a way to hide the view so that it doesn't occupy space in the lauout? I've tried to set it's visibility to GONE or to set ad.getLayoutParams().height to zero but this doesn't work.</p>","517558","","","","","2011-01-28 10:11:33","getHeight() vs getLayoutParams().height","<android><view><height>","2","0","2","",""
"4825952","1","4825977","","2011-01-28 07:42:10","0","163","<p>in my project i am able to render pdf and my problem is when i am opening a page and changing my orientation the application is crashing in the emulator and when  i check it on device it is opening the home page .can any boby suggest how to overcome the problem. Actually  when i open a page i want to see the same page when i change the orientation.thank you in advance..</p>","493244","","","","","2011-01-28 07:46:18","i cant see the output when i change my orientation on device in android","<android>","1","2","","",""
"4825995","1","4826551","","2011-01-28 07:48:39","1","1498","<p>I  have one service in which I am playing a song. Now I want to stop the song when i press volumn up and down button.</p><p>i used broadcast receiver also with the following code but it doesn't help me</p><p>if (intent.getAction().equals(Intent.ACTION_MEDIA_BUTTON)) {      player.stop();<br> }</p><p>please help me.</p><p>Thanks in advance     </p>","437833","","","","","2011-01-28 09:20:31","how to handle media button to stop a song?","<android>","2","0","","",""
"4826000","1","","","2011-01-28 07:49:26","0","220","<p>In my application, I need to post tweets, how can I do this? I have found a jar but it's constructor is deprecated.</p>","487219","","1267304","","2014-01-03 10:03:50","2014-01-03 10:03:50","How to tweet using Android app?","<android><twitter><tweets>","3","1","","",""
"4826076","1","4827057","","2011-01-28 08:00:43","1","1294","<p>Hi im new to android development in want to bind array dynamically to alertbox in android i use the following code :</p><pre><code>  //Return List of file in current directory from ftp//  String[] ListFile =  Utility.GetFileFromFtp(Type.Contacts);  AlertDialog.Builder builder1 = new AlertDialog.Builder(con);   builder1.setTitle(""Select file to Restore"");  builder1.setSingleChoiceItems(ListFile ,-1,new DialogInterface.OnClickListener() {     //@Override public void onClick(DialogInterface dialog, int which) {  // TODO Auto-generated method stub                   //Error Line//         Log.d(""FileName"",String.valueOf(ListFile[which]));      }     });      AlertDialog alert = builder1.create();        alert.setButton(""Ok"", OnClickListener);        alert.show();</code></pre><p>this code bind the list to alert box sucessfully .but when i attempt to get the filename which is selected by the user on onclick Event of the alertbox item</p><p>Code:</p><pre><code>public void onClick(DialogInterface dialog, int which) {                   //Error Line//         Log.d(""FileName"",String.valueOf(ListFile[which]));      }     });</code></pre><p>it give error that Error:</p><pre><code>Change the ListFile modifier to final</code></pre><p>When i change the modifier to final i cant assign list dynamically.i have no idea to resolve this issue,any help in this regard is greatlly appreciated.thanks in advance.</p>","575218","","437703","","2011-01-28 08:32:09","2011-01-28 10:15:40","How to dynamically bind list to Alert box in Android?","<android><alertdialog>","1","1","","",""
"4826090","1","4827026","","2011-01-28 08:02:41","0","667","<p>I've just finished Notepadv# tutorials. And then, I connect through console(adb shell) the 'data' file Notepadv3 tutorial. I tried something.</p><ol><li>Delete notes table, and re-run.<ul><li>Do not work.</li></ul></li><li>Delete data file(db file), and re-run.<ul><li>Work.</li></ul></li></ol><p>If you worked Notepadv# tutorials, you may know about some pre-processing in NotesDbAdapter class. At that code position, I found ""selecting db"" on constructor, ""creating table"" on onCreate method and ""update table"" on onUpgrade method.</p><p>By that method, database(file named data) create table when onCreate called after constructor. No way, that didn't work. Above 2 like-moron test caused by that nonsense. Does anyone drop the notes table on console? I can't find why create doesn't work.</p><p>ps - So sorry about stupid English.</p>","354289","","1228","","2013-08-13 14:31:59","2013-08-13 14:31:59","Does anyone ""DROP TABLE notes;"" on Android Notepadv3 Tutorial?","<android><notepad>","2","0","2","",""
"4826166","1","","","2011-01-28 08:16:22","2","3701","<p>A considerable amount of space is used up by .apk files on my phone with apps which cannot be moved to the sdcard (Adobe Flash and Google Maps). In those directories, there are .apk files. Can I delete these to save space and have the application work as it did before? </p>","436153","","","","","2013-10-26 07:57:25","Do I need to keep the .apk files on my android phone for app to continue working?","<android><flash><google-maps><mobile>","5","0","","",""
"4826230","1","4826517","","2011-01-28 08:26:25","2","280","<p>Hy!!</p><p>I make a new <code>Object</code> from a <code>Thread</code> Class. There is a Http-Post in the run method with a result string.</p><p>My Question:</p><p>How is it possible to notify the main class that the download finished?</p><p>MFG</p>","547995","","547995","","2011-01-28 08:35:02","2011-01-28 09:12:20","Logic Problem between Main Class and Thread Class","<java><android>","3","0","","",""
"4826242","1","4826718","","2011-01-28 08:27:48","2","2914","<p>When I say ""Direct Database Connection"", I meant to use JDBC alike driver to call and run a remote database query within the context of an activity just like using SQLite database to store the local parameters.</p><p>Until I realized that I could barely find any tutorials or documents over the internet regarding this way of database connection, I thought, regardless of the unstable Wi-Fi/3G network bore by most if not all android devices, to connect to a database should be done like so.</p><p>Even in android sdk, only local database access (a.k.a android.database.sqlite) is supported intrinsically. And it's stated in the description of <a href=""http://developer.android.com/reference/java/sql/package-descr.html"" rel=""nofollow"">java.sql</a> API that <b>you must provide your own JDBC driver</b> in order to use this API.</p><p>Then I started to realize if my intention of directly connecting a database is incorrectly in the first place in the realm of android.</p><p>I have read many books and wikis and forums including numerous answers provided in ""Stackflow"", it appears to me that many people are concentrating on getting something done, discussions used to start with ""How can I design a Restful web service for my android device"", however what I need is thorough understanding! And I also need authoritative citations from original android developers.</p><p>Could somebody provide me a fairly amount of insights on this matter?! Lots of thank you in advance!!</p>","593413","","","","","2011-01-28 09:40:31","Why is the paradigm of ""Direct Database Connection"" not welcomed by Android Platform?","<android><database><paradigms>","2","0","4","",""
"4826244","1","","","2011-01-28 08:28:24","4","16992","<p>I am using phonegap to build android apps.</p><p>I would like to detect the touch event from a user so I can pop-up an alert. However, how do I call the ontouch event from javascript?</p><p>Thanks!</p>","502963","","703019","","2012-03-04 10:13:46","2012-03-04 10:13:46","How to detect user touch with phonegap using JS","<javascript><android><touch><phonegap>","1","0","3","",""
"4826343","1","4826373","","2011-01-28 08:45:54","1","225","<p>I am just starting to learn Android Development. I have a method that loads an external XML file, and parses the data. How do I tell the caller that the data is parsed and ready? Should I and a callback argument to the method? Or should the caller register to listen to some kind of event, that I can fire when the data is ready?</p><p>A code example or links would be great.</p>","78782","","","","","2011-01-28 08:52:53","Should I use a callback or some kind of event in Android?","<android>","3","0","","",""
"4826407","1","4828878","","2011-01-28 08:55:23","6","12700","<p>This one is driving me to the brink of insanity!</p><p>I have an activity where I initialize a Button view with an onClickListener, like so:</p><pre><code>@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.myLayout);    mMyButton = (Button) findViewById(R.id.myButtonId);    mMyButton.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            showDialog(ID_MYDIALOG);        }    });}</code></pre><p>I have also written my own dialog builder class (a singleton) since I have several other Activity's in my application which will be using a common set of dialogs, hence in the <code>onCreateDialog(int id)</code> function for the given Activity I call:</p><pre><code>@Overrideprotected Dialog onCreateDialog(int id) {    Dialog dialog;    switch (id) {        case ID_MYDIALOG:            dialog = DialogBuilder.getInstance().getMyDialog(this, mUri, mListener);            break;        default:            dialog = null;            break;    }    return dialog;}</code></pre><p>The <code>mUri</code> and <code>mListener</code> variables are defined elsewhere and I have verified that they are valid. The relevant parts of the singleton <code>DialogBuilder</code> class looks like this:</p><pre><code>public AlertDialog getMyDialog(Context context, Uri uri, DialogInterface.OnClickListener listener) {    // Inflate the custom body for the AlertDialog.    LayoutInflater layoutInflater = LayoutInflater.from(context);    View view = layoutInflater.inflate(R.layout.myDialogBody, null);    // Get the data to show in the dialog.    Cursor cursor = context.getContentResolver().query(uri, null, null, null, null);    cursor.moveToFirst();    // Create a suitable data adapter and use it to populate the dialog body with data.    MyDialogDataAdapter adapter = new MyDialogDataAdapter(context, cursor);    // Populate the GridView in the dialog body with data.    GridView grid = (GridView) view.findViewById(R.id.myDialogDataGrid);    grid.setAdapter(adapter);    return new AlertDialog.Builder(context)    .setIcon(R.drawable.myDialogIcon)    .setTitle(R.string.myDialogTitle)    .setView(view)    .setPositiveButton(R.string.myDialogDone, listener)    .create();}</code></pre><p>Now, when I run my application and tap the button (i.e. <code>mMyButton</code>) I get the following exception stack trace:</p><pre><code>E/AndroidRuntime( 1247): FATAL EXCEPTION: mainE/AndroidRuntime( 1247): android.util.AndroidRuntimeException: requestFeature() must be called before adding contentE/AndroidRuntime( 1247):    at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:181)E/AndroidRuntime( 1247):    at com.android.internal.app.AlertController.installContent(AlertController.java:203)E/AndroidRuntime( 1247):    at android.app.AlertDialog.onCreate(AlertDialog.java:251)E/AndroidRuntime( 1247):    at android.app.Dialog.dispatchOnCreate(Dialog.java:307)E/AndroidRuntime( 1247):    at android.app.Activity.createDialog(Activity.java:886)E/AndroidRuntime( 1247):    at android.app.Activity.showDialog(Activity.java:2557)E/AndroidRuntime( 1247):    at android.app.Activity.showDialog(Activity.java:2524)E/AndroidRuntime( 1247):    at com.dbm.myApp.myActivity$4.onClick(myActivity.java:266)E/AndroidRuntime( 1247):    at android.view.View.performClick(View.java:2534)E/AndroidRuntime( 1247):    at android.view.View$PerformClick.run(View.java:9210)E/AndroidRuntime( 1247):    at android.os.Handler.handleCallback(Handler.java:587)E/AndroidRuntime( 1247):    at android.os.Handler.dispatchMessage(Handler.java:92)E/AndroidRuntime( 1247):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 1247):    at android.app.ActivityThread.main(ActivityThread.java:3652)E/AndroidRuntime( 1247):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 1247):    at java.lang.reflect.Method.invoke(Method.java:507)E/AndroidRuntime( 1247):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)E/AndroidRuntime( 1247):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)E/AndroidRuntime( 1247):    at dalvik.system.NativeStart.main(Native Method)W/ActivityManager(  212):   Force finishing activity com.dbm.myApp/.myActivity</code></pre><p>If I interpret the stack trace correctly the issue is triggered the very moment I tap my button (as of <code>com.dbm.myApp.myActivity$4.onClick(myActivity.java:266)</code> which is the exact <code>showDialog(ID_MYDIALOG);</code> line).</p><p><em>What do you, fellow Android developers say? What du you think is causing my problem?</em></p><p>It's fair to assume that the above code is valid, as per compilation and unit tests etc. The given code is, however, simplified and stripped to fit the forum, hence, please don't put an effort to comment the naming conventions etc.</p>","569885","","569885","","2011-01-28 10:01:37","2013-06-13 21:59:44","""android.util.AndroidRuntimeException: requestFeature() must be called before adding content"" on showDialog(dialogId)","<android><alertdialog>","3","3","3","",""
"4826465","1","","","2011-01-28 09:03:29","0","995","<p>i want to write an application for opening and displaying a dwg image on android using eclipse..for that i included the jdwglib jar in the the project.in this context,is reading a dwg file and diplaying a dwg file the same??also plz tell me wat should be done after including this library.</p><p>Thanks</p>","1081629","","","","","2011-01-28 09:10:04","dwg files:use of jdwglib","<android><eclipse><dwg>","1","0","","",""
"4826467","1","","","2011-01-28 09:03:41","1","1152","<p>I need to encrypt String &amp; send to sever which is in php.</p><p>Below you will find encryption code and function to encrypt it. </p><pre><code>define('SALT', 'whateveryouwant'); function encrypt($text) {         return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, SALT,$text, MCRYPT_MODE_ECB,mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB),MCRYPT_RAND)))); } function decrypt($text) {         return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, SALT,base64_decode($text), MCRYPT_MODE_ECB,mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB),MCRYPT_RAND))); } </code></pre><p>I tried out some classes in android but did not work at all.Anybody having idea about the functions or classes in android which support this functionality?</p><p>Thanks in Advance</p>","593526","","512958","","2011-01-28 09:08:05","2011-01-28 09:15:48","Encryption of string in Android SDK","<php><android>","1","0","","",""
"4826498","1","4832433","","2011-01-28 09:09:50","0","1730","<p>Is there any Voice recognition service that works in an offline mode (without intenet connectivity) for Samsung Galaxt tab?</p>","544631","","38029","","2011-01-28 09:12:39","2011-01-28 19:53:39","Voice Recognition for Galaxy Tab - Offline","<android><speech-recognition><voice-recognition>","2","0","2","",""
"4826503","1","","","2011-01-28 09:10:16","0","528","<p>i want to insert images in sdcard iam trying through command line adb push a.png/sdcard/a.png but its  not working ,even i cant see any sdcard in ddms</p>","584493","","21234","","2011-01-28 09:54:31","2012-06-22 05:53:06","cant push file in sdcard in android","<android><android-sdcard>","2","1","","",""
"4826562","1","4827276","","2011-01-28 09:18:04","1","670","<p>I have developed a Timer component. Currently the time is being display as follows:</p><p><img src=""http://i.stack.imgur.com/Dcu2O.png"" alt=""enter image description here""></p><p>I want to display the time in the following manner , better to say in that specific digital format. </p><p><img src=""http://i.stack.imgur.com/mSkDr.png"" alt=""enter image description here""></p><p>What changes should I make in the layout xml or what should be my approach.</p><p>Kindly provide your inputs.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2011-04-11 09:19:37","Display duration for Timer in the following format","<android>","3","0","","",""
"4826665","1","4826725","","2011-01-28 09:32:54","0","36","<p><img src=""http://i.stack.imgur.com/XjIPJ.jpg"" alt=""enter image description here"">Hi i want to display the barcodes in my application.Is there any predefined view for this one .How i want means </p>","479027","","","","","2011-01-28 09:40:56","how we display the barcodes in our design","<android>","1","0","","",""
"4826683","1","4826767","","2011-01-28 09:35:54","2","3048","<p>I was searching for a while but i couldn't  find the solution.</p><p>Situation:</p><p>I'm using a <code>ListView</code> and I have in a <code>Cursor</code> the result of a SQLiteDatabase.query.</p><ol><li><p>If I use a <code>SimpleCursorAdapter</code>, whenyou call <code>onItemClick(AdapterView&lt;?&gt;parent, View view, int position,long id)</code>, the <code>id</code> returned is the <code>_id</code>of the row of the given Cursor</p></li><li><p>but if I use a custom Adapter thereturn id works like an array[0,1,2,3], how can I set in thecustom Adapter this id?</p></li></ol><p>Thanks</p>","584249","","418183","","2011-01-28 09:40:37","2011-01-28 09:45:27","How to get the id of the row in onItemClick(ListView) when using a custom Adapter?","<android><listview><adapter>","1","0","1","",""
"4826754","1","4827051","","2011-01-28 09:43:51","1","929","<p>I am interested in any advice about special C-programming techniques for ARM-CPU targets using GCC with EABI. My applications contain floating-point intensive calculations on large data arrays. The major goal is to get the fastest executable. Mostly, I use codesourcery and android-ndk's arm-eabi-gcc versions. I also don't want to use neon-intrinsics or do any changes in C-code, which are incompatible with other compilers for other architectures (like Intel compiler for IA32).</p>","215571","","","","","2011-01-28 18:35:21","Is there any special C-level programming technique for ARM (EABI) architecture?","<android><c><gcc><arm><signal-processing>","4","2","2","",""
"4826759","1","","","2011-01-28 09:44:02","1","892","<p>Titanium.Network.online does not yield any result on android emulator, may I know what is wrong? I have added</p><pre><code>&lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE"" /&gt; &lt;uses-permission android:name=""android.permission.ACCESS_WIFI_STATE""/&gt;&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></pre><p>to tiapp.xmlBelow are my code. Thanks.</p><pre><code>$('#login').click(function(){  var email = $('#email').val();  var password = $('#password').val();  Titanium.App.fireEvent('loginNow', {e:email, p:password});  return false;});     Titanium.App.addEventListener('loginNow', function(data){if(!Titanium.Network.online){  Titanium.API.info('connection is not ok');}else{  Titanium.API.info('connection is ok');  var signingin = Titanium.UI.createActivityIndicator({    message: ""Signing in..""  });  signingin.show();}});</code></pre>","324850","","","","","2011-11-11 18:14:51","Titanium.Network.online is not working on android emulator","<javascript><android><titanium>","1","1","","",""
"4826793","1","","","2011-01-28 09:47:47","0","1596","<p>Hello I want to send a C2DM message. To receive the message I use the Chrome to Phone application which I download from <a href=""http://code.google.com/p/chrometophone/source/checkout"" rel=""nofollow"">http://code.google.com/p/chrometophone/source/checkout</a>There I change the sender id to another gmail id which I used to sign up this application (role account used for sending messages). And also get the auth token and registration id for the same mail id using the android code which I download from above. But when I am sending c2dm message using curl as shown below it return 401 error and says that Unauthorized. Can some one help me to pointing out where I am making wrong. </p><pre><code>curl --header ""Authorization: GoogleLogin auth=**authFromRegistrationAbove**"" ""https://android.apis.google.com/c2dm/send"" -d registration_id=**phoneRegistrationId(reciever)** -d ""data.message=Hello"" -d collapse_key=message -k</code></pre>","593564","","231917","","2011-01-28 20:28:41","2011-01-28 20:28:41","Send C2DM Message","<android><android-c2dm>","1","1","1","",""
"4826841","1","","","2011-01-28 09:53:50","0","604","<p>The picture below should be a shutter, the green area is the position of its blinds, the grey area should be hidden. The blinds expected to go up and down.</p><p>Currently I am scaling the blinds using scaleType=""centerCrop"" - but this is not the best option as it crops them on both sides - they should only be cropped from the bottom upwards.Another possible way is to place it behind a frame and change its position.. but I have no idea how to do that.</p><p>Can you help me?</p><p>Picture:<a href=""http://dl.dropbox.com/u/2243168/shutter.png"" rel=""nofollow"">http://dl.dropbox.com/u/2243168/shutter.png</a></p>","593529","","","","","2011-03-04 07:53:32","How to place an ImageView behind a frame or alternatively crop it?","<android><imageview><frame><crop>","0","3","","",""
"4826876","1","5901325","","2011-01-28 09:57:18","1","414","<p>I am developing an app (for both iphone &amp; android platforms). It's using the bump-api.</p><p>Now, does the end-user of my app need the bump app already installed on his/her device for my app (using the Bump API) to function properly?</p>","140693","","1003511","","2012-06-01 05:13:03","2012-06-01 05:13:03","Does a user who wants to use my app (which uses the Bump API) need to have Bump installed on their phone for my app to work?","<iphone><android><api><bump>","2","0","1","",""
"4826927","1","","","2011-01-28 10:02:12","0","3675","<p>I am doing application for multimedia. At present i am concentrating on volume control. Is there any possibilities to change the style of progress bar into volume control. (IE) it should be looks like VLC volume control. pls guide me. </p>","593610","","","","","2011-01-28 10:15:11","Android Progress Bar style","<android>","2","0","","",""
"4826938","1","","","2011-01-28 10:03:32","0","949","<p>I have created a PHP file with the following code that encodes/decodes a string:</p><pre><code>$key = ""D0QgiY8JYvx8qzKx0iaN8kwEJgwpEqAJ""; $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CFB), MCRYPT_RAND);function encrypt($key, $text, $iv) {    return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_CFB, $iv)));}function decrypt($key, $text, $iv) {     return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($text), MCRYPT_MODE_CFB, $iv));}$text = $_GET['text'];echo ""Plain Number : "" . $text . ""&lt;br&gt;&lt;br&gt;"";$encrypted = encrypt($key, $text, $iv);echo ""AES Number : "" . $encrypted . ""&lt;br&gt;&lt;br&gt;"";echo ""block size="";echo $block=mcrypt_get_block_size ( MCRYPT_RIJNDAEL_128,""cfb"" ); echo ""&lt;br/&gt;"".""IV="";   echo $ivValue =mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128,MCRYPT_MODE_CFB);echo ""&lt;br/&gt;"";echo ""Plain Number : "". decrypt($key,$encrypted, $iv) . ""&lt;br&gt;&lt;br&gt;"";</code></pre><p>I wish to do the same thing using the Android API's </p><pre><code>static String encryptString(final String RAWDATA, boolean ENCODE) { // This                  // was a                  // custom   Log.d(""TEST1"", iv.toString());   String encrypted = null;  byte[] encryptedBytes = null;  byte[] key;  key = AES_V1_KEY.getBytes();  //SecretKeySpec skeySpec = new SecretKeySpec(key, ""AES"");  // Instantiate the cipher  Cipher cipher = null;  try {   String input = Integer.toString(RAWDATA.length()) + '|' +RAWDATA;   KeyGenerator kgen = KeyGenerator.getInstance(KEY_ALGORITHM);   SecureRandom sr = SecureRandom.getInstance(""SHA1PRNG"");   sr.setSeed(key);    kgen.init(128, sr); // 192 and 256 bits may not be available   SecretKey skey = kgen.generateKey();      byte[] raw1 = skey.getEncoded();      SecretKeySpec skeySpec = new SecretKeySpec(raw1,KEY_ALGORITHM);   cipher = Cipher.getInstance(CIPHER_ALGORITHM);   cipher.init(Cipher.ENCRYPT_MODE, skeySpec,MyEnc1.ivParameterSpec);   //cipher.init(Cipher.ENCRYPT_MODE, MyEnc1.secretKeySpec,MyEnc1.ivParameterSpec);    // encryptedBytes = cipher.doFinal(nullPadString(input).getBytes());   encryptedBytes = cipher.doFinal(nullPadString(input).getBytes());  }catch(InvalidAlgorithmParameterException e){   Log.d(""error"",e.toString());  }   catch (NoSuchAlgorithmException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (NoSuchPaddingException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (InvalidKeyException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (IllegalBlockSizeException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (BadPaddingException e) {   // TODO Auto-generated catch block   e.printStackTrace();  }  encrypted = new String(encryptedBytes);  if (ENCODE)   encrypted = new String(Base64.encodeBytes(encryptedBytes));  else   encrypted = new String(encryptedBytes);  return encrypted;  // /return encrypted; }// method end</code></pre><p>Where the variables are:</p><pre><code> final static String AES_V1_KEY = ""D0QgiY8JYvx8qzKx0iaN8kwEJgwpEqAJ""; private static final String KEY_ALGORITHM = ""AES""; private static final String CIPHER_ALGORITHM = ""AES/CFB/NoPadding"";</code></pre><p>On the Android side encryption and decryption possible using its own API's.</p>","256612","","419","","2011-02-02 12:15:51","2011-02-02 12:15:51","PHP to Android encryption porting: AES in CFB mode","<php><android><aes>","0","2","","",""
"4826971","1","","","2011-01-28 10:06:29","0","185","<p>I m receiving broadcast in adnroid</p><pre><code>registerReceiver(new BroadcastReceiver(){  @Override  public void onReceive(Context context, Intent intent) {  }}</code></pre><p>in onReceive method I want the ID or number of particular device which receive my message..so how can I get particular device number??pleas help me </p>","593613","","308825","","2011-01-28 10:29:21","2011-05-06 21:59:23","broadcast receiver in android","<android>","1","0","","",""
"4826984","1","","","2011-01-28 10:07:26","1","728","<p>i want to make a breadcrumb for my android app.In breadcrumb on the left there is an imagebutton with arrow border. On the right there is a text title. When user tap on imagebutton, application performs specific task.</p><p>So, can you help me to create imagebutton with arrow border like in attach image?</p><p>Thank you.</p><p><img src=""http://i.stack.imgur.com/jhzQj.png"" alt=""My view""></p>","251434","","","","","2011-01-28 11:01:46","Imagebutton with arrow border","<android><button><view><imagebutton>","1","0","","",""
"4827106","1","4827219","","2011-01-28 10:20:59","1","2053","<p>I'm getting my feet wet regarding android programming so sorry if this is very simple.</p><p>My app widget consists of several dynamically added textviews, each of which launch the same activity with a varying index based on which one was clicked. Getting the correct index is what i'm having trouble with currently.</p><p>Below is the code i use to create the widget:</p><pre><code>public static String ListItemIndex = ""com.georgeduckett.helloworld.ScrollWidgetProvider.ListItemIndex"";@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {    final int N = appWidgetIds.length;    // Perform this loop procedure for each App Widget that belongs to this provider    for (int i=0; i&lt;N; i++) {        int appWidgetId = appWidgetIds[i];        RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.scroll_widget_layout);        // Create several views that will contain the content        for (int newviewindex = 1; newviewindex&lt;5; newviewindex++) {            // Create an Intent to launch WidgetActivity for when we're clicked on            Intent intent = new Intent(context, WidgetActivity.class);            Bundle bundle = new Bundle();            bundle.putInt(com.georgeduckett.helloworld.ScrollWidgetProvider.ListItemIndex, newviewindex);            intent.putExtras(bundle);            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);            PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);            RemoteViews SubItemView = new RemoteViews(context.getPackageName(), R.layout.scroll_widget_item_layout);            SubItemView.setTextViewText(R.id.textbox1, ""testing "" + newviewindex);            SubItemView.setOnClickPendingIntent(R.id.textbox1, pendingIntent);            views.addView(R.id.items_container, SubItemView);        }        // Tell the AppWidgetManager to perform an update on the current App Widget        appWidgetManager.updateAppWidget(appWidgetId, views);    }}</code></pre><p>And here is the activity code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Bundle bundle = getIntent().getExtras();    if(bundle != null) {        int Index = bundle.getInt(com.georgeduckett.helloworld.ScrollWidgetProvider.ListItemIndex);        Toast.makeText(this, Integer.toString(Index), Toast.LENGTH_LONG).show();    }    else    {        Toast.makeText(this, ""Boo!"", Toast.LENGTH_LONG).show();    }    setContentView(R.layout.main);}</code></pre><p>Currently what happens is no matter which one i click on i always get '1' popup, which either implies i'm always clicking on the first one, or it implies the wrong data is getting passed through.</p><p>I've looked all over the place for this one, but can't find any information other than a generic 'how to pass data' type tutorials/problems.</p>","593627","","","","","2011-01-28 10:34:17","Pass data from app widget to activity depending on textview clicked","<android><android-widget>","1","0","","",""
"4827110","1","","","2011-01-28 10:21:39","2","516","<p>I´m trying to play a video using a VideoView. The video plays fine on most devices, but when i run it on the HTC Hero or HTC Wildfire the video does not work. They´re not working in the stock Android mediaplayer either on those devices. </p><p>The video settings are 800x480 resolution, Codec: H264 - MPEG-4, framerate 25</p><p>Heres the Logcat erromessage: 01-28 10:34:48.950: ERROR/MediaPlayer(888): Error (1,-15)</p><p>Does anyone know if Hero/Wildfire have some limitations when it comes to playing 800x480 videos? </p><p>Preciate all your help :) </p><p>Daniel</p>","457401","","","","","2011-01-28 10:46:28","800x480 H264 video not working on some devices","<android><resolution><videoview><codec>","1","0","","",""
"4827168","1","4827286","","2011-01-28 10:29:09","3","9633","<p>Hi i have a webservice like this </p><p></p><pre><code>&lt;audio title=""Terry Waychuk Pure2010"" audio=""http://www.boodang.com/api/audio/**Terry_Waychuk**/Terry_Waychuk_Pure2010.mp3"" description=""Terry Waychuk Pure2010"" createddate = ""23-01-2011"" thumbnail=""http://www.boodang.com/api/thumb/boodean_logo.png"" /&gt;&lt;audio title=""Terry Waychuk frequency2010"" audio=""http://www.boodang.com/api/audio/**Terry_Waychuk**/Terry_Waychuk_frequency2010.mp3"" description=""Terry Waychuk frequency2010"" createddate = ""23-01-2011"" thumbnail=""http://www.boodang.com/api/thumb/boodean_logo.png"" /&gt;&lt;audio title=""The Grimey Tech RandomHero FlooRLayer Scooty OH Mazik Boodang 10 Year Anniversary Promo Mix"" audio=""http://www.boodang.com/api/audio/**The_Grimey_Tech**/The_Grimey_Tech_RandomHero_FlooRLayer_Scooty_OH_Mazik_Boodang_10_Year_Anniversary_Promo_Mix.mp3"" description=""The Grimey Tech RandomHero FlooRLayer Scooty OH Mazik Boodang 10 Year Anniversary Promo Mix"" createddate = ""23-01-2011"" thumbnail=""http://www.boodang.com/api/thumb/boodean_logo.png"" /&gt;&lt;audio title=""The Grimey Tech and Titus 1 Warper Warfare"" audio=""http://www.boodang.com/api/audio/**The_Grimey_Tech**/The_Grimey_Tech_and_Titus_1_Warper_Warfare.mp3"" description=""The Grimey Tech and Titus 1 Warper Warfare"" createddate = ""23-01-2011"" thumbnail=""http://www.boodang.com/api/thumb/boodean_logo.png"" /&gt;                                  .                                  .                                  .                                  .                                  .</code></pre><p>the first attributes have a mp3 file in same file name . the file name denoted in ** ** and next two also have a mp3 file in same file name.so i want to show a listview  according to file names.first i want show a listview  like this</p><pre><code> Terry_Waychuk The_Grimey_Tech</code></pre><p>after click on anyone of these then show a listview as mp3 file titles(that first two in Terry_Waychuk and next two in The_Grimey_Tech).  so please tell me how to get the particular name in attribute value  and also how to add that particular mp3 files to that folder(Terry_Waychuk or The_Grimey_Tech).</p>","745367","","","","","2011-01-28 10:42:02","how to parse the value in the attribute in xml parsing","<android><xml><parsing><listview>","1","0","5","",""
"4827245","1","4827291","","2011-01-28 10:36:32","0","577","<p>I am developing an app which allows users to color the images. I have the color matrix of the color I want to apply but the problem is instead of changing color of x y coordinates whole image gets colored. I don't know how to apply the colormatix to specified coordinates of the image. </p><p>I am using</p><pre><code>matrix =     new float[] { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, };imageview.setColorFilter(new ColorMatrixColorFilter(matrix));</code></pre><p>I am looking for something like <code>imageview.SetPixelColorMatrix(x,y,matrix)</code></p><p>Can anyone help me?</p>","437833","","418183","","2011-01-28 10:43:30","2011-01-28 10:43:30","How to change colormatrix x,y coordinate of image?","<android><imageview><colormatrix>","1","0","","",""
"4827295","1","","","2011-01-28 10:43:34","6","2672","<p>I am trying to display phonetic symbols in a <code>WebView</code>, but so far I am only getting squares.</p><p>For instance, for the word ""apostrophe"", this should be displayed:</p><blockquote>  <p>?'påstr?fi</p></blockquote><p>but all I am getting on the display is:</p><blockquote>  <p>??påstr?fi</p></blockquote><p>If it would help, I am getting the strings from an SQLite database. The string I retrieve has some HTML tags in it, so I use this:</p><pre><code>webView.loadDataWithBaseURL(""file:///android_asset/"",      article, ""text/html"", Encoding.UTF_8.toString(), null);</code></pre><p>where I have my CSS files in <code>/assets</code>. And the <code>article</code> variable contains some text enclosed in HTML tags.</p>","395576","","234780","","2011-01-28 11:09:55","2012-12-04 18:25:45","How can I show phonetic (IPA) symbols on Android","<android><unicode><encoding><webview><special-characters>","2","2","","",""
"4827311","1","","","2011-01-28 10:45:28","1","5170","<p>i have mobile website.. in this i need to detect mobile wap browser and its screen size or resolution.. so then my website b displayed accordingly.</p><p>so can any one help with detecting wap browser and screen size and also i would i like to know how can i open my website according to the screen size??</p><p>Thanks,Shivam Khare</p>","397868","","","","","2012-01-30 15:23:30","How to detect mobile wap browser and its screen size","<asp.net><iphone><android><mobile>","4","0","1","",""
"4827327","1","4827409","","2011-01-28 10:46:49","0","395","<p>I have a requirement where I have to specify a review rating (0 stars to 5 stars) This rating is shown as an <code>ImageView</code>. I understand that <code>StateListDrawable</code> can be used when there are two states in which a button/view exist (for instance a selected state and an idle state)</p><p>My question is if there is a way of including more states (in this case 6 states) and show the drawables accordingly.</p><p>Currently I can only do this - </p><pre><code>&lt;selector&gt;    &lt;item android:drawable=""@drawable/zerostars""          android:state_selected=""true""           android:background=""@color/tab_background_1"" /&gt;    &lt;item android:drawable=""@drawable/fivestars"" /&gt;&lt;/selector&gt;</code></pre><p>Any suggestions will be most helpful.</p>","579705","","418183","","2011-01-28 10:55:29","2011-01-28 10:55:29","More than two states using a StateListDrawable","<android><android-layout><imageview>","1","0","","",""
"4827343","1","","","2011-01-28 10:48:01","0","750","<p>Is it possible to specify the inquiry access code for remote devices during inquiry? By default the GIAC (general inquiry access code) is used, but my remote devices have dedicated inquiry access codes. I don't know the addresses of those devices, but they are discoverable. Is it possible to define DIAC code during scan?</p><p>Thanks!</p>","593660","","","","","2011-10-27 14:56:30","Bluetooth inquiry of devices with IAC (inquiry access code) set different than GIAC?","<android><bluetooth><scan>","1","1","","",""
"4827344","1","","","2011-01-28 10:48:05","40","42156","<p>I'm following this <a href=""http://www.anddev.org/parsing_xml_from_the_net_-_using_the_saxparser-t353.html"">tutorial</a>.</p><p>It works great but I would like it to return an array with all the strings instead of a single string with the last element.</p><p>Any ideas how to do this?</p>","557187","","1023248","","2012-07-20 04:49:39","2014-03-28 12:24:38","How to parse XML using the SAX parser","<java><android><xml><parsing><sax>","1","3","46","",""
"4827406","1","4827492","","2011-01-28 10:55:02","0","229","<p>i have extended View and override onDraw and onSizechanged so i can draw on the screen after i have the full height and width of the screen.But when i tried on my phone the imgs are slightly in different position than that i have defined.Also i have define actual values(in px) in my code and i think i can't use dip at least i don't know....</p><p>What can i do to make it seems the same on many screens,when i'm not using Layouts and i do it on code?</p>","587377","","","","","2011-01-28 11:03:31","custom View Display problem on different android screens","<android><view><screens>","1","0","","",""
"4827452","1","4827498","","2011-01-28 10:59:24","0","784","<p>I have an arraylist. I get this arraylist from another activity with using <code>Bundle</code> like that :</p><pre><code>Bundle name = getIntent().getExtras();ArrayList&lt;String&gt; namevalue = name.getStringArrayList(""name""); </code></pre><p>I want to use same arraylist in a different class. But i can't get with using <code>getIntent()</code> method becoz of my class is not an activity. Is there a way to pass this arraylist? </p>","590757","","","","","2011-01-28 11:04:13","How to pass an activity intent to another class?","<java><android><activity>","2","1","","",""
"4827454","1","4827471","","2011-01-28 10:59:26","0","6064","<p>I am baffled by eclipse. I had a working android application which i created inside eclipse. I now have come back to the application after a week and it is saying in the last java files there are hundreds of issue. I am sure there is no programming error inside the files as they worked one week ago. I think it may be a build path issue...i was wondering has anybody else come across this issue and why does it occur??</p><p>Several of my other projects also say the last file has errors which i know they dont.</p><p>Why is eclipse doing this to me?Where should the build path point?  </p><p>Under Java build path-> libraries..it says...unable to get system library for project?</p>","569654","","","","","2012-09-02 15:13:40","Android Build Path issue?","<android><eclipse>","3","1","","",""
"4827456","1","","","2011-01-28 10:59:38","1","6811","<p>How can we reduce the size of checkbox? Please give me an idea.</p>","432559","","1777090","","2012-12-07 09:45:51","2012-12-07 13:44:28","how can we reduce the size of checkbox please give me an idea","<android><android-checkbox>","5","2","1","",""
"4827565","1","","","2011-01-28 11:13:06","2","555","<p>In Ginger-bread  new feature is added like <code>native-activity</code>.</p><p><code>Native-activity</code> has its own life-cycle.</p><p>Is there any feasibility  to draw our own button and to take the event outfor performing action in the native code itself.As per example given by androiddeveloper site  -which is based on animation using OpenGL is working fine.But I wantwhat type of further experiment can be done.</p>","593701","","881286","","2013-08-18 02:13:17","2013-08-18 02:13:17","About native-activity in android","<android>","0","0","1","",""
"4827643","1","4828188","","2011-01-28 11:21:45","2","584","<p>i have several html pages at sqlite3 which are connect with specific id. how can i dynamically load html from sqlite at runtime ?<img src=""http://i.stack.imgur.com/K2Ynh.png"" alt=""enter image description here""></p>","405219","","405219","","2011-01-28 11:34:50","2011-01-28 12:26:45","how to load html file from sqlite3?","<android><html><sqlite3><webview>","2","3","1","",""
"4827654","1","4837060","","2011-01-28 11:22:48","3","815","<p>I am using andengine in my android app.<br>I plan to use animation in my view along with some native widgets embedded in some view.<br>Is it possible to do it? Can anybody please provide any sample code?  </p>","296257","","417685","","2013-03-07 12:39:27","2013-03-07 12:39:27","Andengine in android app","<android><andengine>","1","0","2","",""
"4827672","1","","","2011-01-28 11:25:06","-1","708","<p>how to build apk for production ?</p>","487219","","","","","2011-01-28 11:27:54","Android build apk","<android>","2","2","","2012-08-17 13:54:44",""
"4827717","1","","","2011-01-28 11:30:41","1","2565","<p>I'm not very experiensed in android specific components, so i just can't get where i need to look</p><p>I have three activities: </p><p>1st gets info about some groups of objects, user selects some of this groups and activity needs to star next activity</p><p>2nd activity shows all objects from groups, that user selected at previous activity, here user can deselect some selected objects and then activity starts 3d activity</p><p>3d activity allows user to do something with selected objects</p><p>My solution is make some singleton model, that let activities get and save information about objects, </p><p>but i suppose, that android has some special components to provide data between activities</p><p>Help me to find this components^ please</p>","564272","","","","","2011-01-28 19:43:41","Working with same data in three activities","<android><data><activity>","5","0","6","",""
"4827725","1","","","2011-01-28 11:31:55","0","453","<p>I am trying to create my own video recording app for android. With lot of googling, I can get it into ""working"" state, but then I haven't time for three weeks and when I returned, the app is crashing on startup. Probably I made some changes before I suspend my work and not tested them, but now I can't find, what is wrong. I know the line, where it is crashing (highlighted in source).</p><p>here are files:</p><p>main.java:             pastebin.com/8iAQhKN1</p><p>CamcorderPreview.java: pastebin.com/C5KSfZHB (here is highlighted crashing code)</p><p>AndroidManifest.xml:   pastebin.com/q46JS0VB</p><p>layout/main.xml:       pastebin.com/icK9MDb3</p><p>values/strings.xml:    pastebin.com/mntQgwaX</p><p>logcat:                pastebin.com/yQ5MSTx7</p><p>(sorry for not links, but as new user, I can post one hyperlink at maximum)</p>","1023519","","1023519","","2011-01-29 17:08:50","2011-01-29 17:08:50","android video recording app - crashing","<android><video><recording>","0","2","","",""
"4827759","1","4828453","","2011-01-28 11:35:34","0","1640","<p>I'm trying to use setText to show different text within the same layout everytime someone clicks a different picture.So all the layout files stay the same the only thing that needs to change is the android:text in that layout.</p><p>I've created a class with case statement for when someone presses on a picture and then call setText().</p><p>But it looks like the setText isn't even called. because I can see my Log.v that is called within the same case statement but the text doesn't change.</p><p>PictureInfo.java</p><pre><code>public class PictureInfo extends Activity implements OnClickListener {        private static final String TAG = ""Popup"";        public TextView infoText;        /** Called when the activity is first created. */        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);            final LayoutInflater  inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);            infoText = (TextView)inflater.inflate(R.layout.information, null);            View a1Button = findViewById(R.id.a1);            a1Button.setOnClickListener(this);        }        @Override        public void onClick(View v)            {                switch(v.getId())                {                    case R.id.a1:                    Intent a = new Intent(this, Information.class);                    startActivity(a);                    Log.v(TAG, ""Change setText"");                    infoText.setText(R.string.a2_text);                    break;                }            }    }</code></pre><p>information.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/information_content""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:text=""@string/a1_text""      /&gt;</code></pre>","560609","","","","","2011-01-28 12:56:56","Android setText() Different Layout File","<android>","2","3","","",""
"4827828","1","","","2011-01-28 11:44:32","1","551","<p>I'm making an android application in eclipse, but I got some issues with the spinners. First of all I would like my spinner to start on no target at all. You see when I start the application the spinner already have the first item in my list selected, and I don't like that. My second issue is that I would like to link specific targets on my list to different url website, don't know really how to do that. </p><p>something like:</p><pre><code>if item &lt;item&gt;""xxxx""&lt;/item&gt; is selected    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(""http://google.com"")));""</code></pre>","593753","","180538","","2011-01-28 11:47:24","2011-01-28 12:46:30","Android Spinner Help","<android><eclipse><sdk><spinner>","1","0","","",""
"4827848","1","4872008","","2011-01-28 11:47:25","3","1387","<p>Ok, here's the deal. I want to move items in my extended gallery class to change the order of images. The way i'm doing it now:</p><ul><li>on long press remove the current selected item,</li><li>use <code>onDraw()</code> to draw the same image so i can move it around using <code>onTouchEvent()</code></li><li>on release add the item again</li></ul><p>This works fine but the problem is that when using the <code>onDraw()</code> method it will draw the image behind the gallery items. Is there a way to change the priority of what is drawn?</p>","571088","","","","","2014-03-17 12:18:19","onDraw() on View draws behind the layout","<android><gallery><ondraw>","1","2","2","",""
"4827947","1","","","2011-01-28 11:58:55","1","3253","<p>I am developing an little OpenGL Activity, it's composed by this layout:</p><pre><code>&lt;RelativeLayout                  android:id=""@+id/vt_layout_opengl""                android:orientation=""horizontal""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:visibility=""gone""        &gt;            &lt;android.opengl.GLSurfaceView                    android:id=""@+id/surface_vt""                    android:layout_width=""900dp""                     android:layout_height=""285dp""            /&gt;               &lt;RelativeLayout                    android:layout_width=""fill_parent""                     android:layout_height=""fill_parent""                    android:layout_below=""@id/surface_vt""                    android:layout_marginTop=""5dp""                    android:background=""@drawable/barra_menu_vt""                  &gt;                    &lt;ImageButton android:id=""@+id/vt_left_arrow""                                  android:layout_width=""wrap_content""                                  android:layout_height=""wrap_content""                                 android:layout_alignParentLeft=""true""                                 android:layout_marginLeft=""20dp""                                 android:background=""@drawable/prev_a""                                 android:onClick=""prec""                    /&gt;                    &lt;ImageButton android:id=""@+id/vt_right_arrow""                                  android:layout_width=""wrap_content""                                  android:layout_height=""wrap_content""                                 android:background=""@drawable/next_a""                                 android:layout_toRightOf=""@+id/vt_left_arrow""                                 android:layout_marginLeft=""20dp""                                 android:onClick=""next""                    /&gt;                    &lt;TextView                        android:id=""@+id/vt_description""                         android:layout_width=""wrap_content""                         android:layout_height=""wrap_content""                        android:layout_toRightOf=""@+id/vt_right_arrow""                        android:layout_marginLeft=""30dp""                        android:maxLength=""30""                        android:singleLine=""true""                        android:ellipsize=""marquee""                    /&gt;                    &lt;ImageButton android:id=""@+id/vt_information""                                  android:layout_width=""wrap_content""                                  android:layout_height=""wrap_content""                                 android:layout_toLeftOf=""@+id/vt_addbookmarks""                                 android:layout_marginRight=""20dp""                                 android:background=""@drawable/info_a""                                 android:onClick=""info""                    /&gt;                    &lt;ImageButton android:id=""@+id/vt_addbookmarks""                                  android:layout_width=""wrap_content""                                  android:layout_height=""wrap_content""                                 android:layout_toLeftOf=""@+id/vt_preferences""                                 android:layout_marginRight=""20dp""                                 android:background=""@drawable/book_a""                                 android:onClick=""bookmark""                    /&gt;                    &lt;ImageButton android:id=""@+id/vt_preferences""                                  android:layout_width=""wrap_content""                                  android:layout_height=""wrap_content""                                 android:layout_alignParentRight=""true""                                 android:layout_marginRight=""20dp""                                 android:background=""@drawable/sett_a""                                 android:onClick=""settings""                    /&gt;                &lt;/RelativeLayout&gt;        &lt;/RelativeLayout&gt;</code></pre><p>It's shows an View like  this:</p><p><img src=""http://i.stack.imgur.com/eUUhV.png"" alt=""enter image description here""></p><p>But when I press the home button and I return on my application I can see only a black screen, the GLSurfaceView and also the RelativeLayout are not displayed!!</p><p>After about two minuts system say:<img src=""http://i.stack.imgur.com/VlLaF.png"" alt=""enter image description here""></p><p>I am very frustrating, I call GLSurface onPause() and onResume() when my Activity calls the corresponding methods.</p><p>Someone can help me!!????</p><p>I post some of my code:</p><pre><code>@Override    public void onCreate(Bundle savedInstanceState) {    Log.d(TAG,""onCreate()"");        super.onCreate(savedInstanceState);        setContentView(R.layout.virtualtour);        loading_ly = (RelativeLayout) findViewById(R.id.vt_layout_loading);        panorama_description = (TextView) findViewById(R.id.vt_description);        virtualtour_relatively = (RelativeLayout) findViewById(R.id.vt_layout_opengl);        vt_handler = new VirtualTourHandler(this);        ext_container = new GLExtensionContainer();        th_checkGL = new ThreadCheckOpenGL(ext_container, extensions_requested,vt_handler);       th_checkGL.start();        mFacebook = new Facebook(ArounderTouchMainActivity.APP_ID);        mAsyncRunner = new AsyncFacebookRunner(mFacebook);        msg = vt_handler.obtainMessage();        output_thread =  msg.getData();        output_thread.putInt(VirtualTour.TYPE_TAG, VirtualTour.START_TAG);        vt_handler.handleMessage(msg);      }</code></pre><p>This is my Handler inner class (I use it for switch texture when users performs some action)</p><pre><code>@Override        public void handleMessage(Message msg) {            bd = msg.getData();            type = bd.getInt(TYPE_TAG);            bd = msg.getData();            switch (type) {                case GL_EXTENSIONS_CHECK_TAG:                    showDialog(GL_EXTENSIONS_CHECK_DIALOG);                    break;                case START_TAG:                    Log.d(TAG, ""START_TAG"");                    loading_ly.setVisibility(View.VISIBLE);                    virtualtour_relatively.setVisibility(View.GONE);                    progress_bar.setProgress(0);                    thread = new DownloadImageProgressBar(vt_handler,getActivity());                    thread.execute(panorama_input.get(position).getUrl_virtual());                    break;                case BAR_TAG:                    progress = bd.getInt(PROGRESS_TAG);                    if(progress &lt;= 100)                        progress_bar.setProgress(progress);                    break;                case SHUTDOWN_TAG:                    finish();                    break;                case SHOW_TAG:                Log.d(TAG, ""SHOW_TAG"");                if(first_visualization){                    glSurface = (GLSurfaceView) findViewById(R.id.surface_vt);                    glSurface.setDebugFlags(GLSurfaceView.DEBUG_CHECK_GL_ERROR);                    renderer = new OpenGLRenderer(first_data,second_data,sphere,vt_handler,ext_container, ( (panorama_input.get(position)).getType().compareTo(CardImage.SPHERE) == 0));                    glSurface.setRenderer(renderer);                    first_visualization = false;                }                // potrebbe essere fatto molto meglio: ricorda!                 panorama_description.setText(panorama_input.get(position).getTitolo());                loading_ly.setVisibility(View.GONE);                virtualtour_relatively.setVisibility(View.VISIBLE);                renderer.setImage(first_data, second_data,( (panorama_input.get(position)).getType().compareTo(CardImage.SPHERE) == 0));                renderer.resetZoom();                renderer.resetAngle();                renderer.startTimer();                  enable_touch = false;                case NOCONNECTION_ERROR_TAG:                    showDialog(OUTOFMEMORY_ERROR_DIALOG);                    break;                case OUTOFMEMORY_ERROR_TAG:                    showDialog(OUTOFMEMORY_ERROR_DIALOG);                    break;                default:                    break;            }            return;        }    }</code></pre><p>The DownloadImageProgressBar is a AsyncTask which downloads images from the web and performs  some UI actions through the Activity Handler.</p><p>There are my onPause and onResume methods:</p><pre><code> @Overrideprotected void onResume() {    Log.d(TAG,""onResume()"");    super.onResume();    if(glSurface != null)        glSurface.onResume();}   @Overrideprotected void onPause() {     Log.d(TAG,""onPause()"");        super.onPause();     glSurface.onPause();}</code></pre><p>I call this methods in onSurfaceChanged and onSurfaceCreated:</p><pre><code>public void setGLTexture(GL10 gl10) {        GL11 gl = (GL11) gl10;        //Generate one texture pointer...        gl.glGenTextures(2, textures_id);        gl.glClearColor(0.2f, 0.2f, 0.2f, 1.0f);        //...and bind it to our array        gl.glBindTexture(GL10.GL_TEXTURE_2D, textures_id.get(0));        gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);        gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);        gl.glTexParameterf( GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE );        gl.glTexParameterf( GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE );        GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, first, 0);        gl.glBindTexture(GL10.GL_TEXTURE_2D, textures_id.get(1));        gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);        gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);        gl.glTexParameterf( GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE );        gl.glTexParameterf( GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE );        GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, second, 0);        return;    }</code></pre><p>I have another question, when my activity switch in background the textures images I downloaded before are deleted?</p><p>It's possible that this is the issues?</p>","554892","","554892","","2011-01-28 14:59:42","2011-01-28 14:59:42","GLSurfaceView onPause shows only a black screen","<android><opengl-es>","1","1","1","",""
"4828116","1","4828294","","2011-01-28 12:17:49","0","313","<p>HY!!</p><p>I have a Json class, so i will parse in the constructor the json string to JSonObject.</p><pre><code>    public class JSONParse extends JSONObject  {        public JSONParse(string json) {//pseudo code        this.obj = new JSONObject(EntityUtils.toString(json));        }    }</code></pre><p>please help</p>","547995","","547995","","2011-01-28 12:24:22","2011-01-28 12:37:55","Parsing string to Json in the Constructor","<java><android>","2","3","","",""
"4828198","1","","","2011-01-28 12:27:50","1","1248","<p>what I'm trying to do is make a selection from a spinner in android and then whatever is selected to be added to an edittext box.  The code I have so far is this...</p><pre><code>spinner.setOnItemSelectedListener(          new OnItemSelectedListener() {     public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {      edittext.setText("""");     }     public void onNothingSelected(AdapterView&lt;?&gt; arg0) {      // TODO Auto-generated method stub     }              //add some code here          }      );</code></pre><p>Problem is this seems to be run even before the spinner is selected so it always sets my edittext to """".  Ideally I would like to have it set the text to the selection made in the spinner.  So, anyone have any ideas?</p>","590490","","544512","","2011-06-21 10:13:35","2011-06-21 10:13:35","Android - How to add selection from Spinner to EditText","<android><android-layout>","2","0","","",""
"4828209","1","4861435","","2011-01-28 12:29:06","0","573","<p>How do I get the current Alpha/Opacity of Layout? I want the from of my AlphaAnimation to be the current alpha so it doesn't flicker between my fade in and fade out calls. </p>","553462","","","","","2011-02-01 10:30:02","Get Alpha/Opacity of Layout","<java><android><user-interface>","2","0","","",""
"4828218","1","4828392","","2011-01-28 12:29:51","0","854","<p>I am working on the Android web base Application. In my application, I am call the web services, parse it and show the parsed data on my view. The data contain text and images. My problem is when i am moving first screen to second screen(in second screen there is a xml data which is display the images and text and it has large number of data, near about 100). But when i am clicking on move button there is a blank screen appear till that xml data is loaded on view and then display the second screen.         I want to show the progress dialog on that screen till load all the data. So please help me....</p>","387466","","","","","2011-01-28 12:58:57","How to avoid the occurence of blank screen between two Activities in Android","<android>","1","0","","",""
"4828245","1","4829495","","2011-01-28 12:33:15","2","1281","<p>i have created an app with maps.i have followed every step as i have found from the web,i have got the key and the app is working excellent on the emulator and i can see the maps.But as i load the singned apk to my mobile the map is not showing...:(..any idea?</p>","519526","","","","","2011-02-16 13:59:17","Problem on loading maps from the apk","<android><map>","2","0","2","",""
"4828324","1","4828655","","2011-01-28 12:41:38","3","2106","<p>I am having a problem with the Alarmmanager functions for the Android. </p><p>The problem is alarms that have over an hour or so to wait fail to go off.</p><p>My application initially creates an alarm like so:-</p><pre><code>PendingIntent sender = PendingIntent.getBroadcast(this, 192837, intent, PendingIntent.FLAG_UPDATE_CURRENT);AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);             am.set(AlarmManager.RTC_WAKEUP, mCal.getTimeInMillis(), sender);</code></pre><p>When the alarm goes off it triggers my RecieverHandler class, specifically this function:-</p><pre><code>public void onReceive(Context context, Intent intent)     {        try {             Bundle bundle = intent.getExtras();             Intent newIntent = new Intent(context, MessageDispatcher.class);             newIntent.putExtras(bundle);            // newIntent.addFlags(Intent.FLAG);             context.startService(newIntent);            } catch (Exception e) {             Toast.makeText(context, ""There was an error somewhere, but we still received an alarm"", Toast.LENGTH_SHORT).show();             e.printStackTrace();            }    }</code></pre><p>This then launches a service by the name of MessageDispatcher and this function is called:-</p><pre><code>public int onStartCommand(Intent intent, int flags, int startId)</code></pre><p>This function gets the next alarm time from my Database, this I am sure is working correctly, it then sets a new alarm based on the date from the database like so:-</p><pre><code>PendingIntent sender = PendingIntent.getBroadcast(this, 192837, newIntent, PendingIntent.FLAG_UPDATE_CURRENT);    AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);        am.set(AlarmManager.RTC_WAKEUP, mCal.getSendAt().getTimeInMillis(), sender);</code></pre><p>This creates the alarm for the next message.</p><p>I have tested this over a short amount of time and it appears to work and have tested it over large amounts of time by changing my date and time within the phone. It appears to fire off successfully.</p><p>Then when this alarm goes off it gets the next alarm to go off and schedules this. I am nearly 100% sure these parts are working fine.</p><p>So I am stuck with only some theories of why it’s not working.</p><p>I thought it might be related to me disconnecting the phone from the debugger but the alarm seems to work over short amounts of time in that case.</p><p>So my main theory is that the alarmmanager I am creating is being deleted after a certain amount of time? If this is true this a big problem since I need this to be working no matter how much time has passed.</p><p>Any help into ensuring my alarm remains is greatly appreciated, thanks.</p>","518118","","518118","","2011-01-28 13:34:08","2011-01-28 13:34:08","Android alarmmanager not being very reliable","<android><alarmmanager>","1","0","1","",""
"4828329","1","4828448","","2011-01-28 12:42:37","1","1508","<p>I want to display a custom alert dialog whose structure has been defined in an XML file. This is the code I used.</p><pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(this);builder.setView(findViewById(R.layout.inputform));builder.show();</code></pre><p>It is fired when a button is clicked. However, the window was not getting displayed. I got this transparent grey layer on top of the screen and could not click on anything. Some basic codes like using <code>setMessage</code> or displaying checkboxes work well, though. Can anyone point out where I do wrong?</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;TableLayout android:id=""@+id/TableLayout01""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;TableRow android:id=""@+id/TableRow01"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TextView android:text=""Room name"" android:id=""@+id/TextView01""        android:layout_width=""fill_parent"" android:layout_height=""wrap_content""/&gt;    &lt;EditText android:hint=""Enter room name"" android:id=""@+id/EditText01""        android:layout_width=""0dp"" android:layout_height=""wrap_content""        android:layout_weight=""1""/&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/TableRow02"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TextView android:text=""Point id"" android:id=""@+id/TextView02""        android:layout_width=""fill_parent"" android:layout_height=""wrap_content""/&gt;    &lt;EditText android:hint=""Enter point id"" android:id=""@+id/EditText02""        android:layout_width=""0dp"" android:layout_height=""wrap_content""        android:layout_weight=""1""/&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/TableRow03"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;Button android:text=""OK"" android:id=""@+id/btnOK""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;/LinearLayout&gt;</code></pre>","404437","","404437","","2011-01-28 12:56:21","2011-10-24 18:20:24","custom alert dialog not getting displayed","<android><alertdialog>","5","1","","",""
"4828395","1","4828515","","2011-01-28 12:50:27","1","533","<p>In the future, I will be porting an iPhone app to Android/NDK which works with large amounts of resource files (over 50 megs).  Will my app have to download and store these files on /sdcard, and check for/download updates in a proprietary way over my own web hosting, or will google have a solution for this?  Can google actually host extra files?</p>","267391","","","","","2012-05-30 18:43:49","Android Market Updates on LARGE Applications (50mb+)","<android><apk><updates><android-ndk>","2","1","","",""
"4828416","1","6265669","","2011-01-28 12:53:03","0","604","<p>I've been looking at Google's C2DM service for push notifications for an Android Application. However, in my scenario, my application is a game. Do you think C2DM would be infeasible for pushing game state notifications to my mobile game clients from the server? I'm developing a game as a project but it will not be a commercial game. Just a prototype. </p><p>If C2DM will not suffice, do you have any suggestions for pushing game state from a server to a multiplayer game running on an android phone? I've explored a TCP/IP connection but I've a feeling this will hammer the batter power. Polling initiated by the client won't be efficient as I need real-time updates.</p><p>Any advice greatly welcomedThanks</p>","543220","","469983","","2011-10-27 08:47:19","2011-10-27 08:47:19","Google's C2DM for gaming","<android><android-c2dm>","2","0","","",""
"4828537","1","","","2011-01-28 13:08:45","1","2144","<p>I have an Activity named <code>Main</code>. I am calling another activity <code>Sub</code> from this <code>Main</code> activity using <code>startActivityForResult()</code>. And I want to take the result of this <code>Sub</code> activity using <code>onActivityResult()</code> function.</p><p>I can call the <code>Sub</code> activity. But when return from <code>Sub</code> activity, it is not calling <code>onActivityResult()</code> function. So I can't get the result of the <code>Sub</code> activity.</p><p>Actually my <code>Main</code> activity is starting from <code>MainGroup</code> activity by using <code>startActivity()</code> function, which extends <code>ActivityGroup</code>.</p><p>Is there any way to take the activity result without calling <code>onActivityResult()</code> ?</p><h2>Edited</h2><p>Actually I am calling an activity for PayPal Preapprovals. And the activity Which I am calling is on the PayPla library (.jar file). So I can't modify that activity. And when I am implemented this in another application without ActivityGroup, this is working fine</p><p>Please help me..</p><p>Thank You...</p>","523058","","523058","","2011-01-28 13:32:23","2012-03-09 10:13:32","Android: onActivityResult() is not calling for startActivityForResult","<android><activity>","2","3","","",""
"4828599","1","4828778","","2011-01-28 13:15:15","1","611","<p>I have created one layout with two edit boxes. After I launch my application, I enter some text in both of the edit boxes, and I press the 7 and 9 buttons to rotate the emulator screen, and the text I have entered still remains. But I have read from the docs that upon screen orientation change, the activity will be restarted and the data will be gone if I don't save the state.</p><p>Am I doing something wrong to change the screen orientation? I welcome any suggestions, as I am new with Android.</p>","593880","","496830","","2011-03-14 20:22:45","2011-03-14 20:22:45","Activity not losing its state when I rotate the emulator screen","<android>","3","0","","",""
"4828636","1","8766475","","2011-01-28 13:18:32","10","16668","<p>My layout contains ListView, SurfaceView and EditText. When I click on the EditText, it receives focus and the on-screen keyboard pops up. When I click somewhere outside of the EditText, it still has the focus (it shouldn't).I guess I could set up OnTouchListener's on the other views in layout and manually clear the EditText's focus. But seems too hackish...</p><p>I also have the same situation in the other layout - list view with different types of items, some of which have EditText's inside. They act just like I wrote above.</p><p>The task is to make EditText lose focus when user touches something outside of it.</p><p>I've seen similar questions here, but haven't found any solution...</p>","467290","","","","","2014-04-11 06:38:38","EditText, clear focus on touch outside","<android><focus><edittext>","6","0","6","",""
"4828639","1","4829299","","2011-01-28 13:19:08","1","181","<p>i am creating an app that is like a mini social network app, with users, that can be friends of other users. Each user haves email, fullName, etc... but now i want to implement and give to the user the possibility to select a image from the images directory of the phone and make it his profile image.</p><p>That image have to be sent to the remote server and all the other users will see that image when open the description of that friend.</p><p>On my app i am using JSON and PHP to connect from my app to the remote database, then i supose that i have to transform the image into a String and add a row on the remote database representing the String of the image.</p><p>I have no idea of how to do this, and i can't find any easy help on google or here, all i am finding is too hard for me or is not what i am searching for.</p><p>Code examples are welcome</p>","479886","","","","","2012-12-28 15:13:18","How can i implement the possibility of select an image on my app and send it to a remote database (JSON+PHP)?","<php><android><database><json>","2","0","1","",""
"4828644","1","","","2011-01-28 13:19:42","4","1979","<p>I'm trying to investigate similarities of <em>communication between objects/components</em> on different mobile platforms.</p><p>On Android, there is the <em>Activity/Intent</em> concept to pass information along, on Qt we have <em>signals and slots</em>.</p><p>Questions that arise here:  </p><ol><li><p><strong>is it legitimate to compare Activity/Intent to signal/slot concept?</strong> The foremost difference from my point of view is the different granularity level. While Activities/Intents operate on ""whole screens"" (Activities to be more precise, since an Activity doesn't necessarily represent a separate screen), Signals/Slots are defined for smaller objects, such as Widgets (in fact, for every class that is derived from QObject).</p></li><li><p>Having platform-independence in mind, would you say the <em>concepts are fundamentally too different</em>, or could a developer overcome the technical differences in terms of object communication and ""abstract"" the application logic sufficiently to minimize porting efforts? how?</p></li><li><p><strong>is there a comparable concept on iOS?</strong> (e.g. Target-Action mechanism - or more like Delegates or Notifications provided by ObjectiveC). </p></li></ol>","226480","","226480","","2011-01-31 14:50:13","2012-01-04 01:40:46","Android Activity/Intent vs. Qt Signal/Slot vs. iPhone ?/?","<iphone><android><qt><android-intent><signals-slots>","4","0","1","",""
"4828676","1","4829593","","2011-01-28 13:22:41","1","581","<p>Quite new to Android development and Java in general, so please excuse any amateur ignorance and lack of terminology.</p><p>I'm working on an Android app that involves fetching Web pages as strings, using a method based on the code available at <a href=""http://www.spartanjava.com/2009/get-a-web-page-programatically-from-android/"" rel=""nofollow"">http://www.spartanjava.com/2009/get-a-web-page-programatically-from-android/</a>.</p><p>This takes a small but noticeable amount of time, but works fine.  It is triggered by pressing a button in the UI.  Since the application is unresponsive while data is being fetched, I've got a toast that is meant to warn users before it happens.</p><p>Here is essentially what is being done (not the actual code, just illustrative):</p><pre><code>public void buttonPressed(View view) {   Toast.makeText(this, ""Getting Data!"", Toast.LENGTH_LONG).show();   //See the page linked above for the code in this function!   String page = getPage(""http://www.google.com/"");   Toast.makeText(this, ""Data Retrieved!"", Toast.LENGTH_LONG).show();}</code></pre><p>Unfortunately, The ""Getting Data"" toast only seems to appear after the getPage method has completed, appearing very briefly before being covered up by the ""Data Retrieved"" toast.</p><p>How do I avoid this, making the ""Getting Data"" toast appear, then the getPage method run, then the ""Data Retrieved"" toast appear when the method terminates?</p><p>Any suggestions would be much appreciated.  I expect the solution involves some kind of threads or synchronisation, but don't even know where to start looking for an appropriate tutorial...</p><p>Greg</p>","593886","","27615","","2011-01-28 14:46:11","2011-05-17 12:57:07","Preventing Internet-accessing-method from delaying a toast popup","<java><android><delay><toast>","2","0","1","",""
"4828724","1","4828808","","2011-01-28 13:26:29","0","337","<p>Hy!</p><p>I don't find the error.The error should be at the <code>btlogin.setOnClickListener</code></p><p>Login Class</p><pre><code>package android.skiptvad;public class Login extends Activity{ ProgressDialog pd = null; //final SharedPreferences settings = getSharedPreferences(""pref"", 0); @Override protected void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.login);  final SharedPreferences settings = getSharedPreferences(""pref"", 0);  final EditText user = (EditText)findViewById(R.id.login_etuser);  final EditText pw = (EditText)findViewById(R.id.login_etpw);  Button btlogin = (Button)findViewById(R.id.login_btlog);  Button btnew = (Button)findViewById(R.id.login_btnew);  final CheckBox cb = (CheckBox)findViewById(R.id.login_cb);  if (settings.getString(""user"", """") != """")  {   user.setText(settings.getString(""user"", """"));   pw.setText(settings.getString(""pw"", """"));  }  btlogin.setOnClickListener(new OnClickListener() {   @Override   public void onClick(View v) {    if (!user.getText().toString().equals("""") &amp;&amp; !pw.getText().toString().equals(""""))    {     pd.setCancelable(true);     pd = ProgressDialog.show(Login.this,"""",""Loading. Please wait..."", true);     List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();                   params.add(new BasicNameValuePair(""username"", user.getText().toString()));                   params.add(new BasicNameValuePair(""password"", pw.getText().toString()));                   Handler handler = new Handler(){                   @Override                   public void handleMessage(Message msg) {                    pd.cancel();                      if (msg.obj.toString()!= null)                      {                     JSONParse json = null;                     try {        json = new JSONParse(msg.obj.toString());      } catch (JSONException e) {       // TODO Auto-generated catch block       e.printStackTrace();      }      String session = json.getsessionid();      SharedPreferences.Editor editor = settings.edit();                       editor.putString(""session_id"", session);                       editor.commit();                       finish();                      }                      else                      {                       runOnUiThread(new  Runnable() {       public void run() {        Toast toast ;                toast =  Toast.makeText(getApplicationContext(), ""error"", 500);            toast.show();       }      });                      }                   }                   };     HttpConnection con = new HttpConnection(params, ""http://surfkid.redio.de/login"", handler);     Log.e(""xxxcon"", ""ok"");     con.start();    }    if (cb.isChecked())    {   SharedPreferences.Editor editor = settings.edit();                         editor.putString(""user"", user.getText().toString());                         editor.putString(""pw"", pw.getText().toString());                         editor.commit();    }   }  });  btnew.setOnClickListener(new OnClickListener() {   @Override   public void onClick(View v) {     startActivityForResult(new Intent(Login.this, NewAccount.class), 1);   }  }); }}</code></pre><p>LogCat:</p><pre><code>01-28 14:11:03.180: ERROR/AndroidRuntime(12132): FATAL EXCEPTION: main01-28 14:11:03.180: ERROR/AndroidRuntime(12132): java.lang.NullPointerException01-28 14:11:03.180: ERROR/AndroidRuntime(12132):     at android.skiptvad.Login$1.onClick(Login.java:71)01-28 14:11:03.180: ERROR/AndroidRuntime(12132):     at android.view.View.performClick(View.java:2461)01-28 14:11:03.180: ERROR/AndroidRuntime(12132):     at android.view.View$PerformClick.run(View.java:8888)01-28 14:11:03.180: ERROR/AndroidRuntime(12132):     at android.os.Handler.handleCallback(Handler.java:587)01-28 14:11:03.180: ERROR/AndroidRuntime(12132):     at android.os.Handler.dispatchMessage(Handler.java:92)01-28 14:11:03.180: ERROR/AndroidRuntime(12132):     at android.os.Looper.loop(Looper.java:123)01-28 14:11:03.180: ERROR/AndroidRuntime(12132):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-28 14:11:03.180: ERROR/AndroidRuntime(12132):     at java.lang.reflect.Method.invokeNative(Native Method)01-28 14:11:03.180: ERROR/AndroidRuntime(12132):     at java.lang.reflect.Method.invoke(Method.java:521)01-28 14:11:03.180: ERROR/AndroidRuntime(12132):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)01-28 14:11:03.180: ERROR/AndroidRuntime(12132):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)01-28 14:11:03.180: ERROR/AndroidRuntime(12132):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","547995","","72746","","2011-01-28 13:44:37","2011-01-28 13:44:37","Unknown NullPointerException","<android>","2","1","","",""
"4828743","1","4828853","","2011-01-28 13:28:18","1","605","<p>I am having trouble getting around a problem. In my application i have a spinner where a user selects a answer and then that answer gets passed onto the next activity. However, what i really want is the id of that answer to get passed on that activity...maybe seeing the code will help...</p><pre><code>db = dbs.getReadableDatabase();         String SQL = ""SELECT * FROM answer table"";     Cursor cursor = db.rawQuery(SQL, null);     startManagingCursor(cursor);    final int l = cursor.getCount();    int j = l + 1;    array_spinner = new String[j];    invisible_array_spinner = new String[j];    int i = 1;    array_spinner[0] = ""Please select from below"";    invisible_array_spinner[0] = ""Please select from below"";    while (cursor.moveToNext()) {     array_spinner[i]= cursor.getString(2);     invisible_array_spinner[i]= cursor.getString(1);     i ++;    }    final ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item, array_spinner);    spinner.setAdapter(adapter);</code></pre><p>in the answer table there is id and then answer, id is at cursor 1 and answer is at cursor 2.. What i am trying here to have maybe an invisible spinner in the back which reflects what the user has selected in the real spinner...Can anyone suggest how to solve this problem?thanks</p>","569654","","","","","2011-01-28 13:41:31","Android how to select an invisible spinner","<android><sqlite><spinner>","1","1","","",""
"4828944","1","5703753","","2011-01-28 13:51:46","3","3180","<p>This question has also been asked at <a href=""http://stackoverflow.com/questions/3002537/problems-with-mediarecorder-class-setting-audio-source-setaudiosource-unsup"">Problems with MediaRecorder class setting audio source - setAudioSource() - unsupported parameter</a>, however this author accepted the answer stating that this only occurs on the emulator, while (for me) this is not the case.</p><p>The problem occurs on my device, a Galaxy S i9000. The device has a microphone and recording with the microphone works regardless of this error.</p><p>The following code reproduces this error (called inside a service):</p><pre><code>int sampleRate = AudioTrack.getNativeOutputSampleRate(AudioManager.STREAM_SYSTEM);int channelMode = AudioFormat.CHANNEL_IN_MONO;int encodingMode = AudioFormat.ENCODING_PCM_16BIT; //only 16bit encoding is supportedint bufferSize = AudioRecord.getMinBufferSize(sampleRate, channelMode, encodingMode);recorder = new AudioRecord(MediaRecorder.AudioSource.MIC, sampleRate, channelMode, encodingMode, bufferSize);</code></pre><p>Setting the sample rate to a lower value like 8000 does not solve the problem. Setting the channelMode to stereo does not solve the problem.</p><p>When executing this code inside my service while the microphone is available for usage, the following errors will be returned:</p><pre><code>01-28 14:50:14.860: ERROR/audio_input(2358): unsupported parameter: x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value01-28 14:50:14.860: ERROR/audio_input(2358): VerifyAndSetParameter failed01-28 14:50:15.246: ERROR/PVOMXEncNode(2358): PVMFOMXEncNode-Audio_AMRNB::DoPrepare(): Got Component OMX.SEC.amrenc handle 01-28 14:50:15.258: ERROR/audio_input(2358): unsupported parameter: x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value01-28 14:50:15.258: ERROR/audio_input(2358): VerifyAndSetParameter failed01-28 14:50:15.328: ERROR/audio_input(2358): unsupported parameter: x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value01-28 14:50:15.328: ERROR/audio_input(2358): VerifyAndSetParameter failed01-28 14:50:15.356: ERROR/PVOMXEncNode(2358): PVMFOMXEncNode-Audio_AMRNB::DoPrepare(): Got Component OMX.SEC.amrenc handle 01-28 14:50:15.359: ERROR/audio_input(2358): unsupported parameter: x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value01-28 14:50:15.359: ERROR/audio_input(2358): VerifyAndSetParameter failed01-28 14:50:15.367: ERROR/AudioHardwareALSA(2358): AudioStreamInALSA - input   - format = 1, channels = 16, rate = 4410001-28 14:50:15.367: ERROR/AudioHardwareALSA(2358): AudioStreamInALSA - default - format = 1, channels = 16, rate = 4410001-28 14:50:15.457: ERROR/AudioFlinger(2358): readInputParameters mInputBytes 8320, mFrameSize 2 mSampleRate 44100 mChannelCount(1)01-28 14:50:15.457: ERROR/(2358): AFCCreateReSampler: avAFCInfo-&gt;bUsed[0] inSampleRate[44100] outSampleRate[44100] nChannel[1] outbitDepth[16]</code></pre><p>Does anyone have a solution to this problem?</p>","45974","","","","","2011-04-18 13:40:11","Android: Microphone AudioSource causing unsupported parameter, VerifyAndSetParameter failed errors","<java><android><audio><audio-recording><microphone>","2","0","1","",""
"4828970","1","4829691","","2011-01-28 13:55:01","0","746","<p>I am implementing a Map Kit based application in Android. I was very new to this sdk. My problem is I need to fire a method when the Map Region changed. Can you please guys let me know is it possible to fire a method when the region did Changed?</p><p>Thanks in Advance,T.</p>","460336","","","","","2011-01-28 15:06:49","On Map Region Change in MapKit Android Sdk","<android><mapkit>","1","0","","",""
"4829077","1","","","2011-01-28 14:05:45","0","654","<p>From past couple of hour I was trying to send JSONObject to a PHP server. I need to send this object through a parameter.</p><p>Some what like this:</p><pre><code>message={""name"":""Firstname"",""email"":""test@test.com""}</code></pre><p>here message is my parameter name.</p><p>Yes I am using HttpClient for posting my request.   As I have mentioned that I need to send a post request to the server attaching a JSONObject to a parameter, I am using the following methods:</p><p>Supose my exact URL is like <a href=""http://www.example.com/"" rel=""nofollow"">http://www.example.com/</a> then I need to append deviceID, date and message type with the URl so as to make it look like <a href=""http://www.example.com/deviceID/date/140"" rel=""nofollow"">http://www.example.com/deviceID/date/140</a> then to this URL I need to send a post request which is a JSONObject attaching it to a parameter named message.</p><p>For this I am doing:</p><pre><code>String url = ""http ://www.example.com/deviceID/date/140"";JSONObject j = new JSONObject();j.put(""name"", ""Firstname"");j.put(""email"", ""test@test.com"");HttpClient httpclient = new DefaultHttpClient();HttpPost request = new HttpPost(url);BasicHttpParams params = new BasicHttpParams();params.setParameter(""message"",j.toString());request.setParams(params);HttpResponse response = httpclient.execute(request);</code></pre><p>If I pass this way, the server returns a JSONObject error message saying <code>""error"":""name not found""</code> -- what am I doing wrong?</p>","562086","","1","","2011-01-31 11:41:22","2011-01-31 11:41:22","Need to post JSONObject to PHP server through parameter","<android>","0","2","","",""
"4829102","1","4889111","","2011-01-28 14:08:48","7","9487","<p>I have an application which consists of a service and an activity that may be started by the service for certain events. The service may create &amp; use the AudioRecord &amp; AudioTrack classes - at which time the application's Activity is displayed. The problem is if the Activity is paused (i.e., onPause() is called) I start getting the RecordThread: buffer overflow errors?</p><p>My guess is the AudioRecorder is running in the main thread. And, even though it was created by the service, when the Activity pauses reading stops thus the buffer overflows? Must the AudioRecorder reading be done in a separate thread even though it is running in the service?</p><p>Any help would be greatly appreciated, thanks.</p>","420008","","388787","","2012-02-17 17:48:46","2012-02-17 17:48:46","AudioFlinger(59): RecordThread: buffer overflow when Activity is paused?","<android><audio>","2","0","5","",""
"4829157","1","4832306","","2011-01-28 14:14:10","1","1994","<p>This is a really hard question to explain in words (well it is for me anyway). I need to be able to take an image (bitmap) and crop the image down to a certain size in the centre of the screen but keeping the size of the image the same. Hopefully the picture below can explain what I mean:</p><p><img src=""http://i.stack.imgur.com/jcySE.jpg"" alt=""enter image description here""></p><p>So the image as a whole is cropped down to the square in the middle but is not stretched across the screen and remains in the centre, so basically removing the pointless part of the image but keeping to co-ordinates of the pixels the same.</p>","400406","","","","","2011-01-28 19:34:25","Crop and keep the size of an image android","<java><android><image-processing><android-image>","3","1","","",""
"4829170","1","","","2011-01-28 14:15:11","0","1521","<p>I am implementing a Map Kit based application in Android. I was very new to this sdk. My problem is that I need to fire a method when the Map Region changed. Can you guys please let me know is it possible to fire a method when the region is changed?</p>","562158","","68805","","2011-01-28 23:18:10","2014-02-25 22:00:23","On Map Region Change in MapView Android Sdk","<android><android-mapview>","2","1","","",""
"4829247","1","6078808","","2011-01-28 14:22:33","0","1132","<p>Does anyone know of a way to modify the visual style of how the WebView displays auto-linked text (phone numbers, addresses, etc.)?  Or more specifically, can I make the links that WebView detects look like standard clickable hyperlinks?  For example,</p><pre><code>webView.loadData(""My phone number is 3035555555"", ""text/html"", ""utf-8"");</code></pre><p>This loads the text into the WebView and it is clickable, but it just looks like the rest of the body text.  I also tried putting the text into an HTML file in assets and doing</p><pre><code>webView.loadUrl(""file:///android_asset/Test.html"");</code></pre><p>But that yielded the same result.  Is there something in WebSettings or WebViewClient that controls this behavior I'm missing?</p><p>Cheers.</p>","246461","","","","","2013-01-29 06:16:41","Android WebView: Change Auto-Link Display","<android><hyperlink><webview>","2","1","","",""
"4829350","1","","","2011-01-28 14:34:01","0","949","<p>I am trying to implement facebook connect from my android app. When searched for that I got this link <a href=""http://www.mobisoftinfotech.com/blog/android/845/"" rel=""nofollow"">http://www.mobisoftinfotech.com/blog/android/845/</a>. I tried to implement as per their instruction, but i am not getting the output. I first download that, then I import fbconnect-android.zip/api to the eclipse using file-->import. Then I imported android.jar and after i exported that to form an .jar named fbconnect.jar. Then I imported fbconnect-android.zip/sample to the eclipse and imported the fbconnect.jar file as detailed in the site. There is no error in the coding, I have registered in the facebook, i got the key and the secret key. Then also i'm getting the error. In the console i'm getting an error msg like 'Android requires .class compatibility set to 5.0'. I tried to right click on the project -> Android Tools -> Fix Project Properties and restart Eclipse after this also the error is still there. Can anyone please help me to solve this?</p>","567795","","","","","2011-03-21 13:27:53","Android fbconnect","<android>","2","0","","",""
"4829383","1","","","2011-01-28 14:37:30","2","615","<p>This is related to another <a href=""http://stackoverflow.com/questions/4724270/"">question about URL shortener</a>. The code for URL shortener works fine, on both standalone Java and on Android. However, when re-using this code to communicate to a custom Google App Engine application, the code works perfectly fine on standalone Java, but produces an empty self.request.body when used from Android. <strong>Why?</strong></p><p>To reproduce this behaviour, run the code below, on android, once with Google shortener URL:<code>https://www.googleapis.com/urlshortener/v1/url</code>, and once with a custom URL to a web server. The same code on standalone java produces exactly the same request (as expected) in both cases. On Android, in the case of custom URL, the content body is empty and content-length is not set. I'm running google-api-java-client 1.2.2-alpha, with jackson 1.7.1.</p><p>The code snippet:</p><pre><code>    HttpTransport transport = GoogleTransport.create();    HttpRequest request = transport.buildPostRequest();    // Change this URL below from Google Shortener URL, to a custom URL,    // and the code on Android produces an empty body and Content-Length is not set    request.setUrl(""GoogleAppEngine url goes here"");    JsonCContent content = new JsonCContent();    GenericData data = new GenericData();    data.put(""id"", ""whatever"");    content.data = data;    request.content = content;    HttpResponse response = request.execute();</code></pre>","593978","","593978","","2011-01-28 20:58:16","2011-01-30 18:33:06","google-api-java-client JSON parser on Android produces an empty self.request.body on GAE","<python><android><google-app-engine><google-api-java-client>","1","0","","",""
"4829395","1","","","2011-01-28 14:38:25","1","4763","<p>We are developing a small contact store application using PhoneGap framework. We have a webservice to perform operations for creating, updating, reading and deleting a contact. We are using the following code to make a SOAP request to create a contact. We are using jQuery and jquery mobile <a href=""http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.js"" rel=""nofollow"">http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.js</a>. The following code is working with iPhone simulator and iPhone. But we are not even getting the response on Android and Android emulator. We greatly appreciate your help.</p><pre><code>var settings = {requestType:""soap1.1"",       error:function(XMLHttpRequest, textStatus, errorThrown){       throw XMLHttpRequest.responseText;     }}; var oBuffer = new Array(); settings.requestType = ""soap1.1""; settings.methodType = ""POST""; settings.contentType = ""text/xml""; settings.url = ""http://example.com/checkdatpriceservice.asmx""; settings.dataType = ""text/xml""; settings.nameSpace = ""http://tempuri.org/""; settings.methodName = ""VerifyUser""; oBuffer.push('&lt;soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""&gt;'); oBuffer.push(""&lt;soap:Body&gt;"");  oBuffer.push('&lt;VerifyUser xmlns=""http://tempuri.org/""&gt;');    oBuffer.push('&lt;email_id&gt;abcd@example.com&lt;/email_id&gt;');    oBuffer.push('&lt;password&gt;user123&lt;/password&gt;');  oBuffer.push(""&lt;/VerifyUser&gt;"");   oBuffer.push(""&lt;/soap:Body&gt;""); oBuffer.push(""&lt;/soap:Envelope&gt;""); settings.requestData = oBuffer.join(""""); alert(""requestData:"" + settings.requestData); $.ajax({   type: settings.methodType,   cache: false,   url: settings.url,   data: settings.requestData,   contentType: settings.contentType,   dataType: settings.dataType,   error: function(status){ alert(""An error occurred in processing your request"");},   success: function(data, testStatus){     alert('data = ' + data);     $('#testp').html(data);   },   beforeSend: function(XMLHttpRequest){     if (settings.requestType == ""soap1.1"" || settings.requestType== ""soap1.2"")       XMLHttpRequest.setRequestHeader(""SOAPAction"",settings.nameSpace + settings.methodName);     XMLHttpRequest.setRequestHeader(""Content-Length"",settings.requestData.length);     XMLHttpRequest.setRequestHeader(""Connection"", ""close"");   } });</code></pre>","186148","","","","","2014-04-04 02:58:57","PhoneGap Android Web Service response using jQuery is NOT coming","<android><web-services><phonegap>","3","2","2","",""
"4829412","1","","","2011-01-28 14:39:49","0","630","<pre><code>private class RSSHandler extends DefaultHandler{    final int stateUnknown = 0;    final int stateTitle = 1;    int state = stateUnknown;    int numberOfTitle = 0;    String strTitle = """";    String strElement = """";    @Override    public void startDocument() throws SAXException {        // TODO Auto-generated method stub        strTitle = ""--- Start Document ---\n"";    }    @Override    public void endDocument() throws SAXException {        // TODO Auto-generated method stub        strTitle += ""--- End Document ---"";        streamTitle = ""Number Of Title: "" + String.valueOf(numberOfTitle) + ""\n""                    + strTitle;    }    @Override    public void startElement(String uri, String localName, String qName,            Attributes attributes) throws SAXException {        // TODO Auto-generated method stub        if (localName.equalsIgnoreCase(""title""))        {            state = stateTitle;            strElement = ""Title: "";            numberOfTitle++;        }        else if (localName.equalsIgnoreCase(""link""))        {            state = stateTitle;            strElement = ""Link: "";            numberOfTitle++;        }        else        {            state = stateUnknown;        }    }    @Override    public void endElement(String uri, String localName, String qName)            throws SAXException {        // TODO Auto-generated method stub        if (localName.equalsIgnoreCase(""title""))        {            strTitle += strElement + ""\n"";        }        else if (localName.equalsIgnoreCase(""link""))        {            strTitle += strElement + ""\n"";        }        state = stateUnknown;    }    @Override    public void characters(char[] ch, int start, int length)            throws SAXException {        // TODO Auto-generated method stub        String strCharacters = new String(ch, start, length);        if (state == stateTitle)        {            strElement += strCharacters;        }    }}</code></pre><p>Now i get all the ""link"" and ""title"" elements on all levels. But what do i need to type to get only the ""title"" elements wich are childs of . Example:</p><pre><code>&lt;title&gt;foo&lt;/title&gt;    &lt;item&gt;        &lt;title&gt;bar&lt;/title&gt;    &lt;/item&gt;</code></pre><p>I only want ""bar"". Thanks</p>","557187","","","","","2011-07-17 14:07:32","android rss parsing, get child elements","<android><xml><rss>","1","0","","",""
"4829467","1","","","2011-01-28 14:44:49","1","580","<p>I would like to connect my Android Droid phone (acting as a device), to an embedded GPS module (acting as host), over usb.  I have the ability to tweak the firmware on the GPS module (which uses an ARM 710 processor, and is not Linux based).</p><p>I know that the Android SDK does not include APIs to control the USB port.  I am hoping I can connect my GPS host to my android phone using a client mode the phone already supports.  I am having difficulty getting this information.</p><p>I would appreciate any suggestions, or links on how to do this.</p>","491316","","21234","","2011-01-28 14:53:35","2013-07-17 15:05:33","What USB client modes does Android support","<android><client><usb>","1","0","","",""
"4829537","1","6215535","","2011-01-28 14:51:08","11","11233","<p>I've looked through dozens of pages if similar questions, none of them have any answers, so hopefully this one will be different.</p><p>I have a webview, and I do not want the zoom of the view to change from the initial zoom level I have it set to.  <strong>The only thing which changes the zoom level currently is when a text box is focused</strong>.</p><p>I need to be able to do this through Java code, not using the viewport meta tag.</p><p>Just so I don't have the common responses, I have the following in my code to disable zooming, and the zoom controls:</p><pre><code>mWebView.getSettings().setBuiltInZoomControls(false);mWebView.getSettings().setSupportZoom(false);</code></pre><p>I'm thinking that a possible solution is to check to see when an onFocus or even an onClick event occurs within the WebView and then zoomOut, but I'm not even sure if that is possible?</p><p>Any suggestions would be appreciated.</p>","158557","","","","","2012-11-09 08:48:06","Disable zoom when clicking on form fields within a WebView?","<android><webview><zoom>","8","10","11","",""
"4829567","1","4829609","","2011-01-28 14:54:17","2","2113","<p>I released my Android app two days ago, using admob advertising. I used my personal phone as the test phone,  but took out the test mode code before releasing it. My admob status is active and I get requests and impressions on the report, but whenever I try to use the app on my personal phone i only get ""test ads"". I don't know why. I looked through the code of my app and can't find anything amiss. And i did delete the test version of the app and then download the released version from the market.</p>","485498","","","","","2012-01-26 20:10:04","admob test ads appearing","<java><android><admob>","3","0","","",""
"4829718","1","","","2011-01-28 15:09:51","16","3478","<p>I'm developing a PopUp window for Android, and it's working, I added a EditText and a Button on that, when running on ADV this work properly, while running on device, when I focus on the EditText this throws a weird Exception.</p><pre><code>android.view.WindowManager$BadTokenException: Unable to add window - - token android.view.ViewRoot&amp;48163b18 is not valid; is your active running?</code></pre><p>I don't know if it matters, but I'm running on a Galaxy Tab with Swype input.</p><p>Now I read the specs of the Window.showAtLocation</p><pre><code>public void showAtLocation (View parent, int gravity, int x, int y)Display the content view in a popup window at the specified location. If the popup window cannot fit on screen, it will be clipped. [...]Parametersparent  a parent view to get the getWindowToken() token from[...]</code></pre><p>The problem is just in that token, but how do I pass the Activity token to it?</p><p>I also wrote a small code to reproduce the error.</p><pre><code>PopupWindow window = new PopupWindow(activity);window.setWidth(WindowManager.LayoutParams.WRAP_CONTENT);window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);window.setTouchable(true);window.setFocusable(true);EditText text = new EditText(activity);text.setText(""Dont touch, this crash!"");window.setContentView(text);window.showAtLocation(arg0, Gravity.NO_GRAVITY, 10,10);</code></pre><p>Running on AVD all works fine, while on device this crash and throw the error I mentioned.</p><p>I discover something new, when I'm in landscape mode this errors don't occurs.</p>","558433","","558433","","2011-02-24 21:37:01","2013-08-15 12:57:51","Exception when focusing a EditText in a PopupWindow running on Device","<java><android><edittext>","5","5","2","",""
"4829844","1","4831147","","2011-01-28 15:22:13","3","3927","<p>I am refering to <a href=""http://developer.android.com/reference/android/app/Activity.html"" rel=""nofollow"">http://developer.android.com/reference/android/app/Activity.html</a>.  </p><p>I have an activity which can be ""interrupted"" by the user, e.g. the user opens the menu to call the preferences screen. When calling the preference screen <code>onSaveInstanceState(Bundle)</code> is called and I can save my data. That's fine so far. But upon pressing the back button <code>onRestoreInstanceState(Bundle savedInstanceState)</code> is <em>NOT</em> called.  </p><p>So how can I save my state? Do I have to do it when calling the new activity? But how?<br>The only way I can think of, is saving the state by passing the state to the new activity, do nothing there with the saved data, return it to the first activity and restore the state in <code>onActivitResult</code>. But that would mean that I have to pass data back and forth just to restore the state. Doesn't seem to be a nice solution.</p>","481493","","648313","","2011-12-13 12:22:11","2011-12-13 12:22:11","Android: Saving a state during Android lifecycle","<android><activity><state>","3","0","1","",""
"4829887","1","4830160","","2011-01-28 15:26:14","3","1180","<p>I have a rather large amount of code written when I decided to useORMLite.</p><p>After reading the doc I found that I would need to extend like:</p><pre><code>MyClass extends OrmLiteBaseActivity&lt;DatabaseHelper&gt;</code></pre><p>but I have already extended it with ListActivity.</p><p>Is is possible to do it without extending OrmLiteBaseActivity?</p><p>Tnx in advance.</p>","505160","","449554","","2011-01-28 15:32:01","2013-07-24 19:35:24","ListActivity ormlite problem?","<android><ormlite>","2","0","1","",""
"4829973","1","4839144","","2011-01-28 15:33:14","0","5950","<p>in my project i have a view with 4 buttons. I have a relative layout to place them correctly. The thing is that i want the buttons to fill the whole screen without disappearing and I don't want to set a fixed size to them to ensure that the buttons will fit in any screen size. Right now the only thing i can see is one big button because RelativeLayout has no <code>android:layout_weight</code>. How can i accomplish this? Here's what i got:</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;Button                android:id=""@+id/search_icon""                android:background=""@drawable/search_icon""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                /&gt;          &lt;Button                android:id=""@+id/categories_icon""                android:background=""@drawable/categories""                android:layout_toRightOf=""@+id/search_icon""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                /&gt;          &lt;Button                android:id=""@+id/green_icon""                android:background=""@drawable/green_icon""                android:layout_below=""@+id/search_icon""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                /&gt;          &lt;Button                android:id=""@+id/red_icon""                android:background=""@drawable/red_icon""                android:layout_toRightOf=""@+id/green_icon""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                /&gt;    &lt;/RelativeLayout&gt;</code></pre>","499488","","405725","","2011-01-28 15:35:40","2012-06-27 15:31:32","Button resize problem. Android","<android>","5","0","","",""
"4830107","1","","","2011-01-28 15:44:54","0","347","<p>I was reading up on <a href=""http://www.codinghorror.com/blog/2007/10/software-branching-and-parallel-universes.html"" rel=""nofollow"">SCM</a> and was curious how it could apply to mobile development.</p><p>Would it be possible to create one project for both iPhone and Android and have a branching policy based on technology ? I know the source code is completely different but at least the assets (art, strings, etc.) could probably be shared by both branches.</p><p>And is it possible to mix branching policies ? As in branch by technology but also branch by version ?</p><p>Any other recommended approach to reuse assets between mobile technology projects ?</p>","271395","","","","","2011-01-28 16:50:54","Android,iPhone simultaneous development SCM","<iphone><android><version-control>","2","0","","",""
"4830173","1","5679987","","2011-01-28 15:50:47","6","6957","<p>I am taking <a href=""http://www.androidpeople.com/android-gallery-imageview-example/"">this</a> tutorial. As you can see on <a href=""http://www.androidpeople.com/wp-content/uploads/2010/05/imagegallery1.png"">this</a> image, the standard grey border is applied to all elements in the gallery. I would like to remove this rather ugly border, or, actually, make it a 1 px border instead (or just so the images can be distinguished from each other).I tried removing this line:</p><pre><code>imgView.setBackgroundResource(GalItemBg);</code></pre><p>That removes the border, but then the images overlap each other and it's still not very pretty.</p><p>So, how do I change the border? And how do I get the gallery elements to not overlap each other?</p>","554002","","","","","2012-09-10 13:13:06","Change border style in Gallery","<android><border><gallery>","1","0","1","",""
"4830280","1","4831780","","2011-01-28 15:59:51","1","2758","<p>I am trying to achieve an effect where, once pressed, an ImageButton draws with the ""pressed"" orange background until it loses focus (something else is touched).  </p><p>StateListDrawable seems intended for this situation, because it would allow me to define how the background should be drawn for the focused state.  And it would be great if I could simply define that the background should be drawn with the pressed drawable, for the focused state.  However, I see no way to reference the default ""pressed"" drawable.</p><p>Any advice on how I can achieve this effect?</p>","426493","","","","","2012-12-10 02:02:14","Android: how to draw an ImageButton using the pressed state drawable for the focused state","<android><button><background>","3","0","","",""
"4830293","1","4830350","","2011-01-28 16:00:51","0","809","<p>I have an Android App with a pre-built SQLite DB packaged with it. However, I'm sure that if I want to do an upgrade with an upgraded/altered/new database it will be tricky.I found this out on my emulator and handset. When I changed DBs (keeping the name the same, or altered the DB and put it back into the assets directory, and then ran the app on the emulator, it wouldn't read the new DB, but would keep the old database. The only way to get rid of the old DB, it seems, is to delete the app and reinstall it. WHich is what I do when I test my apps on my handset after changing the database. Another option is to change the name of the database, and all references to it in the code, but this doubles the database storage of the app and wastes space.</p>","485498","","","","","2011-01-28 16:05:17","Upgrading Android App with pre-built database","<java><android><sqlite>","1","2","","",""
"4830349","1","4830488","","2011-01-28 16:05:17","0","325","<p>My goal here is to change the image in my gallery at certain times ,lets say 5 seconds change , another 5 seconds another change .</p><p>Some sort of infinite loop using a handler to change theimg but i think this approach would consume a lot of battery .</p><p>what is the best way to do that? </p>","569873","","","","","2011-01-28 16:16:10","How can i change the image in a android gallery at certain times","<java><android><handler><infinite-loop><image-gallery>","1","0","","",""
"4830351","1","","","2011-01-28 16:05:19","4","2734","<p>I have a ListActivity with a ListView and everything works great; however I am trying to set a background image and the image is appearing in each row and making the row very tall.</p><p>How do I make the background for that view so the rows don't pick up the image?</p>","578866","","","","","2011-11-23 04:44:01","Android Listview background image shows on each row, why?","<android><listview>","2","0","1","",""
"4830474","1","4904402","","2011-01-28 16:14:53","27","12001","<p>I want to exclude some file paths from ProGuard. Example <code>com.myapp.customcomponents</code></p><p>How can I do this?  I hate to be placing -keep flags for every single custom component file I have in this directory.</p><p>I have tried the following but it doesn't work:</p><pre><code>-keep public class com.myapp.customcomponents.*</code></pre>","398248","","119895","","2011-08-25 17:09:52","2013-01-04 13:22:44","How to keep/exclude a particular package path when using proguard?","<android><proguard>","2","0","15","",""
"4830667","1","4830737","","2011-01-28 16:34:03","0","190","<p>I have the following code:</p><pre><code>Timer micTimer = new Timer();micTimer.schedule(new TimerTask(){    @Override    public void run(){         Log.v(""Timer"", ""Timer"");    }}, 0, 1000);</code></pre><p>Which in theory  should every second output a log line Timer Timer, but does not. I understand its probably a better way to use a Handler and use the postDelay() method but this way if working seems adequate enough for my needs. I don't understand what is wrong with the code.</p><p>.</p>","400406","","","","","2011-01-28 16:41:52","Timer problem in android not outputting anything","<java><android><timer>","1","0","","",""
"4830709","1","","","2011-01-28 16:39:02","5","4977","<p>Hey these perspectives have gone (no longer available). How do I get them back? thanks</p>","594120","","","","","2013-02-20 14:33:40","Eclipse Android Perspectives","<java><android><eclipse>","1","1","","",""
"4830711","1","4830846","","2011-01-28 16:39:21","31","40201","<p>Can someone tell me the code to transform a image (maximum of 200KB) into Base64 String?</p><p>I need to know how to do it with android, because I have to add the functionality to upload images to a remote server in my main app putting them into a row of the database, as a string.</p><p>I am searching in google and in StackOverflow but I could not find easy examples that I canafford and also I find some examples but they are not talking about to transform into String. Then I need to transform into string to upload by JSON to my remote server.</p>","479886","","573034","","2014-01-05 19:26:45","2014-01-05 19:26:45","How to convert a image into Base64 string?","<android><base64>","3","1","29","",""
"4830772","1","","","2011-01-28 16:44:28","4","11026","<p>I'm experiencing an odd problem. I'm doing my testing on an HTC EVO. I have written a demo camera application targeting 2.2 and almost everything works correctly. The problem is that after taking three or four pictures, the application crashes and gives me the following messages:</p><pre><code>D/QualcommCameraHardware(   64): takePicture(479)D/QualcommCameraHardware(   64): val_ril_status = 0,val_wimax_status = 0,val_hotspot_status = 0,val_low_temp_limit = 10.000000,val_batt_temp = 29.799999,val_low_temp_limit = 15,val_batt_cap  = 96D/QualcommCameraHardware(   64): FLASHLIGHT is ENABLEDD/QualcommCameraHardware(   64): stopPreviewInternal E: 1D/QualcommCameraHardware(   64): cancelAutoFocusInternal ED/QualcommCameraHardware(   64): cancelAutoFocusInternal X: 0I/QualcommCameraHardware(   64): deinitPreview ED/QualcommCameraHardware(   64): launch_watchdog_thread:D/QualcommCameraHardware(   64): watchdog_thread_id = 369048I/QualcommCameraHardware(   64): register_buf: camfd = 35, reg = 1 buffer = 0x4153f000I/QualcommCameraHardware(   64): register_buf: camfd = 35, reg = 1 buffer = 0x415bf000I/QualcommCameraHardware(   64): register_buf: camfd = 35, reg = 1 buffer = 0x4163f000I/QualcommCameraHardware(   64): register_buf: camfd = 35, reg = 1 buffer = 0x416bf000I/QualcommCameraHardware(   64): register_buf: camfd = 38, reg = 1 buffer = 0x4331d000I/QualcommCameraHardware(   64): register_buf: camfd = 38, reg = 1 buffer = 0x4351d000I/QualcommCameraHardware(   64): register_buf: camfd = 38, reg = 1 buffer = 0x4371d000I/QualcommCameraHardware(   64): register_buf: camfd = 38, reg = 1 buffer = 0x4391d000I/QualcommCameraHardware(   64): register_buf: camfd = 38, reg = 1 buffer = 0x43b1d000I/QualcommCameraHardware(   64): register_buf: camfd = 38, reg = 1 buffer = 0x43d1d000I/QualcommCameraHardware(   64): register_buf: camfd = 38, reg = 1 buffer = 0x43f1d000I/QualcommCameraHardware(   64): register_buf: camfd = 38, reg = 1 buffer = 0x4411d000I/QualcommCameraHardware(   64): deinitPreview XD/QualcommCameraHardware(   64): stopPreviewInternal X: 0D/QualcommCameraHardware(   64): initRaw E: raw size=3264x2448D/QualcommCameraHardware(   64): initRaw: raw ration = 0.750000, display size=768x432D/QualcommCameraHardware(   64): initRaw: thumbnail_width=768, thumbnail_height=576, thumbnail_buffer_size=663552D/QualcommCameraHardware(   64): native_access_parm: fd 24, type 1, length 32D/mm-camera-ov8810_u(   64): andy cam_mode_sel 0D/QualcommCameraHardware(   64): initRaw: initializing mRawHeap.E/MemoryHeapBase(   64): error opening /dev/pmem_camera: No such file or directoryE/QualcommCameraHardware(   64): failed to construct master heap for pmem pool /dev/pmem_cameraE/QualcommCameraHardware(   64): initRaw X failed with pmem_camera, trying with pmem_adspD/QualcommCameraHardware(   64): frame_thread XD/QualcommCameraHardware(   64): watchdog_thread_id = 369048D/QualcommCameraHardware(   64): release_watchdog_thread: frame_thread_released = 1E/MemoryHeapBase(   64): mmap(fd=38, size=11988992) failed (Invalid argument)E/QualcommCameraHardware(   64): failed to construct master heap for pmem pool /dev/pmem_adspE/QualcommCameraHardware(   64): initRaw X: error initializing mRawHeapE/QualcommCameraHardware(   64): initRaw failed.  Not taking picture.D/AndroidRuntime( 2650): Shutting down VMW/dalvikvm( 2650): threadid=1: thread exiting with uncaught exception (group=0x400259f8)E/AndroidRuntime( 2650): FATAL EXCEPTION: mainE/AndroidRuntime( 2650): java.lang.RuntimeException: takePicture failedE/AndroidRuntime( 2650):  at android.hardware.Camera.native_takePicture(Native Method)E/AndroidRuntime( 2650):  at android.hardware.Camera.takePicture(Camera.java:535)E/AndroidRuntime( 2650):  at android.hardware.Camera.takePicture(Camera.java:503)E/AndroidRuntime( 2650):  at spikes.cameraSpike03.MainActivity.takePicture(MainActivity.java:90)E/AndroidRuntime( 2650):  at spikes.cameraSpike03.MainActivity.access$3(MainActivity.java:87)E/AndroidRuntime( 2650):  at spikes.cameraSpike03.MainActivity$3.onClick(MainActivity.java:80)E/AndroidRuntime( 2650):  at android.view.View.performClick(View.java:2408)E/AndroidRuntime( 2650):  at android.view.View$PerformClick.run(View.java:8817)E/AndroidRuntime( 2650):  at android.os.Handler.handleCallback(Handler.java:587)E/AndroidRuntime( 2650):  at android.os.Handler.dispatchMessage(Handler.java:92)E/AndroidRuntime( 2650):  at android.os.Looper.loop(Looper.java:144)E/AndroidRuntime( 2650):  at android.app.ActivityThread.main(ActivityThread.java:4937)E/AndroidRuntime( 2650):  at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 2650):  at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 2650):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime( 2650):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime( 2650):  at dalvik.system.NativeStart.main(Native Method)W/ActivityManager(  107):   Force finishing activity spikes.cameraSpike03/.MainActivityD/QualcommCameraHardware(   64): void* watchdog(void*), frame_thread_released = 1, cnt = 0D/QualcommCameraHardware(   64): void* watchdog(void*), exit, frame_thread_released=1D/QualcommCameraHardware(   64): void release_watchdog_thread(): pthread_join succeeded on watchdog.</code></pre><p>Could this be a memory management problem?</p><p>Below is all the code I'm using.</p><p>[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=""spikes.cameraSpike03""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;        &lt;activity android:name="".MainActivity"" android:label=""@string/app_name"" android:screenOrientation=""portrait""&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;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-feature android:name=""android.hardware.camera.flash"" /&gt;&lt;/manifest&gt;</code></pre><p>[main.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:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt; &lt;SurfaceView android:id=""@+id/svCameraView"" 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=""#3000"" android:layout_alignParentBottom=""true"" android:layout_centerHorizontal=""true"" android:gravity=""center_horizontal""&gt;  &lt;Button android:id=""@+id/btnCapture"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""capture"" /&gt;  &lt;CheckBox android:id=""@+id/chkAutofocus"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Autofocus"" /&gt; &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>[MainActivity.java]</p><pre><code>package spikes.cameraSpike03;import java.util.List;import android.app.Activity;import android.content.pm.ActivityInfo;import android.content.res.Configuration;import android.graphics.PixelFormat;import android.hardware.Camera;import android.hardware.Camera.AutoFocusCallback;import android.hardware.Camera.Parameters;import android.hardware.Camera.PictureCallback;import android.hardware.Camera.ShutterCallback;import android.hardware.Camera.Size;import android.os.Bundle;import android.util.Log;import android.view.SurfaceHolder;import android.view.SurfaceView;import android.view.View;import android.view.Window;import android.view.WindowManager;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.CheckBox;public class MainActivity extends Activity implements SurfaceHolder.Callback { private static final String LOG_TAG = MainActivity.class.getName(); private static final String LOG_LINE = ""---------------------------------""; private Camera _camera; private boolean _previewIsRunning = false; private SurfaceView _svCameraView; private SurfaceHolder _surfaceHolder; private Button _btnCapture; private CheckBox _chkAutofocus;    @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.main);        _svCameraView = (SurfaceView)findViewById(R.id.svCameraView);        _surfaceHolder = _svCameraView.getHolder();        _surfaceHolder.addCallback(this);        _surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);        _chkAutofocus = (CheckBox)findViewById(R.id.chkAutofocus);        _btnCapture = (Button)findViewById(R.id.btnCapture);        _btnCapture.setOnClickListener(new OnClickListener() {   @Override   public void onClick(View v) {    if(_camera != null){     //Decide whether or not to use autofocus     if(_chkAutofocus.isChecked()){      Log.d(LOG_TAG, LOG_LINE + ""Preparing to take the picture using autofocus..."");      _camera.autoFocus(new AutoFocusCallback() {       @Override       public void onAutoFocus(boolean success, Camera camera) {        Log.d(LOG_TAG, LOG_LINE + ""_camera.autoFocus.onAutoFocus(...) entered."");        takePicture();        Log.d(LOG_TAG, LOG_LINE + ""_camera.autoFocus.onAutoFocus(...) finished."");       }      });     }     else{      Log.d(LOG_TAG, LOG_LINE + ""Preparing to take the picture without autofocus..."");      takePicture();     }    }   }  });    }    private void takePicture(){     Log.d(LOG_TAG, LOG_LINE + ""takePicture() entered."");     _camera.takePicture(_shutterCallback, null, _jpegCallback);  _previewIsRunning = false;  Log.d(LOG_TAG, LOG_LINE + ""takePicture() finished."");    }    private ShutterCallback _shutterCallback = new ShutterCallback() {  @Override  public void onShutter() {   Log.d(LOG_TAG, LOG_LINE + ""_shutterCallback.onShutter() called."");  } }; private PictureCallback _jpegCallback = new PictureCallback() {  @Override  public void onPictureTaken(byte[] data, Camera camera) {   Log.d(LOG_TAG, LOG_LINE + ""_jpegCallback.onPictureTaken() called."");   _camera.startPreview();   _previewIsRunning = true;  } }; @Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {  if(_previewIsRunning){   Log.d(LOG_TAG, LOG_LINE + ""About to stop preview..."");   _camera.stopPreview();   Log.d(LOG_TAG, LOG_LINE + ""Stopped preview."");  }  try{   Log.d(LOG_TAG, LOG_LINE + ""About to set up camera parameters..."");   Camera.Parameters parameters = _camera.getParameters();   //Get the optimal preview size so we don't get an exception when setting the parameters    List&lt;Size&gt; supportedPreviewSizes = parameters.getSupportedPreviewSizes();   Size optimalPreviewSize = CameraUtil.getOptimalPreviewSize(supportedPreviewSizes, width, height);   parameters.setPreviewSize(optimalPreviewSize.width, optimalPreviewSize.height);   parameters.setFocusMode(Parameters.FOCUS_MODE_AUTO);   parameters.setFlashMode(Parameters.FLASH_MODE_AUTO);   _camera.setDisplayOrientation(90);   _camera.setParameters(parameters);   _camera.setPreviewDisplay(holder);   Log.d(LOG_TAG, LOG_LINE + ""Finished setting up camera parameters."");  }  catch(Exception ex){   ex.printStackTrace();   Log.e(LOG_TAG, ex.toString());  }  Log.d(LOG_TAG, LOG_LINE + ""About to start preview..."");  _camera.startPreview();  _previewIsRunning = true;  Log.d(LOG_TAG, LOG_LINE + ""Started preview.""); } @Override public void surfaceCreated(SurfaceHolder holder) {  _camera = Camera.open(); } @Override public void surfaceDestroyed(SurfaceHolder holder) {  Log.d(LOG_TAG, LOG_LINE + ""Tearing down camera because surface was destroyed..."");  _camera.stopPreview();  _previewIsRunning = false;  _camera.release();  Log.d(LOG_TAG, LOG_LINE + ""Finished tearing down camera because surface was destroyed.""); } @Override public void onConfigurationChanged(Configuration newConfig){  Log.d(LOG_TAG, LOG_LINE + ""About to set request orientation to SCREEN_ORIENTATION_PORTRAIT..."");  setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);  Log.d(LOG_TAG, LOG_LINE + ""Successfully set request orientation to SCREEN_ORIENTATION_PORTRAIT.""); }}</code></pre><p>[CameraUtil.java]</p><pre><code>package spikes.cameraSpike03;import java.util.List;import android.hardware.Camera.Size;public class CameraUtil { private CameraUtil(){} /**  * Returns a Size object containing the dimensions for an optimal preview size for the current hardware.  * This code is based on that found at: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html  *   * @param supportedSizes  * A list of Size objects representing all the known preview sizes supported by this hardware.  *   * @param w  * The surface width.  *   * @param h  * The surface height.  *   * @return  * Returns a Size object containing the dimensions for an optimal preview size for the current hardware.  */ public static Size getOptimalPreviewSize(List&lt;Size&gt; supportedSizes, int w, int h) {        final double ASPECT_TOLERANCE = 0.05;        double targetRatio = (double) w / h;        if (supportedSizes == 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 : supportedSizes) {            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 : supportedSizes) {                if (Math.abs(size.height - targetHeight) &lt; minDiff) {                    optimalSize = size;                    minDiff = Math.abs(size.height - targetHeight);                }            }        }        return optimalSize;    }}</code></pre><p>Any suggestions would be greatly appreciated.</p><p>Thank you.</p>","398641","","","","","2012-09-09 18:30:17","Android: ""Camera.takePicture failed"" Exception","<android><exception><camera>","1","2","1","",""
"4830857","1","","","2011-01-28 16:52:35","1","515","<p>I'm using flickrj flickr API, but I can't get a token. I managed to get a frob, and i call the method that is supposed to give me back the token after the user have authorized my application, but I constantly get ""invalid frob"". Any ideas on how to work this out?</p>","588264","","","","","2011-01-28 17:01:48","invalid frob when getting a token from flickr api","<android><api><authentication><token><flickr>","1","0","","",""
"4830864","1","","","2011-01-28 16:53:26","3","9512","<p>Ok I have a very simple and yet difficult question.</p><p>I have 10 checkboxes, all called 'check', each one has a unique id from 1 - 10.When I press a button on my app I want to be able to tell which checkboxes are checked and which aren't.</p><p>I'm sure the answer is very simple but I can't think of how I can do this.  I have the code for the button, I can't work out how to check each checkbox by id when they are all called 'check'.  Hopefully one of you guys can help me out.</p>","590490","","","","","2013-01-01 03:18:02","Android - Find Item By ID","<java><android>","3","2","1","",""
"4830950","1","4857811","","2011-01-28 17:01:54","7","662","<p>I'm letting monkey run on my app (via android emulator) using the following instruction:</p><p><code>Monkey -p &lt;packagename&gt; -v 5000</code></p><p>I am getting the following errors:</p><pre><code>01-28 11:45:55.392: ERROR/MediaPlayerService(34):   error: -201-28 11:45:55.392: ERROR/MediaPlayer(58): Unable to to create media player01-28 11:45:58.783: ERROR/MediaPlayerService(34):   error: -201-28 11:45:58.783: ERROR/MediaPlayer(58): Unable to to create media player01-28 11:46:13.742: ERROR/MediaPlayerService(34):   error: -201-28 11:46:13.752: ERROR/MediaPlayer(58): Unable to to create media player</code></pre><p>This happens over and over again every few seconds and is the only error that occurs.  This is odd because my app doesn't touch any media player functionality at all.  It is a simple note/to-do app.  Any insight into what monkey is touching that's causing the error and what I could do to prevent it?</p><p>Or can this be safely ignored?</p><p>Thanks!</p><p><strong>EDIT:</strong>I think I found the source of my issue.  Apparently monkey managed to put my keyboard into some sort of Asian language.  And whenever the bottom left key (two Asian characters) is pressed in the soft keyboard image below.  I receive the mediaplayer error.  Does anyone know what this key does??<img src=""http://i.stack.imgur.com/PO38m.png"" alt=""WHY MONKEY! WHY!?!?""></p>","580556","","121493","","2011-02-10 16:26:08","2011-02-10 16:26:08","Monkey giving an odd error on android emulator","<android><testing><android-emulator><monkey><android-monkey>","1","3","0","",""
"4830963","1","4833234","","2011-01-28 17:03:17","1","1861","<p>I have the following code and need to be able to listen to the mic on the phone and use that value to be displayed graphically on some sort of visualizer:</p><pre><code>Timer micTimer = new Timer();micTimer.schedule(new TimerTask(){    @Override    public void run(){        int x = MediaRecorder.getAudioSourceMax();        Log.v(""Timer"", """" + x);    }}, 0, 100);</code></pre><p>I know this is probably far from wrong. Later in the class I am using an AudioRecorder object to record the sound for some post processing. Here I don't want to record anything just display the sound on a visualizer. The log from this code just outputs the number 6 every 100ms. Could it have something to do with it auto-adjusting the gain? If so how do I get round this?</p>","400406","","","","","2011-05-21 08:25:00","Return amplitude of the mic input when not recording","<java><android><audio>","2","0","1","",""
"4831095","1","","","2011-01-28 17:16:47","1","2096","<p>I made some changes and my apps are crashing. Somehow the permissions and usernames of my apps do not line up with the /data/data folder.    Each app's username does not line up with the apps' username on the filesystem.I need to reset the filesystem or the username somehow.</p><p>I need either the name of the application username/group assignment file, or a method of resetting the permissions for all applications. </p>","368817","","","","","2011-04-25 17:53:35","How to reset android /data/data/com.xxx.xxx permissions linux?","<android><linux><bash><permissions>","1","2","","",""
"4831122","1","4868926","","2011-01-28 17:19:01","6","1248","<p>I have two different Search activities implemented with <a href=""http://developer.android.com/guide/topics/search/index.html"">SearchManager</a> in my app. One is the default searchable for the whole app and the other is used for only one activity. These two searches perform lookups of different data, and it doesn't make sense to share the search history across the two different searches. The two different searchables are working fine functionally within the app, my issue is with the recent search histories.</p><p>The problem is that there are two different <a href=""http://developer.android.com/reference/android/provider/SearchRecentSuggestions.html"">SearchRecentSuggestionsProvider</a> classes defined within the app, but any search made in one shows up in both searches' recent search suggestions history. I've read through the SearchManager topic in the Dev Guide but don't see any info about multiple suggestions providers.</p><p>Here are the two providers in the AndroidManifest.xml, in the  node:</p><pre><code>&lt;provider android:name="".SearchOneRecentSuggestionsProvider"" android:authorities=""com.company.SearchOneRecentSuggestionsProvider""&gt;&lt;/provider&gt;&lt;provider android:name="".SearchTwoRecentSuggestionsProvider""    android:authorities=""com.company.SearchTwoRecentSuggestionsProvider""&gt;&lt;/provider&gt;</code></pre><p>Here's the class defined in SearchOneRecentSuggestionsProvider.java:</p><pre><code>package com.company;import android.content.SearchRecentSuggestionsProvider;public class SearchOneRecentSuggestionsProvider extends SearchRecentSuggestionsProvider {     public final static String AUTHORITY = ""com.company.SearchOneRecentSuggestionsProvider"";     public final static int MODE = DATABASE_MODE_QUERIES;     public SearchOneRecentSuggestionsProvider() {      setupSuggestions(AUTHORITY, MODE);     }    }</code></pre><p>(The SearchTwoRecentSuggestionsProvider class looks exactly the same except for replacing One with Two and is in it's own SearchTwoRecentSuggestionsProvider.java file.)</p><p>Here's what is inside the search suggestions database (at /data/data/com.company/databases/suggestions.db):</p><pre><code># sqlite3 suggestions.dbSQLite version 3.5.9Enter "".help"" for instructionssqlite&gt; .tablesandroid_metadata  suggestionssqlite&gt; .schema suggestionsCREATE TABLE suggestions (_id INTEGER PRIMARY KEY,display1 TEXT UNIQUE ON CONFLICT REPLACE,query TEXT,date LONG);sqlite&gt; select * from suggestions;1|searchone|searchone|12961778524442|searchtwo|searchtwo|1296177878744</code></pre><p>There's no column for the SearchRecentSuggestionsProvider, so perhaps there's no way to separate the history for the two searches?</p><p>The end result of all this is that when you do a search in either one of the two different searches, you see both searchone and searchtwo in the recent search history suggestions. I'd like each to have their own history if possible. Hopefully I didn't just miss something silly! Thanks for taking the time to read this.</p>","223573","","","","","2011-02-01 22:57:02","Multiple SearchRecentSuggestionsProvider classes in Android app possible?","<android><search><android-searchmanager>","2","0","6","",""
"4831194","1","","","2011-01-28 17:26:52","0","957","<p>I want to create an android app using the Bump API. my main goal is to use the bump API to exchange &amp; compare information.  The iphone app ""BOINK"" is a good example of what im trying to accomplish.  my idea would have the same comparing function but with a different concept.  With the BOINK app each user enters his/her profile info, bumps with another user, and a result is displayed. so in this case is it possible to show me the java syntax where during a bump the profile data is retrieved and compared against the other user.  </p><p>for example.</p><p>profile Asmoke: nodrink: noexercise: yes</p><p>profile Bsmoke: yesdrink: yesexercise: no</p><p>RESULT: NON COMPATIBLE pop up screen</p>","590690","","590690","","2011-01-30 23:30:02","2011-03-02 07:08:46","using bump api to compare","<android><api><compare><bump>","0","3","","",""
"4831327","1","4889947","","2011-01-28 17:40:51","0","1258","<p>so i need to send a SoapObject as a parameter of a SoapObject............ from the request dump above it seems that the envelope structure is fine.......but the server always gets null when i try get ""filter.street"" from the request......any ideas?</p>","594194","","","","","2011-02-03 18:12:10","Android Ksoap with WCF .svc endpoint","<android><wcf><soap><svc>","1","1","","",""
"4831330","1","4854400","","2011-01-28 17:41:41","0","307","<p>I am using a SimpleCursorAdapter to populate a ListView with items from my database. When a user clicks on an item it takes them to the detail Activity for that item. What is the best practice for displaying that page; just write a display function that grabs all the TextViews I want to set the text for and populate them from the database or to use another SimpleCursorAdapter to set the TextViews? If the answer is to use an adapter, do I have to shove the detail page in a ListView?</p>","40149","","","","","2011-02-01 06:34:53","Using adapters for non-list views","<android>","3","0","","",""
"4831474","1","4831691","","2011-01-28 17:57:20","3","1891","<p>I saw some special characters used by developers in the description of their apps.How do I do that (for example show a star icon instead of *)?</p><p>Also - is it possible to show bold\italic\underlined text in the market description?</p>","380490","","","","","2012-02-27 14:27:20","Android market text format","<android><google-play>","3","1","","",""
"4831499","1","4832022","","2011-01-28 18:00:42","9","6229","<p>Is it possible to set a live wallpaper using some lines of code. For example, i want to tell my users that a live wallpaper is available ""click here to set it"". </p>","260298","","19750","","2011-03-30 21:53:09","2012-11-05 21:01:27","Setting live wallpaper programatically","<android><live-wallpaper>","2","4","11","",""
"4831501","1","4832389","","2011-01-28 18:00:44","1","674","<p>I have been using this guide: <a href=""http://darts.cse.nd.edu:8080/Plone/materials/setting-up-android-development"" rel=""nofollow"">http://darts.cse.nd.edu:8080/Plone/materials/setting-up-android-development</a>, to help me build and load my custom kernel. In my custom kernel, I added my own pre-loaded application, but it never appears when I flash my custom kernel onto my Nexus One. I was wondering if following this guide is the right procedure, or am I doing something wrong?</p>","548852","","","","","2011-01-28 19:45:38","Android: Building and Loading Custom Kernel onto Nexus One","<android>","1","2","1","",""
"4831513","1","4832093","","2011-01-28 18:02:24","1","1652","<p>I am trying to learn how to parse HTML, but as I don't have a lot of experience in either Java or Android, it's a little complicated. I have read the IBM XML parsing tutorial and have learned to parse an RSS feed. My problem is: I would like to get data from an HTML site. I have read some information on HTML cleaner, JSON, etc., but I can't find a good tutorial to help me. Do you have any tutorials that might be helpful?</p><p>Thanks.</p>","519526","","1465910","","2012-09-29 08:31:33","2012-09-29 08:31:33","HTML parsing in Android","<android><parsing><rss><html-parsing><rss-reader>","2","0","1","",""
"4831529","1","","","2011-01-28 18:04:09","7","11023","<p>Is it possible to have a single line TextView that cuts off at the nearest pixel and does not add three dots?</p>","463304","","","","","2011-02-08 19:42:13","Android single line TextView without the dots","<android><textview><truncate>","2","0","1","",""
"4831609","1","4831719","","2011-01-28 18:15:20","0","208","<p>It's well-known on Android discussion forums and SO that Android's API doesn't have a good way of blocking calls. You can have an event trigger when a call comes in, but by the time your app suppresses the call, it has already rang once or twice.</p><p>My idea is to have an app that sets your ringtone volume to mute, then when a call arrives, it would look up the appropriate ringtone for that call and play it if the caller is in your address book. Effectively, it would block unwanted rings, though not unwanted calls.</p><p>Being a relatively inexperienced Android developer, I'd like to know what problems this might cause. What would be the major pitfalls, possible causes of bugs, and problems with the user experience (besides seeing their phone on mute, when it really isn't)?</p><p>Also, any recommendations on how to best implement this idea?</p>","170431","","","","","2011-01-28 19:50:38","What would the pitfalls be of blocking calls on Android by setting the ringer volume to mute, then having an app play the ringer?","<android>","2","0","","",""
"4831643","1","","","2011-01-28 18:19:39","1","517","<p>I'm developing an app for the Archos 5 Internet Tablet. (With Android 1.6)</p><p>I want to start a video in a VideoView within my app. On my Android emulator the following code works fine but on my Archos 5 I always get an error:</p><p>Cannot play video</p><p>Sorry, this video cannot be played. </p><pre><code>//get current window information, and set format, set it up differently, if you need some special effectsgetWindow().setFormat(PixelFormat.TRANSLUCENT);//the VideoView will hold the videoVideoView videoHolder = (VideoView) findViewById(R.id.VideoView01);//MediaController is the ui control hovering above the video (just like in the default youtube player).videoHolder.setMediaController(new MediaController(this));//assing a video file to the video holdervideoHolder.setVideoURI(Uri.parse(""android.resource://mypackage/"" + R.raw.testmovie));//get focus, before playing the video.videoHolder.requestFocus();if(autoplay){    videoHolder.start();}</code></pre><p>Is there a way to run a VideoView on a archos 5?</p><p>I also tried to play the movie with the archos player. With the following code I get the error: ""Cannot find the media file!"".</p><pre><code>    String ACTION_LAUNCH_AVOS = ""android.intent.action.LAUNCH_AVOS"";     String avosCommand = ""ACTION:video_play,url=videoentries:Video/testmovie.wmv,etype=resume"";    final Intent startAvos = new Intent(ACTION_LAUNCH_AVOS,Uri.parse(avosCommand));    startAvos.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK );    startActivity(startAvos);</code></pre><p>I put the video in the Video folder of the Archos. The video runs when I open it with the file browser.</p><p>I always get the error ""Cannot find the media file!"", no matter what url I use.</p><p>Is there a certain folder where I have to put the video so that it can be found? And how do I get the url to that certain folder?    </p><p>It would be great if you could help me!</p><p>Thanks and BR,Thomas</p>","594185","","","","","2011-01-28 18:19:39","VideoView on Archos 5 (Android 1.6) doesn't work","<android><videoview><archos>","0","0","","",""
"4831726","1","4831978","","2011-01-28 18:27:54","0","462","<p>I am using a header that includes two <code>TextView</code>s in the center and to the left of the <code>TextView</code> I am having two <code>Button</code>s and to right of the <code>TextView</code> I am having two <code>Button</code>s. All these four <code>Button</code>'s visibility is set to <code>gone</code>.</p><blockquote>  <p>Button 1 (gone) -- Button  2 (gone) -- Textview 1 -- TextView  2 -- Button 3 (gone) -- Button4 (gone)</p></blockquote><p>The problem is that if I make only <code>Button 1</code> visible the <code>TextView</code> appears in the center if I make only <code>Button 2</code> visible my <code>TextView</code> moves closer to <code>Button 2</code>.</p><p>What I want is that my `TextView' is always centerd.</p><p>How can I do that?</p><p>My code is:</p><pre><code>&lt;Button android:id=""@+id/back""    android:background=""@drawable/back""     android:layout_marginLeft=""10dip""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:layout_alignParentLeft=""true""    android:layout_centerVertical=""true"" /&gt;&lt;Button android:id=""@+id/allcities""    android:background=""@drawable/campusbttn""    android:visibility=""gone""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_marginLeft=""10dip""    android:layout_alignParentLeft=""true""    android:layout_centerVertical=""true"" /&gt;&lt;TextView android:id=""@+id/quaddeal_header_text""    android:layout_width=""50dip""    android:layout_height=""30dip""    android:layout_centerHorizontal=""true""    android:text=""Quad""    android:textSize=""20sp""    android:textColor=""@color/green""     android:layout_centerVertical=""true""     android:layout_toRightOf=""@+id/allcities"" /&gt;    &lt;TextView android:id=""@+id/quaddeal_header_text_add""    android:layout_width=""50dip""     android:layout_height=""30dip""    android:layout_centerHorizontal=""true""    android:text=""Deals""    android:textSize=""20sp""    android:textStyle=""bold""    android:textColor=""@color/green""    android:layout_centerVertical=""true""    android:layout_toRightOf=""@+id/quaddeal_header_text"" /&gt;  &lt;Button android:id=""@+id/quad_share""    android:background=""@drawable/share""    android:visibility=""gone""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:layout_alignParentRight=""true""    android:layout_centerVertical=""true"" /&gt;&lt;Button android:id=""@+id/quad_login""    android:background=""@drawable/button_img""    android:text=""Login""         android:visibility=""gone""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:layout_alignParentRight=""true""    android:layout_centerVertical=""true"" /&gt;</code></pre>","555221","","418183","","2011-01-28 18:50:29","2011-01-28 18:55:41","Android layout problem","<android><layout>","1","0","","",""
"4831816","1","4831846","","2011-01-28 18:37:22","0","62","<p>I have a pretty good understanding of what Intents and Intent Filters can do, but I was wondering if it would be possible to use them to perform something a bit more mundane, like maybe just monitoring a change in a variable value.</p><p>This is unfortunately a bit of a noob question, and it is probably just my inexperience with Java and Android so far. The task I'm trying to accomplish is really just to have a method that is added to the lifecycle that can detect a simple change and react without having to add a method call to the end of every user triggered action. I've thought of adding a game-like thread with an infinite loop that calls a method repeated on a slight delay... but it seems like that would be overkill.</p><p>Thanks a lot,Jeremiah</p>","351060","","351060","","2011-01-28 18:44:10","2011-01-28 18:44:10","Can Intents/Intent Filters be used for more mundane tasks?","<android>","1","0","","",""
"4831824","1","4831949","","2011-01-28 18:37:59","1","969","<p>I'm creating a drawing app for tablets and am interested in how to best handle the drawing canvas, relating to screen orientation changes.  The drawing program tracks the user inputs and stores them as vectors, anchored by X,Y coordinates.</p><p>The issue relates to the different size of X,Y in portrait/landscape modes.  If a user has a canvas that fills the screen (minus notification and title bars), and in portrait mode draws near the bottom of the canvas (say at point 140,460 on a 320x480 screen), when the screen gets flipped to landscape and recreated from the X,Y vectors that I've stored, the point at 140,460 is now out of the bounds of the screen (because the screen is now 480x320).  Likewise, if they draw points in landscape near the right-hand edge of the screen and flip back to portrait, those points will be out of bounds.</p><p>I've looked around at solutions to this, and the obvious one seems to be to simply lock the screen down to a specific orientation.  A number of the drawing apps I've downloaded from the Marketplace handle it this way.</p><p>As I'm designing this for a tablet, I'd like to give the user the flexibility to draw as they like, yet maintain some sanity when it comes to the screen bounds, etc.</p><p>Ideas I've had/tried include:</p><ul><li>locking to a particular orientation - ok, but hate forcing user to a certain preference</li><li>locking to a particular orientation and hiding title and notification bars, so the user is simply presented a large blank canvas that they can use as they wish - but hate that the notification bar is hidden</li></ul><p>I thought about the possibility of hiding the title bar, showing notification, allowing orientation change and then if the screen is rotated to landscape, rotating the canvas back to portrait, but when the navigation bar moves from what would have been the top in portrait to the right-hand side in landscape, I still get the same X,Y bounding issues, just to a much smaller degree (the width of the notification bar effectively).</p><p>Any thoughts on solutions for this?</p><p>Thanks.</p>","357801","","","","","2011-01-28 18:52:44","Android: Drawing and rotating on a canvas","<android><canvas><coordinates><screen-rotation>","1","0","","",""
"4831910","1","","","2011-01-28 18:47:34","0","549","<p>I'm working on a game and due to the fact it was ported from Blackberry the project started with drawing on a Canvas. Now the game runs pretty well that way, but we want to use OpenGL draw textures on the newer phones, where available.</p><p>The problem is that most phone support the draw_texture extension even if in reality their performance is awful. As an example, the HTC Wildfire next to my computer with the Android PixelFlinger 1.2 runs at 5fps with opengl and 30 fps with Canvas.</p><p>So how can I detect under which condition to use Canvas over OpenGL? I can detect if the renderer is PixelFlinger for sure, but are there other hints? Other renderers to avoid?</p>","3610","","44729","","2011-01-28 19:12:45","2011-01-28 19:43:15","How to detect the slow implementations of OpenGL on Android","<android><opengl-es>","1","0","","",""
"4831918","1","6716131","","2011-01-28 18:49:22","16","17949","<p>I've a couple of question I haven't been able to figure out.</p><p>I'm trying to get all the checked elements from a <code>ListView</code> but:</p><ol><li><p>If I check and then uncheck an element, it's returned as ""checked"" by the <code>getCheckedItemPositions()</code> function</p></li><li><p>I don't know how can I iterate through this: </p><pre><code>SparseBooleanArray checked = list.getCheckedItemPositions();</code></pre></li></ol>","564468","","419","","2011-07-18 11:04:24","2014-03-25 01:30:53","How to get all checked items from a ListView?","<android><listview><checkbox>","8","2","5","",""
"4832084","1","","","2011-01-28 19:09:59","1","543","<p>If i use ""intent"" to download a file with android browser like that :</p><pre><code>Intent downloadIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(""http://myserver.com/picture1.jpg""));startActivity(downloadIntent);</code></pre><p>Can i catch some event when the browser finish the download ?strong text</p>","587853","","244296","","2011-01-28 19:20:12","2011-01-28 20:04:05","Android - browser and download notification","<java><android>","1","0","","",""
"4832262","1","4955612","","2011-01-28 19:29:56","30","6933","<p>So we've seen the preview sdk and the neat new stuff like ActionBar and Fragments. Making a lot of method calls will be unavoidable to make use of these, so what strategies are there for maintaining 1 version of the app, which will let me use all the snazzy new stuff but also work on devices running 2.3 or below? My app targets 1.5 - 2.3 at the moment. </p>","240251","","750987","","2011-05-29 06:47:59","2011-11-30 11:30:33","Strategies for Honeycomb & backward compatibility","<android><backwards-compatibility><android-3.0-honeycomb>","5","0","28","",""
"4832276","1","","","2011-01-28 19:31:28","3","1070","<p>In my Android NDK app, the C++ library runs in a different thread than the ui thread. A JNI call from C++ creates an instance of Java class Foo. I'd like to have another Java object Bar, created on the UI thread, to call methods on Foo. How do I do that? </p><p>Difficulty bonus: Foo has several native methods that call corresponding JNI functions from the C++ library. How to I ensure that those calls are thread safe? </p><p>Difficulty bonus 2: Some of Bar's methods are actually overrides of callback methods, specifically of WebViewClient. The return code of some of the methods depend on the result of the call to Foo's method. So the call to Foo would need to happen immediately. </p>","93802","","93802","","2011-01-28 20:11:29","2011-04-01 18:58:58","Android/Java: How to call methods of an object created on a different thread?","<java><c++><android><jni><android-ndk>","4","3","","",""
"4832498","1","","","2011-01-28 20:01:31","3","2003","<p>I've search around and found questions about storing and retrieving files from a ContentProvider but my situation is a little different.</p><p>I am building an app that will host content for one of our other apps.  Think of it as a way to sell content without actually having in-app-purchase.</p><p>It is currently working, but I have to make copies of the images into the cache so that the ParcelFileDescriptor passed back from openFile is valid.  I was hoping that someone might know how to reference and arbitrary ParcelFileDescriptor from a file bundled with the app.  Assets doesn't seem to facilitate this.  Raw is likely the same scenario.</p><p>Let me try to explain by example...THIS is how I would expect things to work if I were storing all my files in assets (which I currently am).</p><pre><code>@Overridepublic ParcelFileDescriptor openFile(Uri uri, String mode)throws FileNotFoundException {    String fileName = uri.getEncodedPath();    AssetFileDescriptor afd = getContext().getAssets().openFd(fileName);    ParcelFileDescriptor pfd = afd.getParcelFileDescriptor();    return pfd;}</code></pre><p>But, of course, this doesn't work.  I get a valid ParcelFileDescriptor returned to the app calling the ContentResolver, but it appears to be pointing to the entire assets directory.After reading around the intertubes for a while, it seems that assets doesn't allow for a descriptor to reference it from outside of the app it's associated with (though, I have no references for this).</p><p>I ""solved"" the problem by copying the file in question into the cache of the app hosting the ContentProvider then returning the ParcelFileDescriptor of the cached file.This works just fine... but I end up doubling the size of the app.</p><p>That's the heart of my question... Is there a way to bundle a static file (of any type) to be served from a ContentProvider without having to copy it into a cache.</p><p>Even if I were to use sqlite and store the files as blobs, I'd have to make an initial copy of the database so that it would be writable... so it's the same end.</p><p>Does this make sense? :-)</p>","593175","","","","","2012-11-20 12:45:22","Serving images and other files from a ContentProvider","<android><image><android-contentprovider>","1","2","2","",""
"4832505","1","4832543","","2011-01-28 20:01:55","5","280","<p>I come from an Actionscript3 background and this is my first time writing any Java in my life. Hashtables seem to be similar to Dictionaries in Flash, but I want to make sure I am using them correctly. I believe the Hashtable is typed to accept Strings as keys and Typefaces as objects. Is this correct? Is there a different Collection sub-class that would be more appropriate for something like this? By all means, please tear my n00b Java up. I need to learn this.</p><pre><code>package com.typeoneerror.apps.app_name.utils;import android.content.Context;import android.graphics.Typeface;import java.util.Hashtable;public class FontRegistry{    private static FontRegistry _instance;    private Context                         _context;    private Hashtable&lt;String, Typeface&gt;     _fonts;    private FontRegistry()    {        _fonts = new Hashtable&lt;String, Typeface&gt;();    }    public static FontRegistry getInstance()    {        if (_instance == null)        {            _instance = new FontRegistry();        }        return _instance;    }    public void init(Context context)    {        _context = context;    }    public Typeface getTypeface(int resourceId)    {        String fontName = _context.getResources().getString(resourceId);        if (!_fonts.containsKey(fontName))        {            String fontPath = ""fonts/"" + fontName;            Typeface typeface = Typeface.createFromAsset(_context.getAssets(), fontPath);            _fonts.put(fontName, typeface);        }        return (Typeface)_fonts.get(fontName);    }}</code></pre>","53653","","","","","2011-01-28 20:42:24","Is Hashtable appropriate for storing assets?","<java><android><actionscript-3>","2","3","2","",""
"4832604","1","4832926","","2011-01-28 20:13:06","1","4014","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1782743/twitter-integration-on-android-app"">twitter integration on android app</a>  </p></blockquote><p>Hi all, how to post the tweets from my android application. I searched stackoverflow for this but i failed to get the solution. can anyone tell me how can i proceed now??</p><p>thanks<br>venu </p>","461975","","","","","2011-01-28 20:50:01","how to post tweets from android application","<android><twitter>","1","1","1","2011-01-29 01:16:39",""
"4832675","1","4854771","","2011-01-28 20:19:42","3","861","<p>Regarding C2DM, if I have a phone and another device (another phone, potentially a GoogleTV, etc) and I setup a C2DM server, will I receive two different Registration ID's that I can then use to send intents to both devices?</p><p>What seems like it may happen is this: I register one device and I receive my ID. Then I register another device and I receive a different ID which invalidates the first. Is my assumption correct? </p><p>I don't want to do a lot of development only to find out that a user's account can only have one Registration ID active at a time.</p>","594348","","","","","2011-04-09 11:52:43","If I register multiple Android devices in C2DM, do I receive multiple Registration IDs","<php><android><android-c2dm>","1","0","","",""
"4832937","1","4837490","","2011-01-28 20:51:26","1","1529","<p>recently the android market and shopsavvy underwent UI overhauls. The result is a list then seems to slide under a curved top area with buttons on it. The top section seems to cast a slight dropshadow on the list and the list itsself has a different coloured heading to the rest of the list. It's a really big improvement on the look of android UI's , much more professional looking.</p><p>So how is the sliding under the curved top section with drop shadow achieved?</p><p>thanks guys</p>","458872","","","","","2011-05-03 08:08:42","Android - How to create a UI like the market or Shopsavvy","<android><gui><interface><google-play>","1","0","2","",""
"4832943","1","4832988","","2011-01-28 20:52:38","1","966","<p>I'm trying to launch the mapping application when an SMS arrives containing map coordinates. I have my broadcastreceiver set up with no problems and as I understand it I need to do something like:</p><pre><code>                Uri uri = Uri.parse(""geo:"" + latitude  + "","" + longitude +""?z=10"");                Intent mapintent = new Intent(android.content.Intent.ACTION_VIEW, uri);                startActivity(mapintent);</code></pre><p>but Eclipse is telling me that startActivity isn't defined for the type BroadcastReceiver. How do I go about starting the intent?</p>","594397","","","","","2011-01-28 22:11:20","Is it possible to start an intent from a broadcast receiver?","<android><google-maps><android-intent><broadcastreceiver>","3","0","","",""
"4832977","1","4833018","","2011-01-28 20:56:32","2","254","<p>I have an app that is ""skinned"" at launch. The idea being that it looks to the server and loads several graphics for display.  It then moves through a sequence of Activities. I don't want it to have to keep visiting the server for the art, however, every time it comes to Activity 1.  I want to be able to store the images until such time as the user manually clicks a ""refresh art"" button. </p><p>I have every part of this worked out (the downloading, display, storing bits of other data in SharedPreferences), but I can't figure out where to save these images. They don't need to be available to any other application, I just want to have access to them from one running of the app to the next, until the user manually refreshes them.</p><p>TIA.</p>","59947","","","","","2011-01-28 22:22:02","How do I store a JPG in Android, for later use?","<android>","2","0","1","",""
"4833082","1","","","2011-01-28 21:09:48","3","1631","<p>is there any way to convert an html web page to xml and get data (parsing) like the rss feed?thanks</p>","519526","","","","","2011-01-28 21:20:04","html to xml(parsing)","<android><html><xml><parsing>","1","3","1","",""
"4833084","1","4833247","","2011-01-28 21:09:52","0","1598","<p>Is there any easy way to sort a JSONArray of objects by an attribute in Android?</p>","408079","","300311","","2012-01-11 14:37:03","2012-01-11 14:37:03","Is there any easy way to sort a JSONArray of objects by an attribute in Android?","<android><json><sorting><jsonarray>","1","0","","",""
"4833200","1","4833489","","2011-01-28 21:24:58","3","1465","<p>i just new in the android world.</p><p>Basically i just want to record the users voice.<br>I have downloaded some samples and i have not been able to test them using the emulator.<br>Sine it's possible to enable ""audio recording support"" when creating a new Android Virtual Device, i'm just guessing what's wrong here.</p><p>questions:<br>is it possible to use the emulator for audio recording? how?</p><p>thanks</p>","580468","","","","","2012-11-14 09:46:45","android, recording audio with the emulator","<android><android-emulator><android-widget>","2","0","","",""
"4833245","1","","","2011-01-28 21:31:17","0","1263","<p>So here's my issue.  </p><pre><code>String[] list = ws.getList() ///returns a String[] of 2900 elements.AutoCompleteTextView actv= (AutoCompleteTextView)findViewById(R.id.field);ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.dropdownmenu, list); actv.setAdapter(adapter);</code></pre><p>My question is... when I run my application, my autocompletetextview does not generate any sort of text whenever I type in it.  However, if I shorten my list to like, 30 elements, it works perfectly.  Are autocompletetextviews limited to a certain amount of items?  </p><p>Thanks!</p>","588095","","142162","","2011-01-28 21:36:51","2013-08-13 13:10:04","Android -- AutocompleteTextView dropdown question","<android><autocompletetextview>","3","0","","",""
"4833249","1","4833903","","2011-01-28 21:32:45","0","912","<p>I'm trying to keep my activity calling flow simple for the user.  Always one instance of the activity on the history stack.</p><p>So using flag <a href=""http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_REORDER_TO_FRONT"" rel=""nofollow"">FLAG_ACTIVITY_REORDER_TO_FRONT</a>, is perfect! but there is a slight issue.  </p><p>The activity is brought to the front and the onCreate() is not called if already started. Makes sense but I want the behavior to be that it calls onCreate().</p><p>Thanks for the help!</p><p>-Jona</p>","398248","","","","","2011-01-28 23:04:50","How to bring Activity to top of stack and reset it?","<android><activity>","1","0","","",""
"4833382","1","4851448","","2011-01-28 21:50:08","0","679","<p>How can I override the XML attributes of TwoLineListItem. I don't want to do it Java. I'm trying to make the backgrounds of the view and the textViews transparent, but it isn't working when I do it in Java.</p><p>setBackGroundDrawablesetBackGroundColorsetBackGroundResource </p><p>These don't seem to do what I need them to do. I've tried making no background. I've tried setting an alpha value of 0 to the color, but I still get the same old white list boxes. I have a drawable background that is behind the TwoLineListItem view, and thats all I want to show for the background, not the Item background.</p>","591016","","","","","2011-01-31 13:36:38","TwoLineListItem - Custom attributes","<android><android-layout>","1","0","","",""
"4833522","1","","","2011-01-28 22:05:31","3","2838","<p>I have an app that consists of multiple activities and one service.  The primary activity is a UI for streaming audio.  When the user pushes the play button, the service is started, streaming the audio and reading metadata.  The metadata is then pushed to the UI if visible and the Notification Bar.  Everything functions as expected until a phone call comes in.  I had assumed (silly me) that by using the standard media player, android would handle switching audio between the stream and phone call itself.  So I created a PhoneStateListener to handle the calls and stop my player as needed.  I've done something wrong though, because it still isn't working.  If you wouldn't mind looking at the service class and perhaps the log files, I'd really appreciate it!</p><p>Sorry everything is so verbose!</p><p>Thank you!Dae</p><pre><code>package com.wtts.app;import java.io.BufferedInputStream;import java.io.FilterInputStream;import java.io.IOException;import java.io.InputStream;import java.net.MalformedURLException;import java.net.URL;import java.net.URLConnection;import java.util.Timer;import java.util.TimerTask;import android.app.Notification;import android.app.NotificationManager;import android.app.PendingIntent;import android.app.Service;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.media.AudioManager;import android.media.MediaPlayer;import android.os.IBinder;import android.telephony.PhoneStateListener;import android.telephony.TelephonyManager;import android.util.Log;public class WttsListenService extends Service { private String txtArtist = """"; private String txtTitle = """"; private String txtAlbum = """"; private Bitmap bmAlbum; private String lastSong = ""a""; String[] mData = new String[3]; boolean IS_PLAYING; boolean INTERRUPTED; public URL streamUrl = null; String url = ""http://customchannels-audio.streamguys.com/wttsfm-mp3""; public static final String UPDATE_SONG = ""com.wtts.custom.intent.action.UPDATE_SONG""; private Timer timer = new Timer(); private static final long UPDATE_INTERVAL = 8500; public static final String PHONE_STATE = ""android.intent.action.PHONE_STATE""; IntentFilter filter; BroadcastReceiver receiver; MediaPlayer player = new MediaPlayer(); private NotificationManager nm; private int NOTIFICATION_ID = 10101; public static final String SHOW_PROGRESS = ""com.wtts.custom.intent.action.SHOW_PROGRESS""; @Override public IBinder onBind(Intent intent) {  return null; } @Override public void onCreate() {  super.onCreate();  Log.i(this.toString(), ""onCreate"");  filter = new IntentFilter(PHONE_STATE);  receiver = new ServiceReceiver();  registerReceiver(receiver, filter);  if (player != null) {   player.reset();   player.release();   player = null;  }  startPlaying(); } void startPlaying() {  Log.i(this.toString(), ""startPlaying"");  try {   player = new MediaPlayer();   player.setDataSource(url);   player.setAudioStreamType(AudioManager.STREAM_MUSIC);   player.prepare();   player.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {    @Override    public void onPrepared(MediaPlayer player) {     // TODO Auto-generated method stub     player.start();     updateProgress(""PLAY"");    }   });  } catch (Exception e) {   Log.e(getClass().getSimpleName(), ""create media player failed"", e);   player.reset();   player.release();   player = null;   updateProgress(""FAIL"");   return;  }  timer.scheduleAtFixedRate(new TimerTask() {   public void run() {    try {     getMetadata();     Thread.sleep(UPDATE_INTERVAL);    } catch (InterruptedException ie) {     Log.e(getClass().getSimpleName(),       ""MetadataService InterruptedException ""         + ie.toString());    }   }  }, 0, UPDATE_INTERVAL); } void notifyUser() {  Log.i(this.toString(), ""notifyUser"");  nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);  Notification note = new Notification(R.drawable.wttsicon, ""92.3 WTTS"",    System.currentTimeMillis());  PendingIntent intent = PendingIntent.getActivity(this, 0, new Intent(    this, WttsApp.class), 0);  String strA = ""92.3 WTTS"";  String strB = ""Live Stream"";  if (txtArtist != """") {   strA = txtTitle;  }  if (txtTitle != """") {   strB = txtArtist;  }  note.setLatestEventInfo(this, strA, strB, intent);  nm.notify(NOTIFICATION_ID, note); } @Override public void onDestroy() {  Log.i(this.toString(), ""onDestroy"");  super.onDestroy();  if (timer != null) {   timer.cancel();  }  if (nm != null) {   nm.cancel(NOTIFICATION_ID);  }  if (player != null) {   player.stop();   player.release();  }  unregisterReceiver(receiver); } private void updateProgress(String state) {  Intent intent;  try {   intent = new Intent(SHOW_PROGRESS);   intent.putExtra(""state"", state);   sendBroadcast(intent);  } catch (Exception e) {   Log.e(getClass().getSimpleName(),     ""sendBroadcast failed - stop spinner"", e);   intent = null;  }  intent = null; } public class ServiceReceiver extends BroadcastReceiver {  @Override  public void onReceive(Context context, Intent intent) {   try {    MyPhoneStateListener phoneListener = new MyPhoneStateListener();    TelephonyManager telephony = (TelephonyManager) context      .getSystemService(Context.TELEPHONY_SERVICE);    telephony.listen(phoneListener,      PhoneStateListener.LISTEN_CALL_STATE);   } catch (Exception e) {    Log.i(""Exception"", ""ServiceReceiver() e = "" + e);   }  } } public class MyPhoneStateListener extends PhoneStateListener {  public void onCallStateChanged(int state, String incomingNumber) {   try {    switch (state) {    case TelephonyManager.CALL_STATE_RINGING:     Log.i(""Telephony Manager"", ""phone state="" + state);     if (IS_PLAYING) {      INTERRUPTED = true;      updateProgress(""STOP"");      player.setAudioStreamType(AudioManager.AUDIOFOCUS_LOSS);      // player.stop();     }     break;    case TelephonyManager.CALL_STATE_OFFHOOK:     Log.i(""Telephony Manager"", ""phone state="" + state);     break;    case TelephonyManager.CALL_STATE_IDLE:     Log.i(""Telephony Manager"", ""phone state="" + state);     if (INTERRUPTED) {      INTERRUPTED = false;      player.setAudioStreamType(AudioManager.AUDIOFOCUS_GAIN);      // player.start();      updateProgress(""PLAY"");     }     break;    }   } catch (Exception e) {    Log.i(""Exception"", ""PhoneStateListener() e = "" + e);   }  } }; private void getMetadata() {  try {   streamUrl = new URL(url);  } catch (MalformedURLException e) {   e.printStackTrace();  }  IcyStreamMeta streamMeta = null;  try {   streamMeta = new IcyStreamMeta(streamUrl);   try {    streamMeta.refreshMeta();    bmAlbum = null;    try {     mData = streamMeta.getSongInfo();     txtArtist = mData[0];     txtTitle = mData[1];     txtAlbum = mData[2];    } catch (Exception e) {     Log.e(this.toString(), ""mData = streamMeta error"", e);     txtArtist = """";     txtTitle = """";     txtAlbum = """";    }   } catch (IOException e) {    Log.e(getClass().getSimpleName(),      ""streamMeta.refreshMeta error"", e);   }  } catch (Exception e) {   e.printStackTrace();  }  String thisSong = txtArtist + txtTitle + txtAlbum;  if (thisSong.equals(lastSong)) {   // do nothing  } else {   if (txtAlbum == """") {   } else if (txtAlbum == null) {   } else {    bmAlbum = findImage();   }   submitSong();   lastSong = txtArtist + txtTitle + txtAlbum;  } } public void submitSong() {  Log.i(this.toString(), ""submitSong"");  Intent intent = new Intent(UPDATE_SONG);  intent.putExtra(""Artist"", txtArtist);  intent.putExtra(""Title"", txtTitle);  intent.putExtra(""Album"", txtAlbum);  intent.putExtra(""bmAlbum"", bmAlbum);  try {   sendBroadcast(intent);  } catch (Exception e) {   Log.e(getClass().getSimpleName(), ""sendBroadcast failed"", e);  }  notifyUser(); } Bitmap findImage() {  Log.i(this.toString(), ""findImage"");  URL fullUrl = null;  String tempAlbum = txtAlbum;  tempAlbum = tempAlbum.replaceAll("" "", ""_"");  String imageUrl = getString(R.string.imageurl) + tempAlbum    + getString(R.string.imageformat);  imageUrl = imageUrl.replaceAll(""\n"", """");  try {   fullUrl = new URL(imageUrl);  } catch (MalformedURLException e) {   // TODO Auto-generated catch block   // Log.i(getClass().getSimpleName(), ""imageUrl not set"");   e.printStackTrace();   return null;  }  try {   final URLConnection conn = fullUrl.openConnection();   conn.connect();   final BufferedInputStream bis = new BufferedInputStream(     new FlushedInputStream(conn.getInputStream()));   bmAlbum = BitmapFactory.decodeStream(bis);   bis.close();   return bmAlbum;  } catch (IOException e) {   Log.d(getClass().getSimpleName(), ""album image not set"");  }  return null; } /*  * An InputStream that skips the exact number of bytes provided, unless it  * reaches EOF.  */ static class FlushedInputStream extends FilterInputStream {  public FlushedInputStream(InputStream inputStream) {   super(inputStream);  }  @Override  public long skip(long n) throws IOException {   long totalBytesSkipped = 0L;   while (totalBytesSkipped &lt; n) {    long bytesSkipped = in.skip(n - totalBytesSkipped);    if (bytesSkipped == 0L) {     int b = read();     if (b &lt; 0) {      break; // we reached EOF     } else {      bytesSkipped = 1; // we read one byte     }    }    totalBytesSkipped += bytesSkipped;   }   return totalBytesSkipped;  } }}</code></pre><p>LogCat Output:</p><pre><code>01-28 16:35:40.487: INFO/com.wtts.app.IcyStreamMeta@43fea268(274): {StreamTitle=Pearl Jam~Black~Ten01-28 16:35:40.487: INFO/com.wtts.app.IcyStreamMeta@43fea268(274): ~334000~S~~~~5:34~Epic}01-28 16:35:40.487: INFO/com.wtts.app.IcyStreamMeta@43fea268(274): getSongInfo01-28 16:35:40.497: INFO/com.wtts.app.IcyStreamMeta@43fea268(274): return mData01-28 16:35:40.570: WARN/AudioFlinger(33): write blocked for 85 msecs, 476 delayed writes, thread 0xb3f001-28 16:35:45.597: WARN/AudioFlinger(33): write blocked for 80 msecs, 522 delayed writes, thread 0xb3f001-28 16:35:48.987: INFO/AudioService(58):  AudioFocus  requestAudioFocus() from AudioFocus_For_Phone_Ring_And_Calls01-28 16:35:49.067: INFO/Telephony Manager(274): phone state=101-28 16:35:49.077: DEBUG/CallNotifier(125): RINGING... (new)01-28 16:35:49.097: DEBUG/CallNotifier(125): onNewRingingConnection():  incoming: true state: INCOMING post dial state: NOT_STARTED01-28 16:35:49.567: DEBUG/Ringer(125): ring()...01-28 16:35:49.677: DEBUG/Ringer(125): mRingHandler: PLAY_RING_ONCE...01-28 16:35:49.677: DEBUG/Ringer(125): creating ringtone: content://settings/system/ringtone01-28 16:35:49.837: INFO/ActivityManager(58): Starting activity: Intent { act=android.intent.action.MAIN flg=0x10840000 cmp=com.android.phone/.InCallScreen }01-28 16:35:50.157: DEBUG/MediaPlayer(125): Couldn't open file on client side, trying server side01-28 16:35:50.317: DEBUG/PhoneWindow(274): couldn't save which view has focus because the focused view com.android.internal.policy.impl.PhoneWindow$DecorView@43e47b58 has no id.01-28 16:35:50.357: ERROR/MediaPlayerService(33): Couldn't open fd for content://settings/system/ringtone01-28 16:35:50.357: ERROR/MediaPlayer(125): Unable to to create media player01-28 16:35:50.367: ERROR/RingtoneManager(125): Failed to open ringtone content://settings/system/ringtone01-28 16:35:50.647: DEBUG/InCallScreen(125): onCreate()...  this = com.android.phone.InCallScreen@43ecc0e001-28 16:35:51.817: WARN/ResourceType(125): getEntry failing because entryIndex 65 is beyond type entryCount 101-28 16:35:52.147: DEBUG/dalvikvm(125): GC_FOR_MALLOC freed 5482 objects / 312040 bytes in 140ms01-28 16:35:52.837: DEBUG/InCallScreen(125): initInCallTouchUi()...01-28 16:35:52.847: DEBUG/ManageConferenceUtils(125): ManageConferenceUtils constructor...01-28 16:35:52.847: DEBUG/InCallScreen(125): - Using SlidingDrawer-based dialpad.  Found dialerView: com.android.phone.DTMFTwelveKeyDialerView@43edf87001-28 16:35:52.867: DEBUG/InCallScreen(125):   ...and the SlidingDrawer: android.widget.SlidingDrawer@43edb1f801-28 16:35:52.887: DEBUG/InCallScreen(125): onCreate(): this is our very first launch, checking intent...01-28 16:35:52.887: DEBUG/InCallScreen(125): internalResolveIntent: action=android.intent.action.MAIN01-28 16:35:52.897: DEBUG/InCallScreen(125): onCreate(): mInCallInitialStatus = SUCCESS01-28 16:35:52.917: DEBUG/InCallScreen(125): onCreate(): exit01-28 16:35:52.917: DEBUG/InCallScreen(125): onResume()...01-28 16:35:52.937: DEBUG/PhoneApp(125): disable status bar01-28 16:35:52.937: DEBUG/PhoneApp(125): StatusBarManager.DISABLE_EXPAND01-28 16:35:52.947: DEBUG/StatusBar(58): DISABLE_EXPAND: yes01-28 16:35:53.047: DEBUG/InCallScreen(125): - onResume: initial status = SUCCESS01-28 16:35:53.047: DEBUG/InCallScreen(125): setInCallScreenMode: NORMAL01-28 16:35:53.077: DEBUG/InCallScreen(125): syncWithPhoneState()...01-28 16:35:53.077: DEBUG/PhoneUtils(125): dumpCallState():01-28 16:35:53.087: DEBUG/PhoneUtils(125): - Phone: Handler{43e79ba8}, name = GSM, state = RINGING01-28 16:35:53.087: DEBUG/PhoneUtils(125):   - FG call: IDLE isAlive false isRinging false isDialing false isIdle true hasConnections false01-28 16:35:53.087: DEBUG/PhoneUtils(125):   - BG call: IDLE isAlive false isRinging false isDialing false isIdle true hasConnections false01-28 16:35:53.087: DEBUG/PhoneUtils(125):   - RINGING call: INCOMING isAlive true isRinging true isDialing false isIdle false hasConnections true01-28 16:35:53.087: DEBUG/PhoneUtils(125):   - hasRingingCall true hasActiveCall false hasHoldingCall false allLinesTaken false01-28 16:35:53.107: DEBUG/PhoneUtils(125):   - Ringer state: false01-28 16:35:53.107: DEBUG/InCallScreen(125): updateScreen()...01-28 16:35:53.127: DEBUG/InCallScreen(125): - updateScreen: updating the in-call UI...01-28 16:35:53.237: DEBUG/InCallScreen(125): dismissAllDialogs()...01-28 16:35:53.237: DEBUG/PhoneApp(125): updateWakeState: callscreen true, dialer false, speaker false...01-28 16:35:53.257: DEBUG/PhoneApp(125): updateWakeState: keepScreenOn = true (isRinging true, isDialing false, showingDisc false)01-28 16:35:53.357: DEBUG/InCallScreen(125): onPhoneStateChanged()...01-28 16:35:53.357: DEBUG/InCallScreen(125): updateScreen()...01-28 16:35:53.407: DEBUG/InCallScreen(125): - updateScreen: updating the in-call UI...01-28 16:35:53.467: DEBUG/InCallScreen(125): dismissAllDialogs()...01-28 16:35:53.467: DEBUG/PhoneApp(125): updateWakeState: callscreen true, dialer false, speaker false...01-28 16:35:53.477: DEBUG/PhoneApp(125): updateWakeState: keepScreenOn = true (isRinging true, isDialing false, showingDisc false)01-28 16:35:53.877: WARN/InputManagerService(58): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@43f3e628 (uid=10036 pid=274)01-28 16:35:54.107: INFO/ActivityManager(58): Displayed activity com.android.phone/.InCallScreen: 3613 ms (total 3613 ms)01-28 16:35:54.187: INFO/ARMAssembler(58): generated scanline__00000177:03010104_00000001_00000000 [ 44 ipp] (66 ins) at [0x333318:0x333420] in 6539073 ns01-28 16:35:57.857: INFO/com.wtts.app.IcyStreamMeta@43ed1820(274): {StreamTitle=Pearl Jam~Black~Ten01-28 16:35:57.857: INFO/com.wtts.app.IcyStreamMeta@43ed1820(274): ~334000~S~~~~5:34~Epic}01-28 16:35:57.857: INFO/com.wtts.app.IcyStreamMeta@43ed1820(274): getSongInfo01-28 16:35:57.867: INFO/com.wtts.app.IcyStreamMeta@43ed1820(274): return mData01-28 16:35:57.947: WARN/AudioFlinger(33): write blocked for 88 msecs, 557 delayed writes, thread 0xb3f001-28 16:35:59.797: DEBUG/dalvikvm(130): GC_EXPLICIT freed 1200 objects / 86592 bytes in 368ms01-28 16:36:02.951: WARN/AudioFlinger(33): write blocked for 76 msecs, 600 delayed writes, thread 0xb3f001-28 16:36:05.347: WARN/ResourceType(125): Attempt to retrieve bag 0x01010041 which is invalid or in a cycle.01-28 16:36:05.417: DEBUG/InCallTouchUi(125): onDialTrigger(whichHandle = 1)...01-28 16:36:05.417: DEBUG/InCallScreen(125): handleOnscreenButtonClick(id 2131099670)...01-28 16:36:05.437: DEBUG/InCallScreen(125): internalAnswerCall: answering...01-28 16:36:05.437: DEBUG/Ringer(125): stopRing()...01-28 16:36:05.477: DEBUG/Ringer(125): mRingHandler: STOP_RING...01-28 16:36:05.477: DEBUG/Ringer(125): - STOP_RING with null ringtone!  msg = { what=3 when=304812 }01-28 16:36:05.508: INFO/phone(125): acceptCall: incoming...01-28 16:36:05.558: DEBUG/AudioHardwareInterface(33): setMode(IN_CALL)01-28 16:36:05.568: DEBUG/dalvikvm(58): GREF has increased to 30101-28 16:36:05.607: DEBUG/InCallTouchUi(125): updateState: Too soon after last action; not drawing!01-28 16:36:05.897: DEBUG/dalvikvm(125): GC_EXTERNAL_ALLOC freed 2894 objects / 169384 bytes in 137ms01-28 16:36:06.217: INFO/AudioService(58):  AudioFocus  requestAudioFocus() from AudioFocus_For_Phone_Ring_And_Calls01-28 16:36:06.308: DEBUG/CallNotifier(125): stopRing()... (OFFHOOK state)01-28 16:36:06.308: DEBUG/Ringer(125): stopRing()...01-28 16:36:06.337: DEBUG/Ringer(125): - stopRing: null mRingHandler!01-28 16:36:06.438: DEBUG/InCallScreen(125): onPhoneStateChanged()...01-28 16:36:06.438: DEBUG/InCallScreen(125): updateScreen()...01-28 16:36:06.457: DEBUG/InCallScreen(125): - updateScreen: updating the in-call UI...01-28 16:36:06.508: DEBUG/PhoneApp(125): updateWakeState: callscreen true, dialer false, speaker false...01-28 16:36:06.508: DEBUG/PhoneApp(125): updateWakeState: keepScreenOn = false (isRinging false, isDialing false, showingDisc false)01-28 16:36:07.048: INFO/Telephony Manager(274): phone state=201-28 16:36:07.158: INFO/Telephony Manager(274): phone state=201-28 16:36:07.358: DEBUG/dalvikvm(157): GC_EXPLICIT freed 2275 objects / 127704 bytes in 1656ms01-28 16:36:07.437: INFO/ActivityManager(58): Process android.process.acore (pid 157) has died.01-28 16:36:10.438: DEBUG/dalvikvm(274): GC_FOR_MALLOC freed 38735 objects / 957792 bytes in 151ms01-28 16:36:11.838: INFO/com.wtts.app.IcyStreamMeta@43e887b0(274): {StreamTitle=Pearl Jam~Black~Ten01-28 16:36:11.838: INFO/com.wtts.app.IcyStreamMeta@43e887b0(274): ~334000~S~~~~5:34~Epic}01-28 16:36:11.838: INFO/com.wtts.app.IcyStreamMeta@43e887b0(274): getSongInfo01-28 16:36:11.848: INFO/com.wtts.app.IcyStreamMeta@43e887b0(274): return mData01-28 16:36:11.938: WARN/AudioFlinger(33): write blocked for 107 msecs, 621 delayed writes, thread 0xb3f001-28 16:36:16.968: WARN/AudioFlinger(33): write blocked for 74 msecs, 666 delayed writes, thread 0xb3f001-28 16:36:21.167: DEBUG/CallNotifier(125): stopRing()... (OFFHOOK state)01-28 16:36:21.167: DEBUG/Ringer(125): stopRing()...01-28 16:36:21.217: DEBUG/Ringer(125): - stopRing: null mRingHandler!01-28 16:36:21.297: DEBUG/InCallScreen(125): onPhoneStateChanged()...01-28 16:36:21.297: DEBUG/InCallScreen(125): updateScreen()...01-28 16:36:21.297: DEBUG/InCallScreen(125): - updateScreen: updating the in-call UI...01-28 16:36:21.328: DEBUG/PhoneApp(125): updateWakeState: callscreen true, dialer false, speaker false...01-28 16:36:21.328: DEBUG/PhoneApp(125): updateWakeState: keepScreenOn = true (isRinging false, isDialing false, showingDisc true)01-28 16:36:21.477: INFO/Telephony Manager(274): phone state=001-28 16:36:21.527: INFO/Telephony Manager(274): phone state=001-28 16:36:21.577: INFO/AudioService(58):  AudioFocus  abandonAudioFocus() from AudioFocus_For_Phone_Ring_And_Calls01-28 16:36:21.707: DEBUG/CallNotifier(125): DISCONNECT01-28 16:36:21.707: DEBUG/CallNotifier(125): - onDisconnect: cause = LOCAL, incoming = true, date = 129625054895301-28 16:36:21.727: DEBUG/CallNotifier(125): stopRing()... (onDisconnect)01-28 16:36:21.727: DEBUG/Ringer(125): stopRing()...01-28 16:36:21.747: DEBUG/Ringer(125): - stopRing: null mRingHandler!01-28 16:36:21.797: DEBUG/CallNotifier(125): - onDisconnect(): logNumber set to: 123123401-28 16:36:21.797: DEBUG/CallNotifier(125): - getPresentation(): ignoring connection's presentation: 101-28 16:36:21.837: DEBUG/CallNotifier(125): - getPresentation: presentation: 101-28 16:36:21.937: DEBUG/InCallScreen(125): onDisconnect:  incoming: true state: DISCONNECTED post dial state: NOT_STARTED, cause=LOCAL01-28 16:36:21.947: DEBUG/InCallScreen(125): updateScreen()...01-28 16:36:21.967: DEBUG/InCallScreen(125): - updateScreen: updating the in-call UI...01-28 16:36:21.987: DEBUG/InCallScreen(125): setInCallScreenMode: CALL_ENDED01-28 16:36:21.987: WARN/KeyCharacterMap(125): No keyboard for id 001-28 16:36:22.017: WARN/KeyCharacterMap(125): Using default keymap: /system/usr/keychars/qwerty.kcm.bin01-28 16:36:22.077: INFO/Telephony Manager(274): phone state=001-28 16:36:22.237: DEBUG/InCallScreen(125): - delayedCleanupAfterDisconnect: phone is idle...01-28 16:36:22.237: DEBUG/InCallScreen(125): - delayedCleanupAfterDisconnect: finishing InCallScreen...01-28 16:36:22.257: DEBUG/InCallScreen(125): endInCallScreenSession()...01-28 16:36:22.268: INFO/ActivityManager(58): moveTaskToBack: 401-28 16:36:22.297: DEBUG/InCallScreen(125): setInCallScreenMode: UNDEFINED01-28 16:36:22.337: DEBUG/PhoneApp(125): updateWakeState: callscreen true, dialer false, speaker false...01-28 16:36:22.337: DEBUG/PhoneApp(125): updateWakeState: keepScreenOn = false (isRinging false, isDialing false, showingDisc false)01-28 16:36:22.357: DEBUG/AudioHardwareInterface(33): setMode(NORMAL)01-28 16:36:22.397: DEBUG/InCallScreen(125): onPhoneStateChanged()...01-28 16:36:22.407: DEBUG/InCallScreen(125): updateScreen()...01-28 16:36:22.417: DEBUG/InCallScreen(125): - updateScreen: updating the in-call UI...01-28 16:36:22.427: DEBUG/PhoneApp(125): updateWakeState: callscreen true, dialer false, speaker false...01-28 16:36:22.427: DEBUG/PhoneApp(125): updateWakeState: keepScreenOn = false (isRinging false, isDialing false, showingDisc false)01-28 16:36:22.457: DEBUG/InCallScreen(125): onPause()...01-28 16:36:22.467: DEBUG/InCallScreen(125): dismissAllDialogs()...01-28 16:36:22.497: DEBUG/PhoneApp(125): re-enable status bar01-28 16:36:22.497: DEBUG/PhoneApp(125): StatusBarManager.DISABLE_NONE01-28 16:36:22.517: DEBUG/PhoneApp(125): updateWakeState: callscreen false, dialer false, speaker false...01-28 16:36:22.527: DEBUG/PhoneApp(125): updateWakeState: keepScreenOn = false (isRinging false, isDialing false, showingDisc false)01-28 16:36:22.997: INFO/ActivityManager(58): Start proc android.process.acore for content provider com.android.providers.contacts/.CallLogProvider: pid=295 uid=10000 gids={3003, 1015}01-28 16:36:23.427: DEBUG/InCallScreen(125): onStop()...01-28 16:36:23.427: DEBUG/InCallScreen(125): onStop: state = IDLE01-28 16:36:24.247: INFO/ActivityThread(295): Publishing provider com.android.social: com.android.providers.contacts.SocialProvider01-28 16:36:24.527: INFO/ActivityThread(295): Publishing provider applications: com.android.providers.applications.ApplicationsProvider01-28 16:36:25.197: INFO/ActivityThread(295): Publishing provider contacts;com.android.contacts: com.android.providers.contacts.ContactsProvider201-28 16:36:27.367: INFO/ActivityThread(295): Publishing provider call_log: com.android.providers.contacts.CallLogProvider01-28 16:36:27.417: INFO/ActivityThread(295): Publishing provider user_dictionary: com.android.providers.userdictionary.UserDictionaryProvider01-28 16:36:30.147: INFO/ActivityManager(58): Process com.android.mms (pid 207) has died.01-28 16:36:30.257: INFO/com.wtts.app.IcyStreamMeta@43f45030(274): {StreamTitle=Pearl Jam~Black~Ten01-28 16:36:30.257: INFO/com.wtts.app.IcyStreamMeta@43f45030(274): ~334000~S~~~~5:34~Epic}01-28 16:36:30.257: INFO/com.wtts.app.IcyStreamMeta@43f45030(274): getSongInfo01-28 16:36:30.277: INFO/com.wtts.app.IcyStreamMeta@43f45030(274): return mData01-28 16:36:30.707: WARN/AudioFlinger(33): write blocked for 86 msecs, 704 delayed writes, thread 0xb3f001-28 16:36:35.727: WARN/AudioFlinger(33): write blocked for 73 msecs, 746 delayed writes, thread 0xb3f001-28 16:36:43.327: DEBUG/dalvikvm(274): GC_FOR_MALLOC freed 37781 objects / 927336 bytes in 191ms01-28 16:36:43.767: INFO/com.wtts.app.IcyStreamMeta@43f123e8(274): {StreamTitle=Pearl Jam~Black~Ten01-28 16:36:43.767: INFO/com.wtts.app.IcyStreamMeta@43f123e8(274): ~334000~S~~~~5:34~Epic}01-28 16:36:43.767: INFO/com.wtts.app.IcyStreamMeta@43f123e8(274): getSongInfo</code></pre>","594485","","","","","2012-07-27 12:27:31","My streaming audio player continues to play during a phone call - cannot make it stop! (Android)","<java><android><media><player><phonecalls>","2","1","","",""
"4833572","1","5752325","","2011-01-28 22:12:33","5","2107","<p>I'm just looking around for starting learning NDK, with one particular project in mind:</p><p>I want to continually render a changing bitmap from NDK side to be able to show it in a live wallpaper.</p><p>(hence I'm not talking about rendering to OpenGL texture here, but about rendering to a Bitmap)</p><p>I googled a bit and found out that there's an option to directly manipulate a Bitmap pixels. But I also found that documentation says that this feature is avaiable only since Android 2.2.And I'd like to support 2.1 in my live wallpaper.</p><p>On the other hand I found several projects that do similar stuff - render something from ndk and show it in live wallpaper. And they work on 2.1. Examples are: wonderful <a href=""http://android.ccpcreations.com/vlw"">Video Live Wallpaper</a>, and I think <a href=""http://www.shake-them-all.net/"">Shake Them All Live Wallpaper</a> does the same kind of stuff.</p><p>So the question is - am I missing some other way to do continuous rendering to LW other than direct manipulation of Bitmap data?Or some other thing I got wrong? :)</p>","258848","","","","","2011-04-22 18:24:02","Android NDK and rendering to live wallpapers","<android><bitmap><android-ndk>","1","0","1","",""
"4833588","1","","","2011-01-28 22:15:03","12","6441","<p>I have an android app that I'm trying to add support for different densities, screen sizes, etc.  I've developed the app on the simulator with the HVGA support and used all icons from our iphone app which turns out nice since the resolution was at 320x480.  Everything looks good now but I'm a bit confused after reading the official android documentation.  For layouts I'm going through and ensuring everything is in dp units but when it comes to the images I'm lost.  I know that mdpi is 160 but what do I tell my designer for what the hdpi image needs to be?  Do we need to increase the height and width and the dpi?  Or is it simply enough to leave the dpi as is and increase the height width?  For example, if I have an image that's 100 x 100 with 160 dpi, in order to render it identical on an hdpi screen it should now be 150 x 150 with 240 dpi?  Assuming if I leave the dpi at 160 it will just be a little blurred?  Sorry about silly question but I just want to make sure I'm doing everything right and I'm really a C developer with no graphics experience at all.... No excuse at all but could use some help.  I saw some examples where the splash screen for mdpi was 320x480 at 160 dpi but then the hdpi splash screen was at 480 x 800 at 240.  Obviously 480 x 1.5 does not equal 800.  Furthermore, after looking at the icons in the android sdk, they only scale up the width and height, not the dpi.  Probably because they're icons and don't need to be?  Lost in photoshop land....</p>","594494","","1140748","","2012-05-06 16:06:26","2013-11-15 04:17:34","Android: Multiple Image Density support - scale height width and dpi?","<android>","4","1","2","",""
"4833777","1","5466249","","2011-01-28 22:43:35","3","5312","<p>My app plays audio resource files from the internal directory designated for my app (/data/data/com...). It seems to download the files to that location okay, setDataSource(String path) doesn't throw any exceptions, but MediaPlayer.prepare() throws IOException.The same code works on the SD card. Why is this happening?</p><p>EDIT:</p><p>Let's assume this is the code; it's simpler than my code and it throws the same exception:</p><pre><code>package com.app.MediaPlayerTest;public class MediaTest extends Activity {    MediaPlayer mp;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        DownloadFiles();        MusicPlay();    }    public void DownloadFiles() {        //Downloads Files    }    public void MusicPlay()    {            try {                mp.setDataSource(""/data/data/com.app.pronounce/winds.mp3"");            } catch (IllegalArgumentException e1) {                e1.printStackTrace();            } catch (IllegalStateException e1) {                e1.printStackTrace();            } catch (IOException e1) {                e1.printStackTrace();            }        try {            mp.prepare();        } catch (IllegalStateException e) {            e.printStackTrace();        } catch (IOException e) {            e.printStackTrace();        }        mp.setLooping(true);        mp.start();    }}</code></pre><p>As for the stack trace:</p><pre><code>(mutexes: tll=0 tsl=0 tscl=0 ghl=0 hwl=0 hwll=0)""main"" prio=5 tid=1 NATIVE  | group=""main"" sCount=1 dsCount=0 obj=0x4001f1a8 self=0xce48  | sysTid=338 nice=0 sched=0/0 cgrp=bg_non_interactive handle=-1345006528  | schedstat=( 151460588 425586896 45 )  at android.os.BinderProxy.transact(Native Method)  at android.app.ActivityManagerProxy.handleApplicationCrash(ActivityManagerNative.java:2547)  at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:76)  at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:854)  at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:851)  at dalvik.system.NativeStart.main(Native Method)""Binder Thread #2"" prio=5 tid=8 NATIVE  | group=""main"" sCount=1 dsCount=0 obj=0x40512b30 self=0x156e90  | sysTid=346 nice=0 sched=0/0 cgrp=default handle=1570912  | schedstat=( 4357682 930487 3 )  at dalvik.system.NativeStart.run(Native Method)""Binder Thread #1"" prio=5 tid=7 NATIVE  | group=""main"" sCount=1 dsCount=0 obj=0x40512a68 self=0x17f578  | sysTid=345 nice=0 sched=0/0 cgrp=bg_non_interactive handle=604904  | schedstat=( 6939806 13372136 3 )  at dalvik.system.NativeStart.run(Native Method)""Compiler"" daemon prio=5 tid=6 VMWAIT  | group=""system"" sCount=1 dsCount=0 obj=0x4050eba8 self=0x938c8  | sysTid=344 nice=0 sched=0/0 cgrp=bg_non_interactive handle=1099136  | schedstat=( 4770066 33579300 5 )  at dalvik.system.NativeStart.run(Native Method)""JDWP"" daemon prio=5 tid=5 VMWAIT  | group=""system"" sCount=1 dsCount=0 obj=0x4050eaf8 self=0x10c3c0  | sysTid=343 nice=0 sched=0/0 cgrp=bg_non_interactive handle=1098624  | schedstat=( 14899224 33240040 20 )  at dalvik.system.NativeStart.run(Native Method)""Signal Catcher"" daemon prio=5 tid=4 RUNNABLE  | group=""system"" sCount=0 dsCount=0 obj=0x4050ea38 self=0x93570  | sysTid=342 nice=0 sched=0/0 cgrp=bg_non_interactive handle=588000  | schedstat=( 24278832 4707632 7 )  at dalvik.system.NativeStart.run(Native Method)""GC"" daemon prio=5 tid=3 VMWAIT  | group=""system"" sCount=1 dsCount=0 obj=0x4050e990 self=0x8f720  | sysTid=341 nice=0 sched=0/0 cgrp=bg_non_interactive handle=1099336  | schedstat=( 791698 556969 3 )  at dalvik.system.NativeStart.run(Native Method)""HeapWorker"" daemon prio=5 tid=2 VMWAIT  | group=""system"" sCount=1 dsCount=0 obj=0x4050e8d8 self=0x10c740  | sysTid=340 nice=0 sched=0/0 cgrp=bg_non_interactive handle=1357728  | schedstat=( 211702049 225986921 9 )  at dalvik.system.NativeStart.run(Native Method)</code></pre>","498680","","498680","","2011-01-29 17:22:06","2013-05-06 02:42:49","Android playing resource files from internal storage causes MediaPlayer.prepare to give IOException","<android><resources><media-player><ioexception><prepare>","2","1","2","",""
"4833850","1","4833904","","2011-01-28 22:57:12","0","308","<p>Looking through the Android docs on unit testing I ran across this recommendation...</p><blockquote>  <p>You can create a test project anywhere in your file system, but the best approach is to add the test project so that its root directory tests/ is at the same level as the src/ directory of the main application's project. This helps you find the tests associated with an application. For example, if your application project's root directory is MyProject, then you should use the following directory structure:</p></blockquote><pre><code>MyProject/    AndroidManifest.xml      res/      ... (resources for main application)    src/      ... (source code for main application) ...    tests/        AndroidManifest.xml        res/          ... (resources for tests)        src/          ... (source code for tests)</code></pre><p>My question is, how can I exclude the ""tests"" directory from the project I am testing when I build for production?  Otherwise, I will just have a bunch of extra code included in the .apk that will never get used for anything.</p>","60231","","179850","","2011-02-21 19:12:35","2011-02-21 19:12:35","Excluding Unit Testing project from Android build","<android><unit-testing><apk><android-install-apk>","1","0","","",""
"4833879","1","","","2011-01-28 23:02:16","0","429","<p>Does free heap space have to be contiguous for gralloc() calls to succeed?  Or can gralloc() return sparse free heap segments to satisfy a request? i.e. heap fragmentation</p>","322939","","","","","2011-01-29 02:59:28","Android Memory Allocator - Does memory need to be contiguous?","<android><memory><memory-allocation>","1","0","","",""
"4833913","1","","","2011-01-28 23:06:12","2","534","<p>i have a button that on click is loading rss feed.i want to load a progress bar until my list opens.i have created a progressbar,it works,but as i press the return button to return to the main menu the progress bar appears again and it doesnt stop(and not even let me see my menu).this is my code</p><pre><code>ProgressBar myProgressBar;  int myProgress = 0; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) {  super.onCreate(icicle);  setContentView(R.layout.main1);  Button nea = (Button) findViewById(R.id.nea);   nea.setOnClickListener(new View.OnClickListener() {   public void onClick (View view) {    setContentView(R.layout.bar);     myProgressBar=(ProgressBar)findViewById(R.id.bar);           new Thread(myThread).start();    Intent myIntent = new Intent(view.getContext(), nea.class);    startActivityForResult(myIntent, 0);   }    });}</code></pre><p>and then,out of the onCreate</p><pre><code>  private Runnable myThread = new Runnable(){    @Override    public void run() {     // TODO Auto-generated method stub     while (myProgress&lt;100){      try{       myHandle.sendMessage(myHandle.obtainMessage());       Thread.sleep(1000);      }      catch(Throwable t){      }     }    }    Handler myHandle = new Handler(){     public void handleMessage(Message msg) {      // TODO Auto-generated method stub      myProgress++;      myProgressBar.setProgress(myProgress);     }    };      };</code></pre>","519526","","","","","2011-01-28 23:22:24","android progressBar problem","<android>","1","0","","",""
"4833947","1","4934227","","2011-01-28 23:14:30","5","5066","<p>I've been able to override any themes that have names with ""android:"" prepended to them, but the Android themes.xml also defines properties that don't seem to be able to be overridden. For example:</p><pre><code>&lt;!-- Variation on the Light theme that turns off the title --&gt;&lt;style name=""Theme.Codebase"" parent=""android:style/Theme.Light""&gt;    &lt;item name=""android:windowNoTitle""&gt;true&lt;/item&gt;    &lt;item name=""android:windowContentOverlay""&gt;@null&lt;/item&gt;    &lt;item name=""colorBackground""&gt;@color/off_white&lt;/item&gt;&lt;/style&gt;</code></pre><p>colorBackground is defined in the Theme.Light xml, but adding this here gives me a </p><pre><code>/res/values/styles.xml:10: error: Error: No resource found that matches the given name: attr 'colorBackground'.</code></pre><p>error. How do I override that style for the Application as a whole?</p>","53653","","","","","2012-11-20 21:46:01","Override default Android themes","<java><android>","2","1","2","",""
"4833954","1","","","2011-01-28 23:16:33","15","1271","<p>I'm experimenting with an Android app that streams Music via UPnP to an XBox. The streaming works for the most part, but quite frequently, after a minute or two, the streaming stalls, especially when there is other activity on the network. This never happens when streaming to other non-XBox devices. I've confirmed this behavior with a number of different UPnP server apps.</p><p>After analyzing lots of Wireshark traces, I've found the root cause. It seems that after the TCP receiver window has filled on the XBox, it only explicitly re-announces a window update in response to Zero Window Probes that contain 1 byte of payload data. </p><p>While Windows-based machines send Zero Window probes that contain a 1-byte payload, Linux-based machines send probes that contain 0-byte payloads (pure ACKs).</p><p>Under ideal network conditions, this isn't a problem, since a receiver will <em>always</em> send ana single Window Update ACK message once it's freed up enough space in its window to avoid the silly window syndrome. However, if that single Window Update packet is missed, it will never respond again to a linux-based Android device, because the TCP stack on those devices uses Zero Window Probes with a 0-byte payload (they look like Keep Alive packets to Wirehsark).  </p><p>A TCP stall between the XBox and WMP looks like this:<pre><code>   4966 92.330358   10.0.2.214            10.0.2.133            TCP      [TCP ZeroWindow] 27883 > 10243 [ACK] Seq=183 Ack=1723007 Win=0 Len=0   4971 92.648068   10.0.2.133            10.0.2.214            TCP      [TCP ZeroWindowProbe] 10243 > 27883 [ACK] Seq=1723007 Ack=183 Win=64240 Len=1   4972 92.649009   10.0.2.214            10.0.2.133            TCP      [TCP ZeroWindowProbeAck] [TCP ZeroWindow] 27883 > 10243 [ACK] Seq=183 Ack=1723007 Win=0 Len=0   4977 93.256579   10.0.2.133            10.0.2.214            TCP      [TCP ZeroWindowProbe] 10243 > 27883 [ACK] Seq=1723007 Ack=183 Win=64240 Len=1   4978 93.263118   10.0.2.214            10.0.2.133            TCP      [TCP ZeroWindowProbeAck] [TCP ZeroWindow] 27883 > 10243 [ACK] Seq=183 Ack=1723007 Win=0 Len=0   4999 94.310534   10.0.2.214            10.0.2.133            TCP      [TCP Window Update] 27883 > 10243 [ACK] Seq=183 Ack=1723007 Win=16384 Len=0</pre></code></p><p>Note that the Xbox is actively responding to the Zero Window Probe packets.</p><p>A normal TCP stall between the XBox and the Android client looks like this:<pre><code>7099 174.844077  10.0.2.214            10.0.2.183            TCP [TCP ZeroWindow] [TCP ACKed lost segment] 20067 > ssdp [ACK] Seq=143 Ack=2962598 Win=0 Len=0 7100 175.067981  10.0.2.183            10.0.2.214            TCP [TCP Keep-Alive|TCP Keep-Alive] ssdp > 20067 [ACK] Seq=2962597 Ack=143 Win=6912 Len=0 7107 175.518024  10.0.2.183            10.0.2.214            TCP [TCP Keep-Alive|TCP Keep-Alive] ssdp > 20067 [ACK] Seq=2962597 Ack=143 Win=6912 Len=0 7108 175.894079  10.0.2.214            10.0.2.183            TCP [TCP Window Update] 20067 > ssdp [ACK] Seq=143 Ack=2962598 Win=16384 Len=0</pre></code></p><p>Note that the XBox does <em>not</em> respond to the KeepAlive packets.</p><p>A TCP stall between the XBox and my Android device look like this if the initial Window Update announcement is missed:<pre><code> 7146 175.925019  10.0.2.214            10.0.2.183            TCP [TCP ZeroWindow] 20067 > ssdp [ACK] Seq=143 Ack=3000558 Win=0 Len=0 7147 176.147901  10.0.2.183            10.0.2.214            TCP [TCP Keep-Alive|TCP Keep-Alive] ssdp > 20067 [ACK] Seq=3000557 Ack=143 Win=6912 Len=0 7155 176.597820  10.0.2.183            10.0.2.214            TCP [TCP Keep-Alive|TCP Keep-Alive] ssdp > 20067 [ACK] Seq=3000557 Ack=143 Win=6912 Len=0 7165 177.498087  10.0.2.183            10.0.2.214            TCP [TCP Keep-Alive|TCP Keep-Alive] ssdp > 20067 [ACK] Seq=3000557 Ack=143 Win=6912 Len=0 7218 179.297763  10.0.2.183            10.0.2.214            TCP [TCP Keep-Alive|TCP Keep-Alive] ssdp > 20067 [ACK] Seq=3000557 Ack=143 Win=6912 Len=0 7297 182.897804  10.0.2.183            10.0.2.214            TCP [TCP Keep-Alive|TCP Keep-Alive] ssdp > 20067 [ACK] Seq=3000557 Ack=143 Win=6912 Len=0 7449 190.097780  10.0.2.183            10.0.2.214            TCP [TCP Keep-Alive|TCP Keep-Alive] ssdp > 20067 [ACK] Seq=3000557 Ack=143 Win=6912 Len=0 7759 204.498070  10.0.2.183            10.0.2.214            TCP [TCP Keep-Alive|TCP Keep-Alive] ssdp > 20067 [ACK] Seq=3000557 Ack=143 Win=6912 Len=0 8412 233.298081  10.0.2.183            10.0.2.214            TCP [TCP Keep-Alive|TCP Keep-Alive] ssdp > 20067 [ACK] Seq=3000557 Ack=143 Win=6912 Len=0 9617 290.898134  10.0.2.183            10.0.2.214            TCP [TCP Keep-Alive|TCP Keep-Alive] ssdp > 20067 [ACK] Seq=3000557 Ack=143 Win=6912 Len=011326 358.047838  10.0.2.214            10.0.2.183            TCP      20067 > ssdp [FIN, ACK] Seq=143 Ack=3000558 Win=16384 Len=0</pre></code></p><p>Note that the XBox never re-announces its open window, and eventually terminates the connection.</p><p>I've confirmed my theory by writing a small packet-injection program. When I get a stall, I can fire off a hand-crafted TCP Zero Window Probe packet. When do this, the XBox instantly springs back to life and continues on as normal. Unfortunately, I can't do this from my application, because crafting such a packet requires the CAP_NET_RAW capability, and I'm not able to grant that to my application.</p><p>Here's the above case, with a manually-injected Zero Window Probe (packet 7258). The right seq/ack numbers aren't even required. The only thing that's required is one byte of data.<pre><code>   7253 373.274394  10.0.2.214            10.0.2.186            TCP      [TCP ZeroWindow] 39378 > ssdp [ACK] Seq=3775184695 Ack=1775679761 Win=0 Len=0   7254 375.367317  10.0.2.186            10.0.2.214            TCP      [TCP Keep-Alive] ssdp > 39378 [ACK] Seq=1775679760 Ack=3775184695 Win=3456 Len=0   7255 379.562480  10.0.2.186            10.0.2.214            TCP      [TCP Keep-Alive] ssdp > 39378 [ACK] Seq=1775679760 Ack=3775184695 Win=3456 Len=0   7256 387.953095  10.0.2.186            10.0.2.214            TCP      [TCP Keep-Alive] ssdp > 39378 [ACK] Seq=1775679760 Ack=3775184695 Win=3456 Len=0   7257 404.703312  10.0.2.186            10.0.2.214            TCP      [TCP Keep-Alive] ssdp > 39378 [ACK] Seq=1775679760 Ack=3775184695 Win=3456 Len=0   7258 406.571301  10.0.2.186            10.0.2.214            TCP      [TCP ACKed lost segment] [TCP Retransmission] ssdp > 39378 [ACK] Seq=1 Ack=1 Win=1 Len=1   7259 406.603512  10.0.2.214            10.0.2.186            TCP      39378 > ssdp [ACK] Seq=3775184695 Ack=1775679761 Win=16384 Len=0</pre></code></p><p>Since the TCP Seq/Ack numbers are incorrect, Wireshark interprets the pack as a wayward data transmission with an invalid ACK, but the XBox nonetheless snaps back to life, and starts streaming again. </p><ul><li>Is there any way to get CAP_NET_RAW capabilities in an Android app without requiring the device to be rooted?</li><li>Is there any other trick I can use to force the Linux TCP layer to send its Zero Window Probes with 1 byte of payload data?</li><li>Is there any other obscure TCP option I could try that would let me wake the XBox's TCP stack up? </li><li>Is there some other out-of-band approach to convincing the XBox to send another Window update?</li><li>Is there some other completely unrelated approach that I might consider?</li></ul><p><strong>Edit:</strong> This is a description of why the provided suggestions won't work.</p><ol><li><p><code>TCP_NODELAY</code> only affects how packets are sent while the window is open. Specifically, setting this option prevents the TCP stack from waiting for a few ms for more data in an attempt to create a TCP packet that fills up the MSS. It doesn't allow data to be sent when the receiver window is closed.</p></li><li><p><code>TCP_QUICKACK</code> affects the way the host ACKs packets it's receiving. The problem I'm facing is that I need to change the way the sender ACKs the packets <em>it</em> is receiving.</p></li><li><p><code>MSG_OOB</code> only sets the TCP urgent flag. Urgent data isn't treated any differently as far as windowing goes, and still will not be sent when the receiver's window is closed.</p></li><li><p>Changing the TCP congestion control algorithm won't help either. Because the XBox is forcibly limiting the data send rate to the play rate of the MP3, it's virtually impossible to avoid filling the congestion window. It might be possible to reduce the congestion window by inferring the throughput, but this would only reduce the likelyhood of a filled congestion window, not prevent it completely.</p></li><li><p>Using UDP is not an option, since using the UPnP stack is a requirement, and UPnP delivers data via HTTP, and thus, TCP.</p></li></ol>","569106","","569106","","2011-01-31 18:24:17","2013-01-14 17:24:46","The XBox 360 TCP stack does not respond to TCP Zero Window Probes with a 0-byte payload","<android><linux><networking><tcp><xbox>","3","1","9","",""
"4833982","1","","","2011-01-28 23:22:43","0","458","<p>I am trying to use the android emulator to preview video from webcam. I have used the tom gibara sample code, minus the webbroadcaster (i am instead using VLC streaming via http).</p><p>So, I have modified the SDK's ""CameraPreview"" app to use the HttpCamera, but the stream never appears. Debugging through doesn't give me any clues either. I wonder if anything obvious is clear to others? The preview app launches and remains black.</p><p>Notes:</p><ol><li>I have updated the original CameraPreview class as described here: <a href=""http://www.inter-fuser.com/2009/09/live-camera-preview-in-android-emulator.html"" rel=""nofollow"">http://www.inter-fuser.com/2009/09/live-camera-preview-in-android-emulator.html</a>, but referencing httpCamera instead of socketcamera. </li><li>I updated Tom's original example to reference ""Camera"" type instead of deprecated ""CameraDevice"" type. </li><li>Below is my CameraPreview.java.</li><li>THANK YOU</li></ol><p>&nbsp;</p><pre><code>package com.example.android.apis.graphics;import android.app.Activity;import android.content.Context;import android.hardware.Camera;import android.os.Bundle;import android.view.SurfaceHolder;import android.view.SurfaceView;import android.view.Window;import java.io.IOException;import android.graphics.Canvas;// ----------------------------------------------------------------------public class CameraPreview extends Activity {        private Preview mPreview;    @Override protected 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 {    SurfaceHolder mHolder;    //Camera mCamera;    HttpCamera mCamera;//changed    Preview(Context context) {        super(context);        // Install a SurfaceHolder.Callback so we get notified when the        // underlying surface is created and destroyed.        mHolder = getHolder();        mHolder.addCallback(this);        //mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);        mHolder.setType(SurfaceHolder.SURFACE_TYPE_NORMAL);//changed    }    public void surfaceCreated(SurfaceHolder holder) {        // The Surface has been created, acquire the camera and tell it where        // to draw.        //mCamera = Camera.open();     this.StartCameraPreview(holder);    }    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();//changed        mCamera = null;    }    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();        //parameters.setPreviewSize(w, h);        //mCamera.setParameters(parameters);        //mCamera.startPreview();     this.StartCameraPreview(holder);    }    private void StartCameraPreview(SurfaceHolder sh)    {     mCamera = new HttpCamera(""10.213.74.247:443"", 640, 480, true);//changed        try {           //mCamera.setPreviewDisplay(holder);         Canvas c = sh.lockCanvas(null);         mCamera.capture(c);         sh.unlockCanvasAndPost(c);        } catch (Exception exception) {            //mCamera.release();            mCamera = null;            // TODO: add more exception handling logic here        }    }}</code></pre>","591524","","142162","","2011-01-28 23:58:41","2012-05-22 11:24:05","Issue getting camera emulation to work with Tom G's HttpCamera","<android><streaming><camera><emulator>","1","0","","",""
"4833984","1","5106764","","2011-01-28 23:23:11","10","9569","<p>I have a layout with two images:</p><ul><li>one that should strech to the screen width</li><li>one above it that should scale to the same proportion the first one was automaticaly scaled (relative to the original image size)</li></ul><p><strong>More specific</strong>: the two images are slices of the same image, and therefore some details inside them should match.<br>Can I make this in XML?</p><p>If I cannot do it through XML, maybe I could prescale the graphics. In this case, how should I prescale them?</p>","594544","","594544","","2013-11-15 12:36:06","2013-11-15 12:36:06","Scale images in android relative to screen width","<android><image><android-layout><scale>","4","2","2","",""
"4834069","1","","","2011-01-28 23:38:35","1","731","<p>I've got this really weird problem, have been working on a project all night and suddenly when I open Eclipse, I get hundreds of errors.</p><p>Nothing from <code>String</code> to <code>Java.IO</code> can be found... text like <code>import java.io can not be resolved</code> is everywhere. I have no clue what I have done, anyone can give me a hint? I would really appreciate it!</p><p>/Nick</p>","478105","","153503","","2011-01-28 23:48:56","2011-01-29 05:48:29","All java classes and objects gone (eclipse, android SDK)","<java><android><eclipse>","3","2","","",""
"4834122","1","","","2011-01-28 23:48:24","29","3652","<p>I'm kind of a noob at programming for the Android OS.  I noticed in the books I have been reading that the authors have placed a ""dot"" in front of the activity name when registering their activities in the manifest.  I've looked around the Android developer site and I can't figure out why we need the ""dot"".  Does the ""dot"" actually server a purpose? Do I need it?  I have included an example below.  Notice the ""dot"" before ""NewActivity"":</p><pre><code>&lt;activity android:name="".NewActivity""&gt;&lt;/activity&gt;</code></pre>","473737","","244296","","2011-01-28 23:52:47","2011-01-29 00:12:19","What's the ""dot"" for when registering an Activity","<android><android-manifest>","2","0","7","",""
"4834142","1","","","2011-01-28 23:51:23","1","8400","<p>I have ONE annoying problem with SimpleCursorAdapter. My programm has list view and ListActivity. Each row has it's own layout:</p><pre><code>&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_height=""wrap_content"" android:layout_width=""fill_parent""android:orientation=""horizontal"" android:weightSum=""1.0""&gt;&lt;TableRow&gt;    &lt;TextView android:id=""@+id/task_time""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:textSize=""24sp"" android:text=""Time""&gt;    &lt;/TextView&gt;    &lt;LinearLayout android:orientation=""vertical""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""&gt;        &lt;TextView android:id=""@+id/task_name""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:textSize=""20sp"" android:text=""Name""&gt;        &lt;/TextView&gt;        &lt;TextView android:id=""@+id/task_categoty""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:text=""Category"" android:textSize=""12sp""&gt;        &lt;/TextView&gt;    &lt;/LinearLayout&gt;    &lt;TextView android:id=""@+id/task_state""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:text=""State"" android:textSize=""12sp""&gt;    &lt;/TextView&gt;    &lt;CheckBox android:id=""@+id/task_enabled""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:focusable=""false""&gt;    &lt;/CheckBox&gt;&lt;/TableRow&gt;</code></pre><p></p><p>Tasks are stored in SQLite database. I have DAO object (singleton) to access the database. TaskDao:</p><pre><code>    public void updateEnabled(int id, boolean enabled){    SQLiteDatabase db = dbHelper.getWritableDatabase();    ContentValues cv = new ContentValues();    cv.put(ENABLED_COLUMN, enabled==true?1:0);    Log.i(TAG, ""update to "" + cv.get(ENABLED_COLUMN) );    try{        db.beginTransaction();        db.update(TASK_TABLE, cv, ID_COLUMN+""=?"", new String[]{id+""""});        db.setTransactionSuccessful();    } catch (SQLException e) {        Log.i(TAG, ""edit task failed!"");    } finally {        db.endTransaction();        if (db != null)            db.close();    }}</code></pre><p>and the Cursor method for ListActivity:</p><pre><code>    public Cursor getTasks(){    SQLiteDatabase db = dbHelper.getReadableDatabase();    return db.query(TASK_TABLE, COLUMNS, null, null, null, null, NAME_COLUMN);}</code></pre><p>I extended SimpleCursorAdapter (TaskDbAdapter) like this:</p><pre><code>    @Overridepublic View getView(int position, View convertView, ViewGroup parent) {    if(convertView==null){        convertView = inflater.inflate(R.layout.task_list_row, null);    }    Cursor c = getCursor();    c.moveToPosition(position);    Log.i(TAG, ""getView "" + position + "" = "" + c.getInt(enabledIdx));    enabled.setTag(c.getInt(c.getColumnIndex(BaseColumns._ID)));    enabled.setChecked(c.getInt(enabledIdx)&gt;0?true:false);    enabled.setOnClickListener(this);    return convertView;}@Overridepublic void onClick(View v) {    CheckBox box = (CheckBox) v;    Integer id = (Integer)box.getTag();    TaskDao.getInstance(context).updateEnabled(id.intValue(), box.isChecked());}</code></pre><p>And at last I use all the above stuff in my main ListActivity</p><pre><code>    private void refreshList(){    c = TaskDao.getInstance(this).getTasks();    startManagingCursor(c);    adapter = new TaskDbAdapter(this, R.layout.task_list_row, c, new String[]{TaskDao.ENABLED_COLUMN}, new int[]{R.id.task_enabled});    setListAdapter(adapter);}@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.task);    getListView().setItemsCanFocus(false);    getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);    getListView().setVerticalScrollBarEnabled(true);    registerForContextMenu(getListView());    getListView().setOnCreateContextMenuListener(this);    refreshList();}@Overrideprotected void onResume() {    super.onResume();    refreshList();}@Overrideprotected void onPause() {    super.onPause();}</code></pre><p>Everything works fine. But CheckBoxes loose their states. For instance I check my first column and scroll the list down. In my trace before press I have:</p><pre><code>getView 0 = 0getView 2 = 0getView 3 = 0</code></pre><p>then</p><pre><code>uptate to 1</code></pre><p>and then (when I scroll up to the first element)</p><pre><code>getView 0 = 0getView 2 = 0getView 3 = 0</code></pre><p>I tried to make <strong>getCursor().requery();</strong> in my TaskDbAdapter onClick method. But then I saw no items in the list! And exception because of cursor management(connection was closed by android). When I write <strong>startManagingCursor(c);</strong> in refreshList() method then check and uncheck methods don't work. Please, Help!</p>","577841","","","","","2011-04-09 18:50:31","Android: SimpleCursorAdapter usage","<android><listview><checkbox><cursor><simplecursoradapter>","2","0","2","",""
"4834161","1","","","2011-01-28 23:56:53","3","1626","<p>The dream is to run Grim fandango on my android,And i stumbled onto 'residual' (http://residual.sourceforge.net/ it's a c++ application) and someone who made it to run on his nokia n900 (http://www.youtube.com/watch?v=TO9a5nTMHYI). </p><p>So for the question, would this be possible for android? My initial thought was the support debian and ubuntu and my android is faster then the n900, why not?</p><p>So before i spend days/weeks learning and getting it to work on my android,I thought it might be a good idea to ask people who actually know about these things if its even possible.And maybe how much work it really would be, in my head it's currently only:</p><ol><li>make allot of Android.mk's</li><li>try to compile and fix errors still it works.</li></ol><p>Which (if i don't get to many errors) doesn't sound to hard.</p><p>Any thoughts are welcome,Thanks for reading!</p>","594569","","","","","2011-01-29 02:35:46","Port possible? (grim fandandroido)","<android>","1","1","1","",""
"4834257","1","4834833","","2011-01-29 00:17:05","2","3216","<p>I have my app on eclipse and I'd like to test it on Nexus S. I use Ubuntu 10.04 and Eclipse Helios. I'm searching for it on web but cant find it. If someone knows how to launch the app on Nexus S tell me detailed please. Thanks!</p>","399459","","399459","","2014-04-07 12:31:57","2014-04-07 12:31:57","How to test app on Android device","<android>","2","2","1","",""
"4834281","1","5524558","","2011-01-29 00:25:19","1","220","<p>I'm having a hard time figuring out what my problem is here.  I'm receiving this error in my program, but it does not cause a crash or anything like that.  I have an update I'd like to release, but I don't want to release it with this error being thrown at certain times.  I've read all related posts on this error, but none apply to my situation.</p><p>I've made sure that I am closing my DatabaseHelper and SQLiteDatabase objects.  I've also made sure that I'm closing all of my cursors.  This error is pointing toward my method getActiveScheduleInfo, which returns a Cursor object.  I've made sure that whenever I call this method, the returned cursor is closed in a Finally block.</p><p>Is this incorrect to do it this way?  In my methods that call getActiveScheduleInfo, I have multiple return statements in them, based on certain conditions.  So, instead of closing the cursor before each return line, I surround the condition testing with a Try, and close everything down in my Finally.</p><p>Everything looks like it should be working, so I'd really appreciate any help!</p><p>Thanks a lot!Paul</p>","299418","","","","","2011-04-02 17:01:23","Can't find the source of a DatabaseObjectNotClosedException error","<android><sqlite>","1","0","1","",""
"4834294","1","4834359","","2011-01-29 00:29:32","10","2554","<p>I'm trying to do an animation that takes a button (with a custom background image and system text) and fades it out. That works fine, actually. The issue is after the animation it goes back to it's initial state. I want it to animate and stay that way.</p><p>Thanks!</p>","538355","","","","","2011-01-30 01:18:02","Leaving an Android Animation at it's end state","<android><animation>","1","0","","",""
"4834296","1","4834822","","2011-01-29 00:29:45","0","1512","<p>I'm trying to get a text component to appear at the bottom of my layout. The whole layout is just an outer Linear layout containing a TextView, an ImageView, a horizontal Linear Layout with two buttons, and finally the TextView (that doesn't display). Note that when I put the same TextView <em>above</em> the LinearLayout with buttons, the TextView shows up. </p><p>Problematic layout code is shown below. </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&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;TextView android:id=""@+id/splash_text"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:textAppearance=""?android:attr/textAppearanceLarge""        android:layout_gravity=""center_vertical|center_horizontal""        android:padding=""30dp"" android:textStyle=""italic"" android:text=""@string/splash_text"" /&gt;    &lt;ImageView android:id=""@+id/splash_image""        android:layout_width=""fill_parent"" android:layout_height=""wrap_content""        android:layout_gravity=""center_vertical|center_horizontal""        android:src=""@drawable/splash""&gt;&lt;/ImageView&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout01""        android:orientation=""horizontal"" android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;Button android:id=""@+id/start_button"" android:text=""@string/start_quiz""            android:layout_marginLeft=""30dp""              android:layout_marginRight=""45dp""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" /&gt;        &lt;Button android:id=""@+id/exit_button"" android:text=""@string/exit_quiz""                android:layout_marginLeft=""45dp""                android:layout_marginRight=""30dp""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" /&gt;    &lt;/LinearLayout&gt;        &lt;TextView android:id=""@+id/splash_text2"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content""         android:padding=""1dp""         android:textSize=""1sp""        android:textColor=""@android:color/white""        android:layout_gravity=""bottom""        android:textStyle=""italic"" android:text=""@string/splash_text2"" /&gt;</code></pre>","64895","","","","","2011-01-29 02:50:50","Android - can't get component to appear below linear layout","<android><layout>","1","3","","",""
"4834319","1","","","2011-01-29 00:33:25","5","1924","<p>Currently I am using a DefaultHttpClient with ThreadSafeClientConnManager. This works fine, but I would like to replace this by using AndroidHttpClient. Unfortunately I am not able to add UsernamePasswordCredentials which is currently important for me. Can anyone provide a tip or solution?</p>","545516","","229044","","2011-01-29 07:11:55","2014-01-25 05:57:36","How to use AndroidHttpClient (API Level 8) and UsernamePasswordCredentials?","<android><httpclient>","3","0","1","",""
"4834338","1","4835246","","2011-01-29 00:37:42","1","1075","<p>I want to store some data to a File (not database) on the Android device.  Currently I'm using Context.getFileDir() as the parent directory.  However, when you update the app that directory gets deleted.  Is there a directory I can use from Context that won't get wacked when the user goes to update the application?  Does it have to be the SD Card since that's not always generally available on all phones?</p>","155020","","155020","","2011-01-29 16:55:55","2012-11-22 03:56:32","Storing Files on Android that don't get deleted on update or uninstall","<android><storage><upgrade>","2","0","1","",""
"4834374","1","5043858","","2011-01-29 00:50:47","5","2309","<p>Apologies if this has already been answered - if someone can point me to an already-answered question, that would be great...</p><p>Very simply, I would like to be able to pop up a list of applications which can process a file of a given type - for instance, if I have a music file (mp3, ogg, whatever), I'd like to be able to display a list of all loaded media applications that can process the file and allow the user to select one.</p><p>I've been playing around with creating an intent to do this as follows:</p><pre><code>Intent myIntent = new Intent();myIntent.setAction(Intent.ACTION_VIEW);myIntent.addCategory(""android.intent.category.LAUNCHER"");myIntent.setType(""mp3"");startActivity(myIntent);</code></pre><p>but I've obviously gotten it wrong, since it crashes every time. Should I be using ACTION_PICK or ACTION_CHOOSER instead of ACTION_VIEW?</p><p>More importantly, is it possible to easily define all media players by something other than the Intent.type? I believe type should be a proper MIME type, in lower case, but I'm not sure what to use in this instance...</p><p>Please be gentle :)</p>","279782","","142162","","2011-01-29 00:52:41","2011-02-18 22:23:06","In Android, How can I display an application selector based on file type?","<android>","2","2","2","",""
"4834386","1","4834505","","2011-01-29 00:53:08","0","1801","<p>Ok well this is my first time posting on here and well I'm still pretty new with android programming.  </p><p><strong>Issue:</strong>I am trying to play a sound routine using a seperate class from my widget.class  For the life of me I cannot get this to work.  Basically the user clicks a button on the widget and the result is a sound file being played. (Well that's the desired result anyways)  I have tried running Toast tests in the seperate.class under onItemClick and I get no result, when I try to run it as an activity I get a blank layout but toast shows a response under the onStart() event.</p><p><strong>Request:</strong>Can someone give me a short bit of code, perhaps a template of what I need to have in the seperate class and under which even it needs triggered?</p>","591253","","","","","2012-05-22 14:38:35","How to Play a Sound in Widget : Android (External Class)","<android><audio><click><widget><playback>","2","0","","",""
"4834396","1","","","2011-01-29 00:56:28","3","1231","<p>I keep getting a ""File not found"" error in the SDK Manager when I try to download the SDK Preview for Honeycomb.  Same thing happens with both http and https.  Any advice?</p><p>Thanks in advance!</p>","594603","","","","","2011-03-18 13:13:46","How do I download the Honeycomb SDK preview?","<android>","3","1","1","",""
"4834408","1","4834497","","2011-01-29 01:00:40","1","440","<p>What I'm doing is wanting to start off my ListView with 0 rows, download a list from the Internet, then populate the ListView with the downloaded contents. Seems easy enough, but arrays are proving to be an issue. </p><p>What's happening is that I'm declaring my array in the only way ListView seems to want it</p><pre><code>static String[] CONTENTS = new String[]{};</code></pre><p>so that it populates with no rows. After downloading the contents through a thread, I then go to fill the array with what I've downloaded. The problem is that it doesn't want to fill the array; if I initiate the array with one empty string, it will only let me fill it with exactly one row (so if I give it an array with more than one object, it doesn't do anything). How can I expand on the array the ListView is taking data from, so I can fill it with more than the number of objects I've declared it with?</p><p>The closest I've been able to come was through the code</p><pre><code>private String[] expand(String[] array, int size) {    String[] temp = new String[size];    System.arraycopy(array, 0, temp, 0, array.length);    for(int j = array.length; j &lt; size; j++)        temp[j] = """";    return temp;}</code></pre><p>to expand the array and giving it the number of objects downloaded, but that still doesn't seem to work.</p><p>Thanks in advance!</p>","219196","","","","","2011-01-29 01:41:14","ListView with Array Issue","<android><listview>","2","0","","",""
"4834463","1","","","2011-01-29 01:16:11","0","1516","<p>I need the Button to stay on the right and then EditText box to automatically take up the rest of the space (re-size). </p><p>XML:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""            android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;                &lt;EditText android:id=""@+id/PPL_Txt""                 android:layout_height=""fill_parent""                android:inputType=""numberDecimal""                 android:layout_width=""wrap_content"" /&gt;            &lt;Button android:text=""@+id/Button01""                 android:id=""@+id/Button01""                 android:layout_width=""wrap_content""                 android:layout_height=""fill_parent""&gt;            &lt;/Button&gt;        &lt;/LinearLayout&gt;</code></pre><p>Any help would be greatly appreciated.</p>","576820","","","","","2011-01-30 09:15:06","Android - Auto-Resizing","<android><xml>","4","0","","",""
"4834516","1","","","2011-01-29 01:30:08","2","1883","<p>I'm getting an OutOfMemoryException:</p><pre><code>E/AndroidRuntime( 3013): java.lang.OutOfMemoryError: bitmap size exceeds VM budgetE/AndroidRuntime( 3013):        at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)E/AndroidRuntime( 3013):        at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:375)E/AndroidRuntime( 3013):        at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:394)</code></pre><p>In the following function:</p><pre><code>static Bitmap downloadBitmap(String url)    {        final HttpClient client = new DefaultHttpClient();        final HttpGet getRequest = new HttpGet(url);        try         {            HttpResponse response = client.execute(getRequest);            final int statusCode = response.getStatusLine().getStatusCode();            // Check HTTP Status code            if (statusCode != HttpStatus.SC_OK)            {                 debugPrint(""ImageDownloader StatusCode Error "" + statusCode + "" while retrieving bitmap from "" + url);                return null;            }            else;            final HttpEntity entity = response.getEntity();            if (entity != null)            {                InputStream inputStream = null;                try                {                    inputStream = entity.getContent();                     if( inputStream == null)                    {                        debugPrint(""ImageDownloader::downloadBitmap() - INPUTSTREAM = NULL!!!!!!"");                    }                    else;                    // THIS LINE IS GIVING THE ERROR                    final Bitmap bitmap = BitmapFactory.decodeStream( new FlushedInputStream(inputStream));                    if( bitmap == null)                    {                        debugPrint(""LocrPhoto::downloadBitmap() - about to return BITMAP =NULL!!!!!!"");                    }                    else;                    return bitmap;                }                catch (Exception e)                {                    // Could provide a more explicit error message for IOException or IllegalStateException                    getRequest.abort();                    debugPrint(""LocrPhoto::downloadBitmap() Error while decoding bitmap from "" + url + ""\n""+ e.toString());                }                finally                {                    if (inputStream != null)                    {                        inputStream.close();                      }                    entity.consumeContent();                }            }            else            {                debugPrint(""LocrPhoto::downloadBitmap(""+url+"") - entity = NULL!!!!!"");            }        }        catch (Exception e)        {            // Could provide a more explicit error message for IOException or IllegalStateException            //getRequest.abort();            debugPrint(""LocrPhoto::downloadBitmap() Error while retrieving bitmap from "" + url + ""\n""+ e.toString());        }        finally        {            if (client != null)            {                // CLOSE CONNECTION            }        }        debugPrint(""LocrPhoto::downloadBitmap(""+url+"") - returning NULL at end of function"");        return null;    }</code></pre><p>FlushedInputStream (though I got the error before adding this code):</p><pre><code>// A Class to hopefully avoid the BitmapFactory.decodeStream() returning null bug    //      http://code.google.com/p/android/issues/detail?id=6066    static class FlushedInputStream extends FilterInputStream {        public FlushedInputStream(InputStream inputStream) {            super(inputStream);        }        @Override        public long skip(long n) throws IOException {            long totalBytesSkipped = 0L;            while (totalBytesSkipped &lt; n) {                long bytesSkipped = in.skip(n - totalBytesSkipped);                if (bytesSkipped == 0L) {                      int byt = read();                      if (byt &lt; 0) {                          break;  // we reached EOF                      } else {                          bytesSkipped = 1; // we read one byte                      }               }                totalBytesSkipped += bytesSkipped;            }            return totalBytesSkipped;        }    }</code></pre><p>Basically, I have an activity that downloads images, places them in a framelayout and fades frames in and out to give a slideshow. The framelayout has two imageview children.</p><p>I've seen people speak of SoftReference being used to prevent OOMExceptions, but I can't understand how this would be applied to my code to (hopefully) prevent this error.</p><p>Could anyone explain how this might be achieved?</p><p>Thanks in advance!r3mo</p>","421636","","","","","2012-10-18 13:35:42","Android: BitmapFactory.decodeStream OutOfMemoryException - is SoftReference the solution?","<android><exception><out-of-memory><soft-references><bitmapfactory>","1","2","2","",""
"4834542","1","","","2011-01-29 01:35:04","12","9730","<p>I am working on a game and would like to have the full screen to itself.</p><p>Did anyone found a way to make the app go full screen on Android Honeycomb preview emulator?</p>","594612","","119895","","2011-08-08 21:52:03","2012-03-02 05:45:20","Where is API call to do ""lights out mode"" in honeycomb?","<android-3.0-honeycomb><android>","3","0","10","",""
"4834574","1","4834599","","2011-01-29 01:42:03","6","2476","<p>Please give me feed back whether it's good practice to have a back button in activity, or is it just nonsense?  Maybe some android phones don't have back/return key?  Or do all models have them?</p><p><img src=""http://i.stack.imgur.com/xGkPp.png"" alt=""the back button is inside any activity that is lunched afterward""></p>","536853","","501557","","2011-01-29 01:45:41","2012-05-15 11:26:06","Is it reasonable to have a ""back"" button in an Android app?","<android><button><activity><back>","5","0","1","",""
"4834620","1","4836459","","2011-01-29 01:53:14","0","2590","<p>Hi i've got a kind of a dumb problem. Im trying to display a notification from a service. When an activity starts i call the startService like so:</p><pre><code>      Intent myIntent = new Intent(getApplicationContext(),notif_service.class);      startService(myIntent); </code></pre><p>the service calculates something and should display the notification and then stop. the code is as follows:</p><pre><code>    if (limit_time_value == 2 &amp;&amp; start &gt;= 6300000 &amp;&amp; notif_past)     {          notif_past=false;        showNotification();        stopSelf();      }</code></pre><p>There are two ways that this service can be stopped, ether from itself with stopSelf() or from a button in my activity with</p><pre><code>           Intent myIntent = new Intent(getApplicationContext(),notif_service.class);      stopService(myIntent);</code></pre><p>the problem is that even when i stop the service the notification is shown after the specified time passes. I tried to stop the setvice with Binding it and than calling onDestroy() in which I cancel the notification and again call stopSelf(). Again the notification is shown.</p><p>What am I doing wrong? Do I misunderstand how notifications or services work?</p>","366659","","","","","2011-01-29 10:51:27","Display status bar notification from service in android","<android><binding><service><notifications>","1","2","","",""
"4834663","1","","","2011-01-29 02:04:09","0","282","<p>Do the native video recording apps on Android and the iPhone embed geolocation data when you choose the ""upload to YouTube"" option? In other words, does the youtube upload contain the location coordinates?</p>","594637","","","","","2011-01-29 02:13:23","Do the native video recording apps on Android and the iPhone include geolocation data when you upload to YouTube?","<iphone><android><youtube>","1","0","","",""
"4834750","1","","","2011-01-29 02:28:48","4","27288","<p>in my Android app I have created a ListView component called myList, and filled it with  objects of my own custom type:</p><pre><code>class MyClass{    private String displayName;    private String theValue;... //here constructor, getters, setters and toString() are implemented}</code></pre><p>I used the ArrayAdapter to bound the ArrayList theObjects with myList:</p><pre><code>ArrayAdapter&lt;MyClass&gt; adapter=                 new ArrayAdapter&lt;MyClass&gt;(this, R.layout.lay_item, theObjects);myList.setAdapter(adapter);</code></pre><p>This works fine, the list is populated and etc., but when I'm trying to access the selected item, i receive a Null object. I've done this using </p><pre><code>myList.setOnItemClickListener(new OnItemClickListener() {   public void onItemClick(AdapterView&lt;?&gt; adapter, View v, int position, long id) {MyClass selItem = (MyClass) myList.getSelectedItem(); //String value= selItem.getTheValue(); //getter method}</code></pre><p>What seems to be the problem? Thank you</p>","594655","","244296","","2011-01-29 02:34:19","2014-03-16 21:40:16","How to get the selected item from ListView?","<android><listview>","5","0","1","",""
"4834930","1","","","2011-01-29 03:17:30","8","21295","<p>I am working on this Android application that needs to communicate over USB. I have an Archos 101 Tablet (specifications here: <a href=""http://www.archos.com/products/ta/archos_101it/specs.html?country=us&amp;lang=en"">http://www.archos.com/products/ta/archos_101it/specs.html?country=us&amp;lang=en</a>). It has a full USB host port. I can put a flash USB drive in the USB port and copy files to and from the flash drive onto internal storage. </p><p>I have this <a href=""http://arduino.cc/en/Main/ArduinoBoardFio"">Arduino Fio</a> board, with an <a href=""http://en.wikipedia.org/wiki/Digi_International#Wireless"">XBee</a> attached to it. I have an XBee Explorer Dongle with another XBee that I plan to hook into the Archos 101 tablet into the USB port.</p><p>As of right now, I can put the XBee Explorer Dongle into my computer and send/receive data to and from the Arduino Fio, no problems. </p><p>Is there a way for Android to talk over USB? I know there has to be drivers somewhere in the tablet allowing USB communication, but I cannot find a way to access them or use them. </p><p>I can see Android recognizing the XBee Explorer Dongle. I downloaded a terminal emulator, and I can type ""dmesg"" and see that it sees the dongle hooked up. But I cannot do anything with it.</p><p>I seem to need a <a href=""http://en.wikipedia.org/wiki/FTDI"">FTDI</a> driver for Android. </p><p>I would greatly appreciate any help in getting my tablet to communicate with the XBee Explorer Dongle. </p>","594674","","63550","","2011-02-09 02:10:00","2012-03-13 12:06:09","USB Communication with Android/Arduino","<android><usb><arduino><usbserial>","4","1","5","",""
"4834982","1","4834997","","2011-01-29 03:35:03","1","2371","<p>First time Java programmer. I'm wondering what my options are for loading XML on the Android platform (java). There are few docs/demos on connectivity and data loading out there (AFAIK). I need to sign a request with basic authentication and then GET/POST/PUT/DELETE to a URL which will return application/xml content-type. Basically I need to emulate this type of cURL request in Java:</p><pre><code>curl  -H 'Content-type: application/xml' -H 'Accept: application/xml' \      -u '{account}/{username}:{apikey}' https://mywebsite.com</code></pre><p>Should I just use the <code>HttpClient</code> in org.apache or is there a better solution? Once I've loaded an XML response from my API, what is the recommeded parser for Android. There seems to be so many parsers for Java, I'm completely overwhelmed.</p>","53653","","","","","2011-05-29 12:52:44","RESTful web service options for Android/Java","<java><android><xml><restful-authentication>","4","0","2","",""
"4835044","1","4839946","","2011-01-29 03:55:27","17","25005","<pre><code>Conversion to Dalvik format failed: Unable to execute dex: wrapper was not properly loaded first   [project]       Android Packaging Problem</code></pre><p>I've never worked with Java or eclipse before, I'm following <a href=""http://www.vogella.de/articles/Android/article.html"">this introductory guide</a> and all searches via google return no helpful results. I'm guessing the problem is I have built Android stuff with eclipse properly but I have no idea, I followed this guide to the letter and everything went as it explains it should. </p><p><img src=""http://i.stack.imgur.com/uwW6v.jpg"" alt=""Here is what I have compiled"">Any ideas what caused this problem, or is it specific to the guide? If so I'll post on their help page. </p><p>I have tried doing project -> source -> clean up, but that didn't fix anything. </p><p>Edit:</p><p>I went to Project -> Android tools -> Dex bytecode and it reported:</p><pre><code>DexDump: missing classex.dex for project. Please compile first.</code></pre><p>So I guess that's my problem! Not sure how to solve though.</p>","200518","","","","","2012-10-25 08:01:42","Error launching first test application: Android Packaging Problem?","<java><android><eclipse>","16","3","6","",""
"4835056","1","","","2011-01-29 03:59:19","3","1078","<p>I am downloading on my android app. I am using a local network connection and the download is really slow.</p><p>Here's he code I am using:</p><pre><code>URL url = new URL(ep.getFileURL());File destFile = new File(&lt;path to sd card file&gt;);URLConnection uCon = url.openConnection();InputStream is = uCon.getInputStream();OutputStream os = new FileOutputStream(destFile);int progress = 0;int lastProgress = 0;int totalSize = uCon.getContentLength();int downloadedSize = 0;byte[] buffer = new byte[4096];int count = -1;while((count = is.read(buffer)) != -1){    os.write(buffer, 0, count);downloadedSize = downloadedSize + count;    progress = (int)(downloadedSize * 100.0 / totalSize);    if(progress - lastProgress &gt;= 5) {        publishProgress(progress);        lastProgress = progress;    }}os.close();</code></pre><p>Do you spot any problems? thank you.</p><p><strong>Edit:</strong></p><p>I tested my code using your suggestions and I got these results:</p><pre># Download times tests #Without bufferedoutputDownloading file:      1 ms, Start downloadDownloading file:      179812 ms, Finished downloading 54687744 bytesDownloading file: end, 179813 msWith bufferedoutputDownloading file:      1 ms, Start downloadDownloading file:      178312 ms, Finished downloading 54687744 bytesDownloading file: end, 178313 msWith httpclientDownloading file: beginDownloading file:      1 ms, Start downloadDownloading file:      178241 ms, Finished downloading 54687744 bytesDownloading file: end, 178242 ms</pre><p>So, using Buffered streams or using HttpClient directly, doesn't change anything...</p><p>I also should have mentioned that my code is inside a AsyncTask, so publishProgress() actually runs on a separated thread already...</p><p>Thank you for your help.</p>","87191","","87191","","2011-01-29 18:07:51","2013-11-21 13:17:25","Android slow file download","<android><file-io><httpclient>","2","3","1","",""
"4835060","1","4835201","","2011-01-29 04:00:01","13","37794","<p>I am playing local video file using MediaPlayer and SurfaceView. SurfaceView is the only control in activity, while my video files are QVGA or other. Problem is that video is getting stretched, How can i play video in its original size e.g. qvga with remaining area black.</p><p>From iteration,</p><p>When i am forcefully sets layout_height/width of Surfaceview in XML, video displayed fine.<code>surface_holder.setFixedSize(w,h)</code> has no effect, neither mp.setdisplay().</p><p>Please guide in this.</p><p><strong>UPDATE</strong></p><p>XML flie</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/home_container""              android:layout_width=""fill_parent""             android:layout_height=""fill_parent""&gt;&lt;SurfaceView         android:id=""@+id/surface""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:paddingTop=""10dip"" /&gt;&lt;/framelayout&gt;</code></pre><p>MediaPlayer usage is as per following link</p><p><a href=""http://davanum.wordpress.com/2007/12/29/android-videomusic-player-sample-from-local-disk-as-well-as-remote-urls/"">http://davanum.wordpress.com/2007/12/29/android-videomusic-player-sample-from-local-disk-as-well-as-remote-urls/</a></p><p>Thanks in advance.</p>","465751","","465751","","2011-01-29 08:42:42","2013-04-25 23:48:42","Android: Mediaplayer: How to use SurfaceView or mediaplayer to play video in correct size","<android><media-player>","3","0","13","",""
"4835089","1","4835219","","2011-01-29 04:09:03","0","303","<p>I am attempting to run the HelloTabWidget example from here: </p><p><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>I am able to build, but once it runs it force closes. I ran the debugger in Eclipse and it looks like the error I am getting is in the res/drawable/ic_tab_artists.xml file. </p><p>The error I am getting is:<em>""org.xmlpull.v1.XmlPullParserException: Binary XML file line #4:  tag requires a 'drawable' attribute or child tag defining a drawable""</em></p><p>This is the xml I have for it, pretty straightforward:</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 grey --&gt;    &lt;item android:drawable=""@drawable/ic_tab_artists_grey"" android:state_selected=""true"" /&gt;    &lt;!-- When not selected, use white--&gt;    &lt;item android:drawable=""@drawable/ic_tab_artists_white"" /&gt;&lt;/selector&gt;</code></pre><p>I'm just confused because the drawable attribute is there...any ideas? The code/XML I have in my implementation is verbatim what they have in the examples, but it just won't run in the emulator.</p>","323497","","323497","","2011-01-29 05:09:46","2011-01-29 05:09:46","Android HelloTabWidget issue","<android>","2","0","","",""
"4835118","1","","","2011-01-29 04:15:30","0","1300","<p>I am beginning Android programming. I have made the rough GUI for a Temperature Converter but when I run my app <strong>I get an error that is hard to determine what is wrong &amp; what point the program fails</strong> (Has anyone knowticed how vague/weird the console &amp; debugging notes are when the Android emulator/OS runs?).</p><p>I am developing an app in Eclipse with the plugin, the Device API version is 9 (Android 2.3), I dont use xml to create &amp; layout the Views, I do it programmatically.</p><p><em>Output from Console when error occurs:</em></p><blockquote>  <p>-Starting activity temperatureconv.main.TempMain on device emulator-5554<br>  -ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=temperatureconv.main/.TempMain }<br>  -Attempting to connect debugger to 'temperatureconv.main' on port 8675</p></blockquote><p>After this error, eclipse then opens the ""Class File Editor"" &amp; it says: </p><blockquote>  <p>Source not found<br>  The JAR file C:/..../android.jar has no source attachment.<br>  You can attach the source by clicking Attach Source below</p></blockquote><p>What error do you think is occuring? How can I fix this?</p><p>My code:        package temperatureconv.main;</p><pre><code>import android.app.Activity;import android.graphics.Color;import android.os.Bundle;import android.view.ViewGroup.LayoutParams;import android.widget.LinearLayout;import android.widget.TextView;public class TempMain extends Activity {    /// Class Variables:    private LinearLayout layout;    /// Class Methods:    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        initComponents();        setContentView( layout );  // is this the correct way to set the main panel/view (remember I am not using the XML layout way)?             // Can I use System.out.println(); in a google app, or will that crash it?             // coz I get some funny errors when I do use it.    }    /**     * Create &amp; initialise all application components     *      * @return True if the application components &amp; facade were successfully created     */    public boolean initComponents()    {        layout          = new LinearLayout( this );        TextView celLbl = new TextView( this );        TextView fahLbl = new TextView( this );        TextView celTxt = new TextView( this );        TextView fahTxt = new TextView( this );        // Set Component data        celLbl.setText( ""Celsius: "" );        fahLbl.setText( ""Fahrenheit: "" );        celTxt.setText( ""0"" );        fahTxt.setText( ""32"" );        layout.setBackgroundColor( Color.BLUE );        celTxt.setBackgroundColor( Color.WHITE );        fahTxt.setBackgroundColor( Color.WHITE );        layout.addView( celLbl );        layout.addView( fahLbl );        layout.addView( celTxt );        layout.addView( fahTxt );        celLbl.setLayoutParams( new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT) );        fahLbl.setLayoutParams( new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT) );        celTxt.setLayoutParams( new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT) );        fahTxt.setLayoutParams( new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT) );        return true;    }}</code></pre>","593747","","223440","","2011-01-29 04:25:49","2011-04-06 18:47:49","Temp Converter App: Fails with unknown error","<android>","1","5","","",""
"4835364","1","4835391","","2011-01-29 05:37:08","0","5644","<p><img src=""http://i.stack.imgur.com/pdLF0.png"" alt=""enter image description here"">I try to change page on android application. It have error but look like its swap a little while.</p><pre><code>public class gps_gui extends Activity implements View.OnClickListener{/** Called when the activity is first created. */private static final int ACTIVITY_CREATE = 0;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    final Button login = (Button) findViewById(R.id.login);    login.setOnClickListener((OnClickListener) this);}public void onClick(View v){    //Toast.makeText(this, ""Already Login"",Toast.LENGTH_SHORT).show();    Intent i = new Intent(this, SecondPage.class);    startActivityForResult(i, ACTIVITY_CREATE);}}public class SecondPage extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState) {    // TODO Auto-generated method stub    super.onCreate(savedInstanceState);    setContentView(R.layout.second_page);}</code></pre><p>}</p><p>In AndriodManifest.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=""gps.GUI""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".gps_gui""                  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=""second_page""&gt;&lt;/activity&gt;&lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre><p>Anyone can help me ? thanks</p><p>Errors:01-29 13:56:57.709: ERROR/AndroidRuntime(393): FATAL EXCEPTION: main01-29 13:56:57.709: ERROR/AndroidRuntime(393): android.content.ActivityNotFoundException: Unable to find explicit activity class {gps.GUI/gps.GUI.SecondPage}; have you declared this activity in your AndroidManifest.xml?01-29 13:56:57.709: ERROR/AndroidRuntime(393):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)01-29 13:56:57.709: ERROR/AndroidRuntime(393):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)01-29 13:56:57.709: ERROR/AndroidRuntime(393):     at android.app.Activity.startActivityForResult(Activity.java:2817)01-29 13:56:57.709: ERROR/AndroidRuntime(393):     at gps.GUI.gps_gui$1.onClick(gps_gui.java:30)01-29 13:56:57.709: ERROR/AndroidRuntime(393):     at android.view.View.performClick(View.java:2408)01-29 13:56:57.709: ERROR/AndroidRuntime(393):     at android.view.View$PerformClick.run(View.java:8816)01-29 13:56:57.709: ERROR/AndroidRuntime(393):     at android.os.Handler.handleCallback(Handler.java:587)01-29 13:56:57.709: ERROR/AndroidRuntime(393):     at android.os.Handler.dispatchMessage(Handler.java:92)01-29 13:56:57.709: ERROR/AndroidRuntime(393):     at android.os.Looper.loop(Looper.java:123)01-29 13:56:57.709: ERROR/AndroidRuntime(393):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-29 13:56:57.709: ERROR/AndroidRuntime(393):     at java.lang.reflect.Method.invokeNative(Native Method)01-29 13:56:57.709: ERROR/AndroidRuntime(393):     at java.lang.reflect.Method.invoke(Method.java:521)01-29 13:56:57.709: ERROR/AndroidRuntime(393):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-29 13:56:57.709: ERROR/AndroidRuntime(393):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-29 13:56:57.709: ERROR/AndroidRuntime(393):     at dalvik.system.NativeStart.main(Native Method)</p>","538788","","411951","","2011-12-26 16:00:52","2013-08-26 15:18:40","How to change the activity to show the next page","<android><activity>","2","0","","",""
"4835451","1","4835469","","2011-01-29 06:04:28","0","317","<p>I created a login application. But when I input a wrong password, the app won't give me any notification that the password was incorrect and it's because I didn't even put any codes for it. I don't know what to put in order to achieve it. I'm a newbie here. Please help.</p><p>This is my code:</p><pre><code>public void onClick(View v){     EditText passwordEditText = (EditText) findViewById(R.id.currentPass);    SharedPreferences prefs = this.getApplicationContext().getSharedPreferences(""prefs_file"",MODE_PRIVATE);    String password = prefs.getString(""password"","""");    if("""".equals(password))    {        Editor edit = prefs.edit();        edit.putString(""password"",passwordEditText.getText().toString());        edit.commit();        StartMain();    }    else    {     if(passwordEditText.getText().toString().equals(password))        {             StartMain();        }    }}</code></pre>","516160","","203600","","2011-01-29 06:09:05","2011-01-29 10:15:44","Help with password validation","<java><android><eclipse><passwords>","4","0","","",""
"4835540","1","","","2011-01-29 06:36:40","2","750","<p>I have a preference activity that allows the user to modify skinning options. If the user modifies the skinning options, I need to reload the activity (call startActivity() with the current intent followed by finish() ) so that the drawables are properly reloaded.</p><p>It would be much easier, and much more reliable, if I could force the current activity to get destroyed rather than paused whenever the preference activity starts.</p><p>Any ideas how I can achieve this?</p><p>Update for clarity:</p><p>CURRENT BEHAVIOR:<code><pre>1. Activity A starts2. User selects Settings command3. Preference Activity starts4. Activity A is paused5. User changes preferences6. Preference Activity is paused and destroyed7. Activity A is unpaused8. Activity A must check if preferences were changed   - If yes, call startActivity() to start itself      again and call finish(). This will reload everything     correctly</code></pre></p><p>DESIRED BEHAVIOR (diff in <strong>BOLD</strong>):<code><pre>1. Activity A starts2. User selects Settings command3. Preference Activity starts4. Activity A is paused <strong>AND DESTROYED</strong>5. User changes preferences6. Preference Activity is paused and destroyed7. Activity A <strong>STARTS AGAIN FRESH</strong></code></pre></p><p>Cheers,swine</p>","418957","","418957","","2011-01-29 18:33:17","2011-01-29 18:33:17","Any way to force an activity to destroy right away but also remain on the stack?","<android>","1","0","","",""
"4835652","1","4837753","","2011-01-29 07:10:19","3","4673","<p>I'm trying to write my first android app. It deals with contacts and contact groups. In order to test on the emulator, I'm trying to add contacts with groups to the emulator. If I try to add them manually, it goes through the whole contact dialog, I click <strong>done</strong> and it goes away but doesn't actually save the contact. </p><p>I tried syncing the phone to a test gmail account, but after poking around, I see that doesn't work either because of an issue with needing a unique IMEI number. </p><p>So I found a thread which said create the contacts in gmail.com, then export them to a vcf file and use adb to push them to the emulator and then import them into <code>Contacts</code>. I tried this, the file copied over okay, and I ran the import, which showed a progress bar and the contact names being imported. It looked like it worked, but then it goes back to <code>Contacts</code> and did not actually save them into the database.</p><p>So, is there ANY way to add contacts with groups into the emulator? Or do I need to build the apk and test it actually on my phone?</p>","80209","","","","","2011-11-03 15:44:09","How to put contacts on the android emulator?","<android><android-emulator><contacts><android-contacts>","2","0","0","",""
"4835695","1","4841682","","2011-01-29 07:22:10","7","7554","<p>Is there any way to get phone name in android??. I have tried  </p><pre><code>android.os.Build.DEVICE;android.os.Build.MODEL;android.os.Build.PRODUCT;</code></pre><p>in Samsung Galaxy S.All these are giving GT-19000 as the result,which is the model name.Is there any way i could get Samsung Galaxy S as the result???.Thanks in advance..</p>","466474","","","","","2011-01-30 07:16:15","How to get phone name in Android","<android><phone>","4","1","7","",""
"4835872","1","4836556","","2011-01-29 08:25:04","1","2513","<p>I have the following code and it works well to fetch the details of all applications installed in android but when i use a filter using isSystemPackage(ResolveInfo) it gives force close.</p><pre><code>try {    lView = (ListView) findViewById(R.id.list1);    PackageManager pm = this.getPackageManager();    Intent intent = new Intent(Intent.ACTION_MAIN, null);    intent.addCategory(Intent.CATEGORY_LAUNCHER);    {        List&lt;ResolveInfo&gt; list = pm.queryIntentActivities(intent, PackageManager.PERMISSION_GRANTED);        for (ResolveInfo rInfo : list) {            if (isSystemPackage(rInfo)) {                results.add(rInfo.activityInfo.applicationInfo.loadLabel(pm).toString());                Log.w(""Installed Applications"", rInfo.activityInfo.applicationInfo                        .loadLabel(pm).toString());            }        }    }} catch(Exception ex) {    Toast.makeText(getApplicationContext(), ex.toString(), 4000).show();}</code></pre><p>it generates force closed </p><p>isSystemPackage() code is</p><pre><code>private boolean isSystemPackage(ResolveInfo ri){    return ((ri.activityInfo.applicationInfo.flags&amp;ApplicationInfo.FLAG_SYSTEM)!=0)?          true:false;}</code></pre><p>I tried to debug it but can't able to do it.</p>","510617","","473070","","2011-01-29 09:39:13","2011-02-16 15:11:52","How to filter nonsystem application from all installed applicatons","<android>","3","0","1","",""
"4835925","1","4836014","","2011-01-29 08:40:03","33","43647","<p>I am trying to distribute my application to some people for testing.I have installed it on my Desire directly from eclipse and it works fine.</p><p>To create an APK-file, I choose <em>""Export Unsigned Application Package""</em> directly from eclipse, and then an APK file was created. I emailed it to myself and downloaded the file to the SD-card. But when I try to install it (using ES File Browser), I get a message saying <em>""Application not installed""</em>.</p><p>(I have already checked the ""Allow installation of non-Market application"" on my phone)Any ideas?</p><p><strong>Yeah I found the problem, see my answer below:</strong></p><p>I did not know that even with the ""<a href=""http://www.androiddevelopment.org/tag/apk/"">Allow Installation of non-Marked application</a>"", I still needed to sign the application.I self-signed my application, following this link self-sign and release application, It only took 5 minutes, then I emailed the signed-APK file to myself and downloaded it to SD-card and then installed it without any problem.</p>","576671","","576671","","2012-12-03 09:40:47","2013-12-11 04:15:52","unsigned APK can not be installed","<android><apk><self-signed>","7","2","10","",""
"4835938","1","4835970","","2011-01-29 08:44:07","0","363","<p>I already have a database and when i write in it i also want to write only one value(store a counter)!because i think that searching for a value first and then search again for a value of counter will be slow i thought using a file to store the counter...but read write delete wouldn't be slow?So,which one is faster and safer(from point of less chances to break)?which method should i be using?</p>","587377","","","","","2011-01-29 08:53:19","Prefer Database or File for data in Android","<android><database><file><performance>","2","1","","",""
"4836058","1","4836093","","2011-01-29 09:17:44","2","679","<p>I am using the MediaPlayer class to play an mp3 file in my application. How do I update a textview control every second with the current position in the mp3 file?</p>","374521","","","","","2013-02-17 11:01:06","Periodically Update a TextView in Android Application","<java><android>","1","0","","",""
"4836119","1","","","2011-01-29 09:34:40","0","3015","<p>I have <code>N</code> ""books"" each with some number of chapters.  So I create a <code>ListView</code>. Each item in the <code>ListView</code> has two parts: <code>TextView</code> for the name, and a <code>Spinner</code> to list the chapters.</p><p>I have created a custom adapter for the <code>ListView</code> - <code>BookAdapt</code>, and a custom adapter for the <code>Spinner</code> - <code>ChapAdapt</code>.  I have it displaying, and working, but I cannot find out how to add a click/selected event.  </p><p>Here is the List resource</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=""Load Chapter"" /&gt;&lt;LinearLayout    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;Button        android:text=""Load""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""/&gt;     &lt;Button        android:text=""Cancel""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""/&gt;&lt;/LinearLayout&gt;&lt;ListView    android:id=""@+id/chapview""     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""/&gt;      </code></pre><p></p><p>Here is the each book display</p><pre><code>&lt;LinearLayout 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:id=""@+id/viewbook""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_weight=""1""/&gt;&lt;Spinner    android:id=""@+id/chapspinner""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:prompt=""@string/chapter_prompt""     android:layout_weight=""1""/&gt;</code></pre><p></p><p>Here are the key parts from the <code>BookAdapt</code></p><pre><code>class BookAdapt extends ArrayAdapter {       BookAdapt( Context context, int txtres, BookHolder[] bks) {     super( context, txtres );       mContext = context;       books = bks;       mInflater = LayoutInflater.from(context);      }      public View getView( int pos, View convert, ViewGroup parent) {       BookHolder book = books[ pos];       String bkname = book.getName();       if (convert == null) {        convert = mInflater.inflate(R.layout.bookview, null);        book.text = (TextView) convert.findViewById(R.id.viewbook);        Spinner sp = (Spinner)convert.findViewById( R.id.chapspinner);        ChapAdapt ch = new ChapAdapt( book, mContext);              sp.setAdapter( ch);        //convert.setClickable(true);        convert.setTag( book);       } else {        book = (BookHolder)convert.getTag();       }       book.text.setText( bkname );       return convert;        }</code></pre><p>The <code>ChapAdapt</code> just assign a <code>TexTView</code>.</p>","570628","","264325","","2013-03-14 16:03:30","2013-03-14 16:03:30","Android: a spinner in a list view, Where is the OnClick/OnItemClick/OnItemSelected event?","<android><android-layout><onclick><spinner><android-listview>","1","0","","",""
"4836136","1","","","2011-01-29 09:38:48","10","14799","<p>Does anyone know any available libraries or sample codes that can be used to develop an app that reads the text in an image captured by the camera? Something similar to Google Goggles but only for reading text.</p>","545790","","71421","","2011-07-14 00:07:28","2013-09-26 21:23:39","Android OCR Library","<android><image-processing><ocr>","3","0","8","",""
"4836184","1","","","2011-01-29 09:49:51","0","1196","<p>I am doing multimedia application. I have tried several different examples to implement videos in surface view but I cannot get. i can hear the sound but no visual is appearing. is there any possibilities to get a video in surface view.  My target SDK is 2.2 API level 8. Even I installed my apk to mobile device, still nothing will changed. Please guide me.</p>","594843","","213269","","2011-01-29 11:15:31","2011-01-29 11:15:31","How to access video in Surface view","<android><video><surfaceview>","1","0","","",""
"4836206","1","","","2011-01-29 09:54:30","2","2221","<p>I've an application that has some foreground activities and also a service that updates some widgets.The problem is that, as the process remains for the service, the memory from the other activities ,if they are opened, is never reclaimed.</p><p>Looking at <a href=""http://stackoverflow.com/questions/1977246/android-finish-method-doesnt-clear-app-from-memory"">that response from Roman Guy</a> it seems that can be normal. But it is? For how much time android keeps the resources of not used activities? They can live for hours?</p><p>How can I know easily if the activities are leaked or are simple not reclaimed? I've tried with a program from AndroidMarket (FreeMemoryRecover) and it's cleared but I suspect that it kills the process and then restart the service...</p><p>Any help or suggestion will be heavily appreciated.</p><p>Note 1: I've investigated with a HeapDump + Eclipse MAT and I don't see strange references holding my activities </p><p>Note 2: I've already asked some questions about this problem:</p><ul><li><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/faa0aefd9eb28201"" rel=""nofollow"">Post 1</a></li><li><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/7018aaa1e1413ebd"" rel=""nofollow"">Post 2</a></li></ul>","269454","","","","","2011-01-29 10:23:24","Memory from activities not released","<android><memory-leaks><memory-management>","3","1","","",""
"4836242","1","","","2011-01-29 10:03:41","0","340","<p>guysI am wondering about the lenght of a table row.</p><p>In my application, views are dynamically created and added to tablelayout...and it gives no problems.</p><p>However, if the length of row is longger than the width of screen(since too many views are contained on the row), I can't see some of views on screen.</p><p>Do you know how to check it in prior to actually display the row on screen?</p><p>Thanks for your help.</p>","594856","","","","","2012-05-30 01:12:27","Dynamically add views to tablerow","<android><android-layout><tablelayout>","1","0","","",""
"4836279","1","4836322","","2011-01-29 10:14:22","-2","1545","<p>I want to install android sdk with eclipse.i am also using Ubuntu as operating system.Please give supports and also good study material on android.</p><p>Regards</p>","188856","","","","","2011-09-28 09:05:21","How to install android with eclipse.?","<android>","2","3","1","",""
"4836331","1","4836371","","2011-01-29 10:26:34","0","1174","<p>I'm new to Android dev and I'm having a hard time trying to do something which seems obvious to me: drawing little images on top of a bigger image.</p><p>Let's say that I have a 500x500 image and I want to draw icons at different locations. Icons are png files that I load with:</p><blockquote>  <p>Bitmap img =  BitmapFactory.decodeResource(getResources(),  R.drawable.idIcon1)</p></blockquote><p>My ""background image"" is a LayerDrawable.</p><p>Then, I am totally lost... Do I have to create a canvas ? How to draw on my ""background image"" my icons at different positions?</p>","446576","","","","","2011-06-13 20:30:13","Android: how to simply draw a bitmap on another bitmap","<android><canvas><drawable>","2","0","","",""
"4836428","1","","","2011-01-29 10:45:52","2","1074","<p>This behavior is fond in Android GingerBread. I had override the onConfigurationChanged() to update the layout on changing the orientation of my device.(updated android:configChanges attribute in manifest file.) Also registered an onOrientationChanged() callback in the application.  When I change the orientation from one to another it's getting call back for both config and orientation change.(which is the expected one) </p><p>But when I follow the below step, sometimes its not getting my layout updated(getting some black screen)</p><ul><li>Rotate the devices continuously through all the 4 orientation</li><li>Do not give enough time to redraw the layout at each orientation</li><li>stop in some orientation after some rotations</li></ul><p>When I traced the logs, I can find out that for all orientation change                     onOrientationChanged() is called. But onConfigurationChanged() is calling only for some cases. The black screen is getting when onConfigurationChanged() is not called(I am using setContentView() in side this call back)</p><p>Can any one tell me what will be the cause for this. Or give me direction to where should I look to trace this. Like from method onConfigurationChanged() is called.</p><p>The application is working fine in froyo.</p><p>Advanced thanks for your help</p>","565428","","","","","2012-01-17 19:41:55","onConfigurationChanged() is sometimes not calling when rotating faster","<android><android-layout>","2","0","","",""
"4836431","1","4836480","","2011-01-29 10:46:13","4","608","<p>I have a list view and i am setting list adapter every time some text is being sent. </p><p>My problem is, when a new message is populated in the list view, it shows the messages from the first.I want to make the list view to display last message when a new item is added to the list.</p><p>Please help me fix this.</p>","303155","","","","","2011-01-29 10:56:05","How to maintain the list view to display last row","<android><listview>","1","0","1","",""
"4836441","1","4836539","","2011-01-29 10:47:18","1","1882","<p>I have this <code>imageview</code> on my layout:</p><pre><code>&lt;ImageView    android:id=""@+id/profileImage""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignBaseline=""@id/profileImageLabel""    android:layout_alignParentRight=""true""    android:maxWidth=""90px""    android:maxHeight=""90px""/&gt; </code></pre><p>And i am giving it the source of the image dynamically on the onCreate():</p><pre><code>Bitmap bm = BitmapFactory.decodeFile(""c:/logo.png"");        profileImage.setImageBitmap(bm);        profileImage.invalidate();</code></pre><p>But when i test my app, it doesn't shows the image, it only shows black screen.</p><p>Why is the <code>imageview</code> not displaying and only a black screen instead?</p>","479886","","571593","","2011-02-25 10:26:05","2011-02-25 10:26:05","Why this ImageView is not showing my image?","<android><imageview>","2","0","1","",""
"4836451","1","4862805","","2011-01-29 10:49:18","0","2982","<p>Bit of a strange post as this is something I posted before, thought it was solved but didn't!</p><p>I have a situation where I need to use a custom Drawable for each marker, the effect I need is to rotate the marker by a set number of degrees and am probably going the wrong way about this completely. </p><p>As a start I am using the excellent Creative Commons as this does work and only breaks after my additions!</p><p><a href=""https://github.com/commonsguy/cw-advandroid/tree/master/Maps/NooYawkAsync"" rel=""nofollow"">https://github.com/commonsguy/cw-advandroid/tree/master/Maps/NooYawkAsync</a></p><p>The previous post and the code is here </p><p><a href=""http://stackoverflow.com/questions/4187012/android-maps-nullpointerexception-itemizedoverlay"">Android Maps NullPointerException ItemizedOverlay</a></p><p>If anyone can recommend a better and more stable way to get a rotated Drawable and put me on the right path that would be great.</p><p>As you can see from my code I don't set the Drawable in the overlay and do this outside within another object and suspect this is why it is breaking!</p><p>At the moment I set my Drawable by doing this...</p><pre><code>public Drawable getRotatedIcon(String string) {        Drawable marker = null;        Double tempHeading = Double.valueOf(string);        long intHeading = Math.round(tempHeading / 10);        int resID = getResources().getIdentifier(                ""icon_rotate_"" + Long.toString(intHeading), ""drawable"",                ""com.test.testapp"");        marker = getResources().getDrawable(resID);        marker.setBounds(0, 0, marker.getIntrinsicWidth(),marker.getIntrinsicHeight());        return marker;    }</code></pre><p>And then to create it all I use this...</p><pre><code>if (sites != null){            sites.clearItems();         }else{            sites = new SitesOverlay();        }        for (int i = 0; i &lt; getMainOverlayArray().size(); i++) {            tempOver = getMainOverlayArray().get(i);            tempOver.setMarker(getRotatedIcon(tempOver.getcourse()));            if (tempOver != null){                 sites.addItem(tempOver);            }        }        sites.finishedLoading();</code></pre><p>And my SitesOverlay class...</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);        private MapLocation selectedMapLocation;          private static final int CIRCLERADIUS = 2;        private ArrayList&lt;pfOverlayItem&gt; mOverlays = new ArrayList&lt;pfOverlayItem&gt;();        public SitesOverlay() {            super(null);            populate();        }public void finishedLoading(){    populate();}        @Override        protected pfOverlayItem createItem(int i) {            return (items.get(i));        }        public void addItem(OverlayItem overlay) {            overlay.setMarker(boundCenter(overlay.getMarker(0)));            items.add((pfOverlayItem) overlay);        }        public void clearItems(){            runOnUiThread(new Runnable() {                public void run() {                    items.clear();                    myMapView.invalidate();                }            });        }        public void clear() {            mOverlays.clear();            myMapView.removeAllViews();            setLastFocusedIndex(-1);            populate();        }        @Override        public void draw(Canvas canvas, MapView mapView, boolean shadow) {            super.draw(canvas, mapView, false);            try {            if (getMainOverlayArray().size() != 0){            pfOverlayItem tempOver = null;            for (int i = 0; i &lt; getMainOverlayArray().size(); i++) {                tempOver = getMainOverlayArray().get(i);            boolean isMatch = false;            //Log.i(""Selected Name"",selectedName);            if (tempOver.getTitle().equals(selectedName))            {                isMatch = true;            }            if (isMatch){            Projection projection = mapView.getProjection();            Point point = new Point();            projection.toPixels(tempOver.getPoint(), point);            Paint background = new Paint();            background.setColor(Color.WHITE);            background.setAlpha(150);            RectF rect = new RectF();            rect.set(point.x - 50, point.y +15,                    point.x + 90, point.y + 50);            canvas.drawRoundRect(rect, 5, 5, background);            Paint text = new Paint();            text.setAntiAlias(true);            text.setColor(Color.BLUE);            text.setTextSize(14);            text.setTypeface(Typeface.MONOSPACE);            canvas.drawText(tempOver.getTitle() + "" "" + tempOver.getcallsign(), point.x -50 , point.y + 30, text);            canvas.drawText(tempOver.getdestination() + "" "" + tempOver.getdraft(), point.x -50 , point.y + 45, text);            }            }            }            }catch (Exception e){                Log.e(""Error"", ""Problem drawing view"", e);                 e.printStackTrace();            }        }        @Override        protected boolean onTap(int i) {            pfOverlayItem item = getItem(i);            if (selectedName.equals(item.getTitle())){                try{                    Intent myIntent = new Intent(TestApp.this, DetailActivity.class);                myIntent.putExtra( ""int"", i);                myIntent.putExtra( ""string"", selectedName );                PlaneFinderMain.this.startActivity(myIntent);                }catch (Exception e){                    Log.e(""Error"", ""Cannot launch"", e);                }            }            currentadshex = item.getmmsi();            new GetRouteTask(item.getmmsi()).execute();            selectedItem = i;            selectedName = item.getTitle();            selectedPlanePoint = item.getPoint();            GeoPoint geo=item.getPoint();            Point pt=myMapView.getProjection().toPixels(geo, null);            View view=panel.getView();            ((TextView)view.findViewById(R.id.reg)).setText(item.getTitle());            ((TextView)view.findViewById(R.id.callsign)).setText(item.getcallsign());            ((TextView)view.findViewById(R.id.dest)).setText(item.getdestination());            ((TextView)view.findViewById(R.id.draft)).setText(item.getdraft());            return (true);        }        @Override        public boolean onTouchEvent(MotionEvent event, MapView mapView) {             if (event.getAction() == MotionEvent.ACTION_DOWN){                 if (selectedPlanePoint != null){                     Projection projection = mapView.getProjection();                     Point point = new Point();                     projection.toPixels(selectedPlanePoint, point);                     Point pointHit = new Point();                     pointHit.x=(int)event.getX();                     pointHit.y=(int)event.getY();                     if ((point.x - pointHit.x) &gt;-100 &amp;&amp; (point.x - pointHit.x) &lt;70  &amp;&amp; (point.y - pointHit.y) &lt; -25  &amp;&amp; (point.y - pointHit.y) &gt; -95){                            try{                                     Intent myIntent = new Intent(TestApp.this, DetailActivity.class);                                    myIntent.putExtra( ""int"", selectedItem);                                    myIntent.putExtra( ""string"", selectedName );                                    TestApp.this.startActivity(myIntent);                                }catch (Exception e){                                    Log.e(""Error"", ""Cannot launch"", e);                                }                     }else{                     }                 }             }            return false;        }        @Override        public int size() {            return (items.size());        }        public void addOverlay(OverlayItem o){            setLastFocusedIndex(-1);            populate();        }    }</code></pre>","103999","","103999","","2011-02-01 06:35:48","2011-02-01 12:53:04","ItemizedOverlay Rotate marker and crash","<android><drawable><itemizedoverlay>","2","0","2","",""
"4836464","1","4841982","","2011-01-29 10:52:30","0","5543","<p>Based on <a href=""http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/"" rel=""nofollow"">this</a> tutorial and the default notepad example by Google, I tried to create my own Database adapter super class. </p><p>Now the idea is to copy a pre-created db from my assets folder to my app database folder. I want to use my databasehelper's onCreate method to call the custom method copyDataBase</p><p>I don't get any IO errors, but what seems to happen is that the database is created, my custom database is copied over and then overwritten again. </p><p>Any ideas why the onCreate method would overwrite my copied database?</p><p>Please see my super dbadapter class that contains the custom helper class</p><pre><code>public abstract class DbAdapter_Super {    protected static final String TAG = ""MyAppDbAdapter"";    protected DatabaseHelper mDbHelper;    protected SQLiteDatabase mDb;    protected static final String DB_PATH = ""/data/data/com.android.myapp/databases/"";    protected static final String DB_NAME = ""MyAppDB"";    protected static final int DB_VERSION = 1;    protected final Context mCtx;    protected static class DatabaseHelper extends SQLiteOpenHelper {     protected final Context mHelpCtx;                  DatabaseHelper(Context context) {                super(context,DB_NAME,null,DB_VERSION);            this.mHelpCtx = context;        }        @Override        public void onCreate(SQLiteDatabase db)  {            //Copy pre-created DB      try{       copyDataBase();}          catch (IOException e) {          throw new Error(""Error copying database"");         }        }        @Override        public void onOpen(SQLiteDatabase db){};        @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 routes"");            onCreate(db);        }        private void copyDataBase() throws IOException{            //Open your local db as the input stream         InputStream myInput = mHelpCtx.getAssets().open(DB_NAME);         // Path to the just created empty db         String outFileName = DB_PATH + DB_NAME;            //if the path doesn't exist first, create it            File f = new File( DB_PATH );            if ( !f.exists() )                f.mkdir();                //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();             }    }    /**     * Constructor - takes the context to allow the database to be     * opened/created     *      * @param ctx the Context within which to work     */    public DbAdapter_Super(Context ctx) {        this.mCtx = ctx;    }    /**     * Open or create the  database.     *      * @return this     * @throws SQLException if the database could be neither opened or created     */    public DbAdapter_Super open() throws SQLException {        mDbHelper = new DatabaseHelper(mCtx);        mDb = mDbHelper.getWritableDatabase();        return this;    }    public void close() {        mDbHelper.close();    }}</code></pre><p>I would really like to keep this abstract super class as is. I just need to understand why the db would be copied over and then overwritten by a blank db. I've tested as much as I can and the db is copied correctly, but overwritten. </p><p>Any help would be GREATLY appreciated. </p><p>Thanks</p>","594874","","546999","","2011-01-29 10:55:20","2012-11-08 10:35:13","Android - SQLitehelper onCreate overwrites copied database","<android>","4","2","1","",""
"4836468","1","4836532","","2011-01-29 10:52:57","2","1941","<p>I am new to android, i have managed to write code that displays the google map, i can able to give source and destination addresses and place push pin over there using reverse Geocode concept...</p><p>the scenario is i want to display the driving,walking,bicycling directions from source to destination point with displaying a line from source to destination..</p>","505580","","569101","","2013-09-09 08:40:57","2013-09-09 08:40:57","finding route directions from source to destinaton in android","<android><google-maps><draw><direction>","1","0","1","",""
"4836509","1","4836597","","2011-01-29 11:04:44","1","2712","<p>I am studying android ndk. What are the advantages and disadvantages of ndk?Are there any good references to study Android NDK?</p>","486554","","1109425","","2012-08-15 23:06:12","2012-08-15 23:06:12","Android ndk advantages and disadvantages","<c++><android><android-ndk>","1","0","0","2012-08-17 07:49:30",""
"4836666","1","4836872","","2011-01-29 11:43:15","0","1604","<p>I have non-system application list in list view and i am trying to implement a onClicklistener or OnTouchListner on this view.But cant able to do that.here is the code</p><pre><code>List&lt;ApplicationInfo&gt; list = getPackageManager().getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);for (int n=0;n&lt;list.size();n++) { if((list.get(n).flags &amp; ApplicationInfo.FLAG_SYSTEM)!=1) { results.add(list.get(n).loadLabel(pm).toString()); Log.w(""Installed Applications"", list.get(n).loadLabel(pm).toString()); }}lView.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, results));</code></pre><p>where result is the arraylist and lView is the ListView.</p>","510617","","","","","2011-01-29 12:31:34","How to implement a click or touch listner on ListView to get application activity","<android>","1","0","","",""
"4836690","1","","","2011-01-29 11:51:12","0","230","<p>how would you disable a button until a user click on the buttons prior to it. One of the buttons has there bio info which is set in preferences. So I can't have them continue until they read the directions and fill there bio. </p>","594921","","","","","2011-01-29 13:40:44","how would you disable a button till the user navigates through prior buttons?","<android><button>","3","0","","",""
"4836716","1","4836799","","2011-01-29 11:57:09","9","7338","<p>In a scenario where I have a UI that will be updated from a separate thread (using AsyncTask), I can define the AsyncTask as an inner class of the activity, but this has two downsides I find problematic:</p><ol><li>It makes the source files very large, reducing efficiency in managing the code</li><li>It makes it hard to reuse the thread class</li></ol><p>What's a good solution? Use an inner class, but abstract everything it does to other classes? Pass a reference to the Activity to the AsyncTask? Always define the AsyncTask class as an inner class and just accept source files will be large?</p>","477415","","512958","","2011-01-29 12:18:46","2011-04-18 22:11:59","How to make activity UI changes from an Android AsyncTask?","<android><oop><android-asynctask>","3","0","","",""
"4836760","1","4836777","","2011-01-29 12:07:42","7","7513","<p>i need to use Base64 on my app (import android.util.Base64;) but Base64 was included in android with 2.2, api lvl 8. Then when i make the import i get this error: Base64 cannot be resolved, and doesn't give me the possibility to import it, because i am making my project with api lvl 3. For some reasons my app have to be compatible with old versions of android (1.5 1.6 etc..)</p><p>it is possible to use Base64 without migrating to api lvl8 ?</p>","479886","","","","","2011-01-29 12:10:51","How to use Base64 (included in android since api 8 (2.2)) in a android project api 3 (android 1.5)?","<android><base64>","1","0","1","",""
"4836801","1","4836837","","2011-01-29 12:17:43","2","1316","<p>Actually i have a edit text.when i click edit text virtual keyboard popups.But i just wanna hide virtual keyboard always even after click on edit text.And edit text should be printable with system keyboard.How could i do this?My code..</p><pre><code>EditText edtNote = (EditText)findViewById(R.id.note);InputMethodManager imm = (InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE);imm.restartInput(edtNote);Configuration config = this.getResources().getConfiguration();if (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES) {    imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);}</code></pre>","594934","","79061","","2011-01-29 12:21:11","2011-01-29 12:25:08","Hide virtual keyboard always","<android><android-softkeyboard>","1","5","","",""
"4836811","1","","","2011-01-29 12:19:27","2","581","<p>Is it possible in the manifest to indicate that the application is only for mdpi (320x480. ..)? There is a parameter ""supports-screens"", but there normalScreens means and hdpi.</p>","574475","","","","","2011-01-29 15:16:42","Application is only for mdpi (320x480...)","<android>","1","0","1","",""
"4836847","1","9002883","","2011-01-29 12:27:46","0","642","<p>I have tried to invoke DX Tool at Runtime. My main idea is to generate a Dexfile and then load into Android System dynamically. I have some mistakes but i think that it is possible to generate a dile directly.  The following code try to generate a simple HelloWorld Bean with a constructor. Can someone help me?</p><pre><code>public class HelloWorld{private String message;public HelloWorld(){}public String getMessage(){return message;}public void setMessage(String message){this.message=message;}}</code></pre><p>My sample code is the next:</p><pre><code>import java.io.ByteArrayInputStream;import java.io.ByteArrayOutputStream;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.InputStream;import java.io.OutputStreamWriter;import java.io.OutputStream;import java.util.ArrayList;import com.android.dx.rop.code.BasicBlock;import com.android.dx.rop.code.BasicBlockList;import com.android.dx.rop.code.FillArrayDataInsn;import com.android.dx.rop.code.Insn;import com.android.dx.rop.code.InsnList;import com.android.dx.rop.code.LocalVariableInfo;import com.android.dx.rop.code.PlainInsn;import com.android.dx.rop.code.RegisterSpec;import com.android.dx.rop.code.RegisterSpecList;import com.android.dx.rop.code.Rop;import com.android.dx.rop.code.RopMethod;import com.android.dx.rop.code.SourcePosition;import com.android.dx.rop.cst.Constant;import com.android.dx.rop.cst.CstFieldRef;import com.android.dx.rop.cst.CstMethodRef;import com.android.dx.rop.cst.CstNat;import com.android.dx.rop.cst.CstType;import com.android.dx.rop.cst.CstUtf8;import com.android.dx.rop.type.StdTypeList;import com.android.dx.rop.type.Type;import com.android.dx.util.IntList;import com.android.dx.dex.code.BlockAddresses;import com.android.dx.dex.code.CatchBuilder;import com.android.dx.dex.code.CatchHandlerList;import com.android.dx.dex.code.CatchTable;import com.android.dx.dex.code.CstInsn;import com.android.dx.dex.code.DalvOps;import com.android.dx.dex.code.Dop;import com.android.dx.dex.code.InsnFormat;import com.android.dx.dex.code.SimpleInsn;import com.android.dx.dex.code.StdCatchBuilder;import com.android.dx.dex.code.OutputFinisher;import com.android.dx.dex.code.DalvCode;import com.android.dx.dex.code.form.Form10t;import com.android.dx.dex.code.form.Form10x;import com.android.dx.dex.code.form.Form11x;import com.android.dx.dex.code.form.Form12x;import com.android.dx.dex.code.form.Form22c;import com.android.dx.dex.code.form.Form22x;import com.android.dx.dex.code.form.Form35c;import com.android.dx.dex.file.ClassDefItem;import com.android.dx.dex.file.DexFile;import com.android.dx.dex.file.EncodedField;import com.android.dx.dex.file.EncodedMethod;public class Main {        private static DexFile outputDex;        /**         * Prints the usage message.         */    public void createDexFile() throws Exception{        CstType type=new CstType(Type.intern(""Lmnt/sdcard/HolaMundo;""));         outputDex=new DexFile();        OutputStream fileOutputStream=new FileOutputStream(""classes.dex"");        /***Class***/        ClassDefItem clazz=new ClassDefItem(type, 1, new CstType(Type.intern(""Ljava/lang/Object;"")), new StdTypeList(0), new CstUtf8(""HolaMundo.java""));        /***Fields***/        EncodedField field=new EncodedField(new CstFieldRef(type,new CstNat(new CstUtf8(""message""),new CstUtf8(""Ljava/lang/String;""))),2);        clazz.addInstanceField(field);        /***Methods***/        /***Constructor***/        CstMethodRef methodref=new CstMethodRef(type,new CstNat(new CstUtf8(""&lt;init&gt;""),new CstUtf8(""()V"")));        /*Rop opcode1=new Rop(1,new Type(""V"", Type.BT_VOID),new StdTypeList(0),new StdTypeList(0),1,false,""nop"");        Rop opcode2=new Rop(2,new Type(""I"",Type.BT_INT),new StdTypeList(Type.BT_INT),new StdTypeList(0),1,false,""move-int"");        Rop opcode3=new Rop(2,new Type(""J"",Type.BT_LONG),new StdTypeList(Type.BT_LONG),new StdTypeList(0),1,false,""move-long"");        Rop opcode4=new Rop(2,new Type(""F"",Type.BT_FLOAT),new StdTypeList(Type.BT_FLOAT),new StdTypeList(0),1,false,""move-float"");        Rop opcode5=new Rop(2,new Type(""D"",Type.BT_DOUBLE),new StdTypeList(Type.BT_DOUBLE),new StdTypeList(0),1,false,""move-double"");        Rop opcode6=new Rop(2,Type.intern(""Ljava/lang/Object;""),new StdTypeList(Type.intern(""Ljava/lang/Object;"").getBasicType()),new StdTypeList(0),1,false,""move-object"");        Rop opcode7=new Rop(2,new Type(""&lt;addr&gt;"", Type.BT_ADDR),new StdTypeList(Type.BT_ADDR),new StdTypeList(0),1,false,""move-return-address"");        Rop opcode8=new Rop(3,new Type(""I"",Type.BT_INT),new StdTypeList(0),new StdTypeList(0),1,false,""move-param-int"");        Rop opcode9=new Rop(3,new Type(""J"",Type.BT_LONG),new StdTypeList(0),new StdTypeList(0),1,false,""move-param-long"");        Rop opcode10=new Rop(3,new Type(""F"",Type.BT_FLOAT),new StdTypeList(0),new StdTypeList(0),1,false,""move-param-float"");        Rop opcode11=new Rop(3,new Type(""D"",Type.BT_DOUBLE),new StdTypeList(0),new StdTypeList(0),1,false,""move-param-double"");        Rop opcode12=new Rop(3,Type.intern(""Ljava/lang/Object;""),new StdTypeList(0),new StdTypeList(0),1,false,""move-param-object"");        Rop opcode13=new Rop(5,new Type(""I"",Type.BT_INT),new StdTypeList(0),new StdTypeList(0),1,false,""const-int"");        Rop opcode14=new Rop(5,new Type(""J"",Type.BT_LONG),new StdTypeList(0),new StdTypeList(0),1,false,""const-long"");        Rop opcode15=new Rop(5,new Type(""F"",Type.BT_FLOAT),new StdTypeList(0),new StdTypeList(0),1,false,""const-float"");        Rop opcode16=new Rop(5,new Type(""D"",Type.BT_DOUBLE),new StdTypeList(0),new StdTypeList(0),1,false,""const-double"");        Rop opcode17=new Rop(5,Type.intern(""Ljava/lang/Object;""),new StdTypeList(0),new StdTypeList(Type.intern(""Ljava/lang/Error;"").getBasicType()),6,false,""const-object"");        Rop opcode18=new Rop(5,Type.intern(""Ljava/lang/Object;""),new StdTypeList(0),new StdTypeList(0),1,false,""const-object-nothrow"");        Rop opcode19=new Rop(6,new Type(""V"", Type.BT_VOID),new StdTypeList(0),new StdTypeList(0),3,false,""goto"");        Rop opcode20=new Rop(7,new Type(""V"", Type.BT_VOID),new StdTypeList(Type.BT_INT),new StdTypeList(0),4,false,""if-eqz-int"");        Rop opcode21=new Rop(8,new Type(""V"", Type.BT_VOID),new StdTypeList(Type.BT_INT),new StdTypeList(0),4,false,""if-nez-int"");        Rop opcode22=new Rop(9,new Type(""V"", Type.BT_VOID),new StdTypeList(Type.BT_INT),new StdTypeList(0),4,false,""if-ltz-int"");        Rop opcode23=new Rop(10,new Type(""V"", Type.BT_VOID),new StdTypeList(Type.BT_INT),new StdTypeList(0),4,false,""if-eqz-int"");        Rop opcode24=new Rop(11,new Type(""V"", Type.BT_VOID),new StdTypeList(Type.BT_INT),new StdTypeList(0),4,false,""if-lez-int"");        Rop opcode25=new Rop(12,new Type(""V"", Type.BT_VOID),new StdTypeList(Type.BT_INT),new StdTypeList(0),4,false,""if-gtz-int"");        Rop opcode26=new Rop(7,new Type(""V"", Type.BT_VOID),new StdTypeList(Type.intern(""Ljava/lang/Object;"").getBasicType()),new StdTypeList(0),4,false,""if-nez-object"");        Rop opcode27=new Rop(8,new Type(""V"", Type.BT_VOID),new StdTypeList(Type.intern(""Ljava/lang/Object;"").getBasicType()),new StdTypeList(0),4,false,""if-eqz-object"");        Rop opcode28=new Rop(7,new Type(""V"", Type.BT_VOID),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),new StdTypeList(0),4,false,""if-eq-NTI"");        Rop opcode29=new Rop(8,new Type(""V"", Type.BT_VOID),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),new StdTypeList(0),4,false,""if-ne-int"");        Rop opcode30=new Rop(9,new Type(""V"", Type.BT_VOID),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),new StdTypeList(0),4,false,""if-lt-int"");        Rop opcode31=new Rop(10,new Type(""V"", Type.BT_VOID),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),new StdTypeList(0),4,false,""if-ge-int"");        Rop opcode32=new Rop(11,new Type(""V"", Type.BT_VOID),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),new StdTypeList(0),4,false,""if-le-int"");        Rop opcode33=new Rop(12,new Type(""V"", Type.BT_VOID),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),new StdTypeList(0),4,false,""if-gt-int"");        Rop opcode34=new Rop(7,new Type(""V"", Type.BT_VOID),StdTypeList.make(Type.intern(""Ljava/lang/Object;""),Type.intern(""Ljava/lang/Object;"")),new StdTypeList(0),4,false,""if-eq-object"");        Rop opcode35=new Rop(8,new Type(""V"", Type.BT_VOID),StdTypeList.make(Type.intern(""Ljava/lang/Object;""),Type.intern(""Ljava/lang/Object;"")),new StdTypeList(0),4,false,""if-ne-object"");        Rop opcode36=new Rop(13,new Type(""V"", Type.BT_VOID),new StdTypeList(Type.BT_INT),new StdTypeList(0),5,false,""switch"");        Rop opcode37=new Rop(14,new Type(""I"", Type.BT_INT),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),new StdTypeList(0),1,false,""add-int"");        Rop opcode38=new Rop(14,new Type(""J"", Type.BT_LONG),StdTypeList.make(new Type(""J"",Type.BT_LONG),new Type(""J"",Type.BT_LONG)),new StdTypeList(0),1,false,""add-long"");        Rop opcode39=new Rop(14,new Type(""F"", Type.BT_FLOAT),StdTypeList.make(new Type(""F"",Type.BT_FLOAT),new Type(""F"",Type.BT_FLOAT)),new StdTypeList(0),1,false,""add-float"");        Rop opcode40=new Rop(14,new Type(""D"", Type.BT_DOUBLE),StdTypeList.make(new Type(""D"",Type.BT_DOUBLE),new Type(""D"",Type.BT_DOUBLE)),new StdTypeList(0),1,false,""add-double"");        Rop opcode41=new Rop(15,new Type(""I"", Type.BT_INT),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),new StdTypeList(0),1,false,""sub-int"");        Rop opcode42=new Rop(15,new Type(""J"", Type.BT_LONG),StdTypeList.make(new Type(""J"",Type.BT_LONG),new Type(""J"",Type.BT_LONG)),new StdTypeList(0),1,false,""sub-long"");        Rop opcode43=new Rop(15,new Type(""F"", Type.BT_FLOAT),StdTypeList.make(new Type(""F"",Type.BT_FLOAT),new Type(""F"",Type.BT_FLOAT)),new StdTypeList(0),1,false,""sub-float"");        Rop opcode44=new Rop(15,new Type(""D"", Type.BT_DOUBLE),StdTypeList.make(new Type(""D"",Type.BT_DOUBLE),new Type(""D"",Type.BT_DOUBLE)),new StdTypeList(0),1,false,""sub-double"");        Rop opcode45=new Rop(16,new Type(""I"", Type.BT_INT),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),new StdTypeList(0),1,false,""mul-int"");        Rop opcode46=new Rop(16,new Type(""J"", Type.BT_LONG),StdTypeList.make(new Type(""J"",Type.BT_LONG),new Type(""J"",Type.BT_LONG)),new StdTypeList(0),1,false,""mul-long"");        Rop opcode47=new Rop(16,new Type(""F"", Type.BT_FLOAT),StdTypeList.make(new Type(""F"",Type.BT_FLOAT),new Type(""F"",Type.BT_FLOAT)),new StdTypeList(0),1,false,""mul-float"");        Rop opcode48=new Rop(16,new Type(""D"", Type.BT_DOUBLE),StdTypeList.make(new Type(""D"",Type.BT_DOUBLE),new Type(""D"",Type.BT_DOUBLE)),new StdTypeList(0),1,false,""mul-double"");        Rop opcode49=new Rop(17,new Type(""I"", Type.BT_INT),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),StdTypeList.make(Type.intern(""Ljava/lang/Error;""),Type.intern(""Ljava/lang/ArithmeticException;"")),6,false,""div-int"");        Rop opcode50=new Rop(17,new Type(""J"", Type.BT_LONG),StdTypeList.make(new Type(""J"",Type.BT_LONG),new Type(""J"",Type.BT_LONG)),StdTypeList.make(Type.intern(""Ljava/lang/Error;""),Type.intern(""Ljava/lang/ArithmeticException;"")),6,false,""div-long"");        Rop opcode51=new Rop(17,new Type(""F"", Type.BT_FLOAT),StdTypeList.make(new Type(""F"",Type.BT_FLOAT),new Type(""F"",Type.BT_FLOAT)),new StdTypeList(0),1,false,""div-float"");        Rop opcode52=new Rop(17,new Type(""D"", Type.BT_DOUBLE),StdTypeList.make(new Type(""D"",Type.BT_DOUBLE),new Type(""D"",Type.BT_DOUBLE)),new StdTypeList(0),1,false,""div-double"");        Rop opcode53=new Rop(18,new Type(""I"", Type.BT_INT),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),StdTypeList.make(Type.intern(""Ljava/lang/Error;""),Type.intern(""Ljava/lang/ArithmeticException;"")),6,false,""rem-int"");        Rop opcode54=new Rop(18,new Type(""J"", Type.BT_LONG),StdTypeList.make(new Type(""J"",Type.BT_LONG),new Type(""J"",Type.BT_LONG)),StdTypeList.make(Type.intern(""Ljava/lang/Error;""),Type.intern(""Ljava/lang/ArithmeticException;"")),6,false,""rem-long"");        Rop opcode55=new Rop(18,new Type(""F"", Type.BT_FLOAT),StdTypeList.make(new Type(""F"",Type.BT_FLOAT),new Type(""F"",Type.BT_FLOAT)),new StdTypeList(0),1,false,""rem-float"");        Rop opcode56=new Rop(18,new Type(""D"", Type.BT_DOUBLE),StdTypeList.make(new Type(""D"",Type.BT_DOUBLE),new Type(""D"",Type.BT_DOUBLE)),new StdTypeList(0),1,false,""rem-double"");        Rop opcode57=new Rop(19,new Type(""I"", Type.BT_INT),new StdTypeList(Type.BT_INT),new StdTypeList(0),1,false,""neg-int"");        Rop opcode58=new Rop(19,new Type(""J"", Type.BT_LONG),new StdTypeList(Type.BT_LONG),new StdTypeList(0),1,false,""neg-long"");        Rop opcode59=new Rop(19,new Type(""F"", Type.BT_FLOAT),new StdTypeList(Type.BT_FLOAT),new StdTypeList(0),1,false,""neg-float"");        Rop opcode60=new Rop(19,new Type(""D"", Type.BT_DOUBLE),new StdTypeList(Type.BT_DOUBLE),new StdTypeList(0),1,false,""neg-double"");        Rop opcode61=new Rop(20,new Type(""I"", Type.BT_INT),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),new StdTypeList(0),1,false,""and-int"");        Rop opcode62=new Rop(20,new Type(""J"", Type.BT_LONG),StdTypeList.make(new Type(""J"",Type.BT_LONG),new Type(""J"",Type.BT_LONG)),new StdTypeList(0),1,false,""and-long"");        Rop opcode63=new Rop(21,new Type(""I"", Type.BT_INT),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),new StdTypeList(0),1,false,""or-int"");        Rop opcode64=new Rop(21,new Type(""J"", Type.BT_LONG),StdTypeList.make(new Type(""J"",Type.BT_LONG),new Type(""J"",Type.BT_LONG)),new StdTypeList(0),1,false,""or-long"");        Rop opcode65=new Rop(22,new Type(""I"", Type.BT_INT),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),new StdTypeList(0),1,false,""xor-int"");        Rop opcode66=new Rop(22,new Type(""J"", Type.BT_LONG),StdTypeList.make(new Type(""J"",Type.BT_LONG),new Type(""J"",Type.BT_LONG)),new StdTypeList(0),1,false,""xor-long"");        Rop opcode67=new Rop(23,new Type(""I"", Type.BT_INT),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),new StdTypeList(0),1,false,""shl-int"");        Rop opcode68=new Rop(23,new Type(""J"", Type.BT_LONG),StdTypeList.make(new Type(""J"",Type.BT_LONG),new Type(""I"",Type.BT_INT)),new StdTypeList(0),1,false,""shl-long"");        Rop opcode69=new Rop(24,new Type(""I"", Type.BT_INT),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),new StdTypeList(0),1,false,""shr-int"");        Rop opcode70=new Rop(24,new Type(""J"", Type.BT_LONG),StdTypeList.make(new Type(""J"",Type.BT_LONG),new Type(""I"",Type.BT_INT)),new StdTypeList(0),1,false,""shr-long"");        Rop opcode71=new Rop(25,new Type(""I"", Type.BT_INT),StdTypeList.make(new Type(""I"",Type.BT_INT),new Type(""I"",Type.BT_INT)),new StdTypeList(0),1,false,""ushr-int"");        Rop opcode72=new Rop(25,new Type(""J"", Type.BT_LONG),StdTypeList.make(new Type(""J"",Type.BT_LONG),new Type(""I"",Type.BT_INT)),new StdTypeList(0),1,false,""ushr-long"");        Rop opcode73=new Rop(26,new Type(""I"", Type.BT_INT),new StdTypeList(Type.BT_INT),new StdTypeList(0),1,false,""not-int"");        Rop opcode74=new Rop(26,new Type(""J"", Type.BT_LONG),new StdTypeList(Type.BT_LONG),new StdTypeList(0),1,false,""not-long"");        Rop opcode75=new Rop(14,new Type(""I"", Type.BT_INT),new StdTypeList(Type.BT_INT),new StdTypeList(0),1,false,""add-const-int"");        Rop opcode76=new Rop(14,new Type(""J"", Type.BT_LONG),new StdTypeList(Type.BT_LONG),new StdTypeList(0),1,false,""add-const-long"");        Rop opcode77=new Rop(14,new Type(""F"", Type.BT_FLOAT),new StdTypeList(Type.BT_FLOAT),new StdTypeList(0),1,false,""add-const-float"");        Rop opcode78=new Rop(14,new Type(""D"", Type.BT_DOUBLE),new StdTypeList(Type.BT_DOUBLE),new StdTypeList(0),1,false,""add-const-double"");        */        Rop opcodeMethod1=new Rop(3,Type.intern(""Ljava/lang/Object;""),new StdTypeList(0),new StdTypeList(0),1,false,""move-param-object"");        Rop opcodeMethod2=new Rop(6,new Type(""V"", Type.BT_VOID),new StdTypeList(0),new StdTypeList(0),3,false,""goto"");        SourcePosition sourcePositionMethod1=new SourcePosition(new CstUtf8(""HolaMundo.java""),1,1);        SourcePosition sourcePositionMethod2=new SourcePosition(new CstUtf8(""HolaMundo.java""),2,2);        RegisterSpec registerSpecMethod1=RegisterSpec.make(0,new Type(""NffffHolaMundo;"",Type.BT_OBJECT,2147483647));        RegisterSpec registerSpecMethod2=null;        RegisterSpec registerSpecMethod0=RegisterSpec.make(0,Type.intern(""Ljava/lang/Object;""));        RegisterSpecList registerSpecListMethod0=new RegisterSpecList(1);        registerSpecListMethod0.set(0, registerSpecMethod1);        RegisterSpecList registerSpecListMethod1=new RegisterSpecList(0);        RegisterSpecList registerSpecListMethod2=new RegisterSpecList(0);        PlainInsn insn1=new PlainInsn(opcodeMethod1,sourcePositionMethod1,registerSpecMethod1,registerSpecListMethod1);        PlainInsn insn2=new PlainInsn(opcodeMethod2,sourcePositionMethod2,registerSpecMethod2,registerSpecListMethod2);        Dop dopMethod0 = new Dop(DalvOps.INVOKE_DIRECT,DalvOps.INVOKE_DIRECT,Form35c.THE_ONE,false,""invoke-direct"");        Dop dopMethod1 = new Dop(DalvOps.RETURN_VOID, DalvOps.RETURN_VOID, Form10x.THE_ONE, false, ""return-void"");        CstInsn simpleInsnMethod0=new CstInsn(dopMethod0,sourcePositionMethod1,registerSpecListMethod0,methodref);        SimpleInsn simpleInsnMethod1=new SimpleInsn(dopMethod1,sourcePositionMethod2,registerSpecListMethod1);        OutputFinisher outputFinisherMethod1=new OutputFinisher(21,2);        outputFinisherMethod1.add(simpleInsnMethod0);        outputFinisherMethod1.add(simpleInsnMethod1);        /***DalvCode***/        InsnList insnList1=new InsnList(2);        insnList1.set(0, insn1);        insnList1.set(1, insn2);        int primarySuccesor1=0;        int label1=10;        IntList intList1=new IntList(1);        insnList1.setImmutable();        intList1.add(0);        intList1.setImmutable();        BasicBlock basicBlock1=new BasicBlock(label1,insnList1,intList1,primarySuccesor1);        InsnList insnList2=new InsnList(1);        insnList2.set(0, insn2);        int primarySuccesor2=11;        int label2=0;        IntList intList2=new IntList(11);        BasicBlockList basicBlockList1=new BasicBlockList(1);        basicBlockList1.set(0, basicBlock1);    // Bueno!!  int[] orderMethod1={14,12,0,13};        /**** Constructor ****/        int[] orderMethod1={10};        RopMethod ropMethod1=new RopMethod(basicBlockList1,10);        BlockAddresses blockAddresses1=new BlockAddresses(ropMethod1);        StdCatchBuilder stdCatchBuilder1=new StdCatchBuilder(ropMethod1,orderMethod1,blockAddresses1);        DalvCode code1=new DalvCode(2,outputFinisherMethod1,stdCatchBuilder1);        EncodedMethod method=new EncodedMethod(methodref,0x10001,code1,new StdTypeList(0));        clazz.addDirectMethod(method);        /*** Method setMessage ***/        CstMethodRef methodref2=new CstMethodRef(type,new CstNat(new CstUtf8(""setMessage""),new CstUtf8(""(Ljava/lang/String;)V"")));        Dop dopMethod2=new Dop(DalvOps.IPUT_OBJECT,DalvOps.IPUT_OBJECT,Form22c.THE_ONE,false,""iput-object"");        Dop dopMethod3 = new Dop(DalvOps.RETURN_VOID,DalvOps.RETURN_VOID,Form10x.THE_ONE,false,""return-void"");        SourcePosition sourcePositionMethod3=new SourcePosition(new CstUtf8(""HolaMundo.java""),2,6);        SourcePosition sourcePositionMethod4=new SourcePosition(new CstUtf8(""HolaMundo.java""),5,7);        RegisterSpec registerSpecMethod4=RegisterSpec.make(0,Type.intern(""Ljava/lang/String;""));        RegisterSpec registerSpecMethod3=RegisterSpec.make(1, Type.intern(""LHolaMundo;""));        RegisterSpecList registerSpecListMethod3=new RegisterSpecList(2);        RegisterSpecList registerSpecListMethod4=new RegisterSpecList(0);        registerSpecListMethod3.set(0,registerSpecMethod3);        registerSpecListMethod3.set(1,registerSpecMethod4);        CstFieldRef cstFieldRef1=new CstFieldRef(type,new CstNat(new CstUtf8(""message""),new CstUtf8(""Ljava/lang/String;"")));        CstInsn simpleInsnMethod2=new CstInsn(dopMethod2,sourcePositionMethod3,registerSpecListMethod3,cstFieldRef1);        SimpleInsn simpleInsnMethod3 = new SimpleInsn(dopMethod3,sourcePositionMethod4, registerSpecListMethod4);        OutputFinisher outputFinisherMethod2=new OutputFinisher(22,2);        outputFinisherMethod2.add(simpleInsnMethod2);        outputFinisherMethod2.add(simpleInsnMethod3);        int[] orderMethod2={10};        RopMethod ropMethod2=new RopMethod(basicBlockList1,10);        BlockAddresses blockAddresses2=new BlockAddresses(ropMethod2);        StdCatchBuilder stdCatchBuilder2=new StdCatchBuilder(ropMethod2,orderMethod2,blockAddresses2);        DalvCode code2=new DalvCode(2,outputFinisherMethod2,stdCatchBuilder2);        EncodedMethod method2=new EncodedMethod(methodref2,1,code2,new StdTypeList(0));        clazz.addVirtualMethod(method2);        /*** Method getMessage ***/        CstMethodRef methodref3=new CstMethodRef(type,new CstNat(new CstUtf8(""getMessage""),new CstUtf8(""()Ljava/lang/String;"")));        Dop dopMethod4 = new Dop(DalvOps.IGET_OBJECT, DalvOps.IGET_OBJECT, Form22c.THE_ONE, true, ""iget-object"");        Dop dopMethod5 = new Dop(DalvOps.RETURN_OBJECT,DalvOps.RETURN_OBJECT,Form11x.THE_ONE,false,""return-object"");        RegisterSpec registerSpecMethod5=RegisterSpec.make(1, Type.intern(""LHolaMundo;""));        RegisterSpec registerSpecMethod6=RegisterSpec.make(0,Type.intern(""Ljava/lang/String;""));        SourcePosition sourcePositionMethod5=new SourcePosition(new CstUtf8(""HolaMundo.java""),2,8);        SourcePosition sourcePositionMethod6=new SourcePosition(new CstUtf8(""HolaMundo.java""),5,9);        RegisterSpecList registerSpecListMethod5=new RegisterSpecList(2);        registerSpecListMethod5.set(0, registerSpecMethod5);        registerSpecListMethod5.set(1,registerSpecMethod6);        RegisterSpecList registerSpecListMethod6=new RegisterSpecList(1);        registerSpecListMethod6.set(0, registerSpecMethod6);        CstFieldRef cstFieldRef2=new CstFieldRef(type,new CstNat(new CstUtf8(""message""),new CstUtf8(""Ljava/lang/String;"")));        CstInsn simpleInsnMethod4=new CstInsn(dopMethod4,sourcePositionMethod5,registerSpecListMethod5,cstFieldRef2);        SimpleInsn simpleInsnMethod5=new SimpleInsn(dopMethod5,sourcePositionMethod6,registerSpecListMethod6);        OutputFinisher outputFinisherMethod3=new OutputFinisher(22,2);        outputFinisherMethod3.add(simpleInsnMethod4);        outputFinisherMethod3.add(simpleInsnMethod5);        int[] orderMethod3={10};        RopMethod ropMethod3=new RopMethod(basicBlockList1,10);        BlockAddresses blockAddresses3=new BlockAddresses(ropMethod3);        StdCatchBuilder stdCatchBuilder3=new StdCatchBuilder(ropMethod3,orderMethod3,blockAddresses3);        DalvCode code3=new DalvCode(2,outputFinisherMethod3,stdCatchBuilder3);        EncodedMethod method3=new EncodedMethod(methodref3,1,code3,new StdTypeList(0));        clazz.addVirtualMethod(method3);        outputDex.add(clazz);        outputDex.writeTo(fileOutputStream, null, false);        fileOutputStream.flush();        fileOutputStream.close();        InputStream is = new FileInputStream(""mnt/sdcard/classes.dex"");        int len;        int size = 1024;        byte[] buf;        if (is instanceof ByteArrayInputStream) {          size = is.available();          buf = new byte[size];          len = is.read(buf, 0, size);        } else {          ByteArrayOutputStream bos = new ByteArrayOutputStream();          buf = new byte[size];          while ((len = is.read(buf, 0, size)) != -1)            bos.write(buf, 0, len);          buf = bos.toByteArray();        }        System.out.println(System.getProperty(""user.dir""));       System.out.println(""buf ""+buf.toString());       com.android.dx.command.dexer.Main m=new com.android.dx.command.dexer.Main();        m.createJar(""mnt/sdcard/HelloWorld.jar"", buf);        System.out.println(""Yeahhhhh"");    //  ClassDefIt    }        /**         * Returns a copy of the given args array, but without the indicated         * element.         *         * @param orig non-null; original array         * @param n which element to omit         * @return non-null; new array         */        private static String[] without(String[] orig, int n) {            int len = orig.length - 1;            String[] newa = new String[len];            System.arraycopy(orig, 0, newa, 0, n);            System.arraycopy(orig, n + 1, newa, n, len - n);            return newa;        }    public static void main(String[] args){        String[] args2={""--dex"",""--output=HolaMundo.jar"",""HolaMundo.class""};        Main m=new Main();        try{            m.createDexFile();        }catch(Exception e){System.out.println(e.getMessage());}    }}</code></pre>","577909","","","","","2012-01-25 12:40:01","Triying to generate Dex bytecode at Runtime","<android><bytecode><dex>","1","0","3","",""
"4836866","1","4837346","","2011-01-29 12:30:25","0","586","<p>I am from a PHP background where I never used cursors.</p><p>I have followed the Google Android Notepad example where I got practice using cursors and database adaptors. I vaguely understand the point of the cursor is ""to assist with the life cycle activities that happen in Android"" or quoting the example, ""...that allows Android to take care of the Cursor lifecycle instead of us needing to worry about it"".</p><p>My question is if you're doing something simple like obtaining a read-only value, is it still the best idea to use a cursor? Is there maybe some other better (faster) way of retrieving the data? Using a cursor seems more overhead than needed for this particular query.</p><p>The point of the code below is to obtain the number of items in a cart.</p><pre><code>public long getNumItemsInCart(Long rowId) throws SQLException {        Cursor mCursor =            mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID, KEY_NUM_ITEMS_IN_CART}, KEY_ROWID + ""='"" + rowId + ""'"", null,                    null, null, null, null);        if (mCursor != null) {            mCursor.moveToFirst();        }        return mCursor.getLong(mCursor.getColumnIndexOrThrow(ProductsDbAdapter.KEY_NUM_ITEMS_IN_CART));            }</code></pre>","150398","","815724","","2012-03-06 16:49:55","2012-03-06 16:49:55","When programming in Android, do I need a cursor to retrieve a simple read-only value from SQLite?","<android><sqlite><cursor>","1","0","","",""
"4836876","1","","","2011-01-29 12:32:11","3","3604","<p>If we have 2 activities A and B both defined as singleTask in MANIFEST, when A start B, A will be close (onDestroy() called immediately). Why this happen and how to avoid A to be closed by the system: multiple singleTask activities in same application.</p><p>Thank you very muchCristi, </p>","594943","","12547","","2011-04-07 15:41:46","2012-03-28 08:13:00","Android launchMode singleTask","<android><android-manifest>","4","0","","",""
"4836885","1","4837007","","2011-01-29 12:32:56","1","1902","<p>I am broadcasting a intent which will be received by a broadcast receiver, as application is still running and new intent is fired by Alarm Service  but the receiver is showing the previous intent value. As per docs broadcast receiver is no longer active after returning onReceive(), so receiver should show next intent values which is fired by alarm service, but it is not happening, can any one tell correct approach.</p><p>This is from activity to broadcast intent:</p><pre><code> Intent intent = new Intent(SCH_ALARM_ACTION);    intent.setClass(getBaseContext(), SchAlarmReciever.class);    intent.putExtra(""id"", maxId);    PendingIntent pi = PendingIntent.getBroadcast(getBaseContext(),                0,                intent,                0);   alarmManager.set(AlarmManager.RTC, gc.getTimeInMillis(), pi);</code></pre><p>This is broadreceiver:</p><pre><code>@Override    public void onReceive(Context context, Intent data)                 {        // TODO Auto-generated method stub        if(data.getAction().equals(SchedulerActivity.SCH_ALARM_ACTION)){        int id = data.getIntExtra(""id"",0);        Toast.makeText(context, ""in receiver ""+String.valueOf(id), Toast.LENGTH_LONG).show();                }</code></pre><p>here toast shows id which is sent by first broadcast from alarmservice even when second intent is fired from alarmservice(second time alarm goes off)</p>","529664","","-1","","2012-12-06 07:28:24","2012-12-06 07:28:24","Sending new intent to broadcast receiver gives extras values from previous intent","<android><broadcastreceiver><android-intent><alarmmanager>","1","2","","",""
"4836921","1","","","2011-01-29 12:39:12","0","564","<p>i have an app with buttons that on click are playing some mp3 sounds.i have two questions.Firstly,when i m trying to install my signed apk to my device,it says before the installation ""allow this application to :read phone calls"".How can i change it?i m not reading any phone calls in this app,its only a button play app.And secondly, if the app is running and i change the volume from the two buttons on the left,it changes the ringer volume...how could i fix it to change the mutimedia volume?thanks a lot</p>","519526","","","","","2011-01-29 13:15:15","Music Buttons app --Multimedia volume and Phone calls","<android>","1","1","","",""
"4836941","1","6794660","","2011-01-29 12:43:01","1","570","<p>I have a service that I want to update a number in the display on an activity. I have an explicit intent already set up, that I use to start the activity if it isn't running, and I've added a broadcast receiver to my activity in the form:</p><pre><code>    public BroadcastReceiver mReceiver = new BroadcastReceiver() {        @Override        public void onReceive(Context context, Intent intent) {            Log.d(LOG_NAME, ""Received broadcast"");        }   };</code></pre><p>But it never receives any broadcasts. I suspect this is because my explicit intent is to MyClass.class (which is not a receiver itself) rather than the actual receiver, which is a member.Does anyone have suggestions on whether this is possible with an explicit intent? I could use an implicit intent, but that seems a little wasteful as this is only ever going to a particular class.</p>","369074","","","","","2011-07-22 18:47:50","Explicit intent with a non-class BroadcastReceiver","<java><android><android-intent><broadcastreceiver>","2","0","","",""
"4837032","1","","","2011-01-29 13:04:49","4","4858","<p>Have tried the KSOAP2 library from a console application using the Eclipse IDE talking to a .NET web service located at <a href=""http://www.w3schools.com/webservices/tempconvert.asmx"" rel=""nofollow"">http://www.w3schools.com/webservices/tempconvert.asmx</a>. No problem, easy and straight forward. Embedded the code in a simple method, test(). </p><p>The problem started when I wanted everything to work from an Android application.</p><p>Here is a summary of what I have done (and the problem):</p><p><strong>1.</strong> I generated a new Android project in Eclipse IDE using the Android 2.3.1 SDK and I created also an Android Virtual Device based on the same SDK. No problem when starting the virtual device. Worked just fine.</p><p><strong>2.</strong> Then I added the uses-permission tag with android:name=""android.permission.INTERNET"" in AndroidManifest.xml file.</p><p><strong>3.</strong> After that I added the KSOAP2 library exactly as I did when making the console application.</p><p><strong>4.</strong> Now I added the method test(), earlier tested and validated, including the correct import statements. Everything looked good. No warnings.</p><p><strong>5.</strong> Compiled and started the project and on the first line of code I got a class loader failure of SoapObject, i.e. ""could not found"" org.ksoap2.serialization.SoapObject. The line of code looked something liked this: SoapObject objSoapTest = new SoapObject(""http://tempuri.org/"", ""FahrenheitToCelsius"");</p><p>Tried to see if it could detect some other class in the same package hence I added this line of code before the above mentioned code: PropertyInfo objPropertyInfo = new PropertyInfo();</p><p>Got the same problem... ""could not found"" org.ksoap2.serialization.PropertyInfo.</p><p>What can be the problem here? Have tried to change the ""Order and Export"" in Java Build Path but with no result. Do I need to put this KSOAP2 library where I have the Android SDK files? I am an hardcore C++ programmer so I dont have so much experience with Eclipse IDE etc so I really need some advise on this one.</p><p>In addition to the above mentioned, I also created a Java Swing app, no problem at all to connect to the .net web service. Does AVD have any restrictions regarding access to certain libraries? Do I need to add any other permissions? </p><p>Btw 1. I have tested other Android apps, connecting to Internet, streaming picture resources in a ListView and it worked just fine.</p><p>Btw 2. I am using Windows 7.</p><p>All my best!</p>","594965","","594965","","2011-01-29 15:05:02","2013-05-04 05:57:13","could not find class SoapObject","<.net><android><service><ksoap2>","3","6","1","",""
"4837050","1","4842713","","2011-01-29 13:09:21","3","2204","<p><br>con.getInputStream() throw exception, when the code running on android,but when copy the code to regular java project it is working,<br>The thrown object e contain ""detailMessage = Permission denied"".my code::</p><pre><code>            public static HttpData get(String sUrl) {                HttpData ret = new HttpData();                String str;                StringBuffer buff = new StringBuffer();                try {                        URL url = new URL(sUrl);                        URLConnection con = url.openConnection();                        BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));                        while ((str = in.readLine()) != null) {                                buff.append(str);                        }                        ret.content = buff.toString();                        //get headers                        Map&lt;String, List&lt;String&gt;&gt; headers = con.getHeaderFields();                        Set&lt;Entry&lt;String, List&lt;String&gt;&gt;&gt; hKeys = headers.entrySet();                        for (Iterator&lt;Entry&lt;String, List&lt;String&gt;&gt;&gt; i = hKeys.iterator(); i.hasNext();) {                                Entry&lt;String, List&lt;String&gt;&gt; m = i.next();                                Log.w(""HEADER_KEY"", m.getKey() + """");                                ret.headers.put(m.getKey(), m.getValue().toString());                                if (m.getKey().equals(""set-cookie""))                                ret.cookies.put(m.getKey(), m.getValue().toString());                        }                } catch (Exception e) {                        Log.e(""HttpRequest"", e.toString());                }                return ret;        }</code></pre><p><img src=""http://i.stack.imgur.com/Ms6yG.jpg"" alt=""con object while debug""></p>","315264","","315264","","2011-01-29 14:17:02","2011-06-29 05:49:35","con.getInputStream() throw exception in Android project, how to fix?","<java><android>","2","7","","",""
"4837110","1","4837293","","2011-01-29 13:28:19","29","21363","<p>I have a Base64 String that represents a BitMap image.</p><p>I need to transform that String into a BitMap image again to use it on a ImageView in my Android app</p><p>How to do it?</p><p>This is the code that I use to transform the image into the base64 String: </p><pre><code>//proceso de transformar la imagen BitMap en un String://android:src=""c:\logo.png""Resources r = this.getResources();Bitmap bm = BitmapFactory.decodeResource(r, R.drawable.logo);ByteArrayOutputStream baos = new ByteArrayOutputStream();  bm.compress(Bitmap.CompressFormat.PNG, 100, baos); //bm is the bitmap object   byte[] b = baos.toByteArray();//String encodedImage = Base64.encode(b, Base64.DEFAULT);encodedImage = Base64.encodeBytes(b);</code></pre>","479886","","2964945","","2014-01-17 12:47:09","2014-01-17 12:47:09","How to convert a Base64 string into a BitMap image to show it in a ImageView?","<android><base64><imageview>","2","0","11","",""
"4837171","1","","","2011-01-29 13:42:16","0","971","<p>I try a project in which I want to stream media from my java application which is running in my pc to my android app and vice versa.In my first try  I believe that I can make a tcp or udp connection and stream bytes from pc app to the android app. But not find how to do it,  is there any way for doing this?I stream the bytes, but not find solution for mediaplayer to play from received bytes.</p><p>My second try was to have two threads in android app, one reads media bytes from socket and writes to an temporary file and a second thread which uses mediaplayer to play this temp file but nothing...</p><p>I also try to have the media file into an apache http server that I have to my pc and try to feed the mediaplayer with the http url, like <a href=""http://my-computer-ip-addres/media.mp4"" rel=""nofollow"">http://my-computer-ip-addres/media.mp4</a> and works. So, it's a good solution to try to make an embedded http server to streams the file from my java application to the android phone or use the httpserver api.</p><p>Also there is the rtp/rstp method, but I'm so new in streaming and I don't know if I can create an rtp server, to streaming the media.It's very hard to do this?I think that will be the best solution, but I don't know how to do it, and from where to start. If anyone can help me, suggest some resource like tutorial, a book.</p><p>Thank you.</p>","594971","","","","","2011-03-29 10:14:29","Stream from pc to android throw java sockets, it's possible or may use RTP or http?","<java><android><sockets><streaming><rtp>","2","0","","",""
"4837188","1","","","2011-01-29 13:46:14","0","586","<p>in <code>SQLiteOpenHelper</code>, <code>delete()</code> doesn't work.inspite of that I've implemented example code of internet, <code>delete()</code> sometimes fail.So I checked logcat like following code's delete Buttonalmost fail occurred during performing <code>delete()</code> of <code>SQLiteOpenHelper</code>'s son class instance.If someone knows this problem or had similar problem before me, please advice me anything.</p><pre><code>package com.android.demo.notepad1;import android.app.Activity;import android.database.Cursor;import android.database.SQLException;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.TextView;import android.widget.Toast;public class NotePadTest extends Activity {     private NotesDbAdapter dbAdapter;     private TextView tv1, tv2;     @Override     public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          setContentView(R.layout.main);          dbAdapter = new NotesDbAdapter(this);          dbAdapter.open();          tv1 = (TextView) findViewById(R.id.title_textview);          tv2 = (TextView) findViewById(R.id.body_textview);          Button createButton = (Button)findViewById(R.id.create_button);          createButton.setOnClickListener(new OnClickListener() {               @Override               public void onClick(View v) {                              dbAdapter.createTable();               }          });          Button dropButton = (Button)findViewById(R.id.drop_button);          dropButton.setOnClickListener(new OnClickListener() {               @Override               public void onClick(View v) {                    try {                             dbAdapter.dropTable();                             showToast(""??? ?? ??"");                    }                    catch(SQLException e)                    {                             showToast(""??? ?? ??"");                    }               }         });         Button insertButton = (Button)findViewById(R.id.insert_button);         insertButton.setOnClickListener(new OnClickListener() {               @Override               public void onClick(View v) {                    dbAdapter.createNote(""text"", ""body"");               }         });         Button selectButton = (Button) findViewById(R.id.select_button);         selectButton.setOnClickListener(new OnClickListener() {              @Override              public void onClick(View v) {                    tv1.setText("""");                    tv2.setText("""");                    Cursor cursor = dbAdapter.fetchAllNotes();                    cursor.moveToFirst();                    while(!cursor.isAfterLast())                    {                          String text = cursor.getString(1);                          String body = cursor.getString(2);                          tv1.append(text);                          tv2.append(body);                          cursor.moveToNext();                    }                    cursor.close();              }         });         Button updateButton = (Button)findViewById(R.id.update_button);         updateButton.setOnClickListener(new OnClickListener() {              @Override              public void onClick(View v) {                    tv1.setText("""");                    tv2.setText("""");                    Cursor cursor = dbAdapter.fetchAllNotes();                    cursor.moveToFirst();                    dbAdapter.updateNote(cursor.getCount() - 1, ""xx"", ""yy"");                    while(!cursor.isAfterLast())                    {                           String text = cursor.getString(1);                           String body = cursor.getString(2);                           tv1.append(text);                           tv2.append(body);                           cursor.moveToNext();                    }                    cursor.close();                 }        });        Button deleteButton = (Button)findViewById(R.id.delete_button);        deleteButton.setOnClickListener(new OnClickListener() {             @Override             public void onClick(View v) {                   tv1.setText("""");                   tv2.setText("""");                   Cursor cursor = dbAdapter.fetchAllNotes();                   cursor.moveToFirst();                   boolean result = dbAdapter.deleteNote(cursor.getCount() - 1);                   Log.i(""delete work : "", result == true ? ""succeed"" : ""fail"");                   Log.i(""cursor count : "", new Integer(cursor.getCount()).toString());                   while(!cursor.isAfterLast())                   {                          String text = cursor.getString(1);                          String body = cursor.getString(2);                          tv1.append(text);                          tv2.append(body);                          cursor.moveToNext();                   }                   cursor.close();            }        });     }     private void showToast(String msg) {        Toast.makeText(this, msg, Toast.LENGTH_LONG);     }}</code></pre>","594987","","867603","","2011-11-25 07:44:57","2011-11-25 07:44:57","in SQLiteOpenHelper, delete() doesn't work","<java><android><sqlite>","0","2","","",""
"4837189","1","4837216","","2011-01-29 13:46:46","1","3280","<p>I' m starting on android, i want to learn to do this:</p><p>To give the user the possibility to press a button and select a photo from the phone and show the image reduced to 100x100 pixels on a ImageView from my layout. If it is possible, the image haves to be 200 KB maximum</p><p>i'm searching at google but the info i am finding is too hard for me, and the examples are not the ones i am searching for</p><p>if someone can give me the code to do this will be great, my skills are not soo good</p><p>this is my layout:</p><pre><code>&lt;RelativeLayout    android:gravity=""center_vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView        android:id=""@+id/profileImageLabel""         android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Profile Image:""        android:layout_marginTop=""13px""/&gt;    &lt;ImageView        android:id=""@+id/profileImage""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignBaseline=""@id/profileImageLabel""        android:layout_alignParentRight=""true""        android:maxWidth=""90px""        android:maxHeight=""90px""/&gt; &lt;/RelativeLayout&gt;</code></pre>","479886","","244296","","2011-01-29 13:55:48","2011-01-29 13:55:48","How to give the user the possibility to select a photo from the phone and show the image reduced to 100x100 pixels?","<android><imageview>","1","0","1","",""
"4837254","1","","","2011-01-29 14:01:43","2","933","<p>I am trying to make Phonegap show a titlebar in my Android application. From what I've seen around the net, it should do that by default and people are having trouble actually hiding it - but in my case it is hidden by default and only shows while the app is loading. Once index.html is loaded, titlebar disappears.</p><p>This also happens on a blank project created according a tutorial. What am I missing?</p>","979","","","","","2012-12-28 14:41:59","Phonegap Android show titlebar","<android><phonegap><titlebar>","1","3","","",""
"4837314","1","4895847","","2011-01-29 14:10:46","0","110","<p>I have added tab bar in my application with four tab like home stock etc .In that tab bar i have used nested activity using activity group for all tabs .The home page will default show to the user.If I swith stock tab I am calling stock activity group class from stock activity class .In stock activity I have edittext view with list view If user give 'a' or 'A' value in textwatcher listenere I am listing the value in listview .If i click home tab and come again stock tab that value in listview is coming again can anybody tell how to avoid that?</p>","426344","","426344","","2011-02-03 15:09:14","2011-02-04 08:13:55","switch over tab previous data is coming","<java><android>","1","0","","",""
"4837325","1","","","2011-01-29 14:13:39","0","1192","<p>I'm trying to display a large image (originally about 2048x1536px) in my android app.When using an ImageView, or when using my own custom view with <code>onDraw()</code>  method overridden I got a strange behavior - I see some kind of squares, like in a chess board. It doesn't depend on the original image I use or even on a scaling factor.</p><p>The original picture is not stored in res/drawable. I read it from the external storage using <code>BitmapFactory.decodeFile()</code> or <code>BitmapFactory.decodeStream()</code>.</p><p>But default picture viewer works fine with large images. I had briefly looked through its sources - it seems, default viewer uses a View inherited from ImageView. But that code still gave me no idea about the reason of such a distortion.</p><p>Any ideas why this could happen?</p><p><a href=""http://img3.imageshack.us/img3/4677/goodimg.png"" rel=""nofollow"">normal image as seen in gallery</a></p><p><a href=""http://img11.imageshack.us/img11/5915/badimg.png"" rel=""nofollow"">distorted image</a></p><p><img src=""http://i.stack.imgur.com/w9ADH.png"" alt=""Distorted image""><img src=""http://i.stack.imgur.com/rO8FL.png"" alt=""Normal image""></p>","247904","","247904","","2011-01-29 14:18:54","2011-01-29 14:18:54","Scale image on Android","<android><canvas><bitmap><imageview><scale>","0","5","","",""
"4837344","1","","","2011-01-29 14:17:59","-1","1219","<p>I'm very new to android and I am wondering how I can have 2 windows displaying content at the same time.</p><p>Here is an example:I have a HorizontalScrollView at the bottom of the screen which houses the buttons for a menu. Above it, I would like a window(like a JFrame) that I can change depending on which button from the menu was pressed. The ScrollView menu must remain unchanged an exist as a separate entity(if you know what I mean).</p><p>How can I go about doing this? I don't want to have to draw the menu every time a user click a button and a new page is displayed. I have a feeling it has something to do with intents and Activities, but I'm not sure.</p><p>Hope someone can help me out. </p><p>Thanks.</p>","595017","","142162","","2011-01-29 14:19:56","2011-01-29 15:19:11","Android with multiple content view at same time?","<android><menu><activity><android-intent>","2","0","","",""
"4837392","1","","","2011-01-29 14:27:24","2","620","<p>I've created a customized keyboard of my own.</p><p>When I click &amp; drag over the keyboard the key should be highlighted according to my finger move. When I lift up my finger the corresponding letter has to be printed on the <code>EditText</code>.</p><p>How could I do this?</p>","594934","","418183","","2011-01-31 10:37:07","2011-02-23 18:04:48","Touch event on custom keyboard","<android><keyboard>","2","1","","",""
"4837412","1","4837555","","2011-01-29 14:32:57","12","4494","<p>I have a doubt and hope someone can help me.I've written an application for me and it works well, so I've decided to share.The problem is that I've used the <strong>body</strong> of 2 methods from a class from an Android source presents on the public repository.</p><p>Edit: the body of one method is copied and the other copied with a modification.</p><p>This file has the Apache license 2.0. As my source code will not be released, what should I do to satisfy the license's requirements?</p><p>thanks in advance for all the answers </p>","167194","","167194","","2011-01-30 09:30:46","2011-01-30 09:30:46","Closed source Android app and Apache License","<android><licensing><apache-license>","2","3","1","",""
"4837463","1","4838844","","2011-01-29 14:44:24","2","827","<p>I have created an android app and would like to enable users to transfer data (e.g. over TCP). Both have my app installed. Is there any framework or guide how to use bluetooth and/or w-lan to get a good user experience? How do they initiate the connection?</p><p>Thanks!</p>","292233","","","","","2013-05-27 14:07:50","Transfer data between android devices","<android>","1","0","1","",""
"4837489","1","4837647","","2011-01-29 14:52:13","1","1259","<p>I'm creating an android application and i'm trying to use a PreferenceActivity.</p><p>I'm getting the <em>java.lang.ClassCastException: java.lang.String</em> error when it gets to this line <code>return PreferenceManager.getDefaultSharedPreferences(context).getInt(USER_TERM, USER_TERM_DEF);</code></p><p>I thought it might be because I'm not converting it properly from it's string value in the EditText box to the int I need but I can't figure out how to fix this, or is that even the cause? I'm flummoxed.</p><p>Here's my preference activity class:</p><pre><code>public class UserPrefs extends PreferenceActivity {//option names and default valsprivate static final String USER_TERM = ""term_length"";private static final String USER_YEAR = ""year_length"";private static final int USER_TERM_DEF = 12;private static final int USER_YEAR_DEF = 34;@Override protected void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    addPreferencesFromResource(R.xml.preferences); }public static int getTermLength(Context context){    try{    return PreferenceManager.getDefaultSharedPreferences(context).getInt(USER_TERM, USER_TERM_DEF);    }catch (ClassCastException e){Log.v(""getTermLength"", ""error::: "" + e); }    //return 1;//temporary, needed to catch the error and couldn't without adding a return outside the block.//}public static int getYearLength(Context context){    return PreferenceManager.getDefaultSharedPreferences(context).getInt(USER_YEAR, USER_YEAR_DEF);}</code></pre><p>And here's the bit of code where I'm trying to use the the preferences inside another class:</p><pre><code>public float alterForFrequency(Context keypadContext, float enteredAmount, String spinnerPosition){    int termLength = UserPrefs.getTermLength(keypadContext);    int yearLength = UserPrefs.getYearLength(keypadContext);}</code></pre><p>The complete android logcat, i've uploaded here: <a href=""http://freetexthost.com/v3t4ta3wbi"" rel=""nofollow"">http://freetexthost.com/v3t4ta3wbi</a></p>","523874","","523874","","2011-01-29 15:12:24","2011-01-29 15:20:20","Why am I getting a ClassCastException here?","<java><android><preferences><classcastexception><preferenceactivity>","1","3","","",""
"4837503","1","4837539","","2011-01-29 14:54:49","1","1770","<p>I have a htc wildfire phone and i have developed one application in android 2.1 using eclipse IDE now its time to run it on the actual device.</p><p>so far i have done following.</p><ol><li>i have set my application as ""debuggable"" in my Android Manifest. </li><li>i have download the driver that is setup_3.0.5511.exe (HTC Sync)</li><li>i have connect my device via usb to my pc.</li><li>i tried running abd devices and its giving me 'HTXXXXXXXX device'</li></ol><p>apart form these when i operate something in my phone i can see the log information in my eclips LogCat section.</p><p>Moreover when i open  Android SDK and AVD Manager all i can see the Virtual devices listed ; there is not actual physical device is shown over here.</p><p>I am using Windows XP operating system and <strong><em>HTC Wildfire phone.</em></strong></p>","405383","","142162","","2011-01-29 14:56:12","2011-01-29 15:00:50","unable to test android application on HTC wildfire","<android><htc>","2","0","","",""
"4837598","1","6907639","","2011-01-29 15:12:04","0","313","<p>I want to release an android application to android market. Different versions of this application should run on different Android platforms, i.e. 1.5, 1.6, 2.1, and 2.2. How can I release these separate versions under one app name?</p>","218665","","676226","","2011-08-03 07:07:27","2013-01-25 06:16:32","Releasing application in Android Market","<android><google-play>","1","0","","",""
"4837627","1","","","2011-01-29 15:17:13","0","149","<p>I create a layout in code in onCreate. Inside this layout, i have spinner with registred listener. When user changes item in a spinner, new data is read and layout must be changed according to data. I do this with the same function as in onCreate (i create scrollview and other views and call setContentView(scollView) on the last line). </p><p>The layout changes correctly but everything blocks, spinner and buttons can't be clicked anymore. Logcat displays no error(only lots of GC freed x objects). </p><p>I tried calling scrollview.removeAllViews() before trying to redraw layout, but that doesn't help either.</p><p>What am i missing here?</p>","324417","","","","","2011-01-29 16:16:38","App blocks with no error when redrawing GUI with setContentView","<android><layout>","2","1","","",""
"4837652","1","","","2011-01-29 15:21:16","0","3767","<p>I am trying to access the OpenGL capability of the phone before deciding whether to use OpenGL or Canvas for graphics puposes. However, all the functions that I can read documentation on requires you to already have a valid OpenGL context (namely, create a GLSurfaceView and assign it a rendered. Then check the OpenGL parameters in the onSurfaceCreated). </p><p>So, is there a way to check the extensions, renderer name and max texture size capability of the phone BEFORE having to create any OpenGL views?</p>","3610","","","","","2013-04-10 01:20:35","How to detect OpenGL capabilities without creating a GLSurfaceView (Android)","<android><opengl-es>","2","0","1","",""
"4837715","1","4837803","","2011-01-29 15:38:29","53","70640","<p>I have a bitmap taken of a Base64 String from my remote database, (<code>encodedImage</code> is the string representing the image with Base64):</p><pre><code>profileImage = (ImageView)findViewById(R.id.profileImage);byte[] imageAsBytes=null;try {    imageAsBytes = Base64.decode(encodedImage.getBytes());} catch (IOException e) {e.printStackTrace();}profileImage.setImageBitmap(    BitmapFactory.decodeByteArray(imageAsBytes, 0, imageAsBytes.length));</code></pre><p><strong>profileImage is my ImageView</strong></p><p>Ok, but I have to resize this image before showing it on my ImageView of my layout. I have to resize it to 120x120.</p><p>Can someone tell me the code to resize it?</p><p>The examples I found could not be applied to a base64 string obtained bitmap.</p><p>Thanks</p>","479886","","338479","","2013-05-20 17:03:23","2014-04-07 08:26:06","How to Resize a Bitmap in Android?","<android><bitmap><base64>","5","0","20","",""
"4837727","1","4837779","","2011-01-29 15:43:43","1","993","<p>I have a linear layout and some widgets inside it. How to get position of some widget inside linear layout, so i can then use removeViewAt(int positon) function?</p>","324417","","","","","2011-01-29 15:54:54","How to get View's position inside ViewGroup?","<android><view><position>","1","0","","",""
"4837732","1","4837863","","2011-01-29 15:44:26","1","348","<p>I have a script that pulls an image from SQL Server and displays it as a link or on a page.  Works perfectly in a browser and on most mobile devices.  However, when linking directly to the aspx file <code>&lt;a href=""imagehandler.aspx?ImageID=123""&gt;link&lt;/a&gt;</code> Android phones download the content but don't recognize the extension as an image, so they just save in the downloaded items folder as an image with an .aspx extension.</p><p>How can I cause Android devices to recognize the fileStream as an image instead of an object to be downloaded?</p><p>Thanks</p>","203489","","","","","2011-01-29 17:41:19","Android tries to download database-created image files","<android><database><image><filestream>","1","0","","",""
"4837762","1","","","2011-01-29 15:52:03","1","2914","<p>Want to switch light on/off and not succeeding.  Probably not getting the most from th documentation.  In any event, this is what I have tried.</p><p>Amongst the imports I have</p><pre><code>import android.hardware.Camera;</code></pre><p>Within the body</p><pre><code>Camera myCamera;.......myCamera = Camera.open();.......Camera.Parameters myCameraParameters = myCamera.getParameters();myCameraParameters.setFlashMode(FLASH_MODE_TORCH);</code></pre><p>The above line brings up an error 'FLASH_MODE_TORCH cannot be resolved to a variable'  I am assuming that I am missing an import which defines FLASH_MODE_TORCH.</p><p>Anyine point me in the right direction?</p><p>IF I am missing an import, where should I go in the documentation to find out what imports are needed for what statements, constants .....</p><p>Regards,</p><p>Oliver</p>","586378","","","","","2011-03-20 19:36:19","Using setFlashMode - Android 2.2","<android>","2","0","1","",""
"4837826","1","4839070","","2011-01-29 16:02:15","0","1211","<p>I'm trying to understand the correct way to apply a texture mapping to an opengl triangle, on the android platform.I found a weird behaviour: it seems that the texture mapping get affected by the order in which i specify the vertex.</p><p>Here is the concrete problem. In this picture you can see the texture, the triangle and the desired mapping: (i had to combine the 2 images into a single link, sorry)</p><p><a href=""http://www.flickr.com/photos/21134083@N07/5398416606/"" rel=""nofollow"">combined images</a></p><p>The actual texture picture is a 2x2 png.</p><p>The code is subdivided basically in 2 classes: the renderer and the model.</p><ul><li>The renderer</li></ul><p>This is the opengl initialization (there are many things in here that i still didn't fully understand, i just adopted this code from an example:</p><pre><code>[...]public void onSurfaceCreated(GL10 gl, EGLConfig config){    glDisable(GL_DITHER);    gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, lightAmbientBuffer);    gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, lightDiffuseBuffer);    gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightPositionBuffer);    gl.glEnable(GL10.GL_LIGHT0);    gl.glShadeModel(GL10.GL_SMOOTH);    gl.glClearColor(0.0f, 0.5f, 0.5f, 1f);    // per rimuovere superfici nascoste    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);    // caricamento texture    glEnable(GL_TEXTURE_2D);    int[] textures = new int[1];    gl.glGenTextures(1, textures, 0);    textureId = textures[0];    gl.glBindTexture(GL_TEXTURE_2D, textureId);    gl.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);    gl.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);    gl.glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);    for (Drawable m : models) { // the models are kept in a Vector         if (m.getTextureLoader() != null)            m.getTextureLoader().load(gl);    }}</code></pre><p>And here the frame rendering function (the actual drawing gets done in the m.draw(gl) call):</p><pre><code>public void onDrawFrame(GL10 gl){    glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE,            GL_MODULATE);    // Clear Screen And Depth Buffer    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    gl.glLoadIdentity();    gl.glEnable(GL10.GL_LIGHTING);    gl.glTranslatef(0.0f, -1.2f, -z); // just a little translation in order to see the complete drawing    glActiveTexture(GL_TEXTURE0);    glBindTexture(GL_TEXTURE_2D, textureId);    gl.glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, gl.GL_CLAMP_TO_EDGE);    gl.glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, gl.GL_CLAMP_TO_EDGE);    for (Drawable m : models) {        m.draw(gl);    }    gl.glLoadIdentity();}</code></pre><ul><li>The model</li></ul><p>Here is the model class:</p><pre><code>public class OneTriangle implements Drawable {    Context     context;    FloatBuffer textureMappingBuffer;    FloatBuffer vertexBuffer;    ShortBuffer facesIdxBuffer;    public OneTriangle(Context context) {        this.context = context;        float[] v = {                -2, 2, 0, //A                2, 2, 0,//B                -2, -2, 0 };//C     //correct    /*         short[] idx = {0,1,2};        float[] vt ={                0,0,//red                1,0,//green                0,1};//yellow                */    //wrong       short[] idx = {1,2,0};        float[] vt ={                1,0,//green                0,1,//yellow                0,0//red                };        {            ByteBuffer vBuf = ByteBuffer.allocateDirect(v.length * Float.SIZE / 8);            vBuf.order(ByteOrder.nativeOrder());            vertexBuffer = vBuf.asFloatBuffer();            vertexBuffer.put(v);            vertexBuffer.position(0);        }        {            ByteBuffer fBuf = ByteBuffer.allocateDirect(idx.length * Short.SIZE / 8);            fBuf.order(ByteOrder.nativeOrder());            facesIdxBuffer = fBuf.asShortBuffer();            facesIdxBuffer.put(idx);            facesIdxBuffer.position(0);        }        {            ByteBuffer vBuf = ByteBuffer.allocateDirect(vt.length * Float.SIZE / 8);            vBuf.order(ByteOrder.nativeOrder());            textureMappingBuffer = vBuf.asFloatBuffer();            textureMappingBuffer.put(vt);            textureMappingBuffer.position(0);        }    }    public void draw(GL10 gl)    {        glEnableClientState(GL_VERTEX_ARRAY);        glEnableClientState(GL_TEXTURE_COORD_ARRAY);        glVertexPointer(3, GL_FLOAT, 0, vertexBuffer);        glTexCoordPointer(2, GL_FLOAT, 0, textureMappingBuffer);        glDrawElements(GL_TRIANGLES, facesIdxBuffer.capacity(), GL_UNSIGNED_SHORT, facesIdxBuffer);        glDisableClientState(GL_VERTEX_ARRAY);        glDisableClientState(GL_TEXTURE_COORD_ARRAY);    }    public TextureLoader getTextureLoader()    {        return new AssetTextureLoader(context, ""tetraedro.png"");    }}</code></pre><p>and finally here is the AssetTextureLoader class, which load the texture file from the ""assets"" folder in the project (cleaned of boring exception handling code):</p><pre><code>public class AssetTextureLoader implements TextureLoader {    private Context context;    private String  filename;    public AssetTextureLoader(Context context, String filename) {        this.context = context;        this.filename = filename;    }    public void load(GL10 gl)    {        InputStream is;        is = context.getResources().getAssets().open(filename);        Bitmap bitmap = BitmapFactory.decodeStream(is);        is.close();        Log.d(""texture loader"", ""internal format:"" + GLUtils.getInternalFormat(bitmap)+"", type: ""+GLUtils.getType(bitmap));        GLUtils.texImage2D(GL_TEXTURE_2D, 0, bitmap, 0);        bitmap.recycle();    }}</code></pre><p>Ok. As you can see in the OneTriangle class there is a commented ""correct"" initialization which basically lists the vertices in the A-B-C order and the mappings  in the red-green-yellow order. That code produce the correct texture mapping. </p><p>Then i tried to simply change the order of the vertices in the ""wrong"" section: B-C-A and green-yellow-red. I would expect to get the exact same output, because A is always mapped to red, B is mapped to green and C is mapped to yellow. But instead i get a completely different output.</p><p>Here you can see the 2 outputs: (see the second part of the image before)</p><p>But there is more! If i change again the model initialization in this way:</p><pre><code>     //should be wrong but is correct       short[] idx = {1,0,2};        float[] vt ={                0,0,//red                1,0,//green                0,1};//yellow</code></pre><p>.. i get the correct mapping! In fact, i can choose any arbitrary order for the idx array and it doesn't matter: as long as the vt array is in that specific r-g-y order i get the correct image. </p><p>Why is opengl so hostile to me? </p><p>I'm sorry for the very long post, but the mistake (if any) may hide anywhere in the implementation..</p>","527935","","","","","2011-01-29 19:55:23","How is android opengl texture-mapping affected by vertex order?","<android><opengl-es><order><texture-mapping><vertex>","1","0","1","",""
"4837834","1","","","2011-01-29 16:04:33","4","13453","<p>i would like to have two lines in every listview item.this is my code but its not working...</p><p>RE-EDITED CODE</p><pre><code>public class nea extends ListActivity{    private List&lt;Message&gt; messages;     @Override     public void onCreate(Bundle icicle) {         super.onCreate(icicle);        setContentView(R.layout.main2);        loadFeed(ParserType.DOM);    }    private void loadFeed(ParserType type){        try{            Log.i(""News"", ""ParserType=""+type.name());            FeedParser parser = FeedParserFactory.getParser(type);            long start = System.currentTimeMillis();            messages = parser.parse();            long duration = System.currentTimeMillis() - start;            Log.i(""News"", ""Parser duration="" + duration);            String xml = writeXml();            Log.i(""News"", xml);            List&lt;String&gt; titles = new ArrayList&lt;String&gt;(messages.size());            for (Message msg : messages){                String o = titles.get(messages.size());                if (o != null) {                    TextView tt = (TextView) findViewById(R.id.TextView01);                    TextView bt = (TextView) findViewById(R.id.TextView02);                    if (tt != null) {                         titles.add(""""+msg.getDate());                            }                    if(bt != null){                        titles.add(""date: ""+ msg.getTitle());                    }return;            //titles.add(msg.getDate()+""\n""+msg.getTitle());                }            //  titles.add(msg.getTitle()+""  ""+msg.getDate());            }            ArrayAdapter&lt;String&gt; adapter =                 new ArrayAdapter&lt;String&gt;(this, R.layout.row,titles);            this.setListAdapter(adapter);        //  textView.setText(Html.fromHtml(titles.get(position)));        } catch (Throwable t){            Log.e(""News"",t.getMessage(),t);        }    }</code></pre><p>SECOND WAY--not working too</p><pre><code>    List&lt;String&gt; titles = new ArrayList&lt;String&gt;(messages.size());                for (Message msg : messages){                               String o = titles.get(messages.size());                    if (o != null) {                        TextView tt = (TextView) findViewById(R.id.TextView01);                        TextView bt = (TextView) findViewById(R.id.TextView02);                        if (tt != null) {                             titles.add(""""+msg.getDate());                            }                        if(bt != null){                            titles.add(""date: ""+ msg.getTitle());                        }return;                //titles.add(msg.getDate()+""\n""+msg.getTitle());                    }                //  titles.add(msg.getTitle()+""  ""+msg.getDate());                }                ArrayAdapter&lt;String&gt; adapter =                     new ArrayAdapter&lt;String&gt;(this, R.layout.row,titles);                this.setListAdapter(adapter);            //  textView.setText(Html.fromHtml(titles.get(position)));            } catch (Throwable t){Log.e(""News"",t.getMessage(),t);        }</code></pre>","519526","","519526","","2011-01-29 16:17:16","2013-12-26 16:57:22","2 lines in a listView item","<android>","3","2","2","",""
"4837889","1","","","2011-01-29 16:13:15","3","7731","<p>So I've read Romain Guy's <a href=""http://android-developers.blogspot.ca/2009/03/window-backgrounds-ui-speed.html"" rel=""nofollow"">blog post</a> on setting the Window background and percieved performance, and am trying to emulate that.  It is such a simple solution and not sure why I can't get this working, but the activity simply refuses to pick-up the directed background.</p><p>I have a ListView that onListItemClick launches a new Activity, one that takes 3-5 seconds to fully load.  While the user is waiting, I'd like to draw a windowBackground so that they 'see' the activity before it is actually ready.  Here's my code:</p><p>AndroidManifest snippet for the launched Activity:</p><pre><code>&lt;activity         android:name="".activity.EditorActivity""        android:screenOrientation=""portrait""        android:windowBackground=""@drawable/background_editor""&gt;</code></pre><p>The XML layout for the EditorActivity:</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;TextView     android:id=""@+id/editor""    android:layout_height=""wrap_content""    android:layout_width=""match_parent""    android:text=""Editor"" /&gt;&lt;/FrameLayout&gt;</code></pre><p>And finally, the drawable being set in the Manifest, background_editor.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;bitmap xmlns:android=""http://schemas.android.com/apk/res/android""    android:src=""@drawable/editor_bg""    android:tileMode=""repeat"" /&gt;</code></pre><p>editor_bg is a .png file located int he drawable folder.</p><p>The end result is the EditorActivity gets launched, and all I see is the default black background with the ""Editor"" text displayed in white (I added that to test that the XML file was loading correctly.</p><p>I've also tried setting the background of the FrameLayout and TextView to transparent via android:background=""@android:color/transparent"", thinking maybe they were defaulting to a black background, but no luck.</p><p>It's been a long few days, I'm sure I am missing something simple... any obvious mistakes I am making here?</p><p>Thanks.</p>","357801","","357801","","2013-05-03 02:49:43","2013-05-03 02:49:43","Android: Setting Window Background on launched Activity","<android><background><android-layout>","1","1","0","",""
"4837894","1","4837969","","2011-01-29 16:13:42","0","2668","<p>I've created a TabHost example with 1 tab which is running fine. I'm adding views in tabs with <strong>TabContentFactory</strong> using <em>TabSpec.setContent(TabHost.TabContentFactory contentFactory)</em></p><p>But as soon as I try to add tabs by views in tabs using <strong>View/Resource IDs</strong> using <em>TabSpec.setContent(int viewId)</em> my app crashes. The code is as follows:</p><pre><code>public class MainAct extends TabActivity implements TabContentFactory{    protected Resources res;    protected ListView listView;    protected LayoutInflater inflater;    @Override    public void onCreate(Bundle savedInstanceState) {    /*init*/        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        res = getResources();        listView = new ListView(this);    /*prepare tabs*/        TabHost tabHost = getTabHost();        TabSpec spec;        spec = tabHost.newTabSpec(res.getString(R.string.label_project));        spec.setIndicator(res.getString(R.string.label_project));        spec.setContent(this); // &lt;&lt; this works perfect        //spec.setContent(R.id.list_item); // &lt;&lt; CRASHES        //spec.setContent(R.id.list_item2); // &lt;&lt; CRASHES        tabHost.addTab(spec);    }    @Override    public View createTabContent(String tag) {        return listView;    }}</code></pre><p>My XML files are 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:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""10dp""    android:textSize=""22sp""    android:id=""@+id/list_item""&gt;&lt;/TextView&gt;</code></pre><p>and</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/list_item2""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TextView android:id=""@+id/TextView01""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""list_item2""&gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>Both of them defines IDs properly, yet they crash. I've already gone through following online tutorials:</p><p><a href=""http://android-pro.blogspot.com/2010/08/tabbed-applications-in-android.html"" rel=""nofollow"">http://android-pro.blogspot.com/2010/08/tabbed-applications-in-android.html</a></p><p><a href=""http://www.codeproject.com/KB/android/AndroidTabs.aspx"" rel=""nofollow"">http://www.codeproject.com/KB/android/AndroidTabs.aspx</a></p><p><a href=""http://www.androidpeople.com/android-custom-listview-tutorial-example/"" rel=""nofollow"">http://www.androidpeople.com/android-custom-listview-tutorial-example/</a></p><p>All of them describes how to add views in tabs using IDs, but none works for me.</p><p><strong>All I want to do is to define a view in a layout file and add it inside my tab using IDs. Please help.</strong> </p><p>EDIT LogCat:</p><pre><code>01-29 21:53:44.665: DEBUG/AndroidRuntime(1336): &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;01-29 21:53:44.675: DEBUG/AndroidRuntime(1336): CheckJNI is ON01-29 21:53:44.945: DEBUG/AndroidRuntime(1336): --- registering native functions ---01-29 21:53:45.395: DEBUG/ddm-heap(1336): Got feature list request01-29 21:53:45.934: DEBUG/PackageParser(63): Scanning package: /data/app/vmdl69673.tmp01-29 21:53:45.944: INFO/PackageParser(63): org.pixeroid.gtd: compat added android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_PHONE_STATE01-29 21:53:46.164: DEBUG/dalvikvm(63): GC freed 8169 objects / 609984 bytes in 156ms01-29 21:53:46.285: INFO/PackageManager(63): Removing non-system package:org.pixeroid.gtd01-29 21:53:46.285: DEBUG/PackageManager(63): Removing package org.pixeroid.gtd01-29 21:53:46.295: DEBUG/PackageManager(63):   Activities: org.pixeroid.gtd.MainAct01-29 21:53:46.414: DEBUG/PackageManager(63): Scanning package org.pixeroid.gtd01-29 21:53:46.414: INFO/PackageManager(63): /data/app/vmdl69673.tmp changed; unpacking01-29 21:53:46.426: DEBUG/installd(31): DexInv: --- BEGIN '/data/app/vmdl69673.tmp' ---01-29 21:53:46.735: DEBUG/dalvikvm(1342): DexOpt: load 53ms, verify 85ms, opt 3ms01-29 21:53:46.745: DEBUG/installd(31): DexInv: --- END '/data/app/vmdl69673.tmp' (success) ---01-29 21:53:46.755: DEBUG/PackageManager(63):   Activities: org.pixeroid.gtd.MainAct01-29 21:53:46.764: DEBUG/ActivityManager(63): Uninstalling process org.pixeroid.gtd01-29 21:53:46.774: DEBUG/ActivityManager(63): Force removing process ProcessRecord{43f230b8 1327:org.pixeroid.gtd/10029} (org.pixeroid.gtd/10029)01-29 21:53:46.774: INFO/Process(63): Sending signal. PID: 1327 SIG: 901-29 21:53:46.805: DEBUG/ActivityManager(63): Received spurious death notification for thread android.os.BinderProxy@43d6652001-29 21:53:46.925: INFO/installd(31): move /data/dalvik-cache/data@app@vmdl69673.tmp@classes.dex -&gt; /data/dalvik-cache/data@app@org.pixeroid.gtd.apk@classes.dex01-29 21:53:46.934: DEBUG/PackageManager(63): New package installed in /data/app/org.pixeroid.gtd.apk01-29 21:53:47.085: DEBUG/AndroidRuntime(1336): Shutting down VM01-29 21:53:47.095: DEBUG/dalvikvm(1336): DestroyJavaVM waiting for non-daemon threads to exit01-29 21:53:47.105: DEBUG/dalvikvm(1336): DestroyJavaVM shutting VM down01-29 21:53:47.105: DEBUG/dalvikvm(1336): HeapWorker thread shutting down01-29 21:53:47.115: DEBUG/dalvikvm(1336): HeapWorker thread has shut down01-29 21:53:47.125: DEBUG/jdwp(1336): JDWP shutting down net...01-29 21:53:47.125: INFO/dalvikvm(1336): Debugger has detached; object registry had 1 entries01-29 21:53:47.125: DEBUG/dalvikvm(1336): VM cleaning up01-29 21:53:47.176: ERROR/AndroidRuntime(1336): ERROR: thread attach failed01-29 21:53:47.195: DEBUG/ActivityManager(63): Uninstalling process org.pixeroid.gtd01-29 21:53:47.215: DEBUG/dalvikvm(1336): LinearAlloc 0x0 used 623916 of 5242880 (11%)01-29 21:53:47.474: WARN/ResourceType(63): Resources don't contain package for resource number 0x7f0700e501-29 21:53:47.504: WARN/ResourceType(63): Resources don't contain package for resource number 0x7f02003101-29 21:53:47.504: WARN/ResourceType(63): Resources don't contain package for resource number 0x7f02003001-29 21:53:47.504: WARN/ResourceType(63): Resources don't contain package for resource number 0x7f05000001-29 21:53:47.535: WARN/ResourceType(63): Resources don't contain package for resource number 0x7f06000001-29 21:53:47.584: WARN/ResourceType(63): Resources don't contain package for resource number 0x7f06000101-29 21:53:47.785: DEBUG/dalvikvm(141): GC freed 294 objects / 13368 bytes in 327ms01-29 21:53:48.155: DEBUG/dalvikvm(63): GC freed 4525 objects / 319208 bytes in 399ms01-29 21:53:48.485: WARN/ResourceType(63): Resources don't contain package for resource number 0x7f0700e501-29 21:53:48.514: WARN/ResourceType(63): Resources don't contain package for resource number 0x7f02003101-29 21:53:48.514: WARN/ResourceType(63): Resources don't contain package for resource number 0x7f02003001-29 21:53:48.514: WARN/ResourceType(63): Resources don't contain package for resource number 0x7f05000001-29 21:53:48.565: WARN/ResourceType(63): Resources don't contain package for resource number 0x7f06000001-29 21:53:48.595: WARN/ResourceType(63): Resources don't contain package for resource number 0x7f06000101-29 21:53:48.895: DEBUG/AndroidRuntime(1347): &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;01-29 21:53:48.977: DEBUG/AndroidRuntime(1347): CheckJNI is ON01-29 21:53:49.504: DEBUG/AndroidRuntime(1347): --- registering native functions ---01-29 21:53:49.905: DEBUG/ddm-heap(1347): Got feature list request01-29 21:53:50.425: INFO/ActivityManager(63): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=org.pixeroid.gtd/.MainAct }01-29 21:53:50.505: INFO/ActivityManager(63): Start proc org.pixeroid.gtd for activity org.pixeroid.gtd/.MainAct: pid=1353 uid=10029 gids={1015}01-29 21:53:50.514: DEBUG/AndroidRuntime(1347): Shutting down VM01-29 21:53:50.524: DEBUG/dalvikvm(1347): DestroyJavaVM waiting for non-daemon threads to exit01-29 21:53:50.534: DEBUG/dalvikvm(1347): DestroyJavaVM shutting VM down01-29 21:53:50.534: DEBUG/dalvikvm(1347): HeapWorker thread shutting down01-29 21:53:50.544: DEBUG/dalvikvm(1347): HeapWorker thread has shut down01-29 21:53:50.544: DEBUG/jdwp(1347): JDWP shutting down net...01-29 21:53:50.544: INFO/dalvikvm(1347): Debugger has detached; object registry had 1 entries01-29 21:53:50.555: DEBUG/dalvikvm(1347): VM cleaning up01-29 21:53:50.585: ERROR/AndroidRuntime(1347): ERROR: thread attach failed01-29 21:53:50.645: DEBUG/dalvikvm(1347): LinearAlloc 0x0 used 639500 of 5242880 (12%)01-29 21:53:50.864: DEBUG/ddm-heap(1353): Got feature list request01-29 21:53:51.494: DEBUG/AndroidRuntime(1353): Shutting down VM01-29 21:53:51.494: WARN/dalvikvm(1353): threadid=3: thread exiting with uncaught exception (group=0x4001b188)01-29 21:53:51.504: ERROR/AndroidRuntime(1353): Uncaught handler: thread main exiting due to uncaught exception01-29 21:53:51.535: ERROR/AndroidRuntime(1353): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.pixeroid.gtd/org.pixeroid.gtd.MainAct}: java.lang.RuntimeException: Could not create tab content because could not find view with id 213109964801-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at android.os.Handler.dispatchMessage(Handler.java:99)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at android.os.Looper.loop(Looper.java:123)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at android.app.ActivityThread.main(ActivityThread.java:4363)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at java.lang.reflect.Method.invokeNative(Native Method)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at java.lang.reflect.Method.invoke(Method.java:521)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at dalvik.system.NativeStart.main(Native Method)01-29 21:53:51.535: ERROR/AndroidRuntime(1353): Caused by: java.lang.RuntimeException: Could not create tab content because could not find view with id 213109964801-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at android.widget.TabHost$ViewIdContentStrategy.&lt;init&gt;(TabHost.java:587)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at android.widget.TabHost$ViewIdContentStrategy.&lt;init&gt;(TabHost.java:578)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at android.widget.TabHost$TabSpec.setContent(TabHost.java:435)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at org.pixeroid.gtd.MainAct.onCreate(MainAct.java:45)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)01-29 21:53:51.535: ERROR/AndroidRuntime(1353):     ... 11 more01-29 21:53:51.554: INFO/Process(63): Sending signal. PID: 1353 SIG: 301-29 21:53:51.554: INFO/dalvikvm(1353): threadid=7: reacting to signal 301-29 21:53:51.554: ERROR/dalvikvm(1353): Unable to open stack trace file '/data/anr/traces.txt': Permission denied01-29 21:53:55.305: INFO/Process(1353): Sending signal. PID: 1353 SIG: 901-29 21:53:55.334: INFO/ActivityManager(63): Process org.pixeroid.gtd (pid 1353) has died.01-29 21:53:55.365: INFO/UsageStats(63): Unexpected resume of com.android.launcher while already resumed in org.pixeroid.gtd01-29 21:53:55.494: WARN/InputManagerService(63): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43c98060</code></pre>","453906","","453906","","2011-01-29 16:25:34","2013-05-29 15:49:05","unable to add views in TabHost by IDs, crashing","<android>","2","1","0","",""
"4837928","1","4842554","","2011-01-29 16:22:10","2","853","<p>I have a buffer of RGB (or RGBA) texture image, and I want to display it on my Android device with the following code. I use OpenGL from NDK.</p><pre><code>glTexImage2D(GL_TEXTURE_2D,             0,             GL_RGBA,             256,             256,             0,             GL_RGBA,             GL_UNSIGNED_BYTE,             this-&gt;pBuffer);</code></pre><p>I have also set the PixelFormat from the Java side with:</p><pre><code>this.getHolder().setFormat(PixelFormat.RGBA_8888);this.setEGLConfigChooser(8, 8, 8, 8, 0, 0);setRenderer(new MyRenderer());</code></pre><p>The image is displayed but there are four columns (identical and contains recognizable parts of the original image) and there are horizontal lines all over the image.</p><p>What can be the problem?</p><p>Original Image:</p><p><img src=""http://i.stack.imgur.com/DcUYa.jpg"" alt=""Original Image""></p><p>How it looks with my code:</p><p><img src=""http://i.stack.imgur.com/oiRQo.jpg"" alt=""How it looks with my code""></p>","471016","","471016","","2011-01-29 16:42:53","2011-01-30 15:36:12","OpenGL ES texture problem, 4 duplicate columns and horizontal lines (Android)","<android><opengl-es><android-ndk><rgb><textures>","1","0","","",""
"4838001","1","5136267","","2011-01-29 16:35:09","1","2064","<p>In android I can't figure out why this cursor is empty in htc wildfire. but works on all other phonesthere are several audiofiles on the sdcard.the stock mediaplayer can find and play these songs alright.</p><pre><code>Cursor c = managedQuery(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, new String[] { ""distinct "" + MediaStore.Audio.Media.ALBUM, MediaStore.Audio.Media.ARTIST, MediaStore.Audio.Media.ALBUM_KEY, MediaStore.Audio.Media.ALBUM_ID},                 null,                null,                 MediaStore.Audio.Media.ARTIST);</code></pre><p>If there is anyone out there that has been able to successfully query the mediastore.audio.media on a wildfire, please let me know.</p><p>Update: Apperantly it's just on this single device. Other wildfire's work fine. Still it seems strange that both the ambling book player (I'm guessing they just loop through the folders and do their own id3 parsing) and the stock android music player find the music but I can't get anything from the mediastore. No "".nomedia"" files are present, I have tried inserting new mp3 files to a new folder.</p><p>Is there no one out there that has experienced this behaviour with, not necessarily a wildfire, just any android device.</p>","595099","","595099","","2011-02-11 11:52:17","2011-02-27 21:54:27","MediaStore.Audio.Media.EXTERNAL_CONTENT_URI return an empty cursor","<android><mediastore>","2","1","1","",""
"4838029","1","4838046","","2011-01-29 16:40:02","1","633","<p>With the NDK-r5, we can create Native Activities with c++.My question is: Can it be run in android 2.2 ?</p>","84325","","","","","2011-01-29 16:45:02","About the NativeActivity in Android 2.2/NDK-r5?","<android>","1","0","","",""
"4838053","1","","","2011-01-29 16:46:08","1","624","<p>I am new to androidBox2D and I want to create a polygon body such as a rectangle or a triangle using Box2D in Android.</p><p>I was not getting the <code>B2FixtureDef</code> in my code when I was creating a body. What may be the reason for that?</p><p>But I am getting <code>BBFixtureDef</code>. What is the difference between <code>B2FixtureDef</code> and <code>BBFixtureDef</code>?</p>","655814","","496830","","2011-11-08 14:33:14","2012-10-26 04:55:54","How can I create a polygon body in Box2D Android?","<android><box2d>","1","0","1","",""
"4838181","1","","","2011-01-29 17:09:55","1","81","<p>i want to make an application that can read the values of another gadget that can get your pulse very correctly, anyone know to such item that can also sync with a android devicethanks in advance!</p>","553642","","","","","2011-01-29 17:09:55","Read pulse rate on your phone","<android><pulse>","0","0","","",""
"4838207","1","4855788","","2011-01-29 17:13:31","40","15822","<p>I have a worker thread that sits in the background, processing messages. Something like this:</p><pre><code>class Worker extends Thread {    public volatile Handler handler; // actually private, of course    public void run() {        Looper.prepare();        mHandler = new Handler() { // the Handler hooks up to the current Thread            public boolean handleMessage(Message msg) {                // ...            }        };        Looper.loop();    }}</code></pre><p>From the main thread (UI thread, not that it matters) I would like to do something like this:</p><pre><code>Worker worker = new Worker();worker.start();worker.handler.sendMessage(...);</code></pre><p>The trouble is that this sets me up for a beautiful race condition: at the time <code>worker.handler</code> is read, there is no way to be sure that the worker thread has already assigned to this field!</p><p>I cannot simply create the <code>Handler</code> from the <code>Worker</code>'s constructor, because the constructor runs on the main thread, so the <code>Handler</code> will associate itself with the wrong thread.</p><p>This hardly seems like an uncommon scenario. I can come up with several workarounds, all of them ugly:</p><ol><li><p>Something like this:</p><pre><code>class Worker extends Thread {    public volatile Handler handler; // actually private, of course    public void run() {        Looper.prepare();        mHandler = new Handler() { // the Handler hooks up to the current Thread            public boolean handleMessage(Message msg) {                // ...            }        };        notifyAll(); // &lt;- ADDED        Looper.loop();    }}</code></pre><p>And from the main thread:</p><pre><code>Worker worker = new Worker();worker.start();worker.wait(); // &lt;- ADDEDworker.handler.sendMessage(...);</code></pre><p>But this is not reliable either: if the <code>notifyAll()</code> happens before the <code>wait()</code>, then we'll never be woken up!</p></li><li><p>Passing an initial <code>Message</code> to the <code>Worker</code>'s constructor, having the <code>run()</code> method post it. An ad-hoc solution, won't work for multiple messages, or if we don't want to send it right away but soon after.</p></li><li><p>Busy-waiting until the <code>handler</code> field is no longer <code>null</code>. Yep, a last resort...</p></li></ol><p>I would like to create a <code>Handler</code> and <code>MessageQueue</code> on behalf of the <code>Worker</code> thread, but this does not seem to be possible. What is the most elegant way out of this?</p>","14637","","14637","","2011-01-29 17:18:54","2011-01-31 20:35:21","How to create a Looper thread, then send it a message immediately?","<android><multithreading><handler><looper>","1","5","27","",""
"4838228","1","4838300","","2011-01-29 17:16:14","5","8733","<p>I have a class file which extends SurfaceView and implements SurfaceHolder.Callback which is saved as myView.java</p><pre><code>public class myView extends SurfaceView implements SurfaceHolder.Callback</code></pre><p>Now i got another java file GlobalVar.java which is like this</p><pre><code>import android.app.Application;class GlobalVar extends Application {private int touchCount;public int getCount()  {  return touchCount;  }public void setCount(int tCount)  {  touchCount = tCount;  }}</code></pre><p>Inside myView class(myView.java) there is a function onTouchEvent</p><pre><code>@Overridepublic boolean onTouchEvent(MotionEvent event) {   int pointerCount = event.getPointerCount();   }</code></pre><p>Now what i want is to set the the global Variable touchCount to pointCount.And i tried like this</p><pre><code>@Overridepublic boolean onTouchEvent(MotionEvent event) {    int pointerCount = event.getPointerCount();    GlobalVar tcount = ((GlobalVar)getApplicationWindowToken());tcount.setCount(pointerCount);  } </code></pre><p>And this is giving me error.So how can i set the global variable value inside this myView class file??? </p><p>Application portion of manifest file</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".MyViewActivity""              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;application android:name="".GlobalVar""  android:icon=""@drawable/icon""                 android:label=""@string/app_name""&gt;&lt;/application&gt;</code></pre>","466474","","466474","","2011-01-30 03:01:55","2011-08-02 09:47:44","Accessing global Variables in Android","<android><global-variables>","4","0","6","",""
"4838246","1","","","2011-01-29 17:19:12","1","4560","<p>I want to open a <code>Dialog</code> every time I click on a <code>ListView</code> item.</p><p>This code is not working and I really cant find error. Please help!</p><pre><code> private void loadFeed(){            try{                BaseFeedParser parser = new BaseFeedParser();                messages = parser.parse();                List&lt;String&gt; descriptions = new ArrayList&lt;String&gt;();                List&lt;String&gt; titles = new ArrayList&lt;String&gt;(messages.size());                for (Message msg : messages){                     descriptions.add(msg.getDescription());                    titles.add(msg.getTitle() + ""\n"" +msg.getDate());                }                ArrayAdapter&lt;String&gt; adapter =                     new ArrayAdapter&lt;String&gt;(this, R.layout.row,titles);                this.setListAdapter(adapter);            } catch (Throwable t){                Log.e(""AndroidNews"",t.getMessage(),t);            }        }        @Override        protected void onListItemClick(ListView descriptions,                     View v, int position, long id) {            super.onListItemClick(descriptions, v, position, id);            String description = descriptions.get(position);            Dialog dialog = new Dialog(this);                dialog.setContentView(R.layout.single);                dialog.setTitle(""Blog"");                dialog.setCancelable(true);                TextView text = (TextView) dialog.findViewById(R.id.TextView1);                text.setText(description);                dialog.show();        }</code></pre><p>with this code the app is running ,the dialog show the description but the description is also shown in the list item.</p><pre><code>messages = parser.parse();List&lt;String&gt; titles = new ArrayList&lt;String&gt;(messages.size());for (Message msg : messages){    titles.add(msg.getTitle() + ""\n"" +msg.getDate() + ""\n\n"" + msg.getDescription()); }ArrayAdapter&lt;String&gt; adapter =                 new ArrayAdapter&lt;String&gt;(this, R.layout.row,titles);this.setListAdapter(adapter);protected void onListItemClick(ListView l, View v, int position, long id) {        super.onListItemClick(l, v, position, id);        String selection = l.getItemAtPosition(position).toString();        Dialog dialog = new Dialog(this);            dialog.setContentView(R.layout.row2)            dialog.setCancelable(true);            TextView text = (TextView) dialog.findViewById(R.id.SinglePost);            text.setText(selection);            dialog.show();    }</code></pre>","519526","","519526","","2011-01-29 21:08:39","2013-11-28 16:34:19","Open a Dialog on ListView item click","<android><listview><dialog>","2","2","","",""
"4838322","1","","","2011-01-29 17:31:40","0","975","<p>This is my own application developed with the intention of distributing it via the Android market. It's been tested on several handsets, installed each time with from the SDK (so, adb).However that appears to be the only way I can install it:</p><ul><li>I signed the application and uploaded it to my own server.</li><li>Any previous version is uninstalled from the device:</li><li>Downloading via the browser results in a silent fail. Server logs show that there was only one access (a successful OTA install requires, I believe, two request/responses). There is nothing at all in Logcat.</li><li>I tried instead releasing it to the Android Market. This time Logcat indicates a server-side error:DEBUG/vending(530): [42] BaseAction.run(): ApiException: com.android.vending.api.ApiException: Error from backend. Request=com.android.vending.model.PurchaseOrderRequest, Response=INTERNAL_SERVICE_ERRORDEBUG/vending(530): [1] LocalAssetDatabase.notifyListener(): -7763566390739351724 / UNINSTALLEDDEBUG/vending(530): [1] LocalAssetCache.updateOneAsset(): No local info for -7763566390739351724INFO/vending(530): [1] BaseAction.displayErrorUi(): Server error in com.android.vending.billing.PurchaseOrderAction: com.android.vending.api.ApiException: Error from backend. Request=com.android.vending.model.PurchaseOrderRequest, Response=INTERNAL_SERVICE_ERROR</li></ul><p>The most likely problem, then, is how I signed the application. However the signed version can be installed via adb on the command line and even from gmail. Furthermore I signed a small, unrelated application with exactly the same results. I've also tried building from another machine and under Windows and Linux. Same results every time, on three different devices, factory reset, over the internet or WIFI. The only constant is me.</p><p>I've read literally every thread on stackoverflow regarding the above error in Logcat, all of which appear to be unrelated because I have no difficulty installing other applications from the Android market.</p><p>I've exhausted my meagre wits trying to debug this and would be very grateful for any ideas.</p>","595139","","","","","2011-01-31 17:56:09","Android apk won't install from the market nor web server","<android>","2","5","","",""
"4838323","1","","","2011-01-29 17:31:46","1","711","<p>I am using Eclipse with Android ADT plugin and my source file will not compile due to errors in project. There are no errors marked anywhere in any of the files in the project. I've tried using clean before compiling but no luck. Is it a case of re-installing Eclipse to fix the problem?</p><p>Thanks.</p>","532462","","1645319","","2012-09-11 07:15:02","2013-03-06 08:00:00","errors in project but none in source files","<android><eclipse>","8","2","","",""
"4838350","1","4838474","","2011-01-29 17:35:39","0","2406","<p>I have two classes: </p><p>MainPanel (where I define some methods)MainThread (where I do a loop with these methods to create a classic game structure)</p><p>In the MainPanel class I have this method to capture if a key was pressed</p><pre><code> @Override  public boolean onKeyDown(int keyCode, KeyEvent event) {          switch(keyCode) {                  case KeyEvent.KEYCODE_DPAD_UP:                          Log.i(TAG,""key up was pressed"");                          return true;          }          return false; }</code></pre><p>It works right, my question is if it's possible to create the onKeyDown as a proper method and use it in the loop to avoid the listener. The idea is to define a method like this in the MainPanel:</p><pre><code>public void myOwnOnKeyDown(int keyCode, KeyEvent event) {      switch(keyCode) {              case KeyEvent.KEYCODE_DPAD_UP:                      Log.i(TAG,""key up was pressed"");     }}</code></pre><p>And then, call it into my loop on MainThread Class like this...</p><pre><code>public class MainThread extends Thread {//...public void loop() {     Canvas canvas;     KeyEvent event; Log.d(TAG, ""Starting game loop"");    while (running) {        this.MainPanel.MyOwnOnKeyDown(keyCode, event);         this.MainPanel.moveElements();         this.MailPanel.drawElements(canvas);     } }</code></pre><p>At the following line I don't know how to pass the parameter keyCode...</p><pre><code>this.MainPanel.MyOwnOnKeyDown(keyCode, event); </code></pre><p>It's possible to that?</p><p>Thanks in advance</p>","591452","","591452","","2011-01-29 17:41:19","2011-01-30 02:28:41","trying to create an own method for onKeyDown event (Android)","<java><android><sdk><onkeydown>","2","1","0","",""
"4838433","1","4838476","","2011-01-29 17:51:29","0","579","<p>""GridView.java""  </p><pre><code>package com.GridView;import android.app.Activity;import android.os.Bundle;public class GridView 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>error with this statement<br>(GridView) findViewById(R.id.gridview)<br>error with<br>setAdapter<br>error with<br>OnItemClickListener()<br>error with<br>AdapterView<br>error with<br>HelloGridView<br>error with<br> });<br>all this was copied from the android website<br><a href=""http://developer.android.com/resources/tutorials/views/hello-gridview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-gridview.html</a></p><p>""Image Adapter.java""  </p><pre><code>package com.GridView;import android.content.Context;import android.view.View;import android.view.ViewGroup;import android.view.ViewGroup.LayoutParams;import android.widget.BaseAdapter;import android.widget.ImageView;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 getView1(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 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    };    @Override    public View getView(int arg0, View arg1, ViewGroup arg2) {        // TODO Auto-generated method stub        return null;    }}</code></pre><p>main.xml<br>    ?xml version=""1.0"" encoding=""utf-8""?    GridView xmlns:android=""http://schemas.android.com/apk/res/android""         android:id=""@+id/gridview""<br>        android:layout_width=""fill_parent""<br>        android:layout_height=""fill_parent""<br>        android:columnWidth=""90dp""<br>        android:numColumns=""auto_fit""<br>        android:verticalSpacing=""10dp""<br>        android:horizontalSpacing=""10dp""<br>        android:stretchMode=""columnWidth""<br>        android:gravity=""center""<br>    />  </p>","595137","","595137","","2011-01-29 19:02:48","2011-01-29 19:02:48","I am getting some errors when I am trying to run the hellogridview from the Android website","<java><android><eclipse>","2","2","","",""
"4838462","1","","","2011-01-29 17:55:49","1","1418","<p>i want to write a program that gets the match dates from this link <a href=""http://www.goal.com/en/teams/germany/148/fc-bayern-munich-news"" rel=""nofollow"">http://www.goal.com/en/teams/germany/148/fc-bayern-munich-news</a>and use it in my program i just want the dates and the matches how can i do this? in andorid</p>","559134","","","","","2011-01-29 19:51:44","getting specific information from a website in android","<android><web-applications><website>","1","0","1","",""
"4838534","1","4839330","","2011-01-29 18:09:57","1","253","<p>I'm just starting to learn OpenGL ES2 for Android, and have come across a weird problem where sometimes a weird jut will be rendered from my objects (see pic). This doesn't always happen, which is strange, so I'm wondering if anyone has any experience with this sort of thing and how to fix it. </p><p><a href=""http://img717.imageshack.us/i/device2h.png/"" rel=""nofollow"">http://img717.imageshack.us/i/device2h.png/</a></p>","349575","","","","","2011-01-29 20:46:55","OpenGL ES2 for Android - Weird random juts","<android><opengl-es-2.0>","1","1","","",""
"4838546","1","4841413","","2011-01-29 18:13:02","10","2393","<p>Can anyone shed some light on how applications like App Protector , ES Security Manager (app protector part) work</p><p>Basically what you do is set all the apps you want to lock in there. then whenever you try to launch ""locked"" app it pops in its Lockscreen activity. so you enter the password there and get access to the locked app.</p><p>It uses the following permissions</p><pre><code>&gt; android.permission.RECEIVE_BOOT_COMPLETED&gt; android.permission.GET_TASKS&gt; android.permission.INTERNET&gt; android.permission.READ_LOGS&gt; android.permission.VIBRATE&gt; android.permission.READ_PHONE_STATE&gt; android.permission.SYSTEM_ALERT_WINDOW</code></pre><p>So how does such a system work. does it keep reading the logs ""READ_LOGS"" to see if the application launch is occurring ??</p>","388044","","639119","","2012-06-20 18:22:06","2012-06-20 18:22:06","Android: how does application Protector app work?","<android><logging>","2","0","9","",""
"4838573","1","4838698","","2011-01-29 18:18:47","1","1418","<p>I'm trying to add native tabs to my phonegap application on Android.I have a way of doing it where each tab has it's own Activity and use loadUrl to load Phonegap in the view but it raises two problems.</p><ol><li>I'm afraid the app is going to beawfully slow if I have 5 tabs eachrunning Phonegap with somejavascript. </li><li>If I go back to a tab,    the last instance state has been    saved, so if i clicked on a link    from the tab, clicking back on the    tab doesn't load back the main page.</li></ol><p>I'm thinking about creating a layout main.xml with a custom linear layout and some callback buttons to call something like : super.loadUrl(""javascript: goTo page rand;""); but I'm not sure this is the best way since I would have to rewrite the tabs functionality and design.</p><p>Thanks !</p>","300115","","","","","2011-01-29 18:37:43","TabHost and PhoneGap","<android><native><phonegap><android-tabhost>","1","1","","",""
"4838582","1","4838623","","2011-01-29 18:19:59","1","93","<p>This is the first time I am trying to use a spinner and I need some help..  I made a layout with a spinner object on it and then I also made a array.xml with the numbers that I would like in the spinner in it.  I run the following code and the screen displays without any values in my spinner??</p><pre><code>public class SpinnerExaple extends Activity {    private Spinner numbersSpinner;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        this.numbersSpinner = (Spinner) findViewById(R.id.Spinner01);        ArrayAdapter&lt;String&gt; numbersArray =            new ArrayAdapter&lt;String&gt;(this, R.layout.main,            getResources().            getStringArray(R.array.numbers));        }}</code></pre>","589450","","7412","","2011-01-29 18:21:28","2011-01-29 18:25:36","I need help with my first Spinner!! Not Displaying values","<java><android><spinner>","2","1","","",""
"4838609","1","9253842","","2011-01-29 18:23:49","4","3356","<p>While similar <a href=""http://stackoverflow.com/questions/3611338/android-how-to-detect-a-particular-view-has-focus-when-user-swipes-finger-on-sc"">questions</a> have been asked in the past they don't seem to really have been answered which might be due to confusion as to what's being asked.</p><p>Put simply, I'd like to detect which view is being entered as your finger slides over the screen. The best example of this in action is the soft keyboard on any android phone. When you press any key it shows up as a popup to tell you what letter is under your finger. If you now move your finger over the keyboard in a single gesture the various letters pop up as you move over the various letters of the alphabet. </p><p>What listeners are used for this type of behaviour. I've tried OnTouchListeners but they seem to be only when you 'touch' the button as opposed to 'finger past' them</p><pre><code>Button button = (Button)findViewById(R.id.button);button.setOnClickListener(new OnClickListener() {  @Override  public void onClick(View v) {doStuff();}});button.setOnTouchListener(new OnTouchListener() {  @Override  public boolean onTouch(View v, MotionEvent event) {      doStuff();      return false;  }});</code></pre><p><code>OnFocusChangeListener</code> don't help either.</p>","516286","","","","","2012-02-12 23:45:25","Detect which view your finger is sliding over in Android","<android><view><detection>","5","1","3","",""
"4838636","1","","","2011-01-29 18:28:37","0","273","<p>I am making a simple web browser. How would I make it possible to view the recent history inside of the browser. Like in the stock android browser how it shows the recent sites you have went to.</p><p>Any help is greatly appreciated.Thanks-Christian</p>","424421","","424421","","2011-01-29 19:03:28","2011-01-29 19:03:28","Viewing web history inside custom web browser?","<android><web-services><web-applications>","0","6","","",""
"4838776","1","4839186","","2011-01-29 18:53:40","10","5873","<p>I would like to create a 'graph paper' look to the Bitmap I am drawing via a Canvas, and trying to figure out the best way to do this.</p><p>I can't pass a source Bitmap containing the graph paper background to the Canvas constructor, as I am getting the Canvas in a SurfaceView via the .lockCanvas() call.</p><p>Some solutions I've tried:</p><ul><li><p>I've tried implementing <a href=""http://stackoverflow.com/questions/1311042/android-tile-bitmap/4575738#4575738"">this solution</a> in my SurfaceView's Thread.run(), but the issue I believe is when the BitmapDrawable is converted to a Bitmap... it loses the tiling properties.</p><p>canvas = mSurfaceHolder.lockCanvas(null);BitmapDrawable TileMe = new BitmapDrawable(BitmapFactory.decodeResource(getResources(), R.drawable.editor_graph));TileMe.setTileModeX(Shader.TileMode.REPEAT);TileMe.setTileModeY(Shader.TileMode.REPEAT);</p><p>Bitmap b = TileMe.getBitmap();canvas.drawBitmap(b, 0, 0, null);</p></li><li><p>If I use the <a href=""http://developer.android.com/reference/android/graphics/Canvas.html#drawBitmap%28android.graphics.Bitmap,%20android.graphics.Rect,%20android.graphics.RectF,%20android.graphics.Paint%29"">Canvas.drawBitmap method that takes a destination RectF as a parameter</a>, it looks like the bitmap will be tiled to fill the RectF... but how do I declare a RectF reliably that fills the entire view area? </p></li><li>Setting the Activities background to the desired graph paper look also doesn't work, as the bitmap/canvas layout is opaque and blocks that from being seen.</li></ul><p>Any ideas how to achieve this?</p><p>Thanks,Paul</p>","357801","","","","","2011-03-13 14:08:20","Android: Tiling a Bitmap on a Canvas","<android><canvas><bitmap><tiling>","2","0","3","",""
"4838777","1","4838840","","2011-01-29 18:53:41","4","12235","<p>I almost feel embarrased asking this but I really can't find my app on my phone. I read that the app should be installed in /data/data/ folder but my /data folder appears to be empty when viewed in Astro. My app is most definitely installed on the phone, should I transfer it to the SD for it to become visible? I have an unrooted HTC Desire HD on Orange UK. I just need to have a peek at the SQLite database managed by my App.</p>","561498","","","","","2013-02-20 07:06:26","where is my app? /data appears empty","<android><sd-card>","3","1","1","",""
"4838779","1","","","2011-01-29 18:54:06","5","2600","<p>i'm wondering if it's possible to get Android permission dynamically without using AndroidManifest just with some codes, because i've some OSGi bundles running on Android and without Android permission they are restricted in functionality.Thanks  </p><hr><p>Thanks for your answers, yes it complicates the user experience and it's also dangerous for the user if that mechanism is provided                                              </p>","595190","","1288","","2011-09-09 11:19:20","2012-11-01 15:48:40","get Android permission dynamiclly","<android><permissions><osgi>","3","1","1","",""
"4838787","1","4841088","","2011-01-29 18:55:25","1","1183","<p>The app I am working on consists of one large custom view that fills the screen. I placed one button in the center of each side of the custom view that can be used to move the drawn object in that direction. Think of the custom view as a ""viewfinder"" of a camera and I would like the user to be able to pan the viewfinder with buttons on all four sides.</p><p>The buttons work perfectly, but when one is pressed, the custom view underneath undergoes lots of redrawing (4 redraws instead of 1) and the UI lags quite a bit.</p><p>Is there some way to stop the custom view from redrawing because of a button's animation?</p><p>Forgive me if I am missing something obvious.</p><p>Thanks in advance for any help... Android rocks!!!</p><p>XML 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;com.app.CustomView    android:id=""@+id/CustomView"" android:layout_above=""@+id/menuButton"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent""/&gt;    &lt;Button android:layout_height=""wrap_content"" android:layout_below=""@+id/CustomView"" android:layout_width=""wrap_content"" android:layout_alignRight=""@+id/CustomView"" android:id=""@+id/toolsButton"" android:text=""Tools"" android:textSize=""24sp""&gt;&lt;/Button&gt;    &lt;Button android:layout_height=""wrap_content"" android:id=""@+id/outButton"" android:text=""-"" android:textSize=""30sp"" android:layout_toLeftOf=""@+id/inButton"" android:layout_alignTop=""@+id/inButton"" android:layout_width=""40sp""&gt;&lt;/Button&gt;    &lt;Button android:layout_height=""wrap_content"" android:layout_alignRight=""@+id/CustomView"" android:layout_alignBottom=""@+id/CustomView"" android:text=""+"" android:textSize=""30sp"" android:id=""@+id/inButton"" android:layout_width=""wrap_content""&gt;&lt;/Button&gt;    &lt;Button android:layout_alignTop=""@+id/CustomView"" android:layout_centerHorizontal=""true"" android:layout_height=""40sp"" android:layout_width=""60sp"" android:text=""^"" android:id=""@+id/upButton""&gt;&lt;/Button&gt;    &lt;Button android:layout_alignBottom=""@+id/CustomView"" android:layout_centerHorizontal=""true"" android:text=""v"" android:layout_height=""40sp"" android:layout_width=""60sp"" android:id=""@+id/downButton""&gt;&lt;/Button&gt;    &lt;Button android:layout_alignRight=""@+id/CustomView"" android:text=""&amp;gt;"" android:id=""@+id/rightButton"" android:layout_height=""60sp"" android:layout_width=""40sp"" android:layout_centerVertical=""true""&gt;&lt;/Button&gt;    &lt;Button android:id=""@+id/leftButton"" android:text=""&amp;lt;"" android:layout_height=""60sp"" android:layout_width=""40sp"" android:layout_centerVertical=""true""&gt;&lt;/Button&gt;    &lt;Button android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:layout_alignLeft=""@+id/CustomView"" android:id=""@+id/menuButton"" android:textSize=""24sp"" android:text=""Functions"" android:layout_alignParentBottom=""true""&gt;&lt;/Button&gt;&lt;/RelativeLayout&gt;</code></pre>","595194","","213269","","2011-01-29 21:33:49","2011-01-30 04:07:53","Most efficient way to draw Buttons on top of a View?","<android><layout><custom-view>","2","0","","",""
"4838796","1","","","2011-01-29 18:56:29","0","325","<p>I'm new to Android programming, and i'm building a small test program.</p><p>My problem is that in the graphical layout of the .xml files the widgets(Spinners,Buttons...) looks nice and round, but when I put my program into my phone(Nexus S, if that matters) or in the emolator, they come out with rounded edges,making the whole program look really ugly.</p><p>Is theres something i'm doing wrong?</p><p>Thanks!</p>","585740","","213269","","2011-01-29 19:00:15","2011-01-30 05:17:20","Ugly Widgets - Android","<android><layout><widget>","3","2","","",""
"4838889","1","4869013","","2011-01-29 19:13:25","1","741","<p>I have a little experience with Android SDK, but don't know anything about NDK. And i want ask some questions about NDK to people who works with it. </p><p>Android dalvik VM have memory restrictions, such as one process cannot have heap size more than 16/24/32 Mb. But in my application i want use a little more memory. Can i create with NDK object that more than max dalvik heap size?</p><p>I wanna work with bitmap images in NDK. Does NDK have any libraries for it?</p><p>Sorry for my english</p>","571914","","571914","","2011-01-29 19:30:29","2011-02-01 23:06:54","Android NDK facilities","<android><android-ndk>","1","0","","",""
"4838992","1","4839248","","2011-01-29 19:34:20","4","5614","<p>In an Android application, is it possible to open the spinner popup from a button click instead of pressing the actual spinner?</p><p>I have tried the following:</p><pre><code>Button btnChange = (Button)findViewById(R.id.btnChange);            btnChange.setOnClickListener(new View.OnClickListener() {                  public void onClick(View v) {                     Spinner mySpinner = (Spinner) findViewById(R.id.sSpinner);                     mySpinner.showContextMenu();                  }                });</code></pre>","297410","","","","","2013-11-22 14:29:06","Android: Open Spinner from Button","<android><button><spinner>","3","0","1","",""
"4839048","1","4839117","","2011-01-29 19:49:48","0","1064","<p>i am designing a simple android app,which has a check box displayed in the list view and my application is giving a alarm when the corresponding  check box is checked.But while i am moving from that screen to my home screen and again coming back to my page containing the check box it doesn't show that which check box i checked previously.</p><p>Please help me regarding this topic,than x in advance..  </p>","595226","","","","","2011-01-29 20:08:33","How to set the check box's checked option persistent,while user switches from one activity class to another","<android><android-widget>","2","1","","",""
"4839051","1","","","2011-01-29 19:50:27","0","735","<p>I have asked this question before but didn't get a ""good enough"" answer. </p><p>My problem basically is that I can't get Admob to show correctly in a ListActivity.</p><p>My layout looks like this:</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""    xmlns:myapp=""http://schemas.android.com/apk/res/se.javalia.myDrinks""    android:orientation=""vertical""&gt;    &lt;LinearLayout android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;        &lt;ListView android:id=""@+id/android:list"" android:layout_alignParentTop=""true""            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/main_no_items"" /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" &gt;        &lt;com.admob.android.ads.AdView android:id=""@+id/ad""            android:layout_alignParentBottom=""true""            android:layout_width=""fill_parent"" android:layout_height=""wrap_content""            myapp:backgroundColor=""#000000"" myapp:primaryTextColor=""#FFFFFF""            myapp:secondaryTextColor=""#CCCCCC""            myapp:keywords=""drink alcohol wiskey rum soda"" myapp:refreshInterval=""300"" /&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>The problem right now is that if I change the layout_hight to fill_parent or attempt a value larger than 150 px the ad wont show. With a layout_hight of 150 or less it shows nicely. The goal is to get the list to fill the screen after the ad has taken its place.</p><p>Any suggestions? I'm quite lost about how to solve this.</p><p>I will update the question if the answer didn't get all the way so please check for updates.</p><p>Thanks in advanceRoland</p>","435267","","435267","","2011-01-30 12:35:21","2011-06-23 10:10:53","Admob and ListActivity","<android><layout><admob><listactivity>","2","0","1","",""
"4839054","1","4839071","","2011-01-29 19:51:07","1","2200","<p>I am inspecting the state of a checkbox. I am using the code below. When app starts (checkbox is unchecked), toast message says ""unchecked"". But when i open another screen and then go back, it doesn't say anymore. How to do that?Partial code:</p><pre><code> public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    cb1 = (CheckBox) findViewById(R.id.CheckBox01);    if (cb1.isChecked())    {        Toast.makeText(main.this, ""checked"", Toast.LENGTH_SHORT).show();    }    else    {        Toast.makeText(main.this, ""NOT checked"", Toast.LENGTH_SHORT).show();    }   </code></pre><p>}</p><p>In this code i also have a </p><pre><code> cb1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){        @Override        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)         {                       //blablabla        }        });</code></pre><p>part where i am inspecting the state of the checkbox when user clicks it.</p><p>I want to inspect the state of checkbox every time this screen shows.</p>","571648","","","","","2011-01-29 19:55:33","Android checkbox state inspection","<android><checkbox>","1","0","1","",""
"4839165","1","4839394","","2011-01-29 20:15:07","2","4591","<p>So I have a WebView inside of a LinearLayout with an EditText Box and a Button to make the application search for the web. When I click go on my button it takes me to the stock android browser. how do I make It so that it stays within my WebView when I click go?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=""fill_parent""    android:layout_height=""fill_parent""    &gt;      &lt;EditText       android:id=""@+id/web_address""       android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       android:text=""http://""/&gt;      &lt;Button       android:id=""@+id/go""       android:layout_width=""wrap_content""       android:layout_height=""wrap_content""       android:background=""@drawable/go""       android:gravity=""right""/&gt; &lt;WebView     android:id=""@+id/webview""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>here is my source:</p><pre><code>    package straightapp.com.Browser;    import android.app.Activity;    import android.content.Intent;    import android.net.Uri;    import android.os.Bundle;    import android.view.KeyEvent;    import android.view.View;    import android.view.View.OnClickListener;    import android.view.View.OnKeyListener;    import android.webkit.WebView;    import android.widget.Button;    import android.widget.EditText;     public class Browser extends Activity { WebView mWebView; Button button; EditText text;    /** Called when the activity is first created. */    @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.straightapp.com"");        text=(EditText)findViewById(R.id.web_address);        button=(Button) findViewById(R.id.go);        button.setOnClickListener(new OnClickListener(){   public void onClick(View v) {    // TODO Auto-generated method stub    openBrowser();   }        });        text.setOnKeyListener(new OnKeyListener() {            public boolean onKey(View v, int keyCode, KeyEvent event) {                    // TODO Auto-generated method stub                    if (keyCode==KeyEvent.KEYCODE_ENTER){                            openBrowser();                            return true;                    }                    return false;            }            });    }    public void openBrowser(){        Uri uri=Uri.parse(text.getText().toString());        Intent intent=new Intent(Intent.ACTION_VIEW,uri);        startActivity(intent);    }    @Override    public boolean onKeyDown(int keyCode, KeyEvent event) {        if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; mWebView.canGoBack()) {            mWebView.goBack();            return true;        }        return super.onKeyDown(keyCode, event);    }  }</code></pre><p>Thanks</p>","424421","","142162","","2011-01-29 20:24:15","2013-04-23 09:49:30","WebView inside application?","<android><web-applications>","3","0","","",""
"4839228","1","4839458","","2011-01-29 20:26:14","0","490","<p>i am picking images on my app with android, and i dont know why, sometimes i got an exception, i think it's allways i select a image with more than 400 or 500 kb's but i am not sure. Why? because when i select small images of 100 kb i dont get the exception, and when i get images with 500kb or 1.5 mb yes, it crash</p><p>i dont know wich exception is because i have to test this functionality with my phone, i can't test with the emulator because i dont know how to put images on the emulator.</p><p>this is my code: </p><pre><code>changeImageButton.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                Intent i = new Intent(Intent.ACTION_PICK,                        android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);                startActivityForResult(i, ACTIVITY_SELECT_IMAGE);            }        }); protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {         super.onActivityResult(requestCode, resultCode, imageReturnedIntent);         switch(requestCode) {        case 1:        {            setResult(1);            finish();            }        case ACTIVITY_SELECT_IMAGE:            if(resultCode == RESULT_OK){                  Uri selectedImage = imageReturnedIntent.getData();                String[] filePathColumn = {MediaStore.Images.Media.DATA};                Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null);                cursor.moveToFirst();                int columnIndex = cursor.getColumnIndex(filePathColumn[0]);                String filePath = cursor.getString(columnIndex);                cursor.close();                selectedPhoto = BitmapFactory.decodeFile(filePath);                //profileImage.setImageBitmap(selectedPhoto);                profileImage.setImageBitmap(Bitmap.createScaledBitmap(selectedPhoto, 80, 80, false));            }        }    }</code></pre><p>profileImage is a ImageView of my layout. and i use scaled butmap to resice the image to 80x80</p><p>please give me some help with this exception, i need to solve it</p><p>thanks</p>","479886","","","","","2011-01-29 21:12:35","Exception picking a image from gallery (SD Card) for use on my app... ¿why?","<android><android-gallery>","1","2","","",""
"4839269","1","4843701","","2011-01-29 20:33:57","0","217","<p>xml and logcat now added,now custom view code, unfortunately i am away from devel computer so i cant check your suggestions,@jems, i may have the wrong constructor for my custom view?@Falmarri, i think the build target is 2.2</p><p>Hopefully a simple thing I don't know about:</p><p>I have a main game activity, and this calls a class which i have extended from the view class. Here it is, in working form:</p><pre><code>public class guappsXOMainGame extends Activity {private static final int cellsX=10;private static final int cellsY=10;private guappsXOBoardView mBoardView;@Overridepublic void onCreate(Bundle bund) {    super.onCreate(bund);    setContentView(R.layout.gamescreen);//loads xml layout called gamescreen    mBoardView = (guappsXOBoardView) findViewById(R.id.boardview);}</code></pre><p>It all was going well, showing my game screen well, until I tried the following, which gives a force close:</p><pre><code>public void onCreate(Bundle bund) {    super.onCreate(bund);    setContentView(R.layout.gamescreen);//loads xml layout called gamescreen    mBoardView = (guappsXOBoardView) findViewById(R.id.boardview);    mBoardView.hello();//problem line}</code></pre><p>What I want is to run a method that will get some info from the guappsxoboardview class, and this was the test case.The method looks like this:</p><pre><code>    public void hello(){    int x = 1;}</code></pre><p>LogCat says:</p><pre><code>01-29 20:50:46.415: INFO/ActivityManager(60): Starting activity: Intent { cmp=com.guapps/.guappsXOMainGame }01-29 20:50:46.535: DEBUG/AndroidRuntime(564): Shutting down VM01-29 20:50:46.535: WARN/dalvikvm(564): threadid=1: thread exiting with uncaught exception (group=0x4001d800)01-29 20:50:46.566: ERROR/AndroidRuntime(564): FATAL EXCEPTION: main01-29 20:50:46.566: ERROR/AndroidRuntime(564): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.guapps/com.guapps.guappsXOMainGame}: java.lang.NullPointerException01-29 20:50:46.566: ERROR/AndroidRuntime(564):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)01-29 20:50:46.566: ERROR/AndroidRuntime(564):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)01-29 20:50:46.566: ERROR/AndroidRuntime(564):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)01-29 20:50:46.566: ERROR/AndroidRuntime(564):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)01-29 20:50:46.566: ERROR/AndroidRuntime(564):     at android.os.Handler.dispatchMessage(Handler.java:99)01-29 20:50:46.566: ERROR/AndroidRuntime(564):     at android.os.Looper.loop(Looper.java:123)01-29 20:50:46.566: ERROR/AndroidRuntime(564):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-29 20:50:46.566: ERROR/AndroidRuntime(564):     at java.lang.reflect.Method.invokeNative(Native Method)01-29 20:50:46.566: ERROR/AndroidRuntime(564):     at java.lang.reflect.Method.invoke(Method.java:521)01-29 20:50:46.566: ERROR/AndroidRuntime(564):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-29 20:50:46.566: ERROR/AndroidRuntime(564):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-29 20:50:46.566: ERROR/AndroidRuntime(564):     at dalvik.system.NativeStart.main(Native Method)01-29 20:50:46.566: ERROR/AndroidRuntime(564): Caused by: java.lang.NullPointerException01-29 20:50:46.566: ERROR/AndroidRuntime(564):     at com.guapps.guappsXOMainGame.onCreate(guappsXOMainGame.java:38)01-29 20:50:46.566: ERROR/AndroidRuntime(564):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)01-29 20:50:46.566: ERROR/AndroidRuntime(564):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)01-29 20:50:46.566: ERROR/AndroidRuntime(564):     ... 11 more01-29 20:50:46.596: WARN/ActivityManager(60):   Force finishing activity com.guapps/.guappsXOMainGame01-29 20:50:46.596: WARN/ActivityManager(60):   Force finishing activity com.guapps/.guappsXOStart01-29 20:50:46.745: DEBUG/dalvikvm(60): GC_FOR_MALLOC freed 7966 objects / 468848 bytes in 99ms01-29 20:50:47.108: WARN/ActivityManager(60): Activity pause timeout for HistoryRecord{44009a08 com.guapps/.guappsXOMainGame}01-29 20:50:48.375: INFO/Process(564): Sending signal. PID: 564 SIG: 901-29 20:50:48.385: INFO/ActivityManager(60): Process com.guapps (pid 564) has died.01-29 20:50:48.385: INFO/WindowManager(60): WIN DEATH: Window{440530d0 com.guapps/com.guapps.guappsXOStart paused=true}01-29 20:50:48.445: WARN/InputManagerService(60): Got RemoteException sending setActive(false) notification to pid 564 uid 1003201-29 20:50:57.482: WARN/ActivityManager(60): Activity destroy timeout for HistoryRecord{43fc4248 com.guapps/.guappsXOStart}01-29 20:50:57.488: WARN/ActivityManager(60): Activity destroy timeout for HistoryRecord{44009a08 com.guapps/.guappsXOMainGame}</code></pre><p>Here is the XML for 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""android:gravity=""center_horizontal""&gt;&lt;com.guapps.guappsXOBoardView    android:id=""@+id/boardview""    android:layout_width=""match_parent""    android:layout_height=""match_parent""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>Hopefully I have done something obvious wrong, thanks.</p><p>Now most of the custom view code also:</p><pre><code>package com.guapps;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.RectF;import android.util.AttributeSet;import android.view.View;public class guappsXOBoardView extends View {    int screenHeight;    int screenWidth;    Context mContext;    private float leftG;    private float topG;    private float rightG;    private float botG;    Bitmap boardGrid;    public guappsXOBoardView(Context context, AttributeSet attrs) {            super(context);            requestFocus();    }    @Override    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec){        screenWidth = View.MeasureSpec.getSize(widthMeasureSpec);        screenHeight = View.MeasureSpec.getSize(heightMeasureSpec);        setMeasuredDimension(screenWidth, screenHeight);    }    @Override    protected void onDraw(Canvas canvas){        canvas.drawColor(Color.WHITE);         }.....</code></pre>","595246","","546999","","2011-01-30 09:14:47","2011-01-30 15:31:00","Newbie - Force close on simple method","<java><android>","3","10","","",""
"4839277","1","4839320","","2011-01-29 20:35:36","3","2447","<p>I would like to add a Status Bar Notification for my Android App. This notification should be shown on the Status Bar after the App is installed. I have a background service for the App which is where I could put the notification code. How do I trigger the Notification only after the App is installed?</p><p>Any insight to solve this problem will be very helpful.</p><p>Thanks.</p>","447886","","213269","","2011-01-29 20:40:27","2012-02-07 12:45:13","Android Notification after App is installed on device - How to?","<java><android><widget>","2","0","1","",""
"4839371","1","4841799","","2011-01-29 20:54:22","10","1354","<p>I am looking into Dalvik bytecode currently but as I lack a compiler background, I am finding it a little hard to grasp the design. I am pretty sure no one has written a book on Dalvik (or I could be wrong) so can someone suggest me a reference on the Java VM that contains some hands-on examples? Specifically, what I am interested in are:</p><ul><li>Understand how to interpret the generated byte-code</li><li>Using VM specifications (Dalvik or Java) to decompile the byte code into an intermediate representation and then compile it back </li></ul><p>In short, probably what I am looking for is to learn reverse engineering byte code so that I can analyze it for vulnerabilities. Any suggestions?</p>","184046","","","","","2011-10-25 02:18:43","Reference on Dalvik or Java Virtual Machines?","<java><android><security><reverse-engineering><bytecode>","2","3","6","",""
"4839393","1","4839420","","2011-01-29 20:58:33","0","1088","<p>I'm working with a ToggleButton in my Android app and it is functioning fine.  The one issue I'm having is that I'd like to color of the button to be red in it's off state.  Currently it's green in it's On state, so I'd like the off color to keep everything consistent and to give users a visual cue.</p><p>Unfortunately, I haven't been able to find any information on how to do this.  I thought there would be a property or something I could set, but scanning through the button's documentation hasn't turned up anything.  Is there a way to do this?  If not, is there a better option someone could recommend?  The ToggleButton has 95% of what I need, if I can get the Off color working, I'll have everything.</p><p>Thanks! </p>","595281","","","","","2011-01-29 21:05:35","Android Toggle Buttons Off Colors","<android><android-layout><android-sdk-2.2>","1","0","","",""
"4839418","1","4839902","","2011-01-29 21:05:05","1","9011","<p>I'm experimenting with android, and I got to the point where I want to save something to internal memory and read from it, but I'm kind of stuck. I found this article <a href=""http://developer.android.com/guide/topics/data/data-storage.html#filesInternal"" rel=""nofollow"">http://developer.android.com/guide/topics/data/data-storage.html#filesInternal</a> and as it suggested I created dummy method :</p><pre><code>public void test(){    String FILENAME = ""hello_file"";    String string = ""hello world!"";    FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);    fos.write(string.getBytes());    fos.close();}</code></pre><p>Which always throws NullPointerException, anyone knows what I'm missing?Maybe some permission in Androidmanifest.xml ?</p><p><strong>QUESTION UPDATE:</strong></p><pre><code>FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);</code></pre><p>Above line trows NPE. My class is abstract and its extending Activity, I don't know if that is relevant or not.</p><p>Stack trace :</p><pre><code>01-29 22:30:44.575: ERROR/TEST(458): java.lang.NullPointerException01-29 22:30:44.575: ERROR/TEST(458): java.lang.RuntimeException: java.lang.NullPointerException</code></pre><p>It seems that any IO operation throws NPE, I tried this as well :</p><pre><code>try {            File myDir = new File(getFilesDir().getAbsolutePath());            String s = """";            FileWriter fw = new FileWriter(myDir + ""/Test.txt"");            fw.write(""Hello World"");            fw.close();            BufferedReader br = new BufferedReader(new FileReader(myDir + ""/Test.txt""));            s = br.readLine();            // Set TextView text here using tv.setText(s);        } catch (FileNotFoundException e) {            e.printStackTrace();        } catch (IOException e) {            e.printStackTrace();        }    }File myDir = new File(getFilesDir().getAbsolutePath());</code></pre><p>Throws NPE, I even added    </p><pre><code>&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt; </code></pre><p>into Androidmanifest.xml</p><p>I've made method and pass in Context ctx, but my ctx ends up null, how can I get this variable? set it to which value ?</p>","169277","","169277","","2011-01-29 22:01:55","2011-01-29 22:43:04","Save file to android memory","<java><android>","2","4","1","",""
"4839447","1","","","2011-01-29 21:10:37","3","3507","<p>I'm using java.net.URL.getPort() to extract the port number from a URL. Most of the time this works great. However, when the URL contains a right bracket character ""]"" it fails:</p><pre><code>new URL(""http://abc.com:123/abc.mp3"").getPort(); returns: (int) 123</code></pre><p>But if the URL contains ""]"" I get:</p><pre><code>new URL(""http://abc.com:123/abc].mp3"").getPort(); returns: (int) -1</code></pre><p>What am I doing wrong?</p><p>EDIT #1: As a test, I pasted this same code into a non-Android Java app and the port number was correctly returned, so this appears to be an anomaly with the Android SDK.</p>","298511","","298511","","2011-01-30 06:11:31","2011-01-31 00:11:34","Problem extracting port number with URL.getPort() when URL contains ""]""","<java><android><url>","4","0","1","",""
"4839529","1","","","2011-01-29 21:23:29","0","172","<p>Is there a way to have 2 installations of eclipse but 1 installation of ADT? I'm trying to save hard drive space, and thought I would ask. Thanks.</p>","357853","","","","","2011-01-30 00:19:58","2 eclipse installations 1 ADT install","<android><eclipse><eclipse-plugin><adt>","2","1","","",""
"4839539","1","4839802","","2011-01-29 21:24:57","3","6171","<p>How can one read the output of a running process in the most efficient manner</p><p>Let me explain what i am trying to achieve.</p><p>I am trying to read logcat via my app on the phone </p><p>i want to make it such that any update in the logcat is instantly reflected and the app is efficient , like less battery consumption.</p>","388044","","","","","2013-04-19 22:39:25","Android: Effecient way to read logcat output","<android><bufferedreader><logcat>","2","0","1","",""
"4839570","1","","","2011-01-29 21:31:31","0","3300","<p>I want to draw something at about 30 frames per seconds on Android Canvas or other convenient object for this purpose. In my application different graphic objects are drawn and if any of the graphic object is touched, the graphic object changes its shape. I looked at theonDraw(Canvas canvas) callback of View subclass but calling invalidate() does not help here: first I cannot control the frame rate and second if the objects are moving too fast, the motion appears jerky.</p>","574122","","213269","","2011-01-29 21:40:41","2011-05-25 22:46:34","How to animate in Android Canvas?","<android><animation><canvas>","1","0","1","",""
"4839683","1","4839883","","2011-01-29 21:51:57","1","322","<p>This isn't really a problem, I am able to use the Android tools correctly, but they always trip me up when I come back to them because they expect input with longitude first, then latitude (<a href=""http://developer.android.com/guide/developing/tools/emulator.html#geo"" rel=""nofollow"">geo fix</a>, and DDMS). </p><p>That's backward from the way I have always used them, and from the way every other tool/API I've used has represented them, and even from the way the Android APIs use them (<a href=""http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/GeoPoint.html"" rel=""nofollow"">GeoPoint</a>, for example, expects latitude first, then longitude). </p><p>I am curious if there is a technical reason for this that I don't understand, or if it's easier in some context or something (some reason for it, or is it just random)? </p>","252676","","","","","2011-01-29 22:36:59","Is there a technical reason why Android tools (DDMS, and emulator ""geo fix"") expect longitude before latitude?","<android>","1","0","","",""
"4839686","1","","","2011-01-29 21:53:12","0","770","<p>Basically I have a form in my android app that lets the user enter his/her username and password and then this is POSTED to a very simple login page made in PHP online. I then need to access a second pae which pulls down data from an xml file - in order to access this page the user must be logged in. The xml page that the user sees is dependent of their username.</p><p>On my login page I have </p><pre><code>session_start();session_register(""username"");</code></pre><p>At the beginning of each page that checks login I have</p><pre><code>&lt;?phpsession_start();?&gt;</code></pre><p>and to check if the user is logged in I use a simple if statement</p><pre><code>if(!session_is_registered(""username"")){?&gt; display whateverelse bla</code></pre><p>How can I make this work in my android application? I am unable to go to the xml page after I have logged in because it does not recognise me as being logged in.</p>","568942","","","","","2011-04-22 06:24:03","Logging into a website from android","<php><android>","4","0","","",""
"4839776","1","5057007","","2011-01-29 22:10:40","2","1622","<p>I understand that flash is quite new to android. Has anyone actually used flash in an android app? How did you do it and what do you recommend. I'm trying to embed flash animation into an app if that helps any.</p>","225727","","","","","2011-02-20 12:24:19","Has anyone created an Android app with embedded flash/.swf files such as animations?","<android><flash>","1","0","3","",""
"4839832","1","","","2011-01-29 22:22:19","0","304","<p>I have a problem to realize Auth to api. It uses http authorization requeste like  Authorization: Basic (somehash)</p><p>Can u help me to realize this auth metod for android?</p>","593267","","","","","2011-01-29 22:22:19","Http Authorization on Android","<android><api><authorization>","0","2","1","",""
"4839898","1","4839962","","2011-01-29 22:41:47","0","1167","<p>I'm very new to RESTFull WCF Services and even newer to calling them from an Android app. Here's my WCF service:</p><pre><code>[ServiceContract]    public interface IPeople    {        [OperationContract]        void DoWork();        [WebGet(UriTemplate = ""/GetPeople"",            BodyStyle = WebMessageBodyStyle.WrappedRequest,            ResponseFormat = WebMessageFormat.Json,            RequestFormat = WebMessageFormat.Json)]        [OperationContract]        string GetPeople();    }</code></pre><p>The implementation of the interface:</p><p>public string GetPeople()         {             PeoplesEntities qe = new PeoplesEntities();</p><pre><code>             var result = from q in qe.tPeople                          select q;             int count = result.Count();             int index = new Random().Next(count);             tPeople people = result.OrderBy(a=&gt;a.ID).Skip(index).FirstOrDefault();             // result.First().ToString();             return people.FirstName + "" - "" + people.LastName;     }</code></pre><p>and this is how i'm consuming it through an android service:</p><p>try {</p><pre><code>       HttpGet request = new HttpGet(SERVICE_URI + ""/GetPeople"");       request.setHeader(""Accept"", ""application/json"");       request.setHeader(""Content-type"", ""application/json"");       DefaultHttpClient httpClient = new DefaultHttpClient();       HttpResponse response = httpClient.execute(request);       HttpEntity responseEntity = response.getEntity();       // Read response data into buffer       char[] buffer = new char[(int)responseEntity.getContentLength()];       InputStream stream = responseEntity.getContent();       InputStreamReader reader = new InputStreamReader(stream);       reader.read(buffer);       stream.close();       JSONArray plates = new JSONArray(new String(buffer));               return new String(buffer);   } catch (Exception e) {       e.printStackTrace();       return e.toString();   }}</code></pre><p>The exception I get is what is mentioned in the subject. What's strange is the value tha ti'm expecting is returned in the exception. I have no clue why it's expecting the square bracket. </p><p>FYI, most of the code i used is taken directly from online examples. Any help would be greatly appreciated. Thanks. </p>","430933","","","","","2011-01-29 22:52:21","a jsonarray text must start with '[' at character 1 of {my returned value}","<.net><android><web-services><json><rest>","1","1","","",""
"4839977","1","4840290","","2011-01-29 22:55:15","1","1370","<p>I am using AdMob in my Android application and want to display a backup ad if AdMob doesn't fill.  I hook into the <code>_adView.setAdListener(</code> but when no ad is returned, <code>onFailedToReceiveAd</code> does not fire like I would expect it to.  When an ad is returned, <code>onReceiveAd</code> fires, so I know I am hooked up correctly.    LogCat tells me: ""No fill.  Server replied that no ads are available."" which seems correct.  Any ideas?</p><p>public class MultipleAdView extends LinearLayout {</p><pre><code>private AdView _adView = null;private WebView _webView = null;private Context _context = null;/* * Constructor from parent class. */public MultipleAdView(Context context) {    super(context, null);    _context = context;}public MultipleAdView(Context context, AttributeSet attrs){       super(context, attrs);    _context = context;}public void initialize(Activity activity){    _adView = new AdView(activity);    _adView.setAdListener(new AdListener() {        @Override        public void onReceiveRefreshedAd(AdView arg0) {            int j = 0;            j++;        }        @Override        public void onReceiveAd(AdView arg0) {            // Just here for breakpoint - gets in here fine when ad is returned            int j = 0;            j++;        }        @Override        public void onFailedToReceiveRefreshedAd(AdView arg0) {            // Is never called when no ad is returned            loadBackupAd();        }        @Override        public void onFailedToReceiveAd(AdView arg0) {            // Is never called when no ad is returned            loadBackupAd();        }        private void loadBackupAd(){            // Load backup ad here        }    });    addView(_adView, new LinearLayout.LayoutParams(            LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));}   </code></pre><p>}</p>","469106","","469106","","2011-01-30 14:12:12","2011-01-30 14:12:12","AdMob onFailedToReceiveRefreshedAd not being called","<android><admob>","2","1","1","",""
"4840292","1","","","2011-01-30 00:03:46","1","979","<p>I have been following the tutorials at <a href=""http://blog.jayway.com/2010/01/01/opengl-es-tutorial-for-android-%E2%80%93-part-iii-%E2%80%93-transformations/"" rel=""nofollow"">http://blog.jayway.com/2010/01/01/opengl-es-tutorial-for-android-%E2%80%93-part-iii-%E2%80%93-transformations/</a> and I was wondering how I would go about implementing some 2d collision detection. I currently have 2 objects displayed on screen (1 of which is movable). How would I check if these objects intersect before I apply the movement?</p>","560571","","","","","2011-01-30 00:03:46","Collision detection with opengl es and android","<android><opengl-es><2d><collision-detection>","0","0","","",""
"4840361","1","4840390","","2011-01-30 00:25:29","3","3429","<p>Android(gdbserver run in Android) says:</p><blockquote>  <p>gdb: Unable to get location for thread creation breakpoint: requested event is not supported</p></blockquote><p>So, how can I know the gdb commands sent by eclipse?<br></p><p>P.S. Can be debugged in cygwin shell, just cannot be debugged in eclipse. I don't know which commands sent by eclipse.</p>","84325","","84325","","2011-01-30 00:38:28","2011-11-17 16:15:56","Remote debugging Android NDK program from eclipse","<android><eclipse><gdb><android-ndk>","1","0","2","",""
"4840447","1","","","2011-01-30 00:46:42","0","197","<p>I'm trying to learn Android development and using the Android SDK in Exclipse.  I'm following a tutorial to build the Main.XML file on the Graphical Layout tab.  It instructs me to drag several Views onto the screen surface, including: EditText, Button, RadioGroup and RadioButton.  </p><p>My issue is that these Views do not seem to drag.  I place the mouse cursor over them, press the right button but the Views are not captured for dragging.  There are other Views (such as Gallery) that do seem to drag ok but those I'm interested in (to complete the tutorial lesson) do not drag.</p><p>Any help making this work properly would be appreciated. </p>","595399","","","","","2011-01-30 06:52:57","Trouble Dragging Android Views","<android>","3","1","","",""
"4840467","1","4840484","","2011-01-30 00:53:09","1","1578","<p>I'm currently developing an application for a company which includes livescoring. The XML-files I access (from the net like: ""http://company.com/files/xml/livescoring.xml"") are not intended to be public and should only known to me.</p><p>I was wondering if it is possible for anyone to decode the .apk file and read my original .java files (which include the link to the XML files).</p><p>So, I renamed the .apk file to .zip and could access the ""classes.dex"", which seemed to include the .java files (or classes). Googling led me to a tool named ""AvaBoxV2"" which decoded this ""classes.dex"" file. Now I have a folder including an ""out"" folder where files named .smali exist. I opend one of these with an editor and finally there is the link to the xml file. Not good. :(</p><p>Is there a way to encrypt my app or the classes.dex file? I don't want to tell that company, that anyone can access the original xml-files. Maybe signing the app probably helps?</p><p>Also, do you know a really noob-friendly tutorial to prepare apps (signing, versioning,...) for Google Market?</p><p>Thanks in advance!</p>","586490","","52626","","2011-03-27 21:05:57","2011-03-27 21:05:57","Android: .java files readable from .apk file?","<java><android><apk>","2","1","1","",""
"4840520","1","","","2011-01-30 01:06:23","0","689","<p>I'm almost ready to publish an app, I'm just adding ads now. I got the AdView working with no problems on the main activity--both the test ad and normal ones. The Adview I put on the about activity, however, doesn't display any ads. I gave the Adview a random background to see if it was even displayed, and it is. LogCat says the ad was fetched, but it doesn't show. Is there something against multiple AdViews in an app?</p>","595425","","","","","2011-01-30 01:06:23","AdMob on multiple Activites","<android><activity><admob><android-sdk-2.2><adview>","0","4","","",""
"4840691","1","","","2011-01-30 02:03:21","0","1370","<p>Today I noticed something rather interesting.  The activity lifecycle seems to have a slight discrepancy when the phone display times out.  Let me explain with an example.</p><p>I have an activity that uses the accelerometer to vibrate the phone.  In the <code>onPause</code> event I unregister the <code>SensorManager</code> listener so that I don't vibrate the phone when my activity is no longer the main focus.</p><p>However, I've noticed if the display shuts off and then comes back on my activity has the <code>SensorManager</code> listener registered even before I unlock the screen, enter my password, and my activity is shown.</p><p>Now I realize this is my own interpretation of how I would expect it to work, but to me this seems rather strange, since my activity isn't yet the main focus.  I expected the <code>SensorManager</code> listener wasn't registered because <code>onResume</code> hasn't yet been called.  This clearly isn't the case when I can make my phone vibrate from both the lock screen and the password screen.</p><p>So, can anyone explain why this behavior?  Secondly what can I do to get around it?</p><p>Thank you.</p><p><strong>EDIT for clarity</strong></p><p>I use the accelerometer to trigger a vibrate by moving the phone.  This is accomplished through the <code>SensorManager</code> listener.</p><p>Scenario:</p><p>My activity is in the foreground (main focus).  I trigger the vibrate by moving the phone. The display times out.  At this point I can not trigger the vibrate.  I press home/power to show the screen.  I can now vibrate my phone even though either the lock screen or password screen is shown and my activity is not in the foreground.</p><p>I can not verify if the reason I can not vibrate the phone when the display turns off is because <code>onPause</code> was called or there is something inherent to the OS that prevents it.  Or to put it another way, I also can't verify if <code>onResume</code> was called when the display turned on.</p><p>The key to all this is understanding the activity life cycle when the phones display is shut off.  Unfortunately, my expectation was that it would follow the same life cycle diagram that we have all learned.  My <em>opinion</em> was that it is different.</p>","432209","","432209","","2011-01-30 02:42:36","2011-11-12 06:52:22","Activity lifecycle during phone display timeouts","<android><activity><listener><lifecycle>","3","2","","",""
"4840927","1","4840966","","2011-01-30 03:13:33","5","10306","<p>I am new the Android. In my application development, I want to handle the display (screen) rotation. Is there any listener is available to handle this event? Or is there any alternate way to handle this situation?</p><p>Thanks &amp; Regards,</p><p>Bala </p>","562743","","501557","","2011-01-30 03:16:14","2013-12-01 17:24:25","Handling display rotation in Android","<android>","3","1","","",""
"4840967","1","4841448","","2011-01-30 03:28:31","2","1535","<p>I have posted a question before about this now I have no errors but when I try to run my app on my simulated android device it comes up with an error that says  </p><blockquote>  <p>sorry the application Hello Grid View  (process com.HelloGridView) has  stopped unexpectedly. Please try  again.</p></blockquote><p>Here is the file tree the files will follow later:</p><pre><code>HelloGridView  src  com.HelloGridView  HelloGridView.java  ImageAdapter.java  gen  Android 2.2  assets  res  drawable( with all the pics)  </code></pre><p>HelloGridView.java  </p><pre><code>package com.HelloGridView;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.GridView;import android.widget.Toast;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 AdapterView.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.java  </p><pre><code>package com.HelloGridView;import android.content.Context;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.GridView;import android.widget.ImageView;public class ImageAdapter extends BaseAdapter {    private Context mContext;    public ImageAdapter(Context c) {        mContext = c;    }    public ImageAdapter(HelloGridView c) {        // TODO Auto-generated constructor stub    }    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>here is my main.xml  </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/gridview""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:columnWidth=""90dp""    android:numColumns=""auto_fit""    android:verticalSpacing=""10dp""    android:horizontalSpacing=""10dp""    android:stretchMode=""columnWidth""    android:gravity=""center""/&gt;</code></pre>","595137","","244296","","2011-01-30 03:33:48","2011-12-15 20:59:07","problems with running hellogridview from android.com","<java><android><android-emulator>","2","1","","",""
"4841228","1","4841276","","2011-01-30 04:52:39","3","4749","<p>From the android tutorial : </p><pre><code>pass_text.setOnKeyListener(new OnKeyListener() {    public boolean onKey(View v, int keyCode, KeyEvent event) {        // If the event is a key-down event on the ""enter"" button        if ((event.getAction() == KeyEvent.ACTION_DOWN)                &amp;&amp; (keyCode == KeyEvent.KEYCODE_ENTER)) {            // Perform action on key press            return true;        }        return false;        }    });}</code></pre><p>when click at EditText, it has a keyboard appear on the frame. I want to know after Enter.How to make keyboard out from frame except click Back. </p><p><img src=""http://i.stack.imgur.com/VjgVx.png"" alt=""enter image description here""></p><p>Thank you</p>","538788","","","","","2013-12-30 06:08:22","After type in EditText, how to make keyboard disappear","<android><keyboard><android-edittext>","3","0","","",""
"4841265","1","4841517","","2011-01-30 05:01:53","0","2246","<p>I am very beginner to android OS.</p><p>I am writing a media player and I get frames from the native code and will be displayed from java code as bitmaps. I convert frames from bytes array into bitmaps and then display it. Right now I am able to display one frame, but i am unable to display them continuously. </p><p>My code is as below</p><p>canvas.drawbitmap(mbitmap,0,0,null);</p><p>but when i am trying to display the next frame, it is still displaying the same previous frame and not changing. Do I need to clear the bitmap or something? Or is there any otherway to draw the rendered frames.</p><p>Thanks for any help</p>","574911","","","","","2011-01-30 06:25:51","How to render all Video frames through canvas in android","<android>","1","1","1","",""
"4841303","1","4841329","","2011-01-30 05:13:36","2","451","<p>Suppose There are some activity.</p><p>I want to start another activity from the main activity. and another from that activity. and another from the next one.</p><p>This is how it is -</p><p>Main Activity -> Activity 1 -> Activity 2 -> Activity 3</p><p>Now I want to switch to Main Activity from Activity 3 without destroying Activity 3 or recreating a new instance of Main Activity.</p><p>I don't know is there any way to get it done.</p><p>If someone know about this. Let me know.</p>","595543","","","","","2011-01-30 05:22:55","Android Problem : Switching Between Activity in Activity Stack","<android><activity>","1","0","","",""
"4841319","1","4841336","","2011-01-30 05:20:02","6","27343","<pre><code>login.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            // TODO Auto-generated method stub            if( username_text.getText().toString() == ""admin"" &amp;&amp;                    pass_text.getText().toString() == ""password""){                startActivityForResult(i, ACTIVITY_CREATE);            }else{                Toast.makeText(gps_gui.this, ""Your username or password is not correct! Please, insert again"",                        Toast.LENGTH_SHORT).show();                clearEditText();            }        }    });</code></pre><p>I'm try to check it, I found it not go to if condition.</p>","538788","","","","","2011-01-30 05:44:05","get String from EditText","<android><if-statement><android-edittext>","2","2","1","",""
"4841345","1","4846887","","2011-01-30 05:27:45","7","5840","<p>I have some image processing Java code in Android that acts upon two large int arrays. Most of the time, Java is fast enough but I need to use C via JNI and the NDK to speed up a few operations.</p><p>The only way I know that I can pass the data from the int arrays to C is to use ByteBuffer.allocateDirect to create a new buffer, copy the data to that and then make the C code act upon the buffer. </p><p>However, I cannot see any way I can manipulate the data in this buffer in Java as if the buffer was an int[] or a byte[]. For example, a call to ByteBuffer.array() will fail on the newly created buffer. Is there any way to make this work?</p><p>I have limited memory and want to reduce how many arrays/buffers I need. For example, it would be nice if I could use IntBuffer.wrap(new int[...]) to create the buffer and then manipulate the array backing the buffer directly in Java but I cannot do this because the only thing that seems to work here for JNI is ByteBuffer.allocateDirect.</p><p>Are there any other ways to send data back and forth between C and Java? Can I somehow allocate memory on the C side and have Java send data directly to there?</p><p>Edit: A benchmark comparing buffer use to int[] use:</p><pre><code>int size = 1000;IntBuffer allocateDirect = java.nio.ByteBuffer.allocateDirect(4 * size).asIntBuffer();for (int i = 0; i &lt; 100; ++i){  for (int x = 0; x &lt; size; ++x)  {    int v = allocateDirect.get(x);    allocateDirect.put(x, v + 1);  }}int[] intArray = new int[size];for (int i = 0; i &lt; 100; ++i){  for (int x = 0; x &lt; size; ++x)  {    int v = intArray[x];    intArray[x] = v + 1;  }}</code></pre><p>On a Droid phone, the buffer version takes ~10 seconds to finish and the array version takes ~0.01 seconds.</p>","580100","","580100","","2011-02-01 09:16:37","2011-02-01 09:16:37","Sending int[]s between Java and C","<java><android><c><jni><android-ndk>","3","13","5","",""
"4841391","1","","","2011-01-30 05:48:46","4","11989","<p>I want to find the view position on the display screen. </p><p>To do the I use the methods such as <code>view.getLeft()</code> ,<code>view.getBottom()</code> , <code>view.getRight()</code> , <code>view.getTop()</code>.  But unfortunately all these methods are returned the ""0""(Zero). Is there any alternate to find the view positions ,i.e coordinates?</p><p>My code snippet in main.xml </p><pre><code>**&lt;TextView android:id=""@+id/tv1""        android:layout_width=""200px""        android:layout_height=""30px""        android:text=""welcome to""    /&gt;    &lt;TextView android:id=""@+id/tv2""        android:layout_width=""200px""        android:layout_height=""30px""        android:text="" Make Eit solution ""    /&gt;**</code></pre><p>in <code>onCreate()</code>:</p><pre><code>    super.onCreate(savedInstanceState);    setContentView(R.layout.main);     tv1=(TextView)findViewById(R.id.tv1);     tv2=(TextView)findViewById(R.id.tv2);     System.out.println(""tv4 width:""+tv2.getWidth());     System.out.println(""tv4 height:""+tv2.getHeight());     System.out.println(""Right:""+tv2.getRight());     System.out.println(""Left:""+tv2.getLeft());     System.out.println(""Top:""+tv2.getTop());     System.out.println(""Bottom:""+tv2.getBottom());</code></pre>","562743","","96196","","2011-09-14 08:03:25","2013-07-25 11:05:09","Finding the View location(position) on display(screen) in android","<android><android-layout><view>","4","1","1","",""
"4841406","1","","","2011-01-30 05:53:30","0","388","<p>i have successfully displayed google map in my app . but i am not able to search the specfied location . can u please put the code snippet or any link available for the  code .</p>","595561","","50109","","2011-01-30 19:13:41","2011-01-31 15:05:44","Searching option in google map in android","<android><google-maps>","1","0","","",""
"4841476","1","","","2011-01-30 06:13:45","4","7987","<p>Whenever I click in the <code>EditText</code> the Android keyboard popup window appears, but I don't want the keyboard to pop up.</p><p>I want to permanently hide the android keyboard popup for my current application. </p><p>How can I do this?</p>","562743","","1288","","2012-05-04 10:51:57","2013-07-01 09:34:53","Hiding the android keyboard for EditText","<android><android-softkeyboard>","4","3","2","",""
"4841527","1","4849502","","2011-01-30 06:29:22","0","1849","<p>Man... this bug has got me down.</p><p>Logcat:</p><pre><code>01-29 22:25:00.293: ERROR/AndroidRuntime(27386): FATAL EXCEPTION: main01-29 22:25:00.293: ERROR/AndroidRuntime(27386): java.lang.IllegalStateException: Could not execute method of the activity01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at android.view.View$1.onClick(View.java:2072)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at android.view.View.performClick(View.java:2408)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at android.widget.CompoundButton.performClick(CompoundButton.java:99)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at android.view.View$PerformClick.run(View.java:8819)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at android.os.Handler.handleCallback(Handler.java:587)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at android.os.Handler.dispatchMessage(Handler.java:92)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at android.os.Looper.loop(Looper.java:123)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at java.lang.reflect.Method.invokeNative(Native Method)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at java.lang.reflect.Method.invoke(Method.java:521)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at dalvik.system.NativeStart.main(Native Method)01-29 22:25:00.293: ERROR/AndroidRuntime(27386): Caused by: java.lang.reflect.InvocationTargetException01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at com.example.viewer.Viewer.denoiseSlice(Viewer.java:170)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at java.lang.reflect.Method.invokeNative(Native Method)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at java.lang.reflect.Method.invoke(Method.java:521)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at android.view.View$1.onClick(View.java:2067)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     ... 12 more01-29 22:25:00.293: ERROR/AndroidRuntime(27386): Caused by: java.lang.UnsatisfiedLinkError: RicianDenoise01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     at com.example.viewer.Viewer.RicianDenoise(Native Method)01-29 22:25:00.293: ERROR/AndroidRuntime(27386):     ... 16 more</code></pre><p>Loading the Library and declaring it:</p><pre><code>    public native void RicianDenoise(int w, int h, int p,         short [] s_noised_slice, double [] d_noised_slice,         short [] s_denoised_slice, double [] d_denoised_slice);    static {        System.loadLibrary(""denoise"");    }</code></pre><p>C Function:</p><pre><code>void Java_com_example_viewer_Viewer_RicianDenoise (JNIEnv *env, jclass cls, jint M,                                               jint N, jint P, jshort * s_noised_slice,                                              jdouble * d_noised_slice,                                               jshort * s_denoised_slice,                                               jdouble * d_denoised_slice) {    /* ... */}</code></pre><p>I ran </p><blockquote>  <p>ndk-build -B -C [project]/jni</p></blockquote><p>and I can't get anything to work. Any suggestions, or experience with this issue? The invocation line in the logcat is me just trying to call the function, btw.  Thank you... please be my hero :(</p>","387064","","501557","","2011-01-30 06:35:33","2011-01-31 09:54:45","JNI and Android... UnsatisfiedLinkError","<java><android><jni><android-ndk>","2","1","","",""
"4841686","1","4841697","","2011-01-30 07:18:05","22","41527","<p>I have been developing for quite a time and I am now trying to make an app that will replace the original home (e.g. HTC sense).</p><p>I need the app to open when the the user hits the home button on their phone.</p><p>So basically it is a home replacement.</p><p>Does any one know how to go about this?</p>","583952","","1576010","","2014-04-12 05:27:07","2014-04-12 05:27:07","How to make a launcher","<android><launcher>","6","0","16","",""
"4841794","1","4841826","","2011-01-30 07:50:56","0","2034","<p>I searched a lot of websites but nothing found.<br>Could anyone offer me a url or something like that?<br>Thanks in advance.</p>","542792","","","","","2012-11-25 18:21:06","Where to get android sdk for linux 64bit?","<android><sdk>","3","0","1","",""
"4841837","1","","","2011-01-30 08:02:47","1","801","<p>How do I detect if an ads fail to load so I can replace the ads view container with something I can show the user. Right now if no ads load my view container just display a black rectangular.</p>","42340","","418183","","2011-01-30 08:08:59","2012-01-25 14:32:29","How to detect if AdWhirl ads failed to load?","<android><adwhirl>","2","0","","",""
"4841908","1","6485971","","2011-01-30 08:23:37","25","18531","<p>I tried to start my avd on Ubuntu 64bit 10.10, but it failed and shows the following in the log:  </p><pre>SDL init failure, reason is: No available video device</pre><p>What can I do with that?</p><p>I tried to search for solutions and someone says it needs x11/sdl/jdk library and I installed them all but it still does not work.</p>","542792","","419","","2011-05-29 17:02:27","2014-04-15 09:25:38","SDL init failure, reason is: No available video device","<android><avd>","11","0","8","",""
"4841925","1","5190876","","2011-01-30 08:27:48","3","7012","<p>The following code is working fine in Android 1.5-2.2.1 but it's not in 2.3 and higher.</p><pre><code>BufferedReader rd;rd = new BufferedReader(new InputStreamReader(connection.getInputStream()));StringBuffer sb = new StringBuffer();String line;while ((line = rd.readLine()) != null){    sb.append(line);}rd.close();</code></pre><p>The stracktrace:</p><pre><code>01-30 08:21:42.668: WARN/System.err(594): java.io.IOException: BufferedInputStream is closed01-30 08:21:42.668: WARN/System.err(594):     at java.io.BufferedInputStream.streamClosed(BufferedInputStream.java:116)01-30 08:21:42.728: WARN/System.err(594):     at java.io.BufferedInputStream.read(BufferedInputStream.java:274)01-30 08:21:42.728: WARN/System.err(594):     at org.apache.harmony.luni.internal.net.www.protocol.http.UnknownLengthHttpInputStream.read(UnknownLengthHttpInputStream.java:40)01-30 08:21:42.758: WARN/System.err(594):     at java.io.InputStreamReader.read(InputStreamReader.java:255)01-30 08:21:42.758: WARN/System.err(594):     at java.io.BufferedReader.fillBuf(BufferedReader.java:128)01-30 08:21:42.758: WARN/System.err(594):     at java.io.BufferedReader.readLine(BufferedReader.java:357)</code></pre><p>Is this an issue? Has anything changed in 2.3??</p>","564468","","564468","","2011-01-31 22:58:24","2011-03-07 23:48:35","java.io.IOException: BufferedInputStream is closed in Android 2.3","<android><http><bufferedreader>","2","2","1","",""
"4841952","1","4842019","","2011-01-30 08:34:16","20","20410","<p>I have an ArrayList that I use within an ArrayAdapter for a ListView.  I need to take the items in the list and convert them to a JSONArray to send to an API. I've searched around, but haven't found anything that explains how this might work, any help would be appreciated.</p><p><strong>UPDATE - SOLUTION</strong></p><p>Here is what I ended up doing to solve the issue.</p><p>Object in ArrayList:</p><pre><code>public class ListItem {    private long _masterId;    private String _name;    private long _category;    public ListItem(long masterId, String name, long category) {        _masterId = masterId;        _name = name;        _category = category;    }    public JSONObject getJSONObject() {        JSONObject obj = new JSONObject();        try {            obj.put(""Id"", _masterId);            obj.put(""Name"", _name);            obj.put(""Category"", _category);        } catch (JSONException e) {            trace(""DefaultListItem.toString JSONException: ""+e.getMessage());        }        return obj;    }}</code></pre><p>Here is how I converted it:</p><pre><code>ArrayList&lt;ListItem&gt; myCustomList = .... // list filled with objectsJSONArray jsonArray = new JSONArray();for (int i=0; i &lt; myCustomList.size(); i++) {        jsonArray.put(myCustomList.get(i).getJSONObject());}</code></pre><p>And the output:</p><pre><code>[{""Name"":""Name 1"",""Id"":0,""Category"":""category 1""},{""Name"":""Name 2"",""Id"":1,""Category"":""category 2""},{""Name"":""Name 3"",""Id"":2,""Category"":""category 3""}]</code></pre><p>Hope this helps someone some day!</p>","564431","","1306012","","2013-08-06 19:42:57","2013-09-03 10:55:24","convert ArrayList<MyCustomClass> to JSONArray","<android><json><arraylist><jsonarray><jsonobject>","2","1","14","",""
"4841980","1","","","2011-01-30 08:41:01","5","3014","<p>I'd like to learn Android app development but I don't want to use any IDE, especially Eclipse and its ADT plug in. It's just that I'm more comfortable with command line, executing commands myself and seeing what's going on beneath. I'm looking for a good reference/tutorial/ebook/walk through on the flow. Is there any such resources available?</p>","129543","","","","","2013-08-06 07:00:51","Android App development without Eclipse/ADT","<android><eclipse><adt>","1","0","","",""
"4841990","1","","","2011-01-30 08:44:47","0","42","<p>Is there any Api Or method available, to protect Folder which contain Sub folder like text,images and videos in android</p>","595646","","","","","2011-01-30 08:44:47","Is there any Api Or method available, to protect Folder which contain Sub folder like text,images and videos in android","<android>","0","2","","",""
"4842069","1","5316679","","2011-01-30 09:08:37","5","2206","<p>I have searched alot on google and in here to find the best featured API for XMPP client.</p><p>I have found the following two:</p><p>asmack: .http://code.google.com/p/asmack/</p><p>patched smack: <a href=""http://davanum.wordpress.com/2008/12/29/updated-xmpp-client-for-android/"">http://davanum.wordpress.com/2008/12/29/updated-xmpp-client-for-android/</a></p><p>I cant find any comparison of these two APIs on the internet, so maybe you can help me in which one to choose.?</p><p>In the original article of the patched smack he inform that TLS does not work (thats fine I should not use that) I consume that the rest works.On the other hand asmack is very popular but when I read around the net it seems that it is a little more buggy?</p><p>What do you advise me to choose?</p><p>Thanks!</p>","589703","","","","","2013-03-18 11:21:50","Android: asmack(ported) or smack(patched)?","<android><xmpp><smack>","2","1","1","",""
"4842112","1","4842251","","2011-01-30 09:16:52","31","8356","<p>I have an android application that access local sqlite3 db frequently, for performance consideration so i always keep the connection open. But one of my friends recommended me to open/close the connection every operation. </p><p>1) What's your guys opinion on these two methods ? cons/pros.2) I did some testing and find the DB connection doesn't have too much perf overhead. Does the performance overhead of DB connection varies on the size of the DB ?</p>","498177","","","","","2012-02-07 10:21:55","When to close db connection on android? Every time after your operation finished or after your app exit","<android><database><sqlite><connection>","2","1","7","",""
"4842218","1","4842258","","2011-01-30 09:48:50","1","781","<p><strong>Hi all!</strong></p><p>I wonder if there is a generally preferred implementation paradigm to respect if one want's two completely different Android applications to access and operate on the same database? Is it recommended or even technically possible to do this at all? What would such an architecture look like?</p><p>As of now I'm considering to let the two applications implement their own <code>ContentProvider</code>s (both <code>ContentProvider</code>s will access the same database, guaranteed never simultaneously, though). I have also thought of building one common content provider and let both applications use that one when accessing the database. I prefer the first example but haven't completely discarded the later.</p><p><strong><em>RATIONALE:</em></strong><br />I have two applications which need to access a common database. The database itself stores data but also describes the relationship between the data rows, typically describing a set of ""forms"" where the form content; UI elements like text boxes, buttons and different kinds of lists, is customizable. Both applications use this ""description data"" in the database to generate parts of the respective application UI during runtime.</p><p>Hence, there are two aspects of the two applications: one ""administrative"" aspect (managing the data structure and relationship between the data rows) and one ""generic user"" aspect (reading/modifying the actual data values). It's a deliberate choice to separate these two aspects in separate applications.</p><p><em>NOTE!</em> The data values are separated from the data structure, i.e. the <em>values</em> are stored in one separate table and the <em>structure</em> is described in another table. This means that the two applications will essentially modify two different tables in the same database and they will never modify ""the other table"", so to speak.</p><p><em>Any thoughts are greatly appreciated. The application is yet on a planning stage, so, now is the time to make fundamental changes.</em></p>","569885","","","","","2011-01-30 09:59:16","Two content providers accessing the very same database","<android><architecture><android-contentprovider>","1","0","","",""
"4842349","1","","","2011-01-30 10:21:02","1","14817","<p>I have a ListView, which is in singleChoice mode. All I want is to display a RadioButton to the side, that when clicked highlights to say it is selected, and when a different one is clicked that one hides and the new one becomes selected.</p><p>I looked in Mark's book, Chapter 8, ""Getting Fancy With Lists"" and his RateList example<br>But it doesn't solve my problem.Please help me .</p>","595494","","","","","2013-07-10 04:56:41","Android ListView with RadioButton/CheckBox in singleChoice mode and a custom row layout","<android><listview><radio-button><listviewitem>","2","1","5","",""
"4842387","1","4842486","","2011-01-30 10:31:26","0","1976","<p>I'd like to start an Activity which is not included in my original .apk.How can I do so? the other Activity is contained in another .apk which is previous version of the current application.Thanks,Eyal.</p>","341497","","","","","2011-01-30 10:51:38","calling activity from external Activity","<android><activity><apk>","2","0","","",""
"4842399","1","","","2011-01-30 10:34:22","1","227","<p>i've had errors in my project so i saved my files on desktop then deleted the project. i remade the project and pasted my source file back in. it's saying R.java doesn't exist when it does.</p><p>any ideas?</p><p>thanks</p>","532462","","","","","2011-06-03 21:40:17","R.java could not be opened/ doesnt exist","<android>","3","0","","",""
"4842416","1","","","2011-01-30 10:37:58","0","346","<p>hi <br>I am writing an Android App, in which  I need to display a List, Clicking on any list item should show another list besides that list item. Can anyone help me how can this be implemented in Android.</p><p>Thanks in Advancem</p>","429501","","","","","2011-01-31 03:14:44","How to Create 2D list View","<android>","1","0","","",""
"4842489","1","4842502","","2011-01-30 10:52:03","0","2395","<p>i want an alarm to go off when user checks in a checkbox. Here is my code:</p><pre><code>if (cb1.isChecked())     {      Calendar calA = Calendar.getInstance();      //calA.set(Calendar.YEAR, Calendar.YEAR);      //calA.set(Calendar.MONTH, Calendar.MONTH);      //calA.set(Calendar.DAY_OF_MONTH, Calendar.DAY_OF_MONTH);      calA.set(Calendar.HOUR_OF_DAY, Calendar.HOUR_OF_DAY);      calA.set(Calendar.MINUTE, Calendar.MINUTE);      calA.set(Calendar.SECOND, Calendar.SECOND);      calA.set(Calendar.MILLISECOND, Calendar.MILLISECOND);      alarmManager.set(AlarmManager.RTC_WAKEUP, calA.getTimeInMillis(), pendingIntentA);      Toast.makeText(main.this, ""Set time: "" + String.valueOf(calA.getTime()), Toast.LENGTH_SHORT).show();    }</code></pre><p>Other codes are working fine, and if i set the hour and minute to specific ones, like</p><pre><code>calA.set(Calendar.HOUR_OF_DAY, 15);calA.set(Calendar.MINUTE, 24);</code></pre><p>it's working, but with this code i always get this toast message: Sat Mar 05 11:12:00 or Sat Mar 05 11:12:13(neither the date nor the time is good)</p><p>What is wrong with my code?</p>","571648","","","","","2011-02-24 06:05:59","Android Calendar has always the same date","<android><calendar>","2","1","","",""
"4842520","1","4842744","","2011-01-30 11:01:30","3","7971","<p>Pretty sure this is an easy one, but i'm getting confused by all the examples that adapt the data returned from a cursor into different views. <strong>I just want to run a rawquery and put each item of data returned into a float array</strong> (so that i can add them up later). What do i need to use for this? <em>Thanks</em></p>","523874","","523874","","2011-01-30 15:31:24","2012-04-23 13:49:32","How do i get data from an SQLITE database to an array in android?","<android><database><arrays><sqlite><cursor>","2","2","1","",""
"4842546","1","","","2011-01-30 11:05:39","2","1305","<p>I have installed Documentation for Android package using AVD manager.<br>On hovering over any element it pops up ""<em>Note: This element has no attached source and the Javadoc could not be found in the attached Javadoc</em>""  </p><p>I cant figure exactly what needs to be set in javadoc location in project properties or something else needs to be done :-/  </p><p>Sorry for such a basic question!<br>Thanks for any help in advance.</p>","95876","","95876","","2011-01-30 11:52:14","2011-06-02 04:27:31","How to use Android documentaion while developing in Eclipse with ADT?","<android><eclipse><documentation><javadoc><adt>","2","3","0","",""
"4842558","1","","","2011-01-30 11:08:20","1","1130","<p>i just need some guide on how to detect a marker and make an output text.. for ex: a marker with an image of a dog , when detected, i have an output text ""DOG"" in a textfield .. can someone help me with my idea? oh, btw which one is more effective to use nyartoolkit or andar for my idea?thanks:) need help..!</p>","524021","","526836","","2011-01-30 12:21:35","2012-10-15 23:35:23","Help with android augmented reality ","<android><augmented-reality><object-recognition>","1","1","2","",""
"4842611","1","6141548","","2011-01-30 11:20:12","6","18992","<p>i was using Eclipse Helios but due to performance issues i changed to Eclipse Galileo and installed the ADT plugging, and added my sdk folder to Elcipse Preferences. Now R.java disappeared from all of my projects. How can i fix this, i did Project/Clean but that won't generate the files, there's nothing wrong in my xml and there's no out.xml in any of my projects. </p><p>Thanks in advance</p>","499488","","213269","","2011-01-30 11:34:39","2014-03-09 19:11:40","R file is missing android","<android><r.java-file>","9","3","1","",""
"4842612","1","","","2011-01-30 11:20:19","26","18432","<p>An update to the Android development tools was just released enabling you to save-to and restore-from an emulator snapshot. Does anyone know how to use this feature? This would greatly reduce the emulator's load time! But I can't find a way to tell the emulator to do so. Thanks.</p>","446940","","","","","2013-06-24 12:06:21","how do you save android emulator snapshot?","<android><android-emulator>","4","0","10","",""
"4842650","1","","","2011-01-30 11:32:01","0","1324","<p>this question is continuation to my previous question :<a href=""http://stackoverflow.com/questions/4802869/how-to-set-user-agent-for-new-action-view-intent"">How to set user agent for new ACTION_VIEW intent</a>.</p><p>In my application I am launching a new Intent with url (browser) using the following code:</p><pre><code>Intent myIntent = new Intent(Intent.ACTION_VIEW,Uri.parse(url));                try {    context.startActivity(myIntent);} catch (ActivityNotFoundException e) {    Log.e(TAG, ""cannot initiate Browser"", e);}</code></pre><p>In the server side I see that some request headers containing ""Apache-HttpClient/UNAVAILABLE (java 1.4)"" as a user agent value.</p><p>Does anyone know if there any device, operator, browser or any other cause that will not sent the real user agent?</p><p>thanks-Z</p>","449466","","449466","","2011-01-30 12:12:24","2011-01-30 14:55:44","Android: Why user agent value is missing","<android><user-agent>","1","0","","",""
"4842709","1","","","2011-01-30 11:48:03","0","996","<p>I'm writing an Android app that communicates via HTTPS with a server application. On the server side, I have to be absolutely sure about the Android app's integrity. This means that the server app needs to be sure that it's communicating with the Android app that I developed and not with a re-written one (e.g. after decompiling the original app or after having rooted the device).</p><p>Is there a possibility to ensure that? Maybe there is a possibility with the signature of the apk file?</p><p>Any hint is appreciated.</p><p>Regards,Peter </p>","502396","","","","","2011-01-30 17:44:43","Android: Verifying the application's integrity on the server side","<android><security><apk><integrity>","3","0","","",""
"4842729","1","","","2011-01-30 11:53:39","2","128","<p>I am developing an android app which makes no reference to the sensor aspect of the phone.  At a certain pint the program sends an sms and then sleeps for five minutes.   If I move the phone during this sleep period a dialog box displayed earlier reappears.   I realise this is rather vague without code at this stage but to start with is this something to be expected.   I am wondering if one of the broadcast listeners is being triggered by the movement but even if this is so I cant make the connection with the dialog box.   Any pointers will be much appreciated.</p>","538847","","","","","2011-04-08 03:31:53","movement of phone causes unexpected result in code","<android>","1","3","1","",""
"4842752","1","","","2011-01-30 11:57:48","5","942","<p>First I found a way to modify the called number during an outgoing call.I tried the same for the caller's number during an incoming call, but the only thing I can do is read the caller's number, not change it. Can someone give me a hint?</p><p>My code in on receive so far:</p><pre><code>Bundle b = intent.getExtras();Log.d(TAG, ""Phone State: ""+ b.getString(TelephonyManager.EXTRA_STATE));incomingNumber = b.getString(TelephonyManager.EXTRA_INCOMING_NUMBER);Log.d(TAG, ""incoming number: ""+ incomingNumber);</code></pre><p>How could I proceed?</p>","595731","","436938","","2011-04-12 13:23:59","2011-08-10 14:33:18","change the caller's number during an incoming call","<android>","1","1","2","",""
"4842782","1","","","2011-01-30 12:03:16","1","1178","<p>I have png images of map tiles over parts of the UK and i want to draw them on top of the google maps view, I have everytyhing set up, just want to be able to draw the tile images now.</p><p>My main class extends 'MapActivity', can i add a canvas function to draw them?</p><p>ALso, I only obviously need to draw the tiles that are in view on the phone while the tiles out of view should not be drawn.</p>","595743","","","","","2011-01-30 14:19:55","Draw custom map tile images (.pngs) on top of Google Map - Android","<java><android><sdk><maps>","1","0","","",""
"4842798","1","4842909","","2011-01-30 12:07:52","8","332","<p>I would like to add two versions of my app to the Android Market, one for a few cents, and one free version, with ads. That's a very common practice.</p><p>I'm currently building AdMod into my app, and it seems I'll have to change quite a few files, so it seems best to make a separate version of my app for this.</p><p>How do you achieve that? A branch? A different repository? Has anyone found a way to keep both apps in the same repository in a reasonable manner?</p><p><em>The title is not misspelled, I do mean ""realise"", i.e. how people manage the two versions, not how they add them to the Market.</em></p>","595745","","996767","","2012-03-13 20:00:29","2012-03-13 20:00:29","How do you release two versions of an app on the Market?","<android><version-control><google-play>","2","0","4","",""
"4842842","1","4843424","","2011-01-30 12:19:40","5","4699","<p>I can successfully listen to an audio stream with the MediaPlayer interface, but how can I get properties of the stream like the current bit rate, or the stream text (lots of streams like on line radios include the currently playing track)?</p><p>I tried to find this information but couldn't, if these things are possibly is there a list somewhere on the android dev site where the various available 'properties' are listed?</p>","560065","","","","","2013-09-19 06:47:47","Android: MediaPlayer, How to get properties of an audio stream?","<android><properties><stream><media-player>","3","0","4","",""
"4842848","1","4843585","","2011-01-30 12:20:55","1","191","<p>Hey guys, I'm looking into creating an application that requires a video file taken on the mobile phone, open it and allow the user to cut the video using two sliders, one for IN(the beginning) and the other for out(end of the clip you want), this will then create a new file and my app will use it then.</p><p>Does this sound feasible? Where should I start looking in order to do this quite simple concept? Does anyone have any ideas?</p><p>Thanks</p>","94279","","","","","2012-01-09 09:25:09","Video 'Snipping' Android - Possible?","<android>","1","0","1","",""
"4843021","1","","","2011-01-30 13:02:55","3","2262","<p>Hello I was wondering if using the android tone generator class would it be possible to create a tone in one device and listen for this same tone in another device. If this is possible I do have a few other questions.</p><p>Taking backround noise into consideration is it possible to listen for only this specific tone?</p><p>Would this process be resource intensive?</p><p>Could I use a tone that would be inaudable to the human ear or close to it?</p><p>Lastly could I use a tone that could only be heard with a couple of feet from the sending device?</p><p>Thanks very much for yer time guys and girls :)</p><p>Edit > Thanks For adding the audio processing tag sabastian. Much better discription.</p>","521241","","521241","","2011-01-30 13:12:50","2012-06-24 14:15:50","Android Microphone To Pick Up A Specific Tone","<android><microphone><audio-processing>","2","0","1","",""
"4843092","1","4843154","","2011-01-30 13:15:41","1","1361","<p>i'm trying to record an audio sample with AudioRecord. I've used a thread to carry out the recording method. there seems to be a prob with the thread. any ideas why?</p><pre><code>package com.tecmark;import java.io.BufferedOutputStream;import java.io.DataOutputStream;import java.io.File;import java.io.FileOutputStream;import android.app.Activity;import android.media.AudioFormat;import android.media.AudioRecord;import android.media.MediaRecorder;import android.os.Bundle;import android.os.Environment;import android.util.Log;import android.view.View;import android.widget.TextView;public class recorder extends Activity  {    private Thread thread;    private boolean isRecording;    private AudioRecord recorder;    private FileOutputStream os;    private BufferedOutputStream bos;    private DataOutputStream dos;    private TextView text;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    public void onClickPlay(View v){    }    public void record(){        Log.i(""inside record method"", ""******"");         text = (TextView)findViewById(R.id.TextView01);         text.setText(""recording"");        int audioSource = MediaRecorder.AudioSource.MIC;        int sampleRate = 22050;        int channel = AudioFormat.CHANNEL_CONFIGURATION_MONO;        int encoding = AudioFormat.ENCODING_PCM_16BIT;        int result = 0;        File path = Environment.getExternalStorageDirectory();        Log.v(""file path"", """"+path.getAbsolutePath());        File file = new File(path, ""test.wav"");        if(file.exists()){            file.delete();        }        path.mkdirs();        Log.v(""file path"", """"+file.getAbsolutePath());         recorder = new AudioRecord(audioSource, sampleRate,channel,encoding,                    AudioRecord.getMinBufferSize(sampleRate, channel,encoding));                    Log.i(""recorder"", ""recorder object created"");            try {                 os = new FileOutputStream(file);                 bos = new BufferedOutputStream(os);                             dos = new DataOutputStream(bos);            } catch (Exception e1) {                e1.printStackTrace();            }            int bufferSize = AudioRecord.getMinBufferSize(sampleRate,channel,encoding);            byte[] buffer = new byte[bufferSize];            recorder.startRecording();            isRecording = true;        try{          while (isRecording){                 result = recorder.read(buffer, 0, bufferSize);                 for(int a=0; a&lt;result;a++){                    dos.write(buffer[a]);                    if(!isRecording){                        recorder.stop();                        break;                    }                 }            }            dos.flush();            dos.close();        }catch(Exception e) {            e.printStackTrace();        }    }// end of record method         public void onClickStop(View v){                Log.v(""onClickStop"", ""stop clicked"");                isRecording=false;            }       public void onClickReverse(View v){        Log.v(""onClickReverse"", ""reverse clicked"");    }     public void onClickRecord(View v){        thread = new Thread(new Runnable() {            public void run() {                isRecording = true;                record();            }        });        thread.start();        isRecording = false;    }}//end of class</code></pre><p>here's the error.</p><pre><code>01-30 12:27:50.434: ERROR/AndroidRuntime(2226): Uncaught handler: thread Thread-8 exiting due to uncaught exception01-30 12:27:50.459: ERROR/AndroidRuntime(2226): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.01-30 12:27:50.459: ERROR/AndroidRuntime(2226):     at android.view.ViewRoot.checkThread(ViewRoot.java:2706)01-30 12:27:50.459: ERROR/AndroidRuntime(2226):     at android.view.ViewRoot.invalidateChild(ViewRoot.java:573)01-30 12:27:50.459: ERROR/AndroidRuntime(2226):     at android.view.ViewRoot.invalidateChildInParent(ViewRoot.java:599)01-30 12:27:50.459: ERROR/AndroidRuntime(2226):     at android.view.ViewGroup.invalidateChild(ViewGroup.java:2396)01-30 12:27:50.459: ERROR/AndroidRuntime(2226):     at android.view.View.invalidate(View.java:4945)01-30 12:27:50.459: ERROR/AndroidRuntime(2226):     at android.widget.TextView.checkForRelayout(TextView.java:5366)01-30 12:27:50.459: ERROR/AndroidRuntime(2226):     at android.widget.TextView.setText(TextView.java:2684)01-30 12:27:50.459: ERROR/AndroidRuntime(2226):     at android.widget.TextView.setText(TextView.java:2552)01-30 12:27:50.459: ERROR/AndroidRuntime(2226):     at android.widget.TextView.setText(TextView.java:2527)01-30 12:27:50.459: ERROR/AndroidRuntime(2226):     at com.tecmark.recorder.record(recorder.java:54)01-30 12:27:50.459: ERROR/AndroidRuntime(2226):     at com.tecmark.recorder$1.run(recorder.java:151)01-30 12:27:50.459: ERROR/AndroidRuntime(2226):     at java.lang.Thread.run(Thread.java:1096)</code></pre>","532462","","512958","","2011-01-30 13:34:47","2011-01-30 15:27:52","thread problem when recording audio","<android><multithreading>","1","0","","",""
"4843109","1","4843422","","2011-01-30 13:18:48","0","4843","<p>I have a mapactivity and when I switch over to it it takes some time before it appears because it loads the map and animates to the specific location.</p><p>does activity have some sort of finished loading event ao i can do the map initialization there?</p><p>Thanks</p>","62898","","","","","2011-01-30 14:33:21","android activity ""loaded event""","<android><loading><android-mapview><mapactivity>","2","0","","",""
"4843185","1","4843368","","2011-01-30 13:33:54","2","2289","<p>I have seen questions like this while searching stackoverflow but havent seen any recent ones regarding 2.3 sdk. As 2.3 sdk is out and available now is multitouch option available in emulator.If yes then how can it be done??</p>","595693","","","","","2011-01-30 15:48:01","Is Multi Touch or even 2 touch possible in android emulator?","<android><android-emulator><multi-touch>","4","0","1","",""
"4843212","1","4843261","","2011-01-30 13:39:12","29","20381","<p>I had uploaded my app to Android Market some time ago. Today I updated the app, but I had deleted the previous keystore and created new. Now market says, that ""The apk must be signed with the same certificates as the previous version"". But I don't have this certificate, and don't want to delete and upload once again the application, because it have active users. What can I do to sign app with new certificate?</p>","497132","","","","","2013-12-13 22:36:23","The apk must be signed with the same certificates as the previous version","<android><eclipse><apk><google-play>","3","1","11","",""
"4843334","1","4843419","","2011-01-30 14:10:17","0","692","<p>I'm trying to convert a Java Program to Android. I created a new xml Interface and most of the core logic is still running but since Swing is not present in Android  i'm missing the class javax.swing.tree.DefaultMutableTreeNode in particular.Is there an easy way to replace the class with something equivalent in Android?</p><p>Thanks in advance!Taber</p>","595824","","","","","2011-01-30 14:32:41","Android: Is there a Tree Package (Datastructure) I can use?","<android><data-structures><tree>","1","0","","",""
"4843480","1","","","2011-01-30 14:46:35","0","976","<p>I work on a Battleships game as my first Android application.</p><p>I decided to use a ViewSwitcher that holds two GridViews. One <strong>bUserGrid</strong> is for the User field (hosting user ships), <strong>bComputerGrid</strong> is for the Computer field (showing user shots). </p><pre><code>GridView bComputerGrid, bUserGrid, mComputerGrid, mUserGrid;ViewSwitcher bigSwitcher, miniSwitcher;</code></pre><p>User strikes (taps Computer field).The application runs the AsyncTask <strong>userAttack</strong> which defines whether that strike was successful or not.</p><pre><code>bComputerGrid.setOnItemClickListener(new OnItemClickListener() {  public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {    runUserAttack(position);  }});</code></pre><p>If user missed, then in a <strong>onPostExecute()</strong> section of <strong>userAttack</strong> I call <strong>notifyDataSetChanged()</strong> in order to refresh the <strong>bComputerGrid</strong>.</p><pre><code>    protected void onPostExecute(String message) {        ...        bComputerAdapter.notifyDataSetChanged();        mComputerAdapter.notifyDataSetChanged();        firstmateMsg.setText(message);        mUserBundle = mUserAttack.getmUBundle();        mUserAttack=null;        if (isCancelled()) return;        if (mUserBundle.getBoolean(""userMissed"")) {            mComputerAttack = new computerAttack();            mComputerAttack.execute(mComputerBundle);        } else {            if (doesWon(seqComputerShips)) {                showDialog(0);            }        }    }</code></pre><p>But it doesn’t happen! Following statement doesn’t update <strong>bComputerGrid</strong>, if user misses.</p><pre><code>bComputerAdapter.notifyDataSetChanged();</code></pre><p>Then here in <strong>onPostExecute()</strong> section of <strong>userAttack</strong> I start AsyncTask <strong>computerAttack</strong>. In <strong>onPreExecute()</strong> section of <strong>computerAttack</strong> I switch <strong>bComputerGrid</strong> to <strong>bUserGrid</strong> by calling</p><pre><code>bigSwitcher.showNext();</code></pre><p>Switching happens but <strong>bComputerGrid</strong> hasn't been updated before that!</p><p>Computer does its strike and successfully refreshes the user field in <strong>onProgressUpdate()</strong> section of <strong>computerAttack</strong> by calling <strong>bUserAdapter.notifyDataSetChanged()</strong>. When Computer missed, the application comes to wait for the user strike (tap) again.</p><pre><code>    protected void onProgressUpdate(String... messages) {        ...        mUserAdapter.notifyDataSetChanged();        bUserAdapter.notifyDataSetChanged();    }    protected void onPostExecute(Boolean result) {        mComputerBundle = mComputerAttack.getmCBundle();        mComputerAttack=null;        if (field_switch) {            switchViews();        }    }</code></pre><p>But why I can’t refresh <strong>bComputerGrid</strong> before that switching and Computer shot happens?</p><p>Could you, please, help me?</p>","595751","","","","","2013-03-22 16:04:27","How to update GridView before ViewSwitcher animation happens?","<android><gridview><viewswitcher>","1","2","","",""
"4843739","1","5440517","","2011-01-30 15:40:13","17","17453","<p>In the below code my <code>audioRecord</code> object is not initializing. I tried moving it to the <code>onCreate</code> method and made it a global. I've logged the state and that returns a value of <code>1</code> which means ready to use. The debugger says that <code>startRecording</code> is being called on an uninitialized object. It is also saying that it could not get the audio source.</p><p>Why am I getting these errors?</p><pre><code>    package com.tecmark;    import java.io.BufferedOutputStream;    import java.io.DataOutputStream;    import java.io.File;    import java.io.FileOutputStream;    import android.app.Activity;    import android.media.AudioFormat;    import android.media.AudioRecord;    import android.media.MediaRecorder;    import android.os.Bundle;    import android.os.Environment;    import android.util.Log;    import android.view.View;    import android.widget.TextView;    public class recorder extends Activity  {        private Thread thread;        private boolean isRecording;        private AudioRecord recorder;        private FileOutputStream os;        private BufferedOutputStream bos;        private DataOutputStream dos;        private TextView text;        private int audioSource = MediaRecorder.AudioSource.MIC;        private int sampleRate = 22050;        private int channel = AudioFormat.CHANNEL_CONFIGURATION_MONO;        private int encoding = AudioFormat.ENCODING_PCM_16BIT;        private int result = 0;        private int bufferSize;        private byte[] buffer;        /** Called when the activity is first created. */        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);            Log.v(""onCreate"", ""layout set, about to init audiorec obj"");            text = (TextView)findViewById(R.id.TextView01);             bufferSize = AudioRecord.getMinBufferSize(sampleRate,channel,encoding);             buffer = new byte[bufferSize];            recorder = new AudioRecord(audioSource, sampleRate,channel,encoding,                    AudioRecord.getMinBufferSize(sampleRate, channel,encoding));            Log.i(""recorder obj state"",""""+recorder.getRecordingState());        }        public void onClickPlay(View v){        }        public void record(){            Log.i(""inside record method"", ""******"");        File path = Environment.getExternalStorageDirectory();            Log.v(""file path"", """"+path.getAbsolutePath());            File file = new File(path, ""test.wav"");            if(file.exists()){            file.delete();            }            path.mkdirs();            Log.v(""file path"", """"+file.getAbsolutePath());            try {             os = new FileOutputStream(file);             bos = new BufferedOutputStream(os);                             dos = new DataOutputStream(bos);                    } catch (Exception e1) {             e1.printStackTrace();            }            int bufferSize = AudioRecord.getMinBufferSize(sampleRate,channel,encoding);            byte[] buffer = new byte[bufferSize];            recorder.startRecording();            isRecording = true;             try{                  while (isRecording){            result = recorder.read(buffer, 0, bufferSize);            for(int a=0; a&lt;result;a++){                 dos.write(buffer[a]);                 if(!isRecording){                   recorder.stop();                             break;                 }            }             }             dos.flush();             dos.close();        }catch(Exception e){             e.printStackTrace();        }    }// end of record method    public void onClickStop(View v){        Log.v(""onClickStop"", ""stop clicked"");        isRecording=false;    }       public void onClickReverse(View v){        Log.v(""onClickReverse"", ""reverse clicked"");    }     public void onClickRecord(View v){        Log.v(""onClickRecourd"", ""record clicked, thread gona start"");        text.setText(""recording"");        thread = new Thread(new Runnable() {            public void run() {                isRecording = true;                record();            }        });        thread.start();        isRecording = false;    }   }//end of class</code></pre><blockquote>  <p>01-30 15:23:16.724: ERROR/AudioRecord(12817): Could not  get audio input for record source 1  01-30 15:23:16.729:  ERROR/AudioRecord-JNI(12817): Error  creating AudioRecord instance:  initialization check failed. 01-30  15:23:16.729:  ERROR/AudioRecord-Java(12817): [  android.media.AudioRecord ] Error code  -20 when initializing native AudioRecord object. 01-30  15:23:16.729: INFO/recorder obj  state(12817): 1 01-30 15:23:16.729:  WARN/dalvikvm(12817): threadid=13:  thread exiting with uncaught exception  (group=0x4001b180) 01-30 15:23:16.729:  ERROR/AndroidRuntime(12817): Uncaught  handler: thread Thread-7 exiting due  to uncaught exception 01-30  15:23:16.739:  ERROR/AndroidRuntime(12817):  java.lang.IllegalStateException:  startRecording() called on an  uninitialized AudioRecord. 01-30  15:23:16.739:  ERROR/AndroidRuntime(12817):     at  android.media.AudioRecord.startRecording(AudioRecord.java:495)  01-30 15:23:16.739:  ERROR/AndroidRuntime(12817):     at  com.tecmark.recorder.record(recorder.java:114)  01-30 15:23:16.739:  ERROR/AndroidRuntime(12817):     at  com.tecmark.recorder$1.run(recorder.java:175)  01-30 15:23:16.739:  ERROR/AndroidRuntime(12817):     at  java.lang.Thread.run(Thread.java:1096)</p></blockquote>","532462","","250260","","2013-06-11 20:59:44","2013-06-18 15:52:05","AudioRecord object not initializing","<android><android-audiorecord>","7","1","19","",""
"4843740","1","4894269","","2011-01-30 15:40:26","3","504","<p>Where is the source code that manages <code>View</code> re-use in Android? I can think of three distinct parts to this process, but there may be more:</p><ol><li>The logic that determines if a <code>View</code> is eligible for re-use</li><li>The code that manages pools of <code>View</code>s that can be re-used</li><li>The code that removes a re-usable <code>View</code> from the pool and resets its property values to represent a logically different <code>View</code></li></ol><p><strong>EDIT:</strong> The blog post <a href=""https://jonhoo.wordpress.com/2010/07/17/developing-applications-for-android-gotchas-and-quirks/"" rel=""nofollow"">Developing applications for Android – gotchas and quirks</a> gives the following example:</p><pre><code>public class PencilWise extends ListActivity {    View activeElement;    // ...    @Override    public void onCreate ( Bundle savedInstanceState ) {        // ...        this.getListView( ).setOnItemClickListener ( new OnItemClickListener ( ) {            public void onItemClick ( AdapterView&lt;?&gt; parent, View view, int position, long id ) {                MyActivity.this.activeElement = view;                MyActivity.this.showDialog ( DIALOG_ANSWER );            }        } );    }}</code></pre><blockquote>  <p>The <code>showDialog</code> method will display the answer dialog, which needs to know what question the user has opened. The problem is that by the time the dialog opens, the view passed to <code>onItemClick</code> might have been reused, and so <code>activeElement</code> would no longer point to the element the user clicked to open the dialog in the first place!</p></blockquote>","196844","","196844","","2011-02-04 16:25:13","2011-02-04 17:51:29","Where is the code that manages View re-use in Android?","<java><android><views><android-ui>","2","3","0","",""
"4843755","1","4849959","","2011-01-30 15:43:37","1","2439","<p>I am doing a simple Async operation with Android, but since I want to execute the action couple of times, I am not using AsyncTask, I instead use Thread/Runnable mechanism with Handler to handle messages and staff. But at one point when I need to execute the second operation, I need to cancel the previous operation if it is still active.</p><p>I have something like this:</p><pre><code>private void exec() {    new Thread(new Runnable() {    public void run() {    mBind.exec(3);    }  }).start();}</code></pre><p>Then in exec(int a) I have an interation like:</p><pre><code>for(int i = 0; i&lt;=res.lenght; i++) {   updateGui();}</code></pre><p>But at one point the exec() method is called for second time, and the gui is updated with the previous results too (I need only the results from the new (2nd) request).</p><p>I know there is way to do this with FutureTask and play with cancel() or with Thread's 'throw ThreadDead' exception, but I am just curious if I can do it the same way I started in the first place.</p><p>thanks!</p>","584513","","","","","2011-01-31 10:45:11","Android cancel Thread","<java><android><multithreading><asynchronous>","2","2","0","",""
"4843764","1","4866204","","2011-01-30 15:45:48","3","1666","<p>Hopefully someone can clarify this to me...I am working on a simple video player app that plays video clip stored on phone.</p><p>All examples I've seen fetch video using MediaStore.Video.Media.EXTERNAL_CONTENT_URI content Uri, something like that</p><pre><code>cursor = resolver.query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, cols, whereClause, null, sortOrder);</code></pre><p>But won't it limit the list to only files stored on SD card?</p><p>Newer android phones has significant amount of internal memory - for example, Samsung Galaxy S typically comes with 16Gb on internal memory and 2Gb sd card.</p><p>Should I scan mediastore twice with external content uri and internal one? </p><p>Again I saw like 10 examples for audio and video players and all of them use external only.</p><p>Even <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Music.git;a=blob;f=src/com/android/music/VideoBrowserActivity.java;h=e8aaf7480bfe5c5a72343e66b516921045b804fc;hb=refs/heads/froyo-release"" rel=""nofollow"">checked source code for the stock music player</a> and it also pulls only from external card. </p>","473725","","","","","2011-02-01 18:01:18","internal vs external uri on fetching data from mediastore","<android><external><internal><mediastore>","2","0","","",""
"4843770","1","4844469","","2011-01-30 15:46:44","3","659","<p>I have app A which is free. I have app B which is a donation app. I know people rather pay 4 bucks for coffee and get my app for free via other channels but oh well.</p><p>I want to enable more features in app A if app B is legit and from the market and paid for.</p><p>So I was curious if I just change the package name in the Market License code in order to check for app B even though app A is executing it.</p><p>For example, this line is from the lvl library code:</p><pre><code>mChecker = new LicenseChecker(ctx, new ServerManagedPolicy(ctx,new AESObfuscator(SALT, ctx.getPackageName(), deviceId)),BASE64_PUBLIC_KEY);</code></pre><p>I would like to replace ctx.getPackageName() with the package name from app B, which of course is my app and I know. For example:</p><pre><code>mChecker = new LicenseChecker(ctx, new ServerManagedPolicy(ctx,new AESObfuscator(SALT, com.something.app.b, deviceId)),BASE64_PUBLIC_KEY);</code></pre><p>Does anyone have experience with this?</p>","491044","","918414","","2012-06-30 02:28:07","2012-06-30 02:28:07","Can I query the Android Market License server from application A in order to see if application B was bought legitimately from the market?","<android><licensing><google-play><android-preferences><android-lvl>","1","1","1","",""
"4843809","1","4844506","","2011-01-30 15:54:19","9","29763","<p>I have an activity that is showing a compass, and I need to know the orientation of the screen to properly rotate the needle. I need to distinguish between 90° and 270° degree rotation to properly handle this.</p><p>When I rotate the screen (on my Nexus S at least) the activity's <code>onCreate</code> gets called, e.g. when I rotate from portrait to landscape mode. When I rotate from one landscape mode to the other with the top edge raised, <code>onCreate()</code> gets called twice (once for portrait orientation and once for the target landscape mode).</p><p>However, when I rotate with the bottom edge up, the screen rotates 180° and <code>onCreate</code> is not getting called. Is there an event that gets fired in this case? </p>","581200","","126353","","2011-01-30 17:14:09","2013-05-27 18:47:30","How do I detect screen rotation","<android><screen-rotation>","5","0","2","",""
"4843842","1","","","2011-01-30 16:00:26","1","571","<p>I wrote an Android application with a UI based on the tab host, consisting of 3 tabs. Each tab consists of some UI elements, mainly text &amp; image views.</p><p>The problem I'm experiencing is as follows:When running the application the first time it works fine.If I don't switch tabs, just click the ""back"" button to close the application and then run it again it works fine.If I switch to a different tab &amp; back to the first one, and then click ""back"" to close the application - when I run it again the first tab view appears corrupted. Meaning, one of the images I'm using as a background of the view doesn't appear and instead I get a few gray horizontal lines with a black background along the whole view. All other tabs' views (that use the same image as background btw) appear fine. All following executions of the application remain corrupted.</p><p>This is also an inconsistent behavior, and not related to the specific background image I'm using (it still happens even when I remove it completely from the application).Another thing I've tried is to switch between the first (problematic) tab view and the second one. When I did that the problem did not repeat itself.</p><p>It smells to me like a problem in the code generation of the R.java file, but I have no idea what's wrong.</p><p>Does anyone have any idea what's the problem and how to solve it?</p><p>Thanks.</p><p>This is the XML of the main tab activity:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    xmlns:myapp=""http://schemas.android.com/apk/res/com.mycompany.myapp""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_gravity=""center""    android:background=""@drawable/main_bg""&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_weight=""1""/&gt;&lt;/LinearLayout&gt;</code></pre><p>This is the XML of the corrupted view:</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:gravity=""center_horizontal""&gt;       &lt;TextView    android:id=""@+id/TextTitle""    android:text=""@string/title""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_gravity=""center_horizontal""    android:paddingTop=""5sp""    android:paddingBottom=""5sp""    android:textColor=""@color/pink""    android:textStyle=""bold""    android:textSize=""18sp""    /&gt;          &lt;ImageView    android:src=""@drawable/silver_line""    android:scaleType=""fitXY""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    /&gt;    &lt;FrameLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;        &lt;ImageView        android:src=""@drawable/star_bg""        android:scaleType=""fitCenter""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_gravity=""center_horizontal""        /&gt;        &lt;ImageView        android:src=""@drawable/pink_lights""        android:scaleType=""fitXY""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        /&gt;        &lt;LinearLayout            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_gravity=""center_horizontal""            android:gravity=""center_horizontal""            android:background=""@color/transparent""&gt;               &lt;FrameLayout                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""&gt;                &lt;LinearLayout                    android:id=""@+id/LayoutSelectImage""                    android:orientation=""vertical""                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                    android:gravity=""center_horizontal""&gt;                           &lt;TextView                    android:text=""@string/select_image""                    android:id=""@+id/TextSelectImage""                        android:layout_width=""wrap_content""                    android:layout_height=""fill_parent""                    android:minHeight=""28sp""                    android:textColor=""@color/white""                    android:textSize=""19sp""                    /&gt;                          &lt;LinearLayout                        android:orientation=""horizontal""                        android:layout_width=""wrap_content""                        android:layout_height=""fill_parent""                        android:layout_marginTop=""10sp""                        android:gravity=""center_vertical""&gt;                             &lt;LinearLayout                            android:orientation=""vertical""                            android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                            android:layout_marginRight=""20sp""                            android:gravity=""center_horizontal""&gt;                                   &lt;ImageView                            android:id=""@+id/ImageCamera""                        android:src=""@drawable/icon_camera_reg""                            android:scaleType=""centerInside""                            android:layout_width=""wrap_content""                            android:layout_height=""fill_parent""                            /&gt;                            &lt;TextView                            android:text=""@string/camera""                            android:id=""@+id/TextCamera""                            android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                            android:textColor=""@color/gray""                            android:textStyle=""bold""                            android:textSize=""13sp""                            /&gt;                              &lt;/LinearLayout&gt;                        &lt;LinearLayout                            android:orientation=""vertical""                            android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                            android:layout_marginLeft=""20sp""                            android:gravity=""center_horizontal""&gt;                                   &lt;ImageView                            android:id=""@+id/ImageGallery""                        android:src=""@drawable/icon_gallery_reg""                            android:scaleType=""centerInside""                            android:layout_width=""wrap_content""                            android:layout_height=""fill_parent""                            /&gt;                            &lt;TextView                                               android:text=""@string/gallery""                            android:id=""@+id/TextGallery""                            android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                            android:textColor=""@color/gray""                            android:textStyle=""bold""                            android:textSize=""13sp""                                             /&gt;                              &lt;/LinearLayout&gt;                    &lt;/LinearLayout&gt;                &lt;/LinearLayout&gt;                &lt;LinearLayout                    android:id=""@+id/LayoutSelectGender""                    android:orientation=""vertical""                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                    android:gravity=""center_horizontal""                    android:visibility=""gone""&gt;                         &lt;TextView                    android:text=""@string/select_gender""                    android:id=""@+id/TextSelectGender""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:minHeight=""28sp""                    android:textColor=""@color/white""                    android:textSize=""19sp""                    /&gt;                          &lt;!--android:layout_weight=""10""--&gt;                    &lt;LinearLayout                        android:orientation=""horizontal""                        android:layout_width=""wrap_content""                        android:layout_height=""wrap_content""                        android:layout_marginTop=""10sp""                        android:gravity=""center_vertical""&gt;                             &lt;!--android:layout_weight=""60""--&gt;                        &lt;LinearLayout                            android:orientation=""vertical""                            android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                            android:layout_marginRight=""20sp""                            android:gravity=""center_horizontal""&gt;                                   &lt;ImageView                            android:id=""@+id/ImageFemale""                        android:src=""@drawable/icon_female_reg""                            android:scaleType=""centerInside""                            android:layout_width=""wrap_content""                            android:layout_height=""fill_parent""                            /&gt;                            &lt;TextView                            android:text=""@string/female""                            android:id=""@+id/TextFemale""                            android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                            android:textColor=""@color/gray""                            android:textStyle=""bold""                            android:textSize=""13sp""                            /&gt;                              &lt;/LinearLayout&gt;                        &lt;LinearLayout                            android:orientation=""vertical""                            android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                            android:layout_marginLeft=""20sp""                            android:gravity=""center_horizontal""&gt;                                   &lt;ImageView                            android:id=""@+id/ImageMale""                        android:src=""@drawable/icon_male_reg""                            android:scaleType=""centerInside""                            android:layout_width=""wrap_content""                            android:layout_height=""fill_parent""                            /&gt;                            &lt;TextView                            android:text=""@string/male""                            android:id=""@+id/TextMale""                            android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                            android:textColor=""@color/gray""                            android:textStyle=""bold""                            android:textSize=""13sp""                            /&gt;                              &lt;/LinearLayout&gt;                    &lt;/LinearLayout&gt;                    &lt;ImageView                    android:id=""@+id/ImageSelected""                    android:background=""@drawable/frame_pink_large""                    android:scaleType=""centerCrop""                    android:layout_width=""wrap_content""                    android:layout_height=""0px""                    android:layout_weight=""1""                    android:layout_margin=""7sp""                    android:padding=""6px""                    /&gt;                &lt;/LinearLayout&gt;                &lt;LinearLayout                    android:id=""@+id/LayoutLoading""                    android:orientation=""vertical""                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                    android:gravity=""center_horizontal""                    android:visibility=""gone""&gt;                         &lt;TextView                    android:text=""@string/loading""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:minHeight=""28sp""                    android:textColor=""@color/white""                    android:textSize=""19sp""                    /&gt;                          &lt;ImageView                    android:id=""@+id/ImageLoading""                    android:scaleType=""center""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_marginTop=""15sp""                    android:layout_marginBottom=""25sp""                    /&gt;                    &lt;ImageView                    android:id=""@+id/ImageSelected2""                    android:background=""@drawable/frame_pink_large""                    android:scaleType=""centerCrop""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_weight=""1""                    android:layout_margin=""7sp""                    android:padding=""6px""                    /&gt;                &lt;/LinearLayout&gt;                &lt;LinearLayout                    android:id=""@+id/LayoutShow""                    android:orientation=""vertical""                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                    android:gravity=""center_horizontal""                    android:visibility=""gone""&gt;                         &lt;AbsoluteLayout                        android:layout_width=""fill_parent""                        android:layout_height=""wrap_content""                        android:layout_marginBottom=""3sp""&gt;                        &lt;ImageView                        android:id=""@+id/ImageStripLeft""                        android:src=""@drawable/strip_left""                        android:scaleType=""fitCenter""                        android:layout_width=""wrap_content""                        android:layout_height=""wrap_content""                        /&gt;                                              &lt;LinearLayout                            android:id=""@+id/LayoutOriginal""                            android:orientation=""vertical""                            android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                            android:gravity=""center_horizontal""&gt;                            &lt;TextView                            android:text=""@string/original""                            android:layout_width=""fill_parent""                            android:layout_height=""wrap_content""                            android:layout_marginTop=""6sp""                                      android:layout_marginBottom=""3sp""                            android:gravity=""center""                            android:textColor=""@color/white""                            android:textStyle=""bold""                            android:textSize=""14sp""                            android:shadowColor=""@color/black""                            android:shadowDy=""1.2""                            android:shadowRadius=""1""                            /&gt;                                  &lt;ImageView                            android:id=""@+id/ImageOriginal""                    android:background=""@drawable/frame_gray_large""                            android:scaleType=""fitXY""                            android:layout_width=""fill_parent""                            android:layout_height=""wrap_content""                            android:layout_margin=""10sp""                            android:padding=""6px""                            /&gt;                        &lt;/LinearLayout&gt;                        &lt;LinearLayout                            android:id=""@+id/LayoutOther""                            android:orientation=""vertical""                            android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                            android:gravity=""center_horizontal""&gt;                            &lt;TextView                            android:text=""@string/other""                            android:layout_width=""fill_parent""                            android:layout_height=""wrap_content""                            android:layout_marginTop=""6sp""                                      android:layout_marginBottom=""3sp""                            android:gravity=""center""                            android:textColor=""@color/white""                            android:textStyle=""bold""                            android:textSize=""14sp""                            android:shadowColor=""@color/black""                            android:shadowDy=""1.2""                            android:shadowRadius=""1""                            /&gt;                                  &lt;ImageView                            android:id=""@+id/ImageOther""                    android:background=""@drawable/frame_pink_large""                            android:scaleType=""fitCenter""                            android:layout_width=""fill_parent""                            android:layout_height=""wrap_content""                            android:layout_margin=""10sp""                            android:padding=""6px""                            /&gt;                        &lt;/LinearLayout&gt;                        &lt;ImageView                        android:id=""@+id/ImageStripRight""                        android:src=""@drawable/strip_right""                        android:scaleType=""fitCenter""                        android:layout_width=""wrap_content""                        android:layout_height=""wrap_content""                        /&gt;                        &lt;TextView                        android:id=""@+id/TextPercentage""                        android:layout_width=""wrap_content""                        android:layout_height=""wrap_content""                        android:gravity=""center_horizontal|top""                        android:background=""@drawable/strip_center""                        android:paddingTop=""2sp""                        android:textColor=""@color/pink""                        android:textStyle=""bold""                        android:textSize=""26sp""                        android:shadowColor=""@color/white""                        android:shadowDy=""1.2""                        android:shadowRadius=""1""                        /&gt;                    &lt;/AbsoluteLayout&gt;                    &lt;TextView                    android:id=""@+id/TextOther""                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                    android:gravity=""center""                    android:textColor=""@color/pink""                    android:textStyle=""bold""                    android:textSize=""16sp""                    /&gt;                          &lt;ImageView                    android:id=""@+id/ImageShare""                    android:src=""@drawable/icon_share_reg""                    android:scaleType=""centerInside""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:layout_gravity=""center_horizontal""                    android:layout_margin=""10sp""                    /&gt;                    &lt;FrameLayout                        android:layout_width=""fill_parent""                        android:layout_height=""wrap_content""&gt;                        &lt;ImageView                        android:id=""@+id/ImageResultsBackground""                        android:src=""@drawable/results_bg""                        android:scaleType=""fitXY""                        android:layout_width=""fill_parent""                        android:layout_height=""wrap_content""                        /&gt;                        &lt;TextView                        android:text=""@string/more_results""                        android:layout_width=""fill_parent""                        android:layout_height=""wrap_content""                        android:layout_gravity=""center_horizontal""                        android:layout_marginTop=""15sp""                        android:gravity=""center""                        android:textColor=""@color/white""                        android:textSize=""16sp""                        android:visibility=""gone""                        /&gt;                              &lt;com.mycompany.myapp.Results.ResultsGallery                        android:id=""@+id/Gallery""                        android:layout_width=""fill_parent""                        android:layout_height=""wrap_content""                        android:layout_gravity=""bottom""                        android:spacing=""20sp""                        /&gt;                    &lt;/FrameLayout&gt;                &lt;/LinearLayout&gt;            &lt;/FrameLayout&gt;        &lt;/LinearLayout&gt;    &lt;/FrameLayout&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>EDIT:</strong> Soooo weird! The solution was to remove the two places in the corrupted view XML where I defined a background of ""@color/transparent"" where ""transparent"" is a color resource of value ""#00000000"".</p><p>My question now is - why???</p><p>This is the proper view:<a href=""http://imgur.com/dEz1G"" rel=""nofollow"" title=""Hosted by imgur.com"">http://imgur.com/dEz1G.jpg</a></p><p>And this is the corrupted one:<a href=""http://imgur.com/CF25i"" rel=""nofollow"" title=""Hosted by imgur.com"">http://imgur.com/CF25i.jpg</a></p>","595896","","497828","","2013-07-09 11:26:02","2013-12-11 08:31:24","Android application reloading with corrupted UI","<android><user-interface><android-tabhost><corruption>","1","6","","",""
"4843865","1","","","2011-01-30 16:05:32","2","2094","<p>I have a spinner in my Android app, that allows users to select countries. The spinner shows the ISO2 code of the selected country when folded. Here an example:</p><p><img src=""http://i.stack.imgur.com/NCQNh.png"" alt=""Capture 1""></p><p>Once the user opens the selection pop-up list, I want to display a more extensive text for each item. So instead of displaying just ""AT"", the item should read ""AT - Austria"" as shown in the following screen-shot.</p><p><img src=""http://i.stack.imgur.com/qTelg.png"" alt=""Capture 2""></p><p>Any ideas how I could achieve this?</p>","400334","","244296","","2011-01-30 16:08:58","2011-01-30 16:19:23","Spinner - different item text in pop-up/list view","<android><spinner>","1","0","","2014-03-25 12:10:43",""
"4844013","1","4844139","","2011-01-30 16:33:28","4","1657","<p>I am doing some simple SAXParsing with SAXParser etc on android/java</p><p>It can parse files properly, but hiccups when it encounters some special characters, for example if it parses this xml below:</p><pre><code>&lt;?xml version=""1.0"" encoding=""ISO-8859-1"" ?&gt;&lt;MTRXML version=""1.0""&gt;&lt;GEOCODE key=""pohj""&gt;&lt;LOC name1=""Pohjantori"" number="""" city=""Espoo"" code=""995"" address="""" type=""1"" category=""poi"" x=""2544225"" y=""6674893"" lon=""24.79378"" lat=""60.18324"" /&gt;&lt;LOC name1=""Pohjois-Haaga"" number="""" city=""Helsinki"" code=""41"" address="""" type=""1"" category=""poi"" x=""2549164"" y=""6680186"" lon=""24.88405"" lat=""60.23018"" /&gt;&lt;LOC name1=""Pohjois-Leppävaara"" number="""" city=""Espoo"" code=""50"" address="""" type=""1"" category=""poi"" x=""2545057"" y=""6679240"" lon=""24.80974"" lat=""60.22216"" /&gt;</code></pre><p>it will hiccup when it encounters ä in Pohjois-Leppävaara in the last line.</p><p>The error it gives is:</p><pre><code>01-30 18:14:52.039: WARN/System.err(686): org.apache.harmony.xml.ExpatParser$ParseException: At line 5, column 24: not well-formed (invalid token)</code></pre><p>I am sure SAXParser can handle those characters, but I believe I need to set some encoding etc somewhere ?</p><p>the Java code is so:</p><pre><code>AXParserFactory factory = SAXParserFactory.newInstance();    SAXParser parser = null;    try {        parser = factory.newSAXParser();    } catch (ParserConfigurationException e) {        e.printStackTrace();        return null;    } catch (SAXException e) {        e.printStackTrace();        return null;    }    XmlHandler handler = new XmlHandler();    try {        parser.parse(urls[0], handler);    } catch (SAXException e) {        e.printStackTrace();        return null;    } catch (IOException e) {        e.printStackTrace();        return null;    }</code></pre>","35065","","","","","2012-08-30 08:07:42","SAXParser fails to parse some characters","<java><android><xml><saxparser><saxparseexception>","2","0","","",""
"4844020","1","","","2011-01-30 16:34:43","0","334","<p>i am fairly new to android programming and usually find my answers to my problems by searching, but this one i just cant and its very confusing.    The code itself doesn't show any signs of problems, well i do get 2 java exception breakpoints but i dont know how to fix those as they are ""unknown""but when i run it on the emulator it says the application has stopped unexpectedly force close. I try to debug it but i dont know how to do it that well. any way here are the codes btw the app is just a test all it to do is have buttons that take me to other ""pages"" and back.  I would appreciate any help.</p><p>Main java file</p><pre><code>package com.simbestia.original;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;public class original extends Activity implements View.OnClickListener {    Button button1, button2;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        button1 = (Button) findViewById(R.id.pagetwo);        button2 = (Button) findViewById(R.id.main);        button1.setOnClickListener(this);        button2.setOnClickListener(this);    }    @Override    public void onClick(View v) {        switch (v.getId()) {        case R.id.pagetwo:            setContentView(R.layout.pagetwo);            break;        case R.id.main:            setContentView(R.layout.main);            break;        }    }}</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;Button android:text=""pagetwo"" android:id=""@+id/pagetwo""              android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>Well here is what i change the code to this one is just one button but it works with multiple and i made a class for every page...</p><pre><code>package com.simbestia.test;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;public class main extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button mainmenu = (Button) findViewById(R.id.mainmenu);    mainmenu.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {            Intent myIntent = new Intent(view.getContext(),  mainmenu.class);            startActivityForResult(myIntent, 0);        }    });}</code></pre><p>}</p><p>Works how i wanted to so its all good i guess ty again</p>","595918","","595918","","2011-01-31 23:48:29","2011-01-31 23:48:29","Application not working, beginner","<java><android>","3","5","","",""
"4844021","1","4943806","","2011-01-30 16:34:57","0","536","<p>Hey there, i'm dealing with resources issue for a while and i cannot figure it out. The thing is that my resources(shapes, gradients, layouts) don't load up in application like they should.  For instance: </p><p>My ""layout.xml"" file (main layout for activity)</p><pre><code>&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/favourite_rest""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:background=""@drawable/activ_favourite_bck""    android:layout_height=""wrap_content""    android:layout_weight=""1""&gt;            ...</code></pre><p>And layout for background: ""activ_favourite_bck.xml""</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;shapexmlns:android=""http://schemas.android.com/apk/res/android""android:shape=""rectangle""&gt;&lt;gradient    android:startColor=""#55555555""    android:centerColor=""#77777777""    android:centerY=""0.5""    android:endColor=""#55555555""    android:angle=""270"" /&gt;  &lt;/shape&gt;</code></pre><p>In this case when i run my application, brackground is pure black like no background is set, but when i rename the file with background definition from activ_favourite_bck.xml to ""halabala.xml"" ( with changing reference in main layout android:background=""@drawable/halabala"") the background is there and everything is working fine. But i don't want to name my resources like retard so it works. I want to name them by they purpuse so later when i have more of them there is no mess. I know there is naming convention that resource filename can contain only small characters with ""_"" and that's what i'm fallowing.</p><p>Note: the file is recognized by IDE, there are no errors during building and i can reference file from code.</p><p>I'm woring with android 1.6 api, but i tried changing to 2.0, 2.2.. with no success. I also tried various phone types and emulator and i tried changing IDE from eclipse to IDEA and nothing helps. I tried rebuilding project, refreshing everything that can be refreshed:) i tried to wipe the application from devices with no effect.  Is anybody facing similar issue like me? </p><p>Btw. the same thing is going on when i put some picture(png) in drawable folder and i'm referencing it from xml. Some pictures are recognized (and shown in running application) and some not( they are recognized only after renaming to sometning else).</p>","595919","","","","","2011-02-09 10:47:53","Android resources not loading","<android><resources>","2","2","","",""
"4844031","1","","","2011-01-30 16:36:10","8","9955","<p>AlertDialog from within BroadcastReceiver? Can it be done?  I am working on a app that will pop up a Dialog box if I get SMS message.  I am trying to code this within a BroadcaseReceiver. But I cant use this line of code <code>AlertDialog.Builder builder = new AlertDialog.Builder(this);</code>.  Can someone please help me with a hint!</p><pre><code>public class SMSPopUpReceiver extends BroadcastReceiver {    private static final String LOG_TAG = ""SMSReceiver"";    public static final int NOTIFICATION_ID_RECEIVED = 0x1221;    static final String ACTION = ""android.provider.Telephony.SMS_RECEIVED"";    public void onReceive(Context context, Intent intent) {        Log.i(LOG_TAG, ""onReceive"");        if (intent.getAction().equals(SMSPopUpReceiver.ACTION)) {            StringBuilder sb = new StringBuilder();            Bundle bundle = intent.getExtras();            if (bundle != null) {            Object[] pdus = (Object[]) bundle.get(""pdus"");            for (Object pdu : pdus){                    SmsMessage messages =            SmsMessage.createFromPdu((byte[]) pdu);            sb.append(""Received SMS\nFrom: "");            sb.append(messages.getDisplayOriginatingAddress());            sb.append(""\n----Message----\n"");            sb.append( messages.getDisplayMessageBody());            }            }            Log.i(SMSPopUpReceiver.LOG_TAG,            ""[SMSApp] onReceiveIntent: "" + sb);            Toast.makeText            (context, sb.toString(), Toast.LENGTH_LONG).show();            }        AlertDialog.Builder builder = new AlertDialog.Builder(this);        builder.setMessage(""Are you sure you want to exit?"")               .setCancelable(false)               .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {                   public void onClick(DialogInterface dialog, int id) {                       dialog.cancel();                   }               })               .setNegativeButton(""No"", new DialogInterface.OnClickListener() {                   public void onClick(DialogInterface dialog, int id) {                        dialog.cancel();                   }               });        AlertDialog alert = builder.create();    }}</code></pre>","589450","","142162","","2011-01-30 16:39:10","2013-12-18 09:39:47","AlertDialog from within BroadcastReceiver?? Can it be done?","<java><android><broadcastreceiver><alertdialog>","5","3","5","",""
"4844037","1","4844226","","2011-01-30 16:37:12","0","909","<p>I'm building an application which players sound using the Media Player class.</p><p>If I use the back button to go to the menu and then reopen the app the music is still playing but if I play another track, the app seems to create a new media player. I can't put a reference saved instance state because it isn't serializble.</p><p>What's the recommended technique for keeping the reference?</p><p>Regards.</p>","4950","","4950","","2011-01-30 16:57:31","2011-01-30 17:23:36","Android: How to keep reference to Media Player?","<android>","2","0","","",""
"4844124","1","4844415","","2011-01-30 16:54:33","0","113","<p>My android application tracks the number of correct answers while the user is in process of taking a quiz. If the user's answer matches the correct answer, a counter to track this is incremented. This logic takes place in the ""onResume"" method. </p><p>The problem is, if the user presses the home button from this activity, then re-enters the application, it resumes at this activity, and the counter gets incremented again. </p><p>The only solution I can think of is to set the correct answer field to a ""magic number"" such as 99 when a correct answer happens, and check for that first before going into the answer-checking logic. If it's 99, then skip the answer-checking logic and just redisplay. </p><p>Is there a better way to do this? </p>","64895","","","","","2011-01-30 17:42:16","Android lifecyle question re: incrementing a counter","<android><lifecycle>","2","0","","",""
"4844128","1","","","2011-01-30 16:55:04","0","377","<p>How to close soft keyboard and have a possibility to determine cursor position by touching place in EditText?</p><pre><code> InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);</code></pre><p>It's hide soft keyboard but i can't set cursor! How solve that problem?</p>","595932","","","","","2011-05-31 18:16:01","How to close soft keyboard and have a possibility to determine cursor position","<android><keyboard><cursor>","1","1","","",""
"4844190","1","4844207","","2011-01-30 17:05:54","1","4040","<p>I have a multiple checkboxes, but I want user to select one checkbox only. I try if-else statement but it is not useable. So, I want to know, how to be like that.</p><p>Thanks</p>","538788","","","","","2013-12-30 03:51:59","Select only one checkbox","<android><checkbox>","2","1","","",""
"4844237","1","4844277","","2011-01-30 17:13:16","2","622","<p>This might be a pretty lame question but i really need to find this out somehow...plz help :)</p><p>OK, so i was trying to make a menu in an application that has a single item. Clicking this menu item takes you to another activity. So basically im starting a sub-activity on having that menu item clicked.</p><p>The problem is here that I have to specify my intent in the <code>onCreate()</code> method of my main activity, but I need this intent in my <code>onOptionItemSelected()</code> method which is outside the <code>onCreate()</code> method. How do i do this?My onCreate() method:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    Intent myIntent=new Intent(mainActivity.this,secondActivityt.class);} </code></pre><p>My onOptionsItemSelected() method:</p><pre><code>public boolean onOptionsItemSelected(MenuItem item){   if(item.getItemId()==R.id.aboutbtn){      startActivity(myIntent);}</code></pre><p>So here im unable to access <code>myIntent</code>. Is there anyway i can declare the intent outside the <code>onCreate</code> method and still make the program work, or anyway i can access the intent outside the <code>onCreate</code> method?plz help :)</p>","595947","","50109","","2011-01-30 17:22:22","2011-01-30 17:23:27","Creating a public intent in Android","<android><android-intent><android-menu>","1","0","","",""
"4844297","1","","","2011-01-30 17:21:30","0","1098","<p>For my application I have access the data stored in emulator i.e. contacts, messages, images etc. I have to access this data in binary format and store it in to the array. Is there any method to access the emulators data in the above format? Which API's can I use to access this data. I don't have to use content provider. </p>","559076","","3041194","","2013-12-20 06:52:12","2013-12-20 06:52:12","how to access the data stored in android emulator.?","<android>","1","0","","",""
"4844426","1","4844504","","2011-01-30 17:44:48","1","607","<p>I need to match Twitter-Hashtags within an Android-App, but my code doesn't seem to do what it's supposed to.What I came up with is:</p><pre><code>ArrayList&lt;String&gt; tags = new ArrayList&lt;String&gt;(0);Pattern p = Pattern.compile(""\b#[a-z]+"", Pattern.CASE_INSENSITIVE);Matcher m = p.matcher(tweet); // tweet contains the tweet as a Stringwhile(m.find()){    tags.add(m.group());}</code></pre><p>The variable tweet contains a regular tweet including hashtags - but find() doesn't trigger. So I guess my regular expression is wrong.</p>","595967","","327466","","2011-08-01 16:52:44","2011-08-01 16:52:44","What's wrong with this regex?","<java><android><regex>","2","0","","",""
"4844515","1","","","2011-01-30 18:00:55","2","186","<p>I use an Android app called EasySMS a lot- it's basically a web interface to your phone's SMS system. You can read, send, etc. from your desktop browser. There are two things about it that bug me:</p><ol><li>The interface is pretty terrible. I'm a web developer by trade, so I'd love to be able to improve on it.</li><li>It isn't open source. It used to be (on <a href=""http://code.google.com/p/androideasysms/"" rel=""nofollow"">Google Code</a>, and the old source is in SVN with an Eclipse Public License), and it's the only app I've given permission to read my inbox... not to sound too paranoid, but I want make sure I know what it's doing.</li></ol><p>Now, I'm keen to get into Android development, and this seems like a great project for me- get to grips with Android while using my web development skills to polish the front-end interface. But what is the legality surrounding this code? The developer has specifically closed the source (he was asked why <a href=""https://bitbucket.org/easysms/easysms/issue/29/open-source"" rel=""nofollow"">here</a>, but he offered no reason), and he charges for a 'pro' version of his app.</p><p>Even with legal issues aside, what is the community's take on this? Just because I can get away with it doesn't mean that I should- I'm curious to know what people think about the idea of me taking code someone else is charging for and developing a separate product (that, for what it's worth, will be open source and free).</p>","470339","","470339","","2011-01-30 18:05:28","2011-01-30 18:06:23","App that went from open to closed source- can I use the old code? Should I?","<android><open-source><licensing><law>","2","0","","2013-02-13 13:51:46",""
"4844569","1","4844678","","2011-01-30 18:11:01","2","4855","<p>Hi i have an android spinner populated from and array that i want to increase the text size of when it actually pops up. See at the moment it looks like this when it expands:</p><p><img src=""http://i.stack.imgur.com/PN7nN.png"" alt=""enter image description here""></p><p>Which on an actual device is impractically small and doesn't look very good. I've tried changing the spinner xml properties But it doesn't seem to make a difference at all.</p><pre><code>&lt;Spinner    android:id=""@+id/frequencyspinner""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:textSize=""18sp""    &gt;</code></pre><p><strong>So how should i be altering the size/ centre of gravity for spinner choices?</strong></p>","523874","","","","","2011-01-30 18:30:22","How can i change text size in an android spinner?","<android><text><view><size><spinner>","1","0","","",""
"4844606","1","","","2011-01-30 18:17:07","0","792","<p>I am an Android developer using VLC(1.1.4) as a VOD server to stream on-demand video to my Android G1(1.5) device. The problem is that my android cannot receive this stream. I try to use a VLC to receive the same stream and it works.</p><p>The more strange thing is that if I use VLC to stream broadcast to my Android it works, while as the VOD streams just doesn't work. Both are in RTSP. Following is the log from VLC server for my Android.</p><blockquote>  <p>[0xa0a4d2c] vod_rtsp vod server debug:  RtspCallback query: type=7 [0xa0a4d2c]  vod_rtsp vod server debug:  RtspCallback query: type=8 [0xa0a4d2c]  vod_rtsp vod server debug:  HTTPD_MSG_SETUP:  transport=RTP/AVP/UDP;unicast;client_port=13438-13439  [0xa0a4d2c] vod_rtsp vod server debug:  HTTPD_MSG_SETUP: unicast  ip=10.217.137.110 port=13438  [0xa0a4d2c] vod_rtsp vod server debug:  new session: 3235830756, connections:  0</p></blockquote><p>If a VLC successfully picks the VOD stream, it looks like this:</p><blockquote>  <p>[0xa0a4d2c] vod_rtsp vod server debug:  RtspCallback query: type=7 [0xa0a4d2c]  vod_rtsp vod server debug:  RtspCallback query: type=8 [0xa0a4d2c]  vod_rtsp vod server debug:  HTTPD_MSG_SETUP:  transport=RTP/AVP;unicast;client_port=60444-60445  [0xa0a4d2c] vod_rtsp vod server debug:  HTTPD_MSG_SETUP: unicast  ip=10.217.137.212 port=60444  [0xa0a4d2c] vod_rtsp vod server debug:  new session: 3309852435, connections:  0 [0xa0a4d2c] vod_rtsp vod server  debug: RtspCallback query: type=8  [0xa0a4d2c] vod_rtsp vod server debug:  HTTPD_MSG_SETUP:  transport=RTP/AVP;unicast;client_port=60446-60447  [0xa0a4d2c] vod_rtsp vod server debug:  HTTPD_MSG_SETUP: unicast  ip=10.217.137.212 port=60446  [0xa0a4d2c] vod_rtsp vod server debug:  RtspCallback query: type=9 [0xa0a4d2c]  vod_rtsp vod server debug:  HTTPD_MSG_PLAY for session: 3309852435  [0xa0a8664] main input debug: Creating  an input for 'toystory3.3gp'  [0xa0a8664] [Media: test] main input  debug: thread (input) created at  priority 10 (input/input.c:214)  [0xa0a8664] [Media: test] main input  debug: thread started [0xa0a8ed4] main  stream output debug: using sout  chain=<code>rtp{dst=10.217.137.212,port-video=60446,port-audio=60444}'  [0xa0a8ed4] [Media: test] main stream  output debug: stream=</code>rtp' [0xa0a79a4]  [Media: test] main stream out debug:  looking for sout stream module: 1  candidate [0xa0a79a4] [Media: test]  main stream out debug: set config  option: sout-rtp-dst to 10.217.137.212  [0xa0a79a4] [Media: test] main stream  out debug: set config option:  sout-rtp-port-video to 60446  [0xa0a79a4] [Media: test] main stream  out debug: set config option:  sout-rtp-port-audio to 60444  [0xa0a79a4] [Media: test] main stream  out debug: using sout stream module  ""stream_out_rtp"" [0xa0a79a4] [Media:  test] main stream out debug: TIMER  module_need() : 0.803 ms - Total 0.803  ms / 1 intvls (Avg 0.803 ms)  [0xa0a8664] [Media: test] main input  debug: using timeshift granularity of  50 MiB [0xa0a8664] [Media: test] main  input debug: using timeshift path  '/tmp' [0xa0a8664] [Media: test] main  input debug:  <code>/home/superuser/Desktop/toystory3.3gp'  gives access</code>' demux <code>' path  </code>/home/superuser/Desktop/toystory3.3gp'  [0xa0a8664] [Media: test] main input  debug: creating demux: access=''  demux=''  path='/home/superuser/Desktop/toystory3.3gp'  [0xa0a7104] [Media: test] main demux  debug: looking for access_demux  module: 9 candidates [0xa0a7104]  [Media: test] main demux debug: no  access_demux module matching ""any""  could be loaded [0xa0a7104] [Media:  test] main demux debug: TIMER  module_need() : 0.114 ms - Total 0.114  ms / 1 intvls (Avg 0.114 ms)  [0xa0a8664] [Media: test] main input  debug: creating access ''  path='/home/superuser/Desktop/toystory3.3gp'  [0xa0a93cc] [Media: test] main access  debug: looking for access module: 7  candidates [0xa0a93cc] [Media: test]  vcd access debug: trying .cue file:  /home/superuser/Desktop/toystory3.cue  [0xa0a93cc] [Media: test] vcd access  debug: could not find .cue file  [0xa0a93cc] [Media: test] filesystem  access debug: opening file  <code>/home/superuser/Desktop/toystory3.3gp'  [0xa0a93cc] [Media: test] main access  debug: using access module  ""filesystem"" [0xa0a93cc] [Media: test]  main access debug: TIMER module_need()  : 0.284 ms - Total 0.284 ms / 1 intvls  (Avg 0.284 ms) [0xa0db3f4] [Media:  test] main stream debug: Using  AStream*Stream [0xa0db3f4] [Media:  test] main stream debug: pre buffering  [0xa0db3f4] [Media: test] main stream  debug: received first data after 0 ms  [0xa0db3f4] [Media: test] main stream  debug: pre-buffering done 1024 bytes  in 0s - 55555 KiB/s [0xa0db59c]  [Media: test] main stream debug:  looking for stream_filter module: 5  candidates [0xa0db59c] [Media: test]  main stream debug: no stream_filter  module matching ""any"" could be loaded  [0xa0db59c] [Media: test] main stream  debug: TIMER module_need() : 0.089 ms  - Total 0.089 ms / 1 intvls (Avg 0.089 ms) [0xa0db59c] [Media: test] main  stream debug: looking for  stream_filter module: 1 candidate  [0xa0db59c] [Media: test] main stream  debug: using stream_filter module  ""stream_filter_record"" [0xa0db59c]  [Media: test] main stream debug: TIMER  module_need() : 0.086 ms - Total 0.086  ms / 1 intvls (Avg 0.086 ms)  [0xa0a8664] [Media: test] main input  debug: creating demux: access=''  demux=''  path='/home/superuser/Desktop/toystory3.3gp'  [0xa0db6f4] [Media: test] main demux  debug: looking for demux module: 52  candidates [0xa0db59c] [Media: test]  mp4 stream debug: found Box: ftyp size  24 [0xa0db59c] [Media: test] mp4  stream debug: found Box: moov size  37653 [0xa0db59c] [Media: test] mp4  stream debug: found Box: mvhd size 108  [0xa0db59c] [Media: test] mp4 stream  debug: read box: ""mvhd"" creation  733734d-54h:47m:13s modification  733734d-54h:47m:13s time scale 600  duration 694977d-48h:00m:01s rate  1.000000 volume 1.000000 next track id 3 [0xa0db59c] [Media: test] mp4 stream  debug: found Box: iods size 21  [0xa0db59c] [Media: test] mp4 stream  warning: unknown box type iods  (incompletely loaded) [0xa0db59c]  [Media: test] mp4 stream debug: found  Box: trak size 14517 [0xa0db59c]  [Media: test] mp4 stream debug: found  Box: tkhd size 92 [0xa0db59c] [Media:  test] mp4 stream debug: read box:  ""tkhd"" creation 733734d-54h:47m:13s  modification 733734d-54h:47m:13s  duration 169958445d-26h:08m:00s track  ID 1 layer 0 volume 1.000000 width  0.000000 height 0.000000 [0xa0db59c] [Media: test] mp4 stream debug: found  Box: mdia size 14417 [0xa0db59c]  [Media: test] mp4 stream debug: found  Box: mdhd size 32 [0xa0db59c] [Media:  test] mp4 stream debug: read box:  ""mdhd"" creation 733734d-54h:47m:13s  modification 733734d-54h:47m:13s time  scale 22050 duration  695015d-04h:45m:52s language und  [0xa0db59c] [Media: test] mp4 stream  debug: found Box: hdlr size 66  [0xa0db59c] [Media: test] mp4 stream  debug: read box: ""hdlr"" handler type  soun name (C) 2007 Google Inc.  v08.13.2007. [0xa0db59c] [Media: test]  mp4 stream debug: found Box: minf size  14311 [0xa0db59c] [Media: test] mp4  stream debug: found Box: smhd size 16  [0xa0db59c] [Media: test] mp4 stream  debug: read box: ""smhd"" balance  0.000000 [0xa0db59c] [Media: test] mp4 stream debug: found Box: dinf size 36  [0xa0db59c] [Media: test] mp4 stream  debug: found Box: dref size 28  [0xa0db59c] [Media: test] mp4 stream  debug: found Box: url size 12  [0xa0db59c] [Media: test] mp4 stream  debug: read box: ""url"" url: (null)  [0xa0db59c] [Media: test] mp4 stream  debug: read box: ""dref"" entry-count 1  [0xa0db59c] [Media: test] mp4 stream  debug: found Box: stbl size 14251  [0xa0db59c] [Media: test] mp4 stream  debug: found Box: stsd size 91  [0xa0db59c] [Media: test] mp4 stream  debug: found Box: mp4a size 75  [0xa0db59c] [Media: test] mp4 stream  debug: read box: ""soun"" mp4 or qt1/2  (rest=39) [0xa0db59c] [Media: test]  mp4 stream debug: found Box: esds size  39 [0xa0db59c] [Media: test] mp4  stream debug: found esds MPEG4ESDescr  (25Bytes) [0xa0db59c] [Media: test]  mp4 stream debug: found esds  MP4DecConfigDescr (17Bytes)  [0xa0db59c] [Media: test] mp4 stream  debug: found esds MP4DecSpecificDescr  (2Bytes) [0xa0db59c] [Media: test] mp4  stream debug: read box: ""soun"" in stsd  channel 1 sample size 16 sample rate  22050.000000 [0xa0db59c] [Media: test] mp4 stream debug: read box: ""stsd""  entry-count 1 [0xa0db59c] [Media:  test] mp4 stream debug: found Box:  stts size 24 [0xa0db59c] [Media: test]  mp4 stream debug: read box: ""stts""  entry-count 1 [0xa0db59c] [Media:  test] mp4 stream debug: found Box:  stsc size 28 [0xa0db59c] [Media: test]  mp4 stream debug: read box: ""stsc""  entry-count 1 [0xa0db59c] [Media:  test] mp4 stream debug: found Box:  stsz size 12912 [0xa0db59c] [Media:  test] mp4 stream debug: read box:  ""stsz"" sample-size 0 sample-count 3223  [0xa0db59c] [Media: test] mp4 stream  debug: found Box: stco size 1188  [0xa0db59c] [Media: test] mp4 stream  debug: read box: ""co64"" entry-count  293 [0xa0db59c] [Media: test] mp4  stream debug: found Box: trak size  22243 [0xa0db59c] [Media: test] mp4  stream debug: found Box: tkhd size 92  [0xa0db59c] [Media: test] mp4 stream  debug: read box: ""tkhd"" creation  733734d-54h:47m:13s modification  733734d-54h:47m:13s duration  171151491d-01h:26m:24s track ID 2  layer 0 volume 0.000000 width  320.000000 height 240.000000 [0xa0db59c] [Media: test] mp4 stream  debug: found Box: mdia size 22143  [0xa0db59c] [Media: test] mp4 stream  debug: found Box: mdhd size 32  [0xa0db59c] [Media: test] mp4 stream  debug: read box: ""mdhd"" creation  733734d-54h:47m:13s modification  733734d-54h:47m:13s time scale 30000  duration 695028d-35h:38m:07s language  und [0xa0db59c] [Media: test] mp4  stream debug: found Box: hdlr size 66  [0xa0db59c] [Media: test] mp4 stream  debug: read box: ""hdlr"" handler type  vide name (C) 2007 Google Inc.  v08.13.2007. [0xa0db59c] [Media: test]  mp4 stream debug: found Box: minf size  22037 [0xa0db59c] [Media: test] mp4  stream debug: found Box: vmhd size 20  [0xa0db59c] [Media: test] mp4 stream  debug: read box: ""vmhd"" graphics-mode  0 opcolor (0, 0, 0) [0xa0db59c]  [Media: test] mp4 stream debug: found  Box: dinf size 36 [0xa0db59c] [Media:  test] mp4 stream debug: found Box:  dref size 28 [0xa0db59c] [Media: test]  mp4 stream debug: found Box: url size  12 [0xa0db59c] [Media: test] mp4  stream debug: read box: ""url"" url:  (null) [0xa0db59c] [Media: test] mp4  stream debug: read box: ""dref""  entry-count 1 [0xa0db59c] [Media:  test] mp4 stream debug: found Box:  stbl size 21973 [0xa0db59c] [Media:  test] mp4 stream debug: found Box:  stsd size 181 [0xa0db59c] [Media:  test] mp4 stream debug: found Box:  mp4v size 165 [0xa0db59c] [Media:  test] mp4 stream debug: found Box:  esds size 79 [0xa0db59c] [Media: test]  mp4 stream debug: found esds  MPEG4ESDescr (65Bytes) [0xa0db59c]  [Media: test] mp4 stream debug: found  esds MP4DecConfigDescr (57Bytes)  [0xa0db59c] [Media: test] mp4 stream  debug: found esds MP4DecSpecificDescr  (42Bytes) [0xa0db59c] [Media: test]  mp4 stream debug: read box: ""vide"" in  stsd 320x240 depth 24 [0xa0db59c]  [Media: test] mp4 stream debug: read  box: ""stsd"" entry-count 1 [0xa0db59c]  [Media: test] mp4 stream debug: found  Box: stts size 168 [0xa0db59c] [Media:  test] mp4 stream debug: read box:  ""stts"" entry-count 19 [0xa0db59c]  [Media: test] mp4 stream debug: found  Box: stss size 468 [0xa0db59c] [Media:  test] mp4 stream debug: read box:  ""stss"" entry-count 113 [0xa0db59c]  [Media: test] mp4 stream debug: found  Box: stsc size 2248 [0xa0db59c]  [Media: test] mp4 stream debug: read  box: ""stsc"" entry-count 186  [0xa0db59c] [Media: test] mp4 stream  debug: found Box: stsz size 17708  [0xa0db59c] [Media: test] mp4 stream  debug: read box: ""stsz"" sample-size 0  sample-count 4422 [0xa0db59c] [Media:  test] mp4 stream debug: found Box:  stco size 1192 [0xa0db59c] [Media:  test] mp4 stream debug: read box:  ""co64"" entry-count 294 [0xa0db59c]  [Media: test] mp4 stream debug: found  Box: udta size 756 [0xa0db59c] [Media:  test] mp4 stream debug: found Box:  meta size 748 [0xa0db59c] [Media:  test] mp4 stream debug: found Box:  hdlr size 33 [0xa0db59c] [Media: test]  mp4 stream debug: read box: ""hdlr""  handler type mdir name  [0xa0db59c]  [Media: test] mp4 stream debug: found  Box: ilst size 703 [0xa0db59c] [Media:  test] mp4 stream debug: found Box:  gsst size 25 [0xa0db59c] [Media: test]  mp4 stream warning: unknown box type  gsst (incompletely loaded) [0xa0db59c]  [Media: test] mp4 stream debug: found  Box: gstd size 30 [0xa0db59c] [Media:  test] mp4 stream warning: unknown box  type gstd (incompletely loaded)  [0xa0db59c] [Media: test] mp4 stream  debug: found Box: gssd size 56  [0xa0db59c] [Media: test] mp4 stream  warning: unknown box type gssd  (incompletely loaded) [0xa0db59c]  [Media: test] mp4 stream debug: found  Box: gspu size 152 [0xa0db59c] [Media:  test] mp4 stream warning: unknown box  type gspu (incompletely loaded)  [0xa0db59c] [Media: test] mp4 stream  debug: found Box: gspm size 152  [0xa0db59c] [Media: test] mp4 stream  warning: unknown box type gspm  (incompletely loaded) [0xa0db59c]  [Media: test] mp4 stream debug: found  Box: gshh size 280 [0xa0db59c] [Media:  test] mp4 stream warning: unknown box  type gshh (incompletely loaded)  [0xa0db59c] [Media: test] mp4 stream  debug: found Box: mdat size 4751946  [0xa0db59c] [Media: test] mp4 stream  debug: skip box: ""mdat"" [0xa0db59c]  [Media: test] mp4 stream debug:  dumping root Box ""root"" [0xa0db59c]  [Media: test] mp4 stream debug: | +  ftyp size 24 [0xa0db59c] [Media: test]  mp4 stream debug: | + moov size 37653  [0xa0db59c] [Media: test] mp4 stream  debug: | | + mvhd size 108 [0xa0db59c]  [Media: test] mp4 stream debug: | | +  iods size 21 [0xa0db59c] [Media: test]  mp4 stream debug: | | + trak size  14517 [0xa0db59c] [Media: test] mp4  stream debug: | | | + tkhd size 92  [0xa0db59c] [Media: test] mp4 stream  debug: | | | + mdia size 14417  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | + mdhd size 32  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | + hdlr size 66  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | + minf size 14311  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | + smhd size 16  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | + dinf size 36  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | + dref size 28  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | | + url size 12  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | + stbl size 14251  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | + stsd size 91  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | | + mp4a size 75  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | | | + esds size 39  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | + stts size 24  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | + stsc size 28  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | + stsz size 12912  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | + stco size 1188  [0xa0db59c] [Media: test] mp4 stream  debug: | | + trak size 22243  [0xa0db59c] [Media: test] mp4 stream  debug: | | | + tkhd size 92  [0xa0db59c] [Media: test] mp4 stream  debug: | | | + mdia size 22143  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | + mdhd size 32  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | + hdlr size 66  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | + minf size 22037  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | + vmhd size 20  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | + dinf size 36  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | + dref size 28  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | | + url size 12  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | + stbl size 21973  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | + stsd size 181  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | | + mp4v size 165  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | | | + esds size 79  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | + stts size 168  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | + stss size 468  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | + stsc size 2248  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | + stsz size 17708  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | | + stco size 1192  [0xa0db59c] [Media: test] mp4 stream  debug: | | + udta size 756 [0xa0db59c]  [Media: test] mp4 stream debug: | | |  + meta size 748 [0xa0db59c] [Media: test] mp4 stream debug: | | | | + hdlr  size 33 [0xa0db59c] [Media: test] mp4  stream debug: | | | | + ilst size 703  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | + gsst size 25  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | + gstd size 30  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | + gssd size 56  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | + gspu size 152  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | + gspm size 152  [0xa0db59c] [Media: test] mp4 stream  debug: | | | | | + gshh size 280  [0xa0db59c] [Media: test] mp4 stream  debug: | + mdat size 4751946  [0xa0db6f4] [Media: test] mp4 demux  debug: unrecognized major file  specification (mp42). [0xa0db6f4]  [Media: test] mp4 demux debug: found 2  tracks [0xa0db6f4] [Media: test] mp4  demux debug: track[Id 0x1] read 293  chunk [0xa0db6f4] [Media: test] mp4  demux debug: track[Id 0x1] read 3223  samples length:149s [0xa0a8664]  [Media: test] main input debug:  selecting program id=0 [0xa0db6f4]  [Media: test] mp4 demux debug: adding  track[Id 0x1] audio (enable) language  undef [0xa0db6f4] [Media: test] mp4  demux debug: track[Id 0x2] read 294  chunk [0xa0db6f4] [Media: test] mp4  demux debug: track[Id 0x2] read 4422  samples length:149s [0xa0db6f4]  [Media: test] mp4 demux debug: adding  track[Id 0x2] video (enable) language  undef [0xa0db6f4] [Media: test] main  demux debug: using demux module ""mp4""  [0xa0db6f4] [Media: test] main demux  debug: TIMER module_need() : 21.890 ms  - Total 21.890 ms / 1 intvls (Avg 21.890 ms) [0xa0db6f4] [Media: test] mp4 demux warning: control query 14  unimplemented [0xa0da1b4] [Media:  test] main decoder debug: looking for  packetizer module: 21 candidates  [0xa0da1b4] [Media: test]  packetizer_mpeg4audio decoder debug:  running MPEG4 audio packetizer  [0xa0da1b4] [Media: test]  packetizer_mpeg4audio decoder debug:  AAC 22050Hz 1024 samples/frame  [0xa0da1b4] [Media: test] main decoder  debug: using packetizer module  ""packetizer_mpeg4audio"" [0xa0da1b4]  [Media: test] main decoder debug:  TIMER module_need() : 0.131 ms - Total  0.131 ms / 1 intvls (Avg 0.131 ms) [0xa0da1b4] [Media: test] main decoder  debug: thread (decoder) created at  priority 5 (input/decoder.c:301)  [0xa0da1b4] [Media: test] main decoder  debug: thread started [0xa0c183c]  [Media: test] main decoder debug:  looking for packetizer module: 21  candidates [0xa0c183c] [Media: test]  packetizer_mpeg4video decoder debug:  opening with vol size: 42 [0xa0c183c]  [Media: test] main decoder debug:  using packetizer module  ""packetizer_mpeg4video"" [0xa0c183c]  [Media: test] main decoder debug:  TIMER module_need() : 0.107 ms - Total  0.107 ms / 1 intvls (Avg 0.107 ms) [0xa0c183c] [Media: test] main decoder  debug: thread (decoder) created at  priority 0 (input/decoder.c:301)  [0xa0c183c] [Media: test] main decoder  debug: thread started [0xa0a8664]  [Media: test] main input debug:  starting in async mode [0xa0c212c]  [Media: test] main demux meta debug:  looking for meta reader module: 2  candidates [0xa0c212c] [Media: test]  lua demux meta debug: Trying Lua  scripts in  /home/superuser/.local/share/vlc/lua/meta/reader  [0xa0c212c] [Media: test] lua demux  meta debug: Trying Lua scripts in  /usr/lib/vlc/lua/meta/reader  [0xa0c212c] [Media: test] lua demux  meta debug: Trying Lua playlist script  /usr/lib/vlc/lua/meta/reader/filename.luac  [0xa0c212c] [Media: test] lua demux  meta debug: Trying Lua scripts in  /usr/share/vlc/lua/meta/reader  [0xa0c212c] [Media: test] main demux  meta debug: no meta reader module  matching ""any"" could be loaded  [0xa0c212c] [Media: test] main demux  meta debug: TIMER module_need() :  0.606 ms - Total 0.606 ms / 1 intvls (Avg 0.606 ms) [0xa0a8664] [Media:  test] main input debug:  </code>/home/superuser/Desktop/toystory3.3gp'  successfully opened [0xa0db6f4]  [Media: test] mp4 demux debug:  track[Id 0x1] does not provide Sync  Sample Box (stss) [0xa0db6f4] [Media:  test] mp4 demux debug: track[Id 0x2]  using Sync Sample Box (stss)  [0xa0db6f4] [Media: test] mp4 demux  debug: stts gives 0 --> 0 (sample  number) [0xa0a8664] [Media: test] main  input debug: Buffering 0% [0xa0a8664]  [Media: test] main input debug:  switching to sync mode [0xa0a8ed4]  [Media: test] main stream output  debug: adding a new sout input  (sout_input:0xb75005b8) [0xa0a79a4]  [Media: test] stream_out_rtp stream  out debug: maximum RTP packet size:  1400 bytes [0xa0a79a4] [Media: test]  main stream out debug: net: connecting  to [10.217.137.212]:60444 [0xa0a8664]  [Media: test] main input debug:  Buffering 0% [0xa0a8664] [Media: test]  main input debug: Buffering 33%  [0xa0a8664] [Media: test] main input  debug: Buffering 66% [0xa0a79a4]  [Media: test] main stream out debug:  net: connecting to  [10.217.137.212]:60445 from  [10.217.137.123]:55804 [0xa0a8664]  [Media: test] main input debug:  Buffering 100% [0xa0a8664] [Media:  test] main input debug: Stream  buffering done (400 ms in 0 ms)  [0xa0a8ed4] [Media: test] main stream  output debug: adding a new sout input  (sout_input:0xa0c1728) [0xa0a79a4]  [Media: test] stream_out_rtp stream  out debug: sdp= v=0 o=-  15054668849591018747  15054668849591018747 IN IP4  imsclient-b s=Unnamed i=N/A c=IN IP4  10.217.137.212 t=0 0 a=tool:vlc 1.1.4 a=recvonly a=type:broadcast  a=charset:UTF-8 m=audio 60444 RTP/AVP  96 b=RR:0 a=rtpmap:96  mpeg4-generic/22050 a=fmtp:96  streamtype=5; profile-level-id=15;  mode=AAC-hbr; config=1388;  SizeLength=13; IndexLength=3;  IndexDeltaLength=3; Profile=1;</p>    <p>[0xa0a79a4] [Media: test]  stream_out_rtp stream out debug:  maximum RTP packet size: 1400 bytes  [0xa0a79a4] [Media: test] main stream  out debug: net: connecting to  [10.217.137.212]:60446 [0xa0a79a4]  [Media: test] main stream out debug:  net: connecting to  [10.217.137.212]:60447 from  [10.217.137.123]:33379 [0xa0a79a4]  [Media: test] stream_out_rtp stream  out debug: sdp= v=0 o=-  15054668849601119458  15054668849601119458 IN IP4  imsclient-b s=Unnamed i=N/A c=IN IP4  10.217.137.212 t=0 0 a=tool:vlc 1.1.4 a=recvonly a=type:broadcast  a=charset:UTF-8 m=audio 60444 RTP/AVP  96 b=RR:0 a=rtpmap:96  mpeg4-generic/22050 a=fmtp:96  streamtype=5; profile-level-id=15;  mode=AAC-hbr; config=1388;  SizeLength=13; IndexLength=3;  IndexDeltaLength=3; Profile=1; m=video  60446 RTP/AVP 97 b=RR:0 a=rtpmap:97  MP4V-ES/90000 a=fmtp:97  profile-level-id=3;  config=000001b003000001b50900000100000001200086c5d4bf07d30a041e1463000001b25876694430303339;</p>    <p>[0xa0a8664] [Media: test] main input  debug: Decoder buffering done in 2 ms  [0xa0a4d2c] vod_rtsp vod server debug:  RtspCallback query: type=11</p></blockquote><p>Does anyone know why my Android cannot play the VOD stream? I hope probably someone can help me. Thanks a lot.</p><p>Charlie</p>","513374","","","","","2011-01-30 18:17:07","VoD stream to Android problem","<android><stream><communication><vlc>","0","2","","",""
"4844629","1","4844918","","2011-01-30 18:21:32","3","12490","<p>I'm trying to get change the transition between two activities in an Android application. I found that overridePendingTransition would do the job, but it doesn't seem to work for me.This is the code I'm working with: </p><pre><code>@Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.splash);  ImageView logo = (ImageView) findViewById(R.id.ImageView01);  Animation fade = AnimationUtils.loadAnimation(this, R.anim.fade_in);  fade.setAnimationListener(new AnimationListener() {   @Override   public void onAnimationRepeat(Animation animation) {    // TODO Auto-generated method stub   }   @Override   public void onAnimationStart(Animation animation) {    // TODO Auto-generated method stub   }   @Override   public void onAnimationEnd(Animation animation) {    startActivity(new Intent(FDSplashActivity.this,      FDGameActivity.class));    FDSplashActivity.this.finish();          overridePendingTransition(R.anim.fade_in, R.anim.fade_out);   }  });  logo.startAnimation(fade);}</code></pre><p>It's supposed to show the splash screen, fade in a logo and then switch to another activity. That works, but not the line overridePendingTransition(R.anim.fade_in, R.anim.fade_out);.When I'm hovering it in Eclipse it just says: ""The method overridePendingTransition(int, int) is undefined for the type new Animation.AnimationListener(){}""</p><p>Please help me.</p>","595990","","1023783","","2012-08-08 03:10:28","2012-08-08 03:10:28","overridePendingTransition in Android SDK doesn't work","<android><animation><activity><transition>","1","0","1","",""
"4844666","1","4844878","","2011-01-30 18:27:40","3","1626","<p>I noticed some applications in Android (like Facebook, WhatsApp, Google Maps and ShopSavvy) have a similar title bar with a button or more on the right corner. I know how to implement a custom title bar, there are plenty of examples here on stack overflow, but I feel like there's a library or some kind of pattern to implement them, since their sizes, icons and separators are similar. I already have a custom bar I created myself, but I'd like it looked like these ones. Are these custom bars too? Any help?</p><p><a href=""http://www.gadgetvenue.com/wp-content/uploads/2010/08/Facebook-Android-App-300x300.jpg"" rel=""nofollow"">http://www.gadgetvenue.com/wp-content/uploads/2010/08/Facebook-Android-App-300x300.jpg</a>http://cdn1.staztic.com/screenshots/whatsapp-messenger-97-1.jpg</p>","595881","","","","","2012-02-13 02:09:31","Facebook-like titlebar in Android","<android><android-widget>","3","0","5","",""
"4844681","1","4844975","","2011-01-30 18:31:21","9","23449","<p>Hello I would like to customize the way the default EditText is drawn on the screen, I have this 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 android:shape=""rectangle""&gt;    &lt;solid        android:color=""#00ff00"" /&gt;    &lt;stroke        android:width=""5dp""        android:color=""#ff0000""        android:dashWidth=""3dp""        android:dashGap=""2dp"" /&gt;&lt;/shape&gt;&lt;/item&gt;&lt;item android:state_focused=""true"" &gt;&lt;shape&gt;    &lt;gradient        android:endColor=""#8dc73f""        android:centerColor=""#d4d4d4""        android:startColor=""#d4d4d4""        android:centerX=""0.5""        android:centerY=""0.5""        android:angle=""270"" /&gt;    &lt;stroke        android:width=""1dp""        color=""#8dc73f"" /&gt;    &lt;corners        android:radius=""6dp"" /&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;gradient        android:endColor=""#d4d4d4""        android:centerColor=""#d4d4d4""        android:startColor=""#d4d4d4""        android:angle=""270"" /&gt;     &lt;stroke        android:width=""1dp""        color=""#00ff00"" /&gt;     &lt;corners        android:radius=""7dp"" /&gt;   &lt;/shape&gt;   &lt;/item&gt;  &lt;/selector&gt;</code></pre><p>wich works fine but the problem is that on the focused state I would like to apply the effect round of the EditText and note inside, like the default android effect is applied, is this possible and how because I haven't found a solution, the above code only applies the effect inside the EditText.</p>","234898","","759866","","2014-03-31 09:10:32","2014-03-31 09:10:32","android custom EditText UI","<android>","3","0","8","",""
"4844711","1","5250463","","2011-01-30 18:36:44","2","2128","<p>I'm implementing my own <code>EGLConfigChooser</code> to pass to <code>setEGLConfigChooser()</code> in order to select the best available configuration for the current device according to the needs I have for the application.</p><p>To be more specific I'm querying all the available configurations and selecting the one with the biggest depth buffer size (and between those with the same depth buffer size I want the one with the biggest colour depth), wall of code follows:</p><pre><code> @Override public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {  //Querying number of configurations  int[] num_conf = new int[1];  egl.eglGetConfigs(display, null, 0, num_conf);  //if configuration array is null it still returns the number of configurations  int configurations = num_conf[0];  //Querying actual configurations  EGLConfig[] conf = new EGLConfig[configurations];  egl.eglGetConfigs(display, conf, configurations, num_conf);  EGLConfig result = null;  for(int i = 0; i &lt; configurations; i++)  {   Log.v(""EGLConfigChooser"", ""Configuration #"" + i );   print(egl, display, conf[i]);   result = better(result, conf[i], egl, display);  }  Log.v(""EGLConfigChooser"", ""Chosen EGLConfig:"");  print(egl, display, result);  return result; } /**  * Returns the best of the two EGLConfig passed according to depth and colours  * @param a The first candidate  * @param b The second candidate  * @return The chosen candidate  */ private EGLConfig better(EGLConfig a, EGLConfig b, EGL10 egl, EGLDisplay display) {  if(a == null) return b;  EGLConfig result = null;  int[] value = new int[1];  egl.eglGetConfigAttrib(display, a, EGL10.EGL_DEPTH_SIZE, value);  int depthA = value[0];  egl.eglGetConfigAttrib(display, b, EGL10.EGL_DEPTH_SIZE, value);  int depthB = value[0];  if(depthA &gt; depthB)   result = a;  else if(depthA &lt; depthB)   result = b;  else //if depthA == depthB  {   egl.eglGetConfigAttrib(display, a, EGL10.EGL_RED_SIZE, value);   int redA = value[0];   egl.eglGetConfigAttrib(display, b, EGL10.EGL_RED_SIZE, value);   int redB = value[0];   if(redA &gt; redB)    result = a;   else if(redA &lt; redB)    result = b;   else //if redA == redB   {    //Don't care    result = a;   }  }  return result; }</code></pre><p>(The print method prints EGLConfig values to the Logger)</p><p>Now, it appears to work fine, it selects the following configuration:</p><pre><code>01-30 18:57:04.424: VERBOSE/EGLConfigChooser(1093): Chosen EGLConfig:01-30 18:57:04.424: VERBOSE/EGLConfigChooser(1093): EGL_RED_SIZE  = 801-30 18:57:04.424: VERBOSE/EGLConfigChooser(1093): EGL_BLUE_SIZE  = 801-30 18:57:04.424: VERBOSE/EGLConfigChooser(1093): EGL_GREEN_SIZE  = 801-30 18:57:04.424: VERBOSE/EGLConfigChooser(1093): EGL_ALPHA_SIZE  = 801-30 18:57:04.424: VERBOSE/EGLConfigChooser(1093): EGL_DEPTH_SIZE  = 2401-30 18:57:04.424: VERBOSE/EGLConfigChooser(1093): EGL_ALPHA_FORMAT  = 2401-30 18:57:04.424: VERBOSE/EGLConfigChooser(1093): EGL_ALPHA_MASK_SIZE  = 001-30 18:57:04.424: VERBOSE/EGLConfigChooser(1093): EGL_STENCIL_SIZE  = 8</code></pre><p>The problem is that when this configuration is used the phone screen turns green with purple artifacts (the scene is supposed to be black with a wooden table), it completely hangs and stops responding to any kind of input, all I can do is to terminate my process via the debugger and when I do so the device reboots(?!!).</p><p>How come that <code>eglGetConfigs</code> is returning a configuration which causes this kind of issues? Has anyone of you experienced something similar or can find some kind of flaw in my code? I double checked it but it looks ok to me (it has been inspired by <a href=""http://brandnewreality.com/blog/android-egl-querying-your-gl-driver"" rel=""nofollow"">http://brandnewreality.com/blog/android-egl-querying-your-gl-driver</a> )</p><p>Thanks for your help.</p>","586545","","586545","","2011-01-31 11:16:42","2011-03-09 18:32:59","EGLConfig on HTC Desire, available configuration hangs the device","<android><opengl-es>","1","0","3","",""
"4844779","1","4845623","","2011-01-30 18:48:58","1","457","<p>Is it possible to have a custom class be the drawable supplied to a selector?  The core question really is whether android supports having a drawable xml that references a custom class.</p><p>Here's the selector:</p><pre><code>&lt;selector  xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;item      android:state_pressed=""true""      android:state_window_focused=""true""      android:drawable=""@drawable/intensity_tick_empty"" /&gt;&lt;/selector&gt;</code></pre><p>Here's intensity_tick_empty.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;com.somepackage.android.RatingTick   xmlns:android=""http://schemas.android.com/apk/res/android""   android:layout_width=""20dip""   android:layout_height=""20dip""   android:background=""#CCCCCC"" /&gt;</code></pre><p>RatingTick is my custom class, and it extends View.</p><p>Thanks much! </p>","369722","","","","","2011-01-30 21:21:53","Is it possible to have a custom class be the drawable supplied to a selector?","<android><drawable>","1","0","","",""
"4844806","1","4844938","","2011-01-30 18:56:23","0","2295","<p>I'm using a database to store and read my data, but I am not sure when my database is saved.  I didn't find anything like <code>db.save()</code>, so should I assume that my database is saved when I close it?  Should I close it also in onPause() (for saving my data)?</p>","587377","","321731","","2014-02-14 05:49:28","2014-02-14 05:49:28","Android database save","<android><database><save>","2","0","","",""
"4844831","1","","","2011-01-30 19:03:45","2","192","<p>after I installed the <code>ScreenFilter</code> App, I wondered how it displays a transparent rectangle on top of all applications.</p><p>And now I want to know if it is possible to write an <code>Service</code>, wich put a drawable ontop of the screen, no matter what application is in focus.</p><p>Is there any solution for this?</p>","596012","","881286","","2013-08-18 02:08:59","2013-08-18 02:08:59","Android: How to put a drawable on top of foreign applications?","<android><service><filter><screen><draw>","0","0","","",""
"4844840","1","4844858","","2011-01-30 19:04:49","1","2357","<p>until now i have one AVD, android 1.5 google Apis 3 (because i use googlemaps on my app), to emulate my apps.</p><p>now i need to use a new AVD, android 1.5 but with SD card, and i created it with the AVD manager of eclipse.</p><p>ok, it's created.... but ¿how can i launch my app with that AVD?? i only can launch it with the old AVD, and i dont know how to do the change of AVD.</p><p>if i put Run Configurations, i only can see my old AVD, i can't see any other. Also if i put manual, i only can see my old AVD, not the new. And yes, it's created.</p>","479886","","","","","2011-01-30 19:13:57","How to select with AVD you want use to emulate a Android Phone?","<android><eclipse>","3","0","","",""
"4844930","1","4845526","","2011-01-30 19:21:38","6","11509","<p>I simply want to call methods of a local service from my activity. How can i do that ?</p>","596018","","","","","2013-08-20 17:36:50","How to call methods of a Service from activity?","<android><service><activity>","3","0","","",""
"4844946","1","","","2011-01-30 19:23:37","0","818","<p>I want to copy ONE file ""test.txt"" to the SD card.</p><p>I found tips on how to copy more than one, but they are not working for me...</p><p>The file is in the root of the assets folder ""/test.txt""</p><p>Thanks.</p>","558292","","703019","","2012-03-07 07:38:57","2012-03-07 07:38:57","Copy one file from assets to sd","<android><android-assets>","1","2","","",""
"4845005","1","4849250","","2011-01-30 19:36:43","0","3115","<p>My company uses OpenFire for server-side and smack for client-side in its XMPP Android application.</p><p>AWS seems like a good and scalable service for what we need. We use it for testing our app, but I'm afraid that the server will crash with 20k-50k users.</p><p>I have 2 questions:</p><ol><li>Is AWS good enough for an XMPP (OpenFire) server? What are the pros and cons?  </li><li>How do I build such an application that can handle 20k online users at least, and lets say 2k opened chat rooms?</li><li>Is there any specific tutorial for this kind of stuff? </li></ol><p>Money is not a problem in terms of server costs. Time is what matter for us right now. </p>","178016","","563231","","2013-09-05 21:43:06","2013-09-05 21:43:06","XMPP Server on EC2 Amazon Web Service (AWS)","<android><amazon-web-services><xmpp><openfire>","1","0","","",""
"4845027","1","","","2011-01-30 19:41:32","3","2331","<p>I am using the following code to read contacts and create a vcard file. </p><pre><code>            String lookupKey = cur.getString(cur.getColumnIndex(Contacts.LOOKUP_KEY));            Uri uri=Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_VCARD_URI, lookupKey);            try {                fd = cr.openAssetFileDescriptor(uri, ""r"");            } catch (FileNotFoundException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }                   try {                fis = fd.createInputStream();            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            byte[] buf = new byte[(int)fd.getDeclaredLength()];            try {                if (0 &lt; fis.read(buf))                {                    vCard = new String(buf);                    writer.write(vCard);                    writer.write(""\n"");                }            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }</code></pre><p>But while going through the list of contacts, I get the error:</p><blockquote>  <p>ERROR/MemoryFile(284):  MemoryFile.finalize() called while  ashmem still open.</p></blockquote><p>And my generated .vcf file is missing some contacts and also does not end properly.</p><p>Can someone please tell me what is wrong with my code.</p>","887304","","142162","","2011-01-30 19:55:35","2012-04-10 11:58:58","Creating vCard file programmatically in android","<android>","2","3","1","",""
"4845135","1","4845928","","2011-01-30 19:58:23","3","4670","<p>I am looking for example code sample that shows how to achieve 30 frames per seconds usingAndroid <a href=""http://developer.android.com/reference/android/view/SurfaceView.html"" rel=""nofollow"">SurfaceView</a>? Assume each frame draws a circle starting at position x and y and each frame increments x and y by one.</p><p>Bonus question:On top of above I want to overlay another View to display text content so that whatever graphics is being drawn shows underneath this text content. How this can be done?</p>","574122","","","","","2011-12-14 05:50:26","How to achieve 30 frames per second using Android SurfaceView?","<android><surfaceview>","3","0","","",""
"4845140","1","","","2011-01-30 19:59:59","8","1442","<p>I am creating android app that uses SQLite database. Looking at the SQLiteDatabase class I found that there is a method called <code>insertOrThrow()</code> which is similar to <code>insert()</code> but with one important difference - if insert fails it will throw exception and app will die (if not catched). I am using <code>insertOrThrow()</code> in the initial stage of the development because it draws my attention to SQL errors in a very noticeable way, i.e. app dies.<br>I am just curious: Why is there no <code>updateOrThrow()</code>, <code>deleteOrThrow()</code>, etc... I've tried to google for info but did not found anything...</p>","425183","","","","","2011-03-13 21:10:05","Why is there insertOrThrow but no updateOrThrow or deleteOrThrow?","<android>","1","0","1","",""
"4845201","1","4845625","","2011-01-30 20:10:26","6","10712","<p>I have a very basic situation:</p><p>I have a table with around 5k rows:</p><pre><code>CREATE TABLE ""words"" (""id"" INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL , ""name"" TEXT NOT NULL , ""def"" TEXT NOT NULL, ""rand"" INTEGER)</code></pre><p>Which I periodically update using ""UPDATE words SET rand=random()""</p><p>In android, when I create a cursor using rawQuery() using the following:</p><pre><code>SELECT w.id, w.name, w.def, w.rand FROM words w ORDER BY w.rand ASC;</code></pre><p>The returned cursor does not iterate in the correct order. E.g. it will output columns with rand values in the following order:</p><pre><code>-1298882092-2138143484-1115732861118839193...</code></pre><p>Does anyone know whats going on here? Shouldn't this work? If I run the exact same query in SQLiteManager it returns the results in the correct order, so this seems to be android/cursor specific.</p><p>UPDATE:</p><p>Here is the code in android, I have tried multiple ways:</p><p>Attempt 1:</p><pre><code>Cursor cursor = db.rawQuery(""SELECT w.id, w.name, w.def, w.rand FROM words w ORDER BY w.rand ASC"", new String[]{});</code></pre><p>Attempt 2:</p><pre><code>Cursor cursor = db.query(""words"", new String[]{""id"", ""name"", ""def"", ""rand""},            null, null, null, null, ""rand ASC"");</code></pre><p>In both cases I iterate like the following:</p><pre><code>while(cursor.moveToNext()) {    ...    Log.i(""Test"", cursor.getInt(3));    ...}</code></pre>","80617","","80617","","2011-01-30 20:39:53","2012-06-15 12:56:32","Android SQLite ORDER BY Doesn't Work","<android><sql><sqlite><sqlite3><cursor>","2","5","0","",""
"4845247","1","","","2011-01-30 20:18:11","0","366","<p>On Android devices when you click or long press on an empty area of a home screen, the Add to Home Activity/dialog opens up allowing you to choose from different options to put on the home screen.</p><p>I have a notification that goes off at the status bar, what I want to do is when that notification is clicked I want to open the Add to Home Activity.</p><p>The notification is working fine. </p><p>Is there an activity name.class that I could set as the target of the notification when clicked?</p><p>I checked [http://android.git.kernel.org/?p=platform/packages/apps/Launcher.git;a=blob;f=src/com/android/launcher/Launcher.java#l1042][1]</p><p>[1]: <a href=""http://Android"" rel=""nofollow"">http://Android</a> Open Source Project Code</p><p>I found this there - </p><pre><code>    if (mWorkspace.allowLongPress()) {1747             if (cellInfo.cell == null) {1748                 if (cellInfo.valid) {1749                     // User long pressed on empty space1750                     mWorkspace.setAllowLongPress(false);1751                     showAddDialog(cellInfo);1752                 }1753             } else {1754                 if (!(cellInfo.cell instanceof Folder)) {1755                     // User long pressed on an item1756                     mWorkspace.startDrag(cellInfo);1757                 }1758             }1759         }1760         return true;</code></pre><p>Most Certainly showAddDialog(cellInfo); brings up the Add to Home screen. </p><p>Any ideas on how do I go about implementing this for my requirement above.</p><p>Thanks for any help.</p>","447886","","","","","2012-01-19 05:51:42","How to Call ""Add to Home"" Activity in Android?","<java><android>","1","1","","",""
"4845337","1","4845779","","2011-01-30 20:33:17","3","198","<p>About 2 months ago I was setting up an Android development environment, and noticed a warning on the Android SDK page that stated ""There are known issues with the ADT plugin running with Eclipse 3.6. Please stay on 3.5 until further notice."" - so I posted a question here about this and from the responses decided, to install Eclipse ver 3.5</p><p>I never saw a notice that  it was safe to upgrade, but...<br>- The warning is now missing from the Android SDK page<br>- I thought I read (maybe I'm wrong, because I can't find it now) a comment that some of the Android tutorials were now assuming Eclipse ver 3.6.1 </p><ol><li>Can I assume it is now safe to upgrade to Android 3.6.1 ?</li><li>The Eclipse IDE for Java Developers download page still seems to be at 3.6.0 ?</li></ol><p>Comments Welcome</p>","515453","","","","","2011-01-30 21:53:03","Is it time to upgrare to eclipse to ver 3.6.xxx","<android><eclipse>","4","0","","",""
"4845446","1","4846076","","2011-01-30 20:49:14","0","530","<p>what is the best way to list all services that start with the phone? Is there a SDK class, or should I check some system files manually?</p>","192936","","50109","","2011-01-30 20:52:29","2011-01-30 22:50:28","Android Startup Services/Apps","<android>","1","1","","",""
"4845516","1","4845681","","2011-01-30 21:03:17","0","107","<p>The first time a user loads my Android app I want to go through a few stages of setting up the app.</p><p>Basically I just want a set of dialogs that goes from one step to the next, but I don't know the best way to go about it. </p>","425459","","","","","2011-01-30 21:35:48","Android set of dialogs for setting up app","<android><dialog>","1","1","","",""
"4845579","1","4845890","","2011-01-30 21:13:28","1","2585","<p>Only the button displays, but I want to see the text above the button</p><pre><code>&lt;RelativeLayout  android:id=""@+id/big_button_layout""  android:layout_width=""match_parent""  android:layout_height=""match_parent""  android:visibility=""gone""&gt;  &lt;ImageButton   android:id=""@+id/big_button""   android:layout_width=""match_parent""   android:layout_height=""match_parent""   android:src=""@drawable/girrafffe""/&gt;  &lt;TextView   android:layout_width=""match_parent""   android:layout_height=""match_parent""   android:gravity=""center_horizontal""   android:text=""Hello""   android:layout_above=""@id/big_button""/&gt; &lt;/RelativeLayout&gt;</code></pre>","420259","","420259","","2011-01-30 21:40:57","2011-01-31 18:27:12","How can I display text above a button?","<android>","2","0","","",""
"4845626","1","","","2011-01-30 21:23:18","0","24","<p>Got a funny thing.I have app via several classes in the end shows tabhost screen build dynamic.Tabs are dynamic as are the options below each tab.</p><p>On 2.2 this works perfect</p><p>But the new Honycomb the screen is shown, all tabs are there and options for the active tab are there but that's all no action possible and after some seconds everything disappears and (if it put it in) we are back at start ...</p><p>In my log I do not have any error regards to this. As soon as I let this run 2.2 it is running as wanted but if i try to run it in Honycomb I get this?</p><p>As I stated no errors in log but it seems I have a inactive screen after timeout or some going back.</p><p>It looks like in Honycomb I need something but so far I could not find what I need.</p>","596088","","3041194","","2013-12-20 06:47:41","2013-12-20 06:47:41","Tab gone after seconds shown but no errors (Honycomb)","<android><class><android-tabhost>","1","0","","",""
"4845635","1","","","2011-01-30 21:25:14","0","294","<p>I have an app that displays images in a grid.  I want to be able to have a user long-click an image, and bring up a menu that has an entry called ""Share"".  When they click that, it brings up a list of all the image-capable apps, and the user can select which one they want to use. </p><p>This is very similar to how the HTC Gallery app works on my HTC EVO:</p><p><img src=""http://i.stack.imgur.com/O6zrF.png"" alt=""Share menu from HTC EVO Gallery App""></p><p>I'm guessing (hoping?) there's a way to ask the system ""which apps would be able to do something with an image"", and that list would include the identifiers of apps that have registered to support sharing of images (like the list above).  </p><p>I'm stuck trying to find such an API (or series of API calls) that would accomplish producing the list.  Once that list is produced, launching the other app should be trivial.</p><p>Any thoughts or sample code would be appreciated.</p><p>-Kevin</p>","271177","","","","","2011-01-30 21:25:14","Creating a list of Image ""Share"" targets","<android>","0","3","","",""
"4845710","1","4845760","","2011-01-30 21:40:06","4","2202","<p>I'm just starting with Android programming, and I receive an error in the following code:</p><pre><code>DisplayMetrics dm = new DisplayMetrics();getWindowManager().getDefaultDisplay().getMetrics(dm);</code></pre><p>The first line is fine according to Eclipse.  But in the second line it's telling me that ""getWindowManager""'s return type is missing.  I don't understand this.  When I search the internet on how to use this code, everyone is doing the same thing.  Yet Eclipse is giving me an error.</p>","530546","","535871","","2012-02-16 17:23:54","2012-02-16 17:23:54","Why am I receiving an error when trying to use DisplayMetrics in Android?","<android>","2","0","","",""
"4845745","1","4845800","","2011-01-30 21:48:00","3","2751","<p>Quick question... Does BlackBerry have an equivalent Android WebView Component, or are we forced to use WebWorks?  </p><p>I'm reading the WebWorks documentation today and it looks like you write html/css/javascript directly within Eclipse (which I use).  However, I would rather have my web app powered using jQuery-Mobile and simply pass the URL to a WebView type component.  Does BB not support a feature like this?    </p>","518116","","","","","2011-01-30 21:55:59","What is BlackBerry's equivalent to Androids WebView Component?","<android><web-applications><blackberry><webview>","1","0","3","",""
"4845971","1","4847263","","2011-01-30 22:24:16","0","197","<p>I'm starting work on a game, with the majority of all actions taking place on the 4x3 board in the middle of the screen. </p><p>As far as Android is concerned, what would be the best way to go about implementing said board? I was considering GridView, but that seems to be more focused on being a list of items than an actual board. I need to know the coordinates of pieces on the board, and not every space will always be filled. Can anyone point me in the right direction?</p>","205910","","","","","2011-01-31 03:01:44","Android: What is the best way to go about implementing a board for a game?","<java><android><gridview>","1","0","","",""
"4846031","1","","","2011-01-30 22:35:50","1","589","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/5282936/android-backup-restore-how-to-backup-an-internal-database"">Android backup/restore: how to backup an internal database?</a>  </p></blockquote><p>I'm using androids backupagenthelper to back up my prefrences and that works like a charm.</p><p>I just can not find any exaples of how to backup my app's database to the android backup service.</p>","368598","","810368","","2012-10-29 12:21:48","2012-10-29 12:21:48","How to perform a sqlite backup to android backup service?","<android><backup><android-backup-service>","0","3","","2011-06-13 11:10:08",""
"4846056","1","7681785","","2011-01-30 22:40:04","24","5875","<p>I have an <a href=""http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject"">Android Library Project</a> that contains several styles/themes defined in its styles.xml file.</p><p>Normally, when referencing this style in some other xml layout or manifest file, you would just write <code>android:theme=""@style/TheNameOfTheStyle""</code></p><p>When using a library project, how does the dependent project properly reference that style now?  Just leaving it as <code>android:theme=""@style/TheNameOfTheStyle""</code> gives me an error saying there is no resource found matching that name.</p><p>I guess this same question applies for other references like @string, @color etc.</p><p>Thanks</p><p><strong>Edit:</strong> Ok so it appears that you are suppose to reference it just like normal, but the console in eclipse is giving me this error: </p><blockquote>  <p>Error: No resource found that matches  the given name (at 'theme' with value '@style/ThemeName').</p></blockquote><p><strong>(facepalm) Edit</strong></p><p>I just needed to ""Clean Project"" in Eclipse.  Now it's working.</p>","445348","","445348","","2011-01-30 22:59:44","2013-10-20 00:04:55","When using an Android Library Project how do you reference xml resources properly?","<android><xml><android-library>","4","5","3","",""
"4846080","1","4855652","","2011-01-30 22:44:33","12","9248","<p>I've got a segfault but I have absolutely no idea how to locate it.</p><p>Tips?<img src=""http://i.stack.imgur.com/Jyelh.png"" alt=""enter image description here""></p>","387064","","","","","2011-02-09 08:01:19","How can I effectively debug C code that's wrapped with JNI in Eclipse? (Android Dev)","<java><android><c><jni><android-ndk>","2","3","12","",""
"4846115","1","","","2011-01-30 22:50:24","1","1973","<p>This is a test project for antialias in Surface View and View,</p><p>in the View : ( it's very good for antialias )</p><pre><code>@Overrideprotected void onDraw(Canvas canvas) {    Paint p = new Paint();    p.setColor(Color.WHITE);    canvas.setDrawFilter(new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG|Paint.FILTER_BITMAP_FLAG));      canvas.drawColor(Color.BLACK);    Matrix mMatrix = new Matrix();    mMatrix.postScale(0.34f, 0.34f);    canvas.drawBitmap(mBitmap, mMatrix, p);    canvas.drawText(""View Anti alias"", 100, 300, p);}</code></pre><p>in the Surface View : ( ugly -_-!!)</p><pre><code>public void doDraw(Canvas canvas) {    Paint p = new Paint();    p.setColor(Color.WHITE);    canvas.setDrawFilter(new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG));    canvas.drawColor(Color.BLACK);    Matrix mMatrix = new Matrix();    mMatrix.postScale(0.34f, 0.34f);    canvas.drawBitmap(mBitmap, mMatrix, p);    canvas.drawText(""Surface View Anti alias"", 100, 300, p);}</code></pre><p>u can download the source from here: <a href=""http://sharpidea.co.cc/GifViewTest.rar"" rel=""nofollow"">http://sharpidea.co.cc/GifViewTest.rar</a></p><p>any one can tell me how to anti alias in surfaceView ?</p>","596133","","596133","","2011-01-31 16:49:11","2011-01-31 16:49:11","Can u ? How to anti alias for SurfaceView in android?","<android><antialiasing><surfaceview>","1","1","2","",""
"4846169","1","","","2011-01-30 23:01:39","1","468","<p>Am I correct in assuming that if a phone-UI sound doesn't have a picker in the phones settings, it cannot be changed programmatically?</p><p>For example, ringtones and notifications can be programmatically set, but camera-click sound, audible touch tone sounds, audible selection sound cannot be.  </p>","589879","","","","","2011-01-30 23:01:39","programmatically setting phone-UI sounds","<android><user-interface><audio>","0","0","","",""
"4846176","1","","","2011-01-30 23:02:52","1","1494","<p>I'm using a custom SimpleCursorAdapter. Currently my list stays empty, if no entries can be found in the database/cursor. Now, I want to display a message within the list, if there are no entries within the cursor/database. How can I handle this event? </p>","566904","","","","","2012-02-15 16:19:29","SimpleCursorAdapter handling empty cursor","<android><simplecursoradapter>","2","0","1","",""
"4846211","1","","","2011-01-30 23:10:22","0","379","<p>I would like to create a menu layout for my application. It should look like half-circle starting from the top of the screen and react like horizontal scroll view, on second half of he screen there will be content of selected option on customlayout. Maybe someone has already tried to do it so any suggestion would be great.Regards</p>","561344","","","","","2011-01-30 23:10:22","Half-circled horizontalscrollview","<android><layout><android-layout><horizontal-scrolling>","0","2","","",""
"4846218","1","","","2011-01-30 23:11:36","1","815","<p>I am trying to create a background drawable for a linearlayout that has multiple gradients.</p><p>E.g. I want to have a gradient at the top and bottom, and a solid color in the middle. So basically a header and footer.</p><p>I am trying to use a layer-list like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;layer-list xmlns:android=""http://schemas.android.com/apk/res/android""&gt; &lt;!--Red--&gt; &lt;item&gt;  &lt;shape   xmlns:android=""http://schemas.android.com/apk/res/android""&gt;   &lt;solid    android:color=""#ff0000"" /&gt;  &lt;/shape&gt; &lt;/item&gt; &lt;!-- Green --&gt;        &lt;!-- Offsets from the top and bottom --&gt; &lt;item  android:top=""20dp""  android:bottom=""20dp""&gt;  &lt;shape   xmlns:android=""http://schemas.android.com/apk/res/android""&gt;   &lt;solid    android:color=""#00ff00"" /&gt;  &lt;/shape&gt; &lt;/item&gt; &lt;item  android:top=""80dp""&gt;  &lt;!--Blue --&gt;  &lt;shape   xmlns:android=""http://schemas.android.com/apk/res/android""&gt;   &lt;solid    android:color=""#0000ff"" /&gt;  &lt;/shape&gt; &lt;/item&gt;&lt;/layer-list&gt;</code></pre><p>The problem is, I am unsure of the max value of density independant pixels. For this to work, the bottom item offest would need to be (max dp value-20). I have tried to assume the max is 100, and also assume the max is 160 (from the documentation), but neither of these work.</p><p>Any ideas?</p>","446963","","770068","","2011-06-23 18:28:35","2011-06-23 18:28:35","android layer-list header and footer","<android><header><background><gradient><footer>","0","0","","",""
"4846241","1","","","2011-01-30 23:16:55","3","3188","<p>I'm tring to run this:</p><pre><code>            String[] hin1 = { ""su"", ""-c"",                    ""mount -o remount,rw -t yaffs2 /dev/block/mtdblk3 /system"" };            try {                Runtime.getRuntime().exec(hin1);            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            String[] hin2 = { ""su"", ""-c"", ""m /system/etc/hosts"" };            try {                Runtime.getRuntime().exec(hin2);            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            String[] hin = { ""su"", ""-c"",                    ""cp /sdcard/hosts /system/etc/"" };            try {                Runtime.getRuntime().exec(hin);            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }</code></pre><p>Sadly it is only working when I make for every action a new button.. :(</p><p>Is there a way to run more than one command at once??</p><p>Thanks</p>","558292","","","","","2012-02-19 06:59:53","More than one Superuser command Android","<android><command><superuser>","3","1","","",""
"4846257","1","4995436","","2011-01-30 23:20:24","0","1351","<p>I have created a custom Array Adapter to bind a custom row that contains some static text and an editable EditText. I am trying to register to be notified when the user changes the text within the edit text and when notified to determine which ArrayList row the modified EditText corresponds to.</p><p>In the past with other types of views such as a Spinner I could simply put a reference to the parent view and the row number into the tag for the Spinner view. And then when I was notified that the value changed I read the tag to determine how to correlate it back to the master ArrayList. </p><p>The problem with registering to be notifed with an EditText change is that you do not get back a view but instead get a TextWatcher and I have no way to correlate back to the parent view or ArrayList row.</p><p>What is the technique that you need to use in this circumstance?</p>","467569","","","","","2011-02-14 17:47:34","Android EditText within a ListView","<android><android-listview><android-edittext>","1","0","1","",""
"4846271","1","","","2011-01-30 23:21:55","3","2738","<p>Does anyone know of a way to obtain the phone service state (IN_SERVICE, OUT_OF_SERVICE, EMERGENCY_ONLY, POWER_OFF) in android. </p><p>I was hoping there would be a broadcastreciever to identify the changes, but I can't find anything. I know there's a listener but I'm not sure how I would use that from my app as it runs as a service using a WakefulIntentService (by thecommonsguy).</p><p>With something like battery level (ie BATTERY_LOW, BATTERY_OKAY) it's quite easy, but I just can't work out a similar things for phone service changes.</p>","596165","","","","","2012-04-04 04:40:09","Broadcastreceiver to obtain ServiceState information","<android><listener><phone><broadcastreceiver>","2","0","","",""
"4846296","1","","","2011-01-30 23:27:57","6","9044","<p>I'm trying to launch an Activity when clicking a link inside a WebView component.</p><p>My Webview is loaded inside <code>Main.java</code> and I would like to launch <code>SubActivity.java</code> when clicking a link inside the Website which is in <code>Main.java</code>?</p><p>Also, how can I pass parameters to this activity?</p><p><strong>Example</strong>: <code>inspection://Project/1</code></p><p>""Inspection"" is the name of my application, <code>inspection</code> is the Activity I would like to launch and <code>1</code> is the ID I would like to have.</p>","596166","","383124","","2012-11-20 14:50:36","2013-07-12 08:14:30","Android SDK WebView call Activity","<android><webview>","3","0","6","",""
"4846484","1","4846511","","2011-01-31 00:03:40","11","26824","<p>I have a simple android client which needs to 'talk' to a simple C# HTTP listener. I want to provide a basic level of authentication by passing username/password in POST requests.</p><p>MD5 hashing is trivial in C# and provides enough security for my needs but I can't seem to find how to do this at the android end.</p><p>Is it possible or is there another alternative to provide simple 'encryption' which I could use with android client and a C# server?</p><p>EDIT: Just to address the concerns raised about MD5 weakness - the C# server runs on the PCs of the users of my android client. In many cases, they'll be accessing the server using wi-fi on their own LANs but, at their own risk, they may choose to access it from the internet. The server will 'listen' on any port the user chooses and the POST request format is not discoverable by using GET, for example, to discover a form layout.</p>","488241","","488241","","2011-01-31 00:28:07","2014-01-27 20:02:01","MD5 (or other) hashing in Android","<android><cryptography><md5>","6","12","","",""
"4846521","1","4846608","","2011-01-31 00:10:16","4","3482","<p>Here's my code:</p><pre><code>URL url = new URL(""http://www.bing.com/"");        URLConnection urlConnection = url.openConnection();        BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));        String inputLine;        while ((inputLine = in.readLine()) != null) System.out.println(inputLine);        in.close();</code></pre><p>In the manifest, I have this:</p><pre><code>&lt;permission android:name=""android.permission.INTERNET""&gt;&lt;/permission&gt;</code></pre><p>It is outside the application tab, but inside the manifest tag.</p><p>And the error I'm getting is this:</p><pre><code>java.net.SocketException: Permission denied (maybe missing INTERNET permission)</code></pre><p>Really not sure why I'm getting this error when I have the internet permission in place. A bit stumped here!</p><p>Thanks!</p>","538355","","","","","2011-12-29 19:41:11","Can't get android to connect to the Internet (permission denied)","<android><permissions><internet>","1","0","","",""
"4846591","1","4846934","","2011-01-31 00:22:54","0","975","<p>Is there any way to prevent the doInBackground method/thread of an AsyncTask from starting until an AlertDialog which is displayed during the onPreExecute method has been dismissed?</p><p>doInBackground is only meant to run when onPreExecute completes, however as far as I can tell, having an open AlertDialog does not stop onPreExecute from completing.</p><p>Details:Am on my phone at the moment so can't give code sample, but the overview of the code is that it's an app that requires data that can only be accessed via mobile data due to being on telco network.  The preExec of my getData asynctask first checks if wifi is up, and if so displays an alert dialog with Disable Wifi and Cancel options.</p><p>Cancel should end the task, and Disable Wifi should, well, disable wifi.  doInBg method then checks if mobile data connection is up, and if not goes into a sleep loop unti it is.  Once it is up, doInBg then gets the data...</p><p>Currently, if wifi is on doInBg starts before the dialog is dismissed, getting trapped in the sleep loop until something causes mobile connection to come up... This leads to potential problems I'd like to avoid.</p>","593886","","593886","","2011-01-31 00:35:04","2011-06-30 05:12:20","Make AlertDialog in AsyncTask onPreExecute stop doInBackground until it is dismissed","<android><android-asynctask><alertdialog><dismiss>","1","0","","",""
"4846596","1","4848639","","2011-01-31 00:23:27","0","771","<p>A small number of appwidgets on the market are able to scroll vertically in some of the custom launcher replacements. How can I do something similar?</p>","362076","","","","","2011-01-31 07:45:30","How can I make a vertically scrolling appwidget for LauncherPro, ADW, etc?","<android>","1","0","","",""
"4846739","1","4847067","","2011-01-31 00:54:15","4","1338","<p>I am trying to set up a child them of <code>Theme.Wallpaper.NoTitleBar</code>, but I want it to only be semitransparent. My current style is written as such:</p><pre><code>&lt;resources&gt;    &lt;style name=""CustomClear"" parent=""@android:style/Theme.Wallpaper.NoTitleBar""&gt;        &lt;item name=""android:color""&gt;#F0000000&lt;/item&gt;    &lt;/style&gt;&lt;/resources&gt;</code></pre><p>The ultimate goal is to still be able to see the wallpaper in the background, but darken it so that text is more easily readable. Am I at least on the right track here?</p>","420377","","","","","2011-01-31 02:11:22","Making a semitransparent Theme.Wallpaper","<android>","1","0","1","",""
"4846809","1","","","2011-01-31 01:09:35","3","17248","<p>I have an MP4 file that I play with the MediaPlayer example in API demos on the emulator. Only the sound is played. No video. Why would this be and how do i get it to play?</p><p>BTW: .3gp files to play both audio and video in the same example.</p><p>Thanks!</p>","578716","","36620","","2013-07-16 17:59:16","2013-11-22 02:20:26","Can Android v2.3 Play MP4 files?","<android>","1","0","1","",""
"4846903","1","","","2011-01-31 01:30:23","1","532","<p>Okay, I'm working on an app that plays a video that the user cannot control.(An intro video). But I cannot seem to find a way to disable the user video controls (Play, pause, go to 1:23, etc...)</p><p>Does anyone know of a way that will enable me to remove the user controls from that object? Ideally the bottom bar of controls will not even show up.</p><p>Thanks in advance for any help you can provide, almighty wizards!</p>","596227","","","","","2011-01-31 19:21:21","Asking for help on how to disable user controls in an Android VideoView object","<android><video><controls><user><videoview>","1","0","","",""
"4846949","1","","","2011-01-31 01:42:18","1","1119","<p>How can I read and write files synchronously, using PhoneGaps Filesystem API?Is there a an synchronous wrapper available?</p>","1567109","","3041194","","2013-12-20 06:41:27","2013-12-20 06:41:27","phonegap html5 android synchonous Filesystem IO","<android><cordova><io><filesystems><synchronous>","2","1","","",""
"4846958","1","4847448","","2011-01-31 01:43:14","2","2421","<p>I'm starting Camera application to take a picture via Intent:</p><pre><code>startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE), 0);</code></pre><p>But camera is always in landscape mode, even when you rotate your handset to portrait mode. Is there any way to make camera detect current orientation? </p><p>Thanks</p>","94892","","213269","","2011-01-31 01:50:32","2011-01-31 03:46:45","Android: Camera orientation when started by Intent","<android><camera>","1","2","","",""
"4847005","1","","","2011-01-31 01:54:41","0","480","<p>Looking at the Android supported video formats here:</p><p><a href=""http://developer.android.com/guide/appendix/media-formats.html"" rel=""nofollow"">http://developer.android.com/guide/appendix/media-formats.html</a></p><p>Which of these gives the highest quality output?</p><p>Thanks.</p>","578716","","","","","2011-01-31 01:54:41","Highest Quality Video Format","<android>","0","3","","",""
"4847068","1","4855295","","2011-01-31 02:11:25","0","789","<p>I've been agonising for a while now about something which ought to be relatively simple, but I can't seem to get it to work. The data for each ListView is displaying correctly, and I can select and activate the onItemClickListener by using the trackball. However, I cannot scroll down or select any of the items by touch, which I know I should be able to. Any help much appreciated. My code and xml follows:</p><pre><code>public class POITab extends TabActivity implements AdapterView.OnItemClickListener {public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.poitab);    ListView raillist=(ListView)findViewById(R.id.raillist);    Cursor mrailStationsCursor = db.type_query(KEY_RAIL);    setupTab(raillist, mrailStationsCursor, ""Rail"", R.drawable.logo);public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {Log.i(""touched"", "" yes"");}public void setupTab (ListView list, Cursor cursor, String tabname, int drawable) {startManagingCursor(cursor);String[] from_all = new String[]{DbAdapter.KEY_NAME};int[] to_all = new int[] {android.R.id.text1};list.setAdapter(new SimpleCursorAdapter(this,android.R.layout.simple_list_item_1, cursor, from_all, to_all));list.setOnItemClickListener(this);TabHost.TabSpec spec= getTabHost().newTabSpec(tabname);spec.setContent(list.getId());spec.setIndicator(tabname, getResources().getDrawable(drawable));getTabHost().addTab(spec);} }</code></pre><p>poitab.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""&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:paddingTop=""62px""&gt;&lt;ListView android:id=""@+id/raillist""android:choiceMode=""singleChoice""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:layout_weight=""1""&gt;&lt;/ListView&gt;&lt;/FrameLayout&gt;&lt;/TabHost&gt;`</code></pre>","278638","","278638","","2011-01-31 02:22:07","2011-01-31 19:45:16","Untouchable ListView within tabhost","<android><listview>","1","1","","",""
"4847088","1","","","2011-01-31 02:16:58","0","286","<p>I'm new to Android SDK. I have not even started using the API. I just wanted to know (before I commit) if it is possible to load a custom map and navigate through it? Google map for Android can provide rich details but it won’t show building structures in a big compound. So is it possible to make my own map with corrected coordinates for the building structures in the map and use it to navigate through it? </p>","596252","","142162","","2011-01-31 02:29:53","2011-01-31 05:08:34","Can you add custom maps when developnig in Android SDK?","<android><google-maps>","1","0","","",""
"4847097","1","4847178","","2011-01-31 02:18:54","0","291","<p>I am trying to run a denoising algorithm on a bitmap image that I have -- the function returns me a short[], so I tried simply casting it to int[] in order to generate a bitmap and I get this:</p><p><img src=""http://i.stack.imgur.com/LESXu.png"" alt=""http://i.min.us/ickyY6.png, android screenshot with &quot;denoised&quot; brain image in pink, not grayscale""></p><p>I'd like it to be in grayscale, not .. well.. pink. Any ideas?</p>","387064","","","","","2011-01-31 03:45:00","How can I convert a short[] into a int[] to create a grayscale bitmap?","<android><image-processing><type-conversion>","2","0","","",""
"4847150","1","4847505","","2011-01-31 02:31:55","1","578","<p>I am creating a softkeyboard for android to play around with ptrace(). I would like to set a fix process id for the application I made. Is it possible to to it so that I can play around android app with ptrace()?</p>","575319","","","","","2011-01-31 04:01:15","Is it possible to set fix process ID for android application?","<java><android><c>","1","3","","",""
"4847255","1","4847476","","2011-01-31 02:58:22","0","107","<p>I am currently reading beginner programing with java for dummies second edition by barry burd, when i finish should I start learning android (if so any recommendations) or more java (again recomendations greatly appreciated) tyvm in advance</p>","596281","","","","","2011-01-31 03:54:42","when to go from java to android","<android>","2","2","","2014-01-01 09:39:06",""
"4847346","1","4847392","","2011-01-31 03:21:46","1","466","<p>onReceive is never getting call!! I had this working and I made some changes and now I been working on this for 5 hours and dont know what my onReceive is not getting called as I do a SMS to it!</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Log.i(LOG_TAG,""onCreate"");        registerReceiver(new BroadcastReceiver() {            @Override            public void onReceive(Context context, Intent intent) {                Log.i(LOG_TAG, ""onReceive"");                if (intent.getAction().equals(ACTION)) {                    Log.i(LOG_TAG,""in getAction()"");                }            }        }, new IntentFilter(RECEIVE_SMS));    }}</code></pre>","589450","","375874","","2011-01-31 03:39:47","2011-01-31 03:39:47","onReceive is never getting call!","<java><android><sms>","2","0","","",""
"4847547","1","4848868","","2011-01-31 04:08:46","3","1618","<p>I have an android app, I want to run some process or show some message to user if he is uninstalling app, how to do that in android...</p>","529664","","","","","2011-01-31 08:28:57","How to know user is uninstalling app, run some service or show dialog before uninstall of my app","<android><uninstall>","2","1","2","",""
"4847569","1","","","2011-01-31 04:14:19","2","1024","<p>I'm trying to develop an android application in which I'm trying to change the scaling_governor to userspace so that I can set the cpu frequency, but I don't know how to gain root user permission programatically in order to change the scaling_governor. Is there any way to change the scaling_governor and to set user specified cpu frequency?</p>","596317","","3041194","","2013-12-20 06:38:09","2014-02-02 20:48:26","gaining root user permission on an android device programatically in java in order to change scaling_governor","<android><user><cpu><root><frequency>","1","2","0","",""
"4847654","1","4847670","","2011-01-31 04:32:47","13","21701","<p>I'm using ubuntu 10.04 for android development.I want to know whether there is a method  to access local files(say text files,web pages) of the filesystem in android emulator.</p>","531996","","52626","","2011-03-27 21:05:46","2012-12-18 17:01:27","How to access local files of filesystem in android emulator?","<android>","1","2","3","",""
"4847684","1","4847700","","2011-01-31 04:39:30","1","4515","<p>Why is</p><pre><code>TextView test = (TextView) findViewById(R.id.testTextView);test.getText();</code></pre><p>generating a null pointer exception? The id is correct, testTextView is correctly declared in my XML layout file.</p>","283311","","244296","","2011-01-31 04:43:53","2012-05-13 19:49:17","Android TextView and null pointer exception","<android><textview>","3","0","1","",""
"4847690","1","","","2011-01-31 04:41:03","0","305","<p>I am doing multimedia application, Now i am concentrating on connecting my application to server. i want to store all my multimedia files(music and videos) into server. whenever my device is connected to WIFI i want to access all my multimedia files from server. In short i want to access my server through WIFI. can anyone pls guide me how to access this process, also give some useful links to know this process in details.    </p>","594843","","146043","","2011-01-31 14:29:49","2011-01-31 14:29:49","How to connect to the server","<android>","1","0","","",""
"4847785","1","5116681","","2011-01-31 05:04:49","2","1886","<p>I have problems when making queries with parameters to DB on Android platform (2.2). I have created table like this:</p><pre><code>db.execSQL(""CREATE VIRTUAL TABLE "" + Msg._TABLE_NAME + "" USING FTS3 (""            + Msg._ID + "" INTEGER, ""            (...)            + Msg.READ + "" SHORT DEFAULT 0,""
            + Msg.URGENT + "" SHORT DEFAULT 0""            + "");"");</code></pre><p>Then I am trying to query this using parametrized query:</p><pre><code>String[] columns = new String[] {Msg.ROWID, Msg.TITLE, Msg.READ, Msg.URGENT};(...)getContentResolver().query(Msg.CONTENT_URI, columns,     Msg.URGENT + ""=? AND "" + Msg.READ + ""=?"" + , whereArgs, null);</code></pre><p>where <code>whereArgs</code> varies for each query:</p><pre><code>String[] urgentUnread = new String[]{""1"", ""0""};String[] regularUnread = new String[]{""0"", ""0""};</code></pre><p>but no matter what it returns 0 results/rows even though data exist. The content provider does not change the params and the query returns nothing using QueryBuilder as well as when calling query ""directly"":</p><pre><code>Cursor c = db.query(tables, columns, where, whereArgs, groupBy, having, orderBy, limit);</code></pre><p>The query works if I do just String concat:</p><pre><code>getContentResolver().query(Msg.CONTENT_URI, columns,     Msg.READ + ""=0 AND "" + Msg.URGENT + ""=1"", null, null);</code></pre><p>but that seems to kill the purpose of param queries and is nasty to cache. Dalvik complains (after making lot of queries) that there is no space in cache for query and, ironically, tells me to use parametrized queries with '?'. I would love to, trust me :)</p><p>I know JavaDoc states that parameters are bound as StringS but I just simply can't believe that... because that would be major ...ahem, ... <em>WTF</em></p><p>Where did I go wrong here?</p><p>Thanks in advance.</p>","596367","","","","","2011-07-02 14:18:41","Android: SQLite Query not binding integer parameters?","<android><sqlite><parameters>","1","0","1","",""
"4847816","1","","","2011-01-31 05:10:27","0","758","<p>Context:</p><p>I have a main activity holding 6 tabs, each tabs holds a gridview with 30+ images, and around 8 images a shown at any moment (each gridview is scollable).</p><p>With these many images I implemented a simple caching system, that is to only cache the latest 25 of them, if new image is needed to display and is not in the cache, I will decode that image from /data/date directory and overwrite the oldest entry in the cache.  And before overwriting the oldest entry, I will call Bitmap.recycle() on that.</p><p>Problem: </p><p>At some point, after displying more than 25 images, old images will start to be recycled. if I were to now navigate back to one of the tab where their Image is no longer in the cache, the GetView method will take care to load the picture again.  The Issue is other than the first Item in the Gridview will be calling GetView, rest of the image will never get call, and the Gridview will attempt to display a cached image where it has been recycled already.</p><p>Any Suggestion? either to force get view or a smart way to cache image in this scenario?</p><p>Much Appreciated</p><p>Thanks</p>","596310","","","","","2011-01-31 07:43:43","Android: Gridview is caching outdated item, how to ensure getview is called for every displaying item upon a reload of the page?","<android><caching><gridview><bitmap><recycle>","1","0","","",""
"4847858","1","4850263","","2011-01-31 05:19:22","4","8016","<p>I used the below code to find out the screen size but I am not getting correct values.</p><pre><code>Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();    int width = display.getWidth();     int height=display.getHeight();</code></pre><p>It returns 320 x 480 for galaxy tab.. which is not correct.</p><p>How do I find the correct screen size of the galaxy tab which is 600 x 1024.</p>","554830","","1","","2011-01-31 10:56:23","2012-10-26 06:14:07","How can I get the exact screen size of the device through code?","<android>","4","0","4","",""
"4847863","1","","","2011-01-31 05:20:03","0","431","<p>I want to show the same menu (made with imageviews) on all my activies, and I try: </p><pre><code>public class BaseActivity extends Activity {    ImageView iv1;    ...    @Override    protected void onCreate(Bundle savedInstanceState) {    {        super.onCreate(savedInstanceState);        iv1 = (ImageView)findViewById(R.id.image1);    }    ...}</code></pre><p>and the others activities looks like: </p><pre><code>public class PlayersActivity extends BaseActivity {    protected void onCreate (Bundle savedInstanceState){        super.onCreate(savedInstanceState);    }}</code></pre><p>But, the activities don't see the ImageView that I defined on the BaseActivity.<br>I have a null object with the imageview.</p>","596380","","3041194","","2013-12-20 06:37:04","2013-12-20 06:37:04","same menu different activities","<android><activity>","1","0","","",""
"4847875","1","","","2011-01-31 05:22:45","14","15204","<p>Below is my codes and I got the <code>android.database.CursorIndexOutOfBoundsException</code>: Index -1 requested, with a size of 2 error. Can anyone tell me how to solve it?</p><pre><code>ContentResolver cr = getContentResolver();  Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,    null, null, null, null);  if (Integer.parseInt(cur.getString(    cur.getColumnIndex(People.PRIMARY_PHONE_ID))) &gt; 0) {   Cursor pCur = cr.query(     Contacts.Phones.CONTENT_URI,      null,      Contacts.Phones.PERSON_ID +"" = ?"",      new String[]{id}, null);   int i=0;   int pCount = pCur.getCount();   String[] phoneNum = new String[pCount];   String[] phoneType = new String[pCount];   while (pCur.moveToNext()) {    phoneNum[i] = pCur.getString(      pCur.getColumnIndex(Contacts.Phones.NUMBER));    phoneType[i] = pCur.getString(      pCur.getColumnIndex(Contacts.Phones.TYPE));    i++;   }   } }}</code></pre>","596379","","3041194","","2013-12-20 06:36:15","2013-12-20 06:36:15","android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 2","<android><cursor><contacts>","1","4","2","",""
"4847877","1","","","2011-01-31 05:22:48","0","26","<p>I am developing an game application in android similar to that made in iphone <a href=""http://itunes.apple.com/us/app/road-trip-bingo/id376434962?mt=8.I"" rel=""nofollow"">http://itunes.apple.com/us/app/road-trip-bingo/id376434962?mt=8.I</a> am facing problem while i am tapping images.Can anybody help me in this regard.</p><p>Thanks in advanceTushar</p>","475349","","","","","2011-01-31 05:22:48","facing problem while tapping icons which are seen next to road in android","<android>","0","7","1","",""
"4847935","1","","","2011-01-31 05:35:34","6","1658","<p>I need some help here. I am working on an application that obtains the user's location. I did refer to a number of websites about this so I'm pretty sure I am not missing any step here (from the codes up to sending mock location). So anyway, my problem is that whenever I send a mock location (using Eclipse's DDMS and telnet) the emulator dies then restarts. I also added permissions (to locate user's coarse and fine location) to the manifest file. I also tried it both on Windows and a Mac but same thing happened. :(</p><p>Here's the log, just in case:</p><pre><code>02-01 13:17:11.793: INFO/ActivityManager(61): Displayed bcorp.mtms/.Main: +4m49s987ms02-01 13:17:11.883: INFO/ARMAssembler(61): generated scanline__00000077:03515104_00001004_00000000 [ 65 ipp] (85 ins) at [0x43ae0520:0x43ae0674] in 7219002 ns02-01 13:17:11.934: INFO/ARMAssembler(61): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x43ae0678:0x43ae0840] in 1115000 ns02-01 13:17:12.173: INFO/ARMAssembler(61): generated scanline__00000177:03515104_00001002_00000000 [ 87 ipp] (110 ins) at [0x43ae0848:0x43ae0a00] in 519000 ns02-01 13:17:13.833: DEBUG/dalvikvm(390): GC_EXTERNAL_ALLOC freed 88K, 51% free 2636K/5379K, external 939K/1038K, paused 65ms02-01 13:17:13.934: INFO/System.out(390): EMERGENCY NUMBERS - DISPLAY PHONEBOOK ----&gt;02-01 13:17:29.013: INFO/DEBUG(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***02-01 13:17:29.013: INFO/DEBUG(31): Build fingerprint: 'generic/google_sdk/generic:2.3/GRH55/79397:eng/test-keys'02-01 13:17:29.023: INFO/DEBUG(31): pid: 61, tid: 134  &gt;&gt;&gt; system_server &lt;&lt;&lt;02-01 13:17:29.033: INFO/DEBUG(31): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000000002-01 13:17:29.033: INFO/DEBUG(31):  r0 00000000  r1 405b8178  r2 4128fab4  r3 459dcc7402-01 13:17:29.033: INFO/DEBUG(31):  r4 0000012d  r5 00000000  r6 405b8178  r7 4128fab402-01 13:17:29.033: INFO/DEBUG(31):  r8 84301321  r9 84302240  10 00100000  fp 0000000102-01 13:17:29.033: INFO/DEBUG(31):  ip 82f0e7d4  sp 459dcc60  lr 82f0ab37  pc 82f07d0e  cpsr 0000003002-01 13:17:29.793: INFO/DEBUG(31):          #00  pc 00007d0e  /system/lib/libandroid_servers.so02-01 13:17:29.793: INFO/DEBUG(31):          #01  pc 0000ab32  /system/lib/libandroid_servers.so02-01 13:17:29.793: INFO/DEBUG(31):          #02  pc 000012ca  /system/lib/hw/gps.goldfish.so02-01 13:17:29.793: INFO/DEBUG(31):          #03  pc 000014ae  /system/lib/hw/gps.goldfish.so02-01 13:17:29.793: INFO/DEBUG(31):          #04  pc 00011a7c  /system/lib/libc.so02-01 13:17:29.803: INFO/DEBUG(31):          #05  pc 00011640  /system/lib/libc.so02-01 13:17:29.803: INFO/DEBUG(31): code around pc:02-01 13:17:29.803: INFO/DEBUG(31): 82f07cec ab04b082 9301cb04 6f646804 b00247a0 02-01 13:17:29.803: INFO/DEBUG(31): 82f07cfc bc08bc10 4718b002 b510b40c ab04b082 02-01 13:17:29.803: INFO/DEBUG(31): 82f07d0c 6804cb04 34f89301 47a06824 bc10b002 02-01 13:17:29.803: INFO/DEBUG(31): 82f07d1c b002bc08 46c04718 b510b40c ab04b082 02-01 13:17:29.803: INFO/DEBUG(31): 82f07d2c 9301cb04 34986804 47a06824 bc10b002 02-01 13:17:29.803: INFO/DEBUG(31): code around lr:02-01 13:17:29.814: INFO/DEBUG(31): 82f0ab14 91099008 f7fb6aa0 900aeb14 1c3a910b 02-01 13:17:29.814: INFO/DEBUG(31): 82f0ab24 6b646b23 930c1c28 1c31940d f7fd9b0f 02-01 13:17:29.814: INFO/DEBUG(31): 82f0ab34 4906f8e7 44791c28 f7ff3150 b011fe1d 02-01 13:17:29.814: INFO/DEBUG(31): 82f0ab44 46c0bdf0 0000454c 000042c8 00000786 02-01 13:17:29.814: INFO/DEBUG(31): 82f0ab54 f7fbb510 bd10ec7c 4802b510 f7fb4478 02-01 13:17:29.814: INFO/DEBUG(31): stack:02-01 13:17:29.814: INFO/DEBUG(31):     459dcc20  00000000  02-01 13:17:29.814: INFO/DEBUG(31):     459dcc24  40ab5800  02-01 13:17:29.814: INFO/DEBUG(31):     459dcc28  00000009  02-01 13:17:29.814: INFO/DEBUG(31):     459dcc2c  00000000  02-01 13:17:29.814: INFO/DEBUG(31):     459dcc30  0000ab90  [heap]02-01 13:17:29.814: INFO/DEBUG(31):     459dcc34  81d48bd3  /system/lib/libdvm.so02-01 13:17:29.824: INFO/DEBUG(31):     459dcc38  0000ab90  [heap]02-01 13:17:29.824: INFO/DEBUG(31):     459dcc3c  459dcc6c  02-01 13:17:29.824: INFO/DEBUG(31):     459dcc40  00010004  [heap]02-01 13:17:29.824: INFO/DEBUG(31):     459dcc44  81d3761b  /system/lib/libdvm.so02-01 13:17:29.824: INFO/DEBUG(31):     459dcc48  403e0000  /dev/ashmem/dalvik-heap (deleted)02-01 13:17:29.824: INFO/DEBUG(31):     459dcc4c  84300daf  /system/lib/hw/gps.goldfish.so02-01 13:17:29.824: INFO/DEBUG(31):     459dcc50  00000000  02-01 13:17:29.824: INFO/DEBUG(31):     459dcc54  459dce00  02-01 13:17:29.824: INFO/DEBUG(31):     459dcc58  df002777  02-01 13:17:29.824: INFO/DEBUG(31):     459dcc5c  e3a070ad  02-01 13:17:29.824: INFO/DEBUG(31): #00 459dcc60  00000001  02-01 13:17:29.824: INFO/DEBUG(31):     459dcc64  8053bf25  /system/lib/libandroid_runtime.so02-01 13:17:29.834: INFO/DEBUG(31):     459dcc68  0000012d  02-01 13:17:29.834: INFO/DEBUG(31):     459dcc6c  82f0ab37  /system/lib/libandroid_servers.so02-01 13:17:29.834: INFO/DEBUG(31):     459dcc70  4128fab4  /dev/ashmem/dalvik-LinearAlloc (deleted)02-01 13:17:29.834: INFO/DEBUG(31):     459dcc74  00000003  02-01 13:17:29.834: INFO/DEBUG(31): #01 459dcc78  00000000  02-01 13:17:29.834: INFO/DEBUG(31):     459dcc7c  403e0000  /dev/ashmem/dalvik-heap (deleted)02-01 13:17:29.834: INFO/DEBUG(31):     459dcc80  00000000  02-01 13:17:29.834: INFO/DEBUG(31):     459dcc84  40418000  /dev/ashmem/dalvik-heap (deleted)02-01 13:17:29.834: INFO/DEBUG(31):     459dcc88  00000000  02-01 13:17:29.834: INFO/DEBUG(31):     459dcc8c  00000000  02-01 13:17:29.834: INFO/DEBUG(31):     459dcc90  00000000  02-01 13:17:29.844: INFO/DEBUG(31):     459dcc94  00000000  02-01 13:17:29.844: INFO/DEBUG(31):     459dcc98  00000000  02-01 13:17:29.844: INFO/DEBUG(31):     459dcc9c  00000000  02-01 13:17:29.844: INFO/DEBUG(31):     459dcca0  00000000  02-01 13:17:29.844: INFO/DEBUG(31):     459dcca4  00000000  02-01 13:17:29.844: INFO/DEBUG(31):     459dcca8  db15e000  02-01 13:17:29.844: INFO/DEBUG(31):     459dccac  0000012d  02-01 13:17:29.844: INFO/DEBUG(31):     459dccb0  459dce56  02-01 13:17:29.844: INFO/DEBUG(31):     459dccb4  00000003  02-01 13:17:29.844: INFO/DEBUG(31):     459dccb8  0000000a  02-01 13:17:29.844: INFO/DEBUG(31):     459dccbc  459dcde8  02-01 13:17:29.844: INFO/DEBUG(31):     459dccc0  00000000  02-01 13:17:29.844: INFO/DEBUG(31):     459dccc4  459dce6b  02-01 13:17:29.844: INFO/DEBUG(31):     459dccc8  00000001  02-01 13:17:29.844: INFO/DEBUG(31):     459dcccc  843012cd  /system/lib/hw/gps.goldfish.so02-01 13:17:43.163: INFO/BootReceiver(61): Copying /data/tombstones/tombstone_02 to DropBox (SYSTEM_TOMBSTONE)02-01 13:17:43.203: DEBUG/Zygote(33): Process 61 terminated by signal (11)02-01 13:17:43.203: INFO/Zygote(33): Exit zygote because system server (61) has terminated02-01 13:17:43.223: INFO/ActivityThread(370): Removing dead content provider: settings02-01 13:17:43.233: INFO/ServiceManager(28): service 'backup' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'batteryinfo' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'usagestats' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'SurfaceFlinger' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'sensorservice' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'activity' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'entropy' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'power' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'meminfo' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'telephony.registry' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'appwidget' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'permission' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'package' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'cpuinfo' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'account' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'content' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'hardware' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'vibrator' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'battery' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'alarm' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'window' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'device_policy' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'statusbar' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'clipboard' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'network_management' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'input_method' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'netstat' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'wifi' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'connectivity' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'throttle' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'accessibility' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'mount' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'diskstats' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'notification' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'devicestoragemonitor' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'location' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'wallpaper' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'search' died02-01 13:17:43.233: INFO/ServiceManager(28): service 'dropbox' died02-01 13:17:43.253: INFO/ActivityThread(390): Removing dead content provider: settings02-01 13:17:43.253: INFO/ActivityThread(124): Removing dead content provider: settings02-01 13:17:43.263: INFO/ActivityThread(122): Removing dead content provider: settings02-01 13:17:43.263: INFO/ActivityThread(117): Removing dead content provider: settings02-01 13:17:43.283: INFO/ServiceManager(28): service 'audio' died02-01 13:17:43.283: INFO/ServiceManager(28): service 'uimode' died02-01 13:17:43.293: ERROR/installd(35): eof02-01 13:17:43.293: ERROR/installd(35): failed to read size02-01 13:17:43.293: INFO/installd(35): closing connection02-01 13:17:43.293: DEBUG/qemud(38): fdhandler_event: disconnect on fd 1102-01 13:17:43.313: ERROR/InputQueue-JNI(124): channel '406a9c38 StatusBar (client)' ~ Publisher closed input channel or an error occurred.  events=0x802-01 13:17:43.403: INFO/ServiceManager(28): service 'isms' died02-01 13:17:43.403: INFO/ServiceManager(28): service 'simphonebook' died02-01 13:17:43.403: INFO/ServiceManager(28): service 'iphonesubinfo' died02-01 13:17:43.403: INFO/ServiceManager(28): service 'phone' died02-01 13:17:43.403: INFO/ServiceManager(28): service 'media.audio_flinger' died02-01 13:17:43.403: INFO/ServiceManager(28): service 'media.audio_policy' died02-01 13:17:43.403: INFO/ServiceManager(28): service 'media.player' died02-01 13:17:43.403: INFO/ServiceManager(28): service 'media.camera' died02-01 13:17:43.603: INFO/Netd(403): Netd 1.0 starting02-01 13:17:44.693: DEBUG/AndroidRuntime(404): &gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START com.android.internal.os.ZygoteInit &lt;&lt;&lt;&lt;&lt;&lt;02-01 13:17:44.703: DEBUG/AndroidRuntime(404): CheckJNI is ON02-01 13:17:45.223: INFO/(402): ServiceManager: 0xad5002-01 13:17:45.223: DEBUG/AudioHardwareInterface(402): setMode(NORMAL)02-01 13:17:45.243: INFO/CameraService(402): CameraService started (pid=402)02-01 13:17:45.293: INFO/AudioFlinger(402): AudioFlinger's thread 0xc650 ready to run02-01 13:17:45.943: INFO/SamplingProfilerIntegration(404): Profiler is disabled.02-01 13:17:46.033: INFO/Zygote(404): Preloading classes...02-01 13:17:46.063: DEBUG/dalvikvm(404): GC_EXPLICIT freed 47K, 78% free 232K/1024K, external 0K/0K, paused 25ms02-01 13:17:46.153: DEBUG/dalvikvm(404): GC_EXPLICIT freed 1K, 73% free 282K/1024K, external 0K/0K, paused 17ms02-01 13:17:46.293: DEBUG/dalvikvm(404): GC_EXPLICIT freed 22K, 70% free 316K/1024K, external 0K/0K, paused 17ms02-01 13:17:46.403: DEBUG/dalvikvm(404): GC_EXPLICIT freed 17K, 66% free 353K/1024K, external 0K/0K, paused 17ms02-01 13:17:46.553: DEBUG/dalvikvm(404): GC_EXPLICIT freed 26K, 63% free 382K/1024K, external 0K/0K, paused 27ms02-01 13:17:46.943: DEBUG/dalvikvm(404): GC_EXPLICIT freed 20K, 58% free 439K/1024K, external 0K/0K, paused 17ms02-01 13:17:47.103: WARN/MediaProfiles(404): could not find media config xml file02-01 13:17:47.953: DEBUG/dalvikvm(404): GC_EXPLICIT freed 99K, 47% free 545K/1024K, external 0K/0K, paused 31ms02-01 13:17:48.953: DEBUG/dalvikvm(404): GC_EXPLICIT freed 272K, 28% free 884K/1219K, external 0K/0K, paused 41ms02-01 13:17:49.093: DEBUG/dalvikvm(404): GC_EXPLICIT freed 21K, 24% free 931K/1219K, external 0K/0K, paused 38ms02-01 13:17:49.123: DEBUG/RenderScript_jni(404): RenderScript JNI library not found!02-01 13:17:49.333: DEBUG/dalvikvm(404): GC_EXPLICIT freed 25K, 19% free 998K/1219K, external 0K/0K, paused 39ms02-01 13:17:49.733: DEBUG/dalvikvm(404): GC_EXPLICIT freed 47K, 5% free 1281K/1347K, external 0K/0K, paused 58ms02-01 13:17:49.933: DEBUG/dalvikvm(404): GC_EXPLICIT freed 24K, 3% free 1310K/1347K, external 0K/0K, paused 56ms02-01 13:17:50.113: DEBUG/dalvikvm(404): GC_EXPLICIT freed 28K, 6% free 1336K/1411K, external 0K/0K, paused 57ms02-01 13:17:50.643: DEBUG/dalvikvm(404): GC_EXPLICIT freed 14K, 3% free 1376K/1411K, external 0K/0K, paused 47ms02-01 13:17:50.923: DEBUG/dalvikvm(404): GC_EXPLICIT freed 28K, 5% free 1402K/1475K, external 0K/0K, paused 59ms02-01 13:17:51.123: DEBUG/dalvikvm(404): GC_EXPLICIT freed 28K, 3% free 1439K/1475K, external 0K/0K, paused 59ms</code></pre><p>By the way, this occurs whenever I send mock location.</p><p>Any help is truly appreciated. :)</p>","596394","","","","","2011-03-24 03:38:52","Android Emulator restarts when sending mock location","<android><mocking><location><emulator><restart>","1","7","","",""
"4847975","1","4848016","","2011-01-31 05:41:36","4","707","<p>Please take a look at this code android sample :</p><pre><code>private static final boolean aBoolean = false;...if(aBoolean){   //do something like logs}</code></pre><p>In this case since the value of aBoolean is false and that it can't change at runtime, would the //do something like logs statement be ignored by on build or will it be still be build and each time it will evaluate the if?</p><p>I'm trying to find a behavior like pre processor #DEFINE #IF... so that when I'm coding I get my logs, when I release I switch one value and all my debug code gets completely ignored.</p><p>(also I would like to point out that my question is android oriented so if there is a  difference between Java and Android on this matter please let me know)</p>","440336","","","","","2011-01-31 06:20:47","Java/Android code optimization: Does Java remove unreachable code on build","<java><android><optimization>","2","0","2","",""
"4847982","1","","","2011-01-31 05:43:08","0","625","<p>I want to make the text in French in my app.so i converted English to French but its not accepted in my app.so how to fix this error.</p>","596397","","21234","","2011-01-31 08:50:05","2011-01-31 08:50:05","French accents are not accepting in eclipse Galileo,so how fix this?-android","<android><eclipse><internationalization>","1","2","","",""
"4847998","1","","","2011-01-31 05:46:26","0","595","<p>I have a griview.In that gridview i clicked one of the image.After onclick on that image then show a button(Download).after onclick that button(Download) then onclicked image will be downloaded .so please tell me how to show a button after onclick on any image in gridview.</p><p>Thank you.</p><p>Best Regards.  </p>","745367","","745367","","2011-02-01 09:30:14","2011-05-04 09:24:07","how to show a button after onclick on image in android","<android><image><button>","1","2","","",""
"4848010","1","4848051","","2011-01-31 05:48:33","-2","3838","<p>Hi           I Want to set Data in EditText in onActivityResult() ,I Got Result From Previous Activity, But I can't set value into my Current EditText..Hi ,my code:</p><pre><code>public class MyStuff extends Activity {EditText messageArea;int baseValue=200;TextView txtCounter;Button btnStuffOk;Button btnStuffCancel;ImageButton imgBrowse;private Gallery gallery;Bitmap myBitmap;boolean flag=false;int val=0;private ArrayList&lt;String&gt; arrayLst=new ArrayList&lt;String&gt;();protected static final int SELECT_IMAGE = 1;protected static final int SELECT_URL = 2;BitmapFactory.Options options = new BitmapFactory.Options();String url_data="""";@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.mystuff);    imgBrowse.setOnClickListener(new OnClickListener()    {        @Override        public void onClick(View v) {            Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);            photoPickerIntent.setType(""image/*"");             startActivityForResult(                        new Intent(                                Intent.ACTION_PICK,                                  android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI),                        SELECT_IMAGE);        }        });     gallery = (Gallery) findViewById(R.id.examplegallery);     gallery.setAdapter(new AddImgAdp(this));     messageArea=(EditText)findViewById(R.id.editArea01);     txtCounter=(TextView)findViewById(R.id.txtCounts);     btnStuffOk=(Button)findViewById(R.id.btnStufftOk);     btnStuffCancel=(Button)findViewById(R.id.btnStuffCancel);   messageArea.addTextChangedListener(new TextWatcher() {         public void afterTextChanged(Editable s) {            if(s.toString().length()&lt;1 ||s.toString().length()&gt;200)            {                btnStuffOk.setEnabled(false);            }            else            {                btnStuffOk.setEnabled(true);            }                txtCounter.setText(""""+(baseValue-s.toString().length()));        }         public void beforeTextChanged(CharSequence s, int start, int count,int after) {         }         public void onTextChanged(CharSequence s, int start, int before, int count) {         } }); }    @Override    public void onActivityResult(int requestCode, int resultCode, Intent data) {        super.onActivityResult(requestCode, resultCode, data);       switch (requestCode) {           case  SELECT_IMAGE:            if (resultCode == Activity.RESULT_OK) {                //                break;            }           case SELECT_URL:               if (resultCode == Activity.RESULT_OK) {                   messageArea.setText(data.getStringExtra(""url""));                   messageArea.setText(""this is a test"");                    break;               }       }     } }   </code></pre><p><code>data.getStringExtra(""url"")</code> shows value .. ,but i cant assign it int Edittext...Please help Me...</p>","593523","","243709","","2011-04-29 10:20:04","2011-04-29 10:20:04","Android:EditText.setText() not working properly?","<android>","2","3","","",""
"4848024","1","5090046","","2011-01-31 05:51:59","0","2309","<p>Since I don't have a flash player to play the video from Youtube itself, I need to play it in my default MediaPlayer. The code I used is as follows:</p><pre><code>MediaController mc = new MediaController(ctx);        setContentView(R.layout.main);        vv = (VideoView) findViewById(R.id.VideoView01);        try {            ur = Uri.parse(Url /*+ ""&amp;fmt=18""*/); // ""&amp;fmt=18""to convert to mp4            System.out.println(""Host = "" + ur.getHost());            System.out.println(""Encoded Path = "" + ur.getEncodedPath());            vv.setVideoURI(ur);            // vv.setVideoPath(""http://www.daily3gp.com/vids/747.3gp"");            vv.setMediaController(mc);            vv.requestFocus();            vv.start();            mc.show();        } catch (Exception ex) {            System.out.println(""Exception!!!!!!!!!!!!!!!! ""                    + ex.getMessage());        }</code></pre><p>The thing is....It is getting the link and when we give the link to the player, it say's This Video cannot be Played.....</p><p>Please help !!!!!!!!!!!!</p>","569547","","","","","2011-02-23 11:07:38","How to create a youtube app in my android Tab?","<java><android><youtube><youtube-api><mediacontroller>","3","0","1","",""
"4848031","1","","","2011-01-31 05:52:41","1","147","<p>I have TextView with height and width as fill parent. Is it possible to find out how many characters can this layout hold?</p>","487219","","638471","","2013-12-20 09:13:22","2013-12-20 09:13:22","Calculating Android TextView's text capacity","<android><android-widget>","1","0","","",""
"4848067","1","4851484","","2011-01-31 06:02:24","22","23112","<p>I get ""Login failed error"" with the Facebook Android SDK while running on the device. I have done everything what they specified, like creating a hash and all.</p><p>The error is:</p><blockquote>  <p>Facebook-authorize(5539): Login failed: invalid_key  facebook error: com.facebook.android.FacebookError: invalid_key</p></blockquote>","1746300","","63550","","2012-05-11 18:56:32","2014-01-27 17:47:08","Login failed invalid key error with Facebook SDK","<android><facebook>","13","4","10","",""
"4848106","1","","","2011-01-31 06:11:30","1","738","<p>I use the following code to create alarm.</p><pre><code>String strDateTime=strDate+"" ""+strTime;                         DateFormat dfm = new SimpleDateFormat(""yyyy-MM-dd HH:mm"");                          Date alarmTime = null;            try {                alarmTime = dfm.parse(strDateTime);            } catch (ParseException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            long setAlarmTime=alarmTime.getTime();            Intent myIntent = new Intent(context, MyAlarmService.class);            pendingIntent = PendingIntent.getService(context, 0, myIntent, 0);            AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);            //set time and get the Intent             alarmManager.set(AlarmManager.RTC_WAKEUP, setAlarmTime, pendingIntent);</code></pre><p>If i set more than one alarm the last one will be executed.How can i add more alarm time in android?</p>","548435","","548435","","2011-01-31 13:46:59","2011-07-14 12:42:49","set More Alarm in Android?","<android>","2","0","3","",""
"4848122","1","4848447","","2011-01-31 06:15:31","0","1130","<p>Iam using ArrayAdapter for ListView.Each ListItems contains checkbox,Title,TitleInfo(below title),period,Image(static/from drawable).Now i want to develop this code into simple adapter.How to use simple adapter for checkboxes and how to handle checkbox events in this simpleAdapter?</p><p>Regards,Android developer</p>","486216","","","","","2012-05-16 10:26:58","how to use simpleAdapter for custom checkbox in ListView android?","<android><listview>","2","0","","",""
"4848260","1","4848374","","2011-01-31 06:40:05","1","10938","<p>i want to create an activity, in which, i would like to have a listview, there can be about 20-30 items in a list view,on tapping any particular value in listview, it should move to another activity, with the data of list view.</p><p>Just wanna pass data from listview to another activity.Suggestion plzRegards</p>","1497488","","510491","","2013-10-07 06:47:24","2013-10-07 06:49:31","passing data from list view to another activity","<android><bundle>","7","1","2","",""
"4848312","1","5090616","","2011-01-31 06:50:02","1","3492","<p>I am using checkbox with ListView.Code is working fine. I strucked to get all the list checked Items. I used below code for getting checked items. But it is giving result of focused area of list.</p><pre><code>int firstPosition = list.getFirstVisiblePosition();        for(int i = firstPosition; i &lt; list.getCount(); i++){            View v = list.getChildAt(i);            if(v != null){                cbx = (CheckBox)v.findViewById(R.id.c_checkbox);                if(cbx.isChecked()){                                        //adding this check box to one sub list                }            }        }</code></pre><p>But it is giving only focusable list items result only.Depending on sublist I want to populate my menu that's why I am using this code in onPrepareOptionsMen() method and clicking on menu item delete this list from database.I found another solution that is</p><pre><code>long checkedPos[] =list.getCheckedItemIds();</code></pre><p>But it is giving</p><blockquote>  <p>01-31 12:07:16.042:  WARN/dalvikvm(294): VFY: unable to  resolve virtual method 808:  Landroid/widget/ListView;.getCheckedItemIds  ()[J 01-31 12:07:16.042:  WARN/dalvikvm(294): VFY:  rejecting  opcode 0x6e at 0x0024</p></blockquote><p>This error. After searching on Google I found another solution that is</p><p><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/368d0bae027aab63/1c61f007e821ed2a?q=%22Getting+the+state+of+a+checkbox+inside+of+a+listview%22+%22Romain+Guy%22#1c61f007e821ed2a"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/368d0bae027aab63/1c61f007e821ed2a?q=%22Getting+the+state+of+a+checkbox+inside+of+a+listview%22+%22Romain+Guy%22#1c61f007e821ed2a</a></p><p>but I want to use SparseBooleanArray  into my activity onPrepareOptionMenu().How to get back this result into my activity from my adapter.Please give me advice?</p><p>At last i used SparseBooleanArray.Now it is working fine.Regards,Android developer</p>","486216","","3041194","","2013-12-20 06:30:36","2013-12-20 06:30:36","how to handle checkbox in listview android?","<android><listview>","1","3","0","",""
"4848350","1","","","2011-01-31 06:58:06","0","874","<p>I am trying to connect mysql in android, but I can't. Are there any alternate ways to developed application without mysql if there is small database needed. And which one is better to use mysql or sqlite and why?</p>","622692","","3041194","","2013-12-20 06:29:41","2013-12-20 06:29:41","How i connect MySql in android","<android>","3","2","1","",""
"4848357","1","","","2011-01-31 06:59:41","0","173","<p>I have a simple app that displays a series of images and infomation about those images. I've set it up so that when a user touches an image, a new activity is launched and they see more pictures and a longer text description about that image. On that screen, I've also implemented the basic gallery widget that they have here in the <a href=""http://developer.android.com/resources/tutorials/views/hello-gallery.html"" rel=""nofollow"">Hello Gallery Tutorial</a>.</p><p>My problem is that even though I'm drawing on images from the res directory (I've thrown everything in drawable-mdpi thinking that there shouldn't be a huge deal), not all of the images on the gallery portion will load. And I haven't been able to reproduce it 100%, but it seems like the more I play with my phone with this app running (lock screen, unlock screen, go to one image, go back, go to another one, hit home, etc), the more likely any picture that I've got loaded up locally display blank image placeholders, gallery or not (the text comes up fine though).</p><p>I'm using a series of imagebuttons, imageviews, and gallery widgets. Play with it enough and eventually they all come as blank, but killing everything through AdvancedTaskKiller brings it back.</p><p>Sometimes pictures in my image galleries will also be blank when I first launch my app. That's really weird. I have it set so that the layoutparams are 300 by 200 and I've pulled pictures all over the place to populate my gallery. They should just all scale differently, not fail to load entirely though.</p><p>Anybody have any ideas on these?</p>","596447","","15168","","2013-09-08 19:08:46","2013-09-08 19:17:45","Android Images have trouble loading after firing off lots of activities?","<android><image>","2","0","","",""
"4848358","1","4848614","","2011-01-31 06:59:42","0","683","<p>I'm using GustureListner for a scrollview.</p><p>In that I have to calculate how many pixel that scrollview is moved during fling event.</p><p>I can get velocity and fling start and end position.</p>","510491","","3041194","","2013-12-20 06:28:33","2013-12-20 06:28:33","Calculate the Displacement of Scrollview while user scrolling","<android><scrollview><onfling>","1","0","0","",""
"4848443","1","4848899","","2011-01-31 07:14:06","3","407","<p>hi all<br>can any body give me an idea about how 2 calculate the website speed in android.<br>means how soon it will open up in browser. and  calculate all the statistics of that particular page.eg. total bytes or connection time etc......</p><p>thanks in advance.</p>","443387","","","","","2011-01-31 08:33:39","calculate website speed in android","<android><browser><website>","2","0","","",""
"4848490","1","4848575","","2011-01-31 07:23:25","6","5046","<p>I want to be able to feature a fairly simple fall detection algorithm in my application. At the moment in onSensorChanged(), I am getting the absolute value of the current x,x,z values and subtracting SensorManager.GRAVITY_EARTH (9.8 m/s) from this. The resulting value has to be bigger than a threshold value 10 times in a row to set a flag saying a fall has been detected by the accelerometer, the threshold value is about 8m/s.  </p><p>Also I'm comparing the orientation of the phone as soon as the threshold has been passed and the orienation of it when the threshold is no longer being passed, this sets another flag saying the orientation sensor has detected a fall.  </p><p>When both flags are set, an event occurs to check is user ok, etc etc. My problem is with the threshold, when the phone is held straight up the absolute value of accelerometer is about 9.8 m/s, but when i hold it still at an angle it can be over 15m/s. This is causing other events to trigger the fall detection, and if i increase the threshold to avoid that, it won't detect falls.<br>Can anyone give me some advice here with what possible values i should use or how to even improve my method?  Many thanks.</p>","506929","","","","","2012-07-05 09:05:23","Android - How to approach fall detection algorithm","<android><orientation><detection><accelerometer><sensor>","3","1","3","",""
"4848541","1","","","2011-01-31 07:30:53","0","381","<p>Hi guys i am new to android, can anyone guide me how server interact with client. Please give some useful links for simple client server interaction with source file.  </p>","594843","","","","","2011-01-31 07:43:47","Client server interaction","<android>","1","0","","",""
"4848572","1","5102408","","2011-01-31 07:34:33","2","1273","<p>The Accelerometer <code>UPDATE</code> event never fires, tho <code>isSupported</code> returns true, when the flash app is running inside the android web browser. <strong>How can I make it work?</strong></p><pre><code>     this.accelerometer = new Accelerometer();            accelerometer.addEventListener(AccelerometerEvent.UPDATE, onAccelerometerUpdate);</code></pre><p>Ref: <a href=""http://blogs.adobe.com/cantrell/archives/2010/04/simple_accelerometer_example.html"" rel=""nofollow"">http://blogs.adobe.com/cantrell/archives/2010/04/simple_accelerometer_example.html</a></p><p>Ref: <a href=""http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/sensors/Accelerometer.html#isSupported"" rel=""nofollow"">http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/sensors/Accelerometer.html#isSupported</a></p><p>My device is Samsung Galaxy S.</p><p>It does however work as an AIR app on android.</p><p>Ref: <a href=""http://forums.adobe.com/search.jspa?resultTypes=DOCUMENT&amp;resultTypes=MESSAGE&amp;resultTypes=COMMUNITY&amp;resultTypes=TASK&amp;resultTypes=PROJECT&amp;resultTypes=SOCIAL_GROUP&amp;resultTypes=COMMENT&amp;peopleEnabled=true&amp;q=Accelerometer"" rel=""nofollow"">""Adobe Forums - Accelerometer""</a></p>","94411","","94411","","2011-02-24 08:41:54","2011-02-24 08:58:35","flash.sensors.Accelerometer on Android within web browser","<android><flash><sensor><android-2.2-froyo>","1","1","","",""
"4848641","1","","","2011-01-31 07:45:42","0","6309","<p>I'm trying to put a mobclix ad banner in a cocos2D game.  I have the ad banner showing up on top of the openGL view.  However, I can not figure out how to place it at the bottom of the screen which is what we want.  The example from mobclix shows the use of a LinearLayout with gravity set to bottom.  I tried this in the GameActivity which is the main activity on startup:</p><pre><code>    adview_banner = new MobclixMMABannerXLAdView(this);    adview_banner.addMobclixAdViewListener(this);    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);    params.gravity = Gravity.BOTTOM;    this.addContentView(adview_banner, params);    adview_banner.bringToFront();    adview_banner.getAd();    adview_banner.setRefreshTime(30000);</code></pre><p>No matter what I do here the banner always shows up on the top of the screen.   Any help would be greatly appreciated.</p>","596003","","201863","","2011-10-15 22:24:04","2011-10-15 22:24:04","Android LayoutParams Problem - View always up top","<android><cocos2d-android><mobclix>","2","1","","",""
"4848664","1","","","2011-01-31 07:49:35","0","1119","<p>I am working on creating a custom view in android. I want to create an autohide custom view control.This control will be holding other UI elements  mostly buttons or icons. It has a small button which is mandatory, clicking which will slide the control in or out thus changing its visibility.one should be able to add other buttons or icons to this controlThe control can be placed only at the borders, which needs to be specified while creating the view.I don't know how to start with it Should I be extending the View class or ViewGroup class.</p>","596492","","746010","","2012-01-29 22:06:40","2013-06-25 19:58:01","Creating autohide custom view in android","<android><animation><view>","2","0","1","",""
"4848731","1","4850420","","2011-01-31 08:00:56","1","751","<p>I'm in JNI hell with typeconversions out the wazoo:</p><p>Here's the general flow of things:</p><ul><li>read a file and it returns me with a1D array of floats. </li><li>convert thesefloats[] to shorts[] (*4095, I want a12 bit number) </li><li>pass these shorts[] toC, which duplicates them in anunsigned short array </li><li>flip bits aroundto make big-endian java bitslittle-endian for image processing</li><li>convert these new numbers to adouble[] (/4095)</li><li>pass the double[] to theimage processing function </li><li>convert processed double[] back to short[] (*4095)</li><li>flip bits in short[] back tobig-endian </li><li>convert short[] back to float (/4095), pass back to java</li><li>pass float[] to intconversion which arranges the bits toARGB_8888 format</li></ul><p>There has GOT to be a better way to do this.</p><p>On top of all that crap, it's not working. I'm getting back all noise, which I feel might be a result of the unsigned short arrays in C (useful for bit-switching) and the signed short arrays in C. This is a major problem.</p><p>So I guess my general question is, how can I improve this so that I'm not dealing with all of these problems converting between types, including signed/unsigned issues.</p><p>Anything you can suggest will be appreciated..</p>","387064","","","","","2011-01-31 11:37:01","JNI + Type Conversion (Signed Short to Unsigned Short, for example)","<java><android><c><jni><type-conversion>","1","0","","",""
"4848803","1","","","2011-01-31 08:14:58","6","3884","<p>I want to perform step by step debugging in android. I am working in Eclipse. Whenever I start my android application and hit a breakpoint a problem occurs. Here is the problem:</p><p>I go into debug mode and I see that my breakpoint has been hit, but now that I want to step through execution, it doesn't work. As soon as I press f5 or press the step over/step into key a new window opens saying the following:</p><p>CLASS FILE EDITOR</p><p>SOURCE NOT FOUND</p><p>What do I do? I have attached the file that I am debugging to the source but it is still not working? What does this error mean?</p>","590849","","863122","","2012-07-20 09:54:17","2013-12-10 22:09:01","Difficulties with step by step debugging in android.","<android>","4","1","2","",""
"4848842","1","","","2011-01-31 08:22:45","0","945","<p>I'm building a mobile web app that incorporates GeoLocation.  On the Android browser (OS 2.0+) if the user has GPS turned off, a request from my web app to get their location does NOT show up.  If their GPS is turned on, then a location permission request does show up.  </p><p>I know that requesting a user's location from the browser when GPS is off is possible as Gowalla's mobile web app (http://m.gowalla.com) is able to trigger the request.  I looked through their sprocket.js file and it looks pretty straight forward.  Any ideas what the secret is here?</p>","534247","","377270","","2011-01-31 08:25:11","2011-04-03 14:47:48","Mobile Web: Request user's location when GPS is turned off","<javascript><android><geolocation><geo>","2","0","","",""
"4848880","1","6684227","","2011-01-31 08:29:49","2","737","<p>How to make the suggestions in the QSB editable when the user clicks on it? I.e. via an edit icon on the right, like on the Google Search app.</p><p>Is there a standard way to do it, or does it require to implement it from scratch, i.e. customized suggestion list item layout in xml with a button, etc.?</p><p>I couldn't find any info on that on <a href=""http://developer.android.com/intl/fr/guide/topics/search/searchable-config.html"" rel=""nofollow"">http://developer.android.com/intl/fr/guide/topics/search/searchable-config.html</a> etc.</p><p><img src=""http://i.stack.imgur.com/M1C6a.png"" alt=""qsb sample""></p><p>Edit:I'm currently trying this for testing, after the search intent is invoked, I start a new search with the query preset - it works but it's too slow, because it closes the search UI and reopens it, which is not what I want. I'd like the search UI to stay open.</p><pre><code>@Overrideprotected void onNewIntent(Intent intent) {    if (Intent.ACTION_SEARCH.equals(intent.getAction())) {        String query = intent.getStringExtra(SearchManager.QUERY);        Toast.makeText(this, ""TRY TO PLACE QUERY IN QSB: "" + query, Toast.LENGTH_LONG).show();        SearchManager searchManager = (SearchManager)getSystemService(Context.SEARCH_SERVICE);        searchManager.startSearch(query, true, this.getComponentName(), b, false);    }}</code></pre>","241475","","241475","","2011-02-02 08:35:56","2011-07-13 19:07:19","QSB (Quick Search Bar): make suggestions editable","<android><android-qsb>","1","0","1","",""
"4848884","1","4848919","","2011-01-31 08:30:53","1","866","<p>First, I run program on emulator. After that, I run on many android phones. Some are very small, some are show in rotate side then can't rotate back, and can't scroll (I did not do that), some are OK. </p><p>I understand may caused by different types of screen and I used AbsoluteLayout, but I do not know how to solve that problem.So, I need to resolve this problem. Anyone can help? Thanks ka </p><p>Example page that I did:</p><pre><code>  &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayout 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/usrname""    android:layout_width=""wrap_content""    android:layout_height=""21px""    android:layout_x=""105px""    android:layout_y=""179px""    android:text=""Username :""    android:textSize=""18sp""    android:textStyle=""bold"" /&gt;&lt;EditText    android:id=""@+id/usrname_text""    android:layout_width=""161px""    android:layout_height=""wrap_content""    android:layout_x=""74px""    android:layout_y=""206px""    android:textSize=""12sp"" /&gt;&lt;TextView    android:id=""@+id/pass""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_x=""105px""    android:layout_y=""252px""    android:text=""Password :""    android:textSize=""18sp""    android:textStyle=""bold"" &gt;&lt;/TextView&gt;&lt;EditText    android:id=""@+id/pass_text""    android:layout_width=""163px""    android:layout_height=""wrap_content""    android:layout_x=""73px""    android:layout_y=""279px""    android:password=""true""    android:textSize=""12sp"" /&gt;&lt;Button    android:id=""@+id/login""    android:layout_width=""73px""    android:layout_height=""wrap_content""    android:layout_x=""75px""    android:layout_y=""333px""    android:text=""Login"" /&gt;&lt;Button    android:id=""@+id/cancle""    android:layout_width=""73px""    android:layout_height=""wrap_content""    android:layout_x=""157px""    android:layout_y=""333px""    android:text=""Cancel"" /&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>These are pictures from Galaxy-S and emulator :</p><p><img src=""http://i.stack.imgur.com/0TzfI.png"" alt=""enter image description here""><img src=""http://i.stack.imgur.com/CMHku.png"" alt=""enter image description here""></p>","538788","","2118554","","2013-06-19 12:02:55","2013-06-19 12:02:55","How to handle different sizes of screen on android","<android><android-emulator><screen>","3","0","","",""
"4848918","1","","","2011-01-31 08:36:54","0","278","<p>I created an alertdiaolog in a class. I put a custom closebutton and another button for make a call. I set these items in a different mapActivity class. </p><p>Actually i have two problems. One is when i try to close my alertdiaolog with close button nothing happens second is when i try to make a call i get IndexOutofBound exception error.</p><p>Here is my code : </p><pre><code>            Context mContext = getApplicationContext();            LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);            View layout = inflater.inflate(R.layout.alertmenu,                                           (ViewGroup) findViewById(R.id.widget0));            ImageButton alertimagebutton = (ImageButton) layout.findViewById(R.id.closebutton);            alertimagebutton.setImageResource(R.drawable.close_button);            Button alertphone = (Button) layout.findViewById(R.id.widget35);             alertphone.setText(phonevalue.get(i)); //call                         alertphone.setOnClickListener(new View.OnClickListener() {                public void onClick(View v) {                    try {                        System.out.println(phonevalue.get(i));                        Intent callIntent = new Intent(Intent.ACTION_CALL);                        callIntent.setData(Uri.parse(""tel:""+phonevalue.get(i)));                        startActivity(callIntent);                    } catch (Exception e) {                        System.out.println(""Couldn't make a call= ""+e);                    }                }            });//close                          alertimagebutton.setOnClickListener(new View.OnClickListener(){                public void onClick(View v) {                    System.out.println(""closed"");  // logcat shows this message                    MyClass.alertDialog.dismiss();                }            });           MyClass.alertDialog = builder.create();           mapOverlays.add(MyClass);</code></pre><p>Note: I did this same things for listview activty and it works fine. When user clicks for detalied view it shows my alertdiaolog and can close and make call. But i created my alertdiaolog in same activity not a different class. </p><p>Note 2 :I do this for when user clicks an image in map i want to show detailed view about this person. First i created balloon and second user clicks this button it shows images detailed view.</p><p>EDIT : I solved phonecall problem. I declared another string variable after i set my phoneno:</p><pre><code>        Button alertphone = (Button) layout.findViewById(R.id.widget35);         alertphone.setText(phonevalue.get(i));        final String phone = phonevalue.get(i);</code></pre><p>And i changed callintent :</p><pre><code>                    callIntent.setData(Uri.parse(""tel:""+phone));</code></pre><p>Now it works fine but still i can't close my dialogbox.</p>","590757","","590757","","2011-01-31 16:50:48","2011-01-31 16:50:48","I can't close alertdialog","<java><android><alertdialog>","0","4","","",""
"4848986","1","4849001","","2011-01-31 08:48:16","12","1074","<p>I would like to know if there exists a good tool to implement a design in Android like tools to make easy to implement and that can generate XML </p><p>Thanks for your help.</p>","596559","","457982","","2011-01-31 10:28:09","2011-01-31 10:28:09","Good Tools To Develop a GUI in Android?","<android><xml><design><gui>","3","1","2","2014-02-18 21:29:32",""
"4848987","1","4850483","","2011-01-31 08:48:36","4","1903","<p>What I want to do is the following:</p><p>I have 4 tabs in total, but in 1 tab i want to have multiple screens which the user can change using the menuI can capture the event of when the user presses the right button, so no help needed there:)what I can't do is starting the Activity without removing the TabBar!I found some information about changing the view of the framelayout, but i really want to start another activity in the layout, not just change the view (I want to keep my code clean you see;)</p><p>thanks in advanceso in Tab A I want to be able to use Activity A and B</p>","452422","","","","","2011-01-31 11:45:43","Android: two activities, one tab","<android><activity><tabs>","2","1","2","",""
"4849063","1","","","2011-01-31 08:59:42","2","3565","<p>For work reasons, I need to develop a LKM for Android platform. I'm not very sure how to cross compile my AndroidModule.c and what tools to use for that. I guess that I'll need the source code of Android in order to tell the compiler to link the libraries from there right? I will also need to download the ARM compiler for Android. I think with those three things is enough (LKM Code in C, Android Source Code, ARM compiler for android).The problem is that I can't find any tutorial that explains how to compile LKM for Android.I'll be very pleased to have more info about it.</p>","596571","","","","","2012-05-15 18:16:30","Cross compile LKM module for Android platform","<android><linux-kernel>","3","0","3","",""
"4849084","1","","","2011-01-31 09:02:58","0","516","<p>hi guys im trying to change the scaling_governor on android device using this code</p><pre><code>String[] args = {""/system/bin/echo userspace &gt;"", ""/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor""};ProcessBuilder cmd1;  cmd1 = new ProcessBuilder(args);Process process = cmd1.start();</code></pre><p>but nothing has changed :( what am i doing wrong??</p>","596317","","377270","","2011-01-31 09:08:56","2011-01-31 09:17:17","changing scaling_governor on android device","<java><android><linux><cpu><frequency>","1","0","","",""
"4849115","1","4859163","","2011-01-31 09:06:53","7","16621","<p>How can I implement double click for a button in Android?Should I use OnDoubleTapListener?</p>","504162","","573261","","2011-01-31 09:11:25","2013-03-27 20:45:15","Implement double click for button in Android","<android><user-interface><double-click>","4","0","","",""
"4849130","1","7656422","","2011-01-31 09:09:04","3","528","<p>Can you create an XML object resource with key-value pairs (basically a hashmap) using an XML file analogous to arrays.xml? This would be an analogue of NSDictionary from Obj-C.</p><p>i.e.</p><pre><code>&lt;key&gt;foo&lt;/key&gt;&lt;value&gt;bar&lt;/value&gt;</code></pre><p>I'd like for the value to be an array of strings, and I'd like to be able to copy and paste from XML files in my Obj-C projects.</p><p>Thanks.</p>","283311","","283311","","2011-01-31 09:18:18","2011-10-05 03:33:30","Android and XML maps","<android><xml><map>","1","0","","",""
"4849142","1","","","2011-01-31 09:11:11","0","627","<p>I am developing an android application. Did all the screens UI. Implemented the functionality.</p><p>Now doing the parsing part. I have declared the attributes but when I run the code it's showing message on the emulator <code>No Message Found...</code></p><p>The url that I am parsing from is <a href=""http://services.mascus.com/api/getexport.aspx?exportid=PonEquipment"" rel=""nofollow"">http://services.mascus.com/api/getexport.aspx?exportid=PonEquipment</a></p><p>Thanks in advanceTushar</p>","475349","","418183","","2011-01-31 09:22:56","2011-03-29 08:11:29","Parsing XML using sax parser","<android><sax><xml-parsing>","1","2","","",""
"4849178","1","4849880","","2011-01-31 09:15:49","4","4409","<p>In my project, I need to trigger an inquiry about the user's action every 1h. This should be done in AyncTask(In fact, I am modifying an existing code).Can I start a new activity in doInBackGround() of AsyncTask? Thanks in advance!</p>","453676","","","","","2011-01-31 11:57:13","Starting a new Activity within doInBackGround() of AsyncTask","<android><activity><android-asynctask>","2","0","1","",""
"4849285","1","","","2011-01-31 09:30:25","2","418","<p>I am able to create database , tables , insert data &amp; retrieve by using Android code . </p><p>I came to know that in iPhone , there is any option of creating database , table using both code &amp; UI &amp; we can add the sql file in the resource folder . It will help us by reducing the time taken in creating the database &amp; tables when the application is run.</p><p>Is the same functionality of adding a predefined .sql file to the resource file possible ?</p><p>Thanks in advance.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2011-01-31 09:30:25","can we add .sql file in resource & access the database , tables","<android>","0","0","0","",""
"4849312","1","4849462","","2011-01-31 09:33:28","1","325","<p>I am developing an application for blind people. I have to work all the time with the TextToSpeech module, GPS and Network connection.</p><p>I need to do a query like this: Consult the GPS, do a JSON call and calling the TextToSpeech(TTS) module.</p><p>I am wondering the best way to deal with the different tasks which communicate with the UI main thread. I have seen so far:Handler objects and AsyncTask class.</p><p>I have to launch each task sequentially, so I want to call the TTS after retrieving data from the network. So I have used ""mHandler.post(Runnable)"" and inside that runnable calling another one and so on.</p><p>However I have seen that is recommendable the use of the AsynTask class. But in this case I think I have to implement a different class for every task, whereas I don't know if those tasks will execute sequentially. Something like:</p><pre><code>AsyntaskClass1 at1;AsyntaskClass2 at2;AsyntaskClass3 at3;at1.execute();at2.execute();at3.execute();</code></pre><p>Will that tasks execute in order? Cause the TTS module have to wait for the network task to finish...</p><p>Thanks for your help,</p><p>BR.David.</p>","588925","","588925","","2011-01-31 14:57:55","2011-01-31 14:57:55","Best way to launch different tasks","<android>","3","0","","",""
"4849347","1","","","2011-01-31 09:37:43","1","1255","<p>If i use this layout, everything is ok </p><p>See this Image:</p><p><img src=""http://i.stack.imgur.com/bx4rf.png"" alt=""enter image description here""></p><pre><code>&lt;TableLayout android:id=""@+id/TableLayout01"" android:layout_width=""fill_parent""  android:layout_height=""wrap_content"" android:background=""#000000"" android:layout_margin=""10dip"" android:padding=""10dip"" &gt;    &lt;TableRow android:id=""@+id/row1"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" &gt;         &lt;TextView android:id=""@+id/n1"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:textColor=""#ffffff""  android:text=""aaaaa a aaaaaaaaa:""&gt;&lt;/TextView&gt;        &lt;TextView android:id=""@+id/c1"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:textColor=""#ffffff""  android:layout_column=""3""  android:text=""15""&gt;&lt;/TextView&gt;    &lt;/TableRow&gt;    &lt;TableRow android:id=""@+id/row2"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;TextView android:id=""@+id/n2"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:textColor=""#ffffff""  android:text=""aaaaaaa aaaaa:""&gt;&lt;/TextView&gt;        &lt;TextView android:id=""@+id/c2"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:textColor=""#ffffff"" android:layout_column=""3"" android:text=""12""&gt;&lt;/TextView&gt;    &lt;/TableRow&gt;    &lt;TableRow android:id=""@+id/row3"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;TextView android:id=""@+id/n3"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:textColor=""#ffffff"" android:text=""aaa:""&gt;&lt;/TextView&gt;        &lt;TextView android:id=""@+id/c3"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:textColor=""#ffffff""  android:layout_column=""3""  android:text=""14""&gt;&lt;/TextView&gt;    &lt;/TableRow&gt;    &lt;TableRow android:id=""@+id/row4"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;TextView android:id=""@+id/n4"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:textColor=""#ffffff"" android:text=""aaa:""&gt;&lt;/TextView&gt;        &lt;TextView android:id=""@+id/c4"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:textColor=""#ffffff""  android:layout_column=""3""  android:text=""18""&gt;&lt;/TextView&gt;    &lt;/TableRow&gt;    &lt;TableRow android:id=""@+id/row5"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;        &lt;TextView android:id=""@+id/n5"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:textColor=""#ffffff"" android:text=""aaaaaa aaaaaaaa:""&gt;&lt;/TextView&gt;        &lt;TextView android:id=""@+id/c5"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:textColor=""#ffffff""  android:layout_column=""2""  android:text=""70""&gt;&lt;/TextView&gt;    &lt;/TableRow&gt; &lt;/TableLayout&gt;</code></pre><p>But if i set android:layout_column=""3""  for the second textview in the last row, this shows <a href=""http://www.lukafinzgar.com/nekul.png"" rel=""nofollow"">http://www.lukafinzgar.com/nekul.png</a> . </p><p>How should i set the attributes to get all the numbers in the third column?</p>","324417","","664177","","2013-04-18 09:35:19","2013-10-04 05:28:40","Aligning columns in TableLayout","<android><tablelayout>","2","0","","",""
"4849350","1","","","2011-01-31 09:37:58","0","1029","<p>I am developing an Android application which involves saving images on click of click button in camera. How can i do it.... Thanks in advance Tushar Sahni</p>","475349","","","","","2011-01-31 09:52:34","android camera and saving the images in sd card of android","<android>","1","3","","",""
"4849416","1","","","2011-01-31 09:45:04","0","1108","<p>Hey everyone ;)I have the following code:</p><pre><code>private void onCreateDBAndDBTables(){ myDB = this.openOrCreateDatabase(""Projects"", MODE_PRIVATE, null); myDB.execSQL(""CREATE TABLE IF NOT EXISTS "" + MY_DB_TABLE    + ""( _id integer primary key autoincrement     name varchar (16),     comment varchar (128),     customer_project boolean,     booking_details varchar (225),     editable boolean )""         +"";"");}</code></pre><p>and it shows the error as mentioned in the Title.I hope you can help me out here, because I have no idea what's wrong...~sam~</p>","582674","","582674","","2011-01-31 09:46:36","2011-02-01 08:26:47","string literal is not properly closed by a double-quote","<android><sql><database><string>","4","3","","",""
"4849448","1","4850871","","2011-01-31 09:49:36","2","761","<p>I am developing an Android application which uses Android's Bluetooth implementation. I want to know whether Bluetooth can be tested in an Android emulator. Can the user send files from the Android emulator using Bluetooth?</p>","475349","","342155","","2012-04-09 20:46:09","2012-10-27 16:06:10","Sending file using bluetooth in android","<android><android-emulator><bluetooth>","2","0","4","",""
"4849565","1","4849636","","2011-01-31 10:01:30","3","4131","<p>hi now i am download ndk but i dont know how to build and compile actually i am new for android application....now i am using linux...and i am not well in command line....</p><pre><code>embdes@embdes-laptop:~$ cd /home/embdes/projects/android/android-sdk-linux_86/platform-tools/embdes@embdes-laptop:~/projects/android/android-sdk-linux_86/platform-tools$ ./adb shell # lsconfigcachesdcardacctmntdetcsystemsyssbinprocinit.rcinit.goldfish.rcinitdefault.propdatarootdev# cd /sdcard# lsLOST.DIRunnai.mp3car.3gpDCIMcheetah-.3gpfunny.3gptshirt.3gpGirl.3gpdancing.3gpb7.jpeggirl1.3gptv.3gpsports.3gpsports1.3gpsports3.3gpsport2.3gptv.jpegtv1.jpegglobal.jpegorange.jpegimages.jpegddddd.jpegballoons-lift-car.3gp3d-little-monster.3gpsmoking.3gpthe.3gpNO$GBA.2.6a.zipworldreborn.bin# </code></pre>","486554","","536148","","2011-01-31 10:08:21","2012-08-21 08:30:11","how to build / compile ndk application?","<android><android-ndk>","1","1","","",""
"4849690","1","4849754","","2011-01-31 10:16:33","7","10525","<p>I have an application, I want to show my app icon to the notification bar when my application is running and i also want when user will click on my app icon present in the notification barmy app will be open. How to do this? Please Help!</p>","489762","","1471203","","2013-02-19 13:42:31","2013-12-04 23:01:25","start an application from notification bar in android","<android>","5","0","9","",""
"4849700","1","","","2011-01-31 10:17:50","4","2331","<pre><code>repo init -u git://android.git.kernel.org/platform/manifest.git -b froyoerror: revision froyo in manifests not found</code></pre><p>Latest version 2.3 required 64 bit machine to build,How to get just froyo code? </p>","110024","","648313","","2011-10-31 13:37:46","2011-10-31 13:37:46","How to sync just android 2.2 froyo code?","<android><android-source>","3","1","1","",""
"4849763","1","","","2011-01-31 10:23:01","5","14707","<p>I am using the Android SDK Emulator ad trying to connect to the web. I can not do it as in the settings > Wireless &amp; Networks , Where i need to turn the WiFi On, i get ""Error""</p><p>How to solve it?</p><p>Gorov</p>","596636","","265167","","2011-12-18 10:29:07","2013-07-05 15:30:13","Android Emulator - Wifi Error","<android><android-emulator><android-wifi>","7","2","1","",""
"4849815","1","4949148","","2011-01-31 10:30:18","0","1926","<p>I like to build my own custom kernel to use with the Android Emulator. I know how to build my own Android Emulator image and how to set the kernel that you want use when booting the emulator. But I have no idea how to build a custom kernel for the emulator and what should be in there.</p><p>Does anyone has some starting point for me or some documentation? </p>","359156","","","","","2012-05-03 23:28:26","How can I build a kernel for the Android Emulator?","<android><android-emulator><linux-kernel>","3","0","0","2013-04-28 01:47:56",""
"4849914","1","4850062","","2011-01-31 10:40:51","0","528","<p>does anybody know how to make a link accessible? For example, if I receive a message that includes www.stackoverflow.com in my application, the user to be able to access the link? The message comes on a web view.</p>","477758","","","","","2011-01-31 10:57:49","Android 2.1 link a string","<android>","1","0","1","",""
"4849967","1","","","2011-01-31 10:46:06","0","62","<p>Whenever I import <em>com.android.maps.MapActivity</em> it gives an error as ""<em>cant resolve the class</em>"".</p>","576605","","53114","","2011-01-31 11:24:32","2011-01-31 11:24:32","What is the way in which we import Map?","<android>","3","1","","",""
"4850025","1","4857931","","2011-01-31 10:52:51","9","13324","<p>Is it possible to use vertex or pixel shaders in android app?please give an example if possible of setting up shader.</p>","439730","","44729","","2011-01-31 13:42:08","2012-04-23 10:41:36","Shader for Android OpenGL ES","<android><opengl-es><shader>","2","2","6","",""
"4850137","1","4850170","","2011-01-31 11:06:45","10","15037","<p>I am trying to delete a row from a table but i have three WHERE clauses and i am not sure if i am using the correct statement. </p><pre><code>    db.delete(DBAdapter.TableName, ""Id=""+ Id          +"" AND WHERE QstnrId = ""+Integer.parseInt(QuestionnaireId)          +"" AND WHERE QstnId = ""+Integer.parseInt(QuestionId), null);</code></pre><p>I am almost certain i am not using the statement correctly. Please assist? </p>","569654","","546999","","2011-01-31 11:08:09","2011-01-31 11:16:16","Android SQLite Delete row issue","<android><sql><sqlite><sqlite3>","1","1","2","",""
"4850168","1","","","2011-01-31 11:09:10","0","1110","<p>I have an android application that have to communicate with the server using post method in HTTP. My application work fine whenever i open some other sites having basic page may be html or others but whenever i want to open my server file it gives nothing even though with get method in HTTP.</p><p>The blank response from the server can be understandable that what i am getting because i have to send some headers with post method as a request and ashx will send some response to it.</p><p>But still as expected by get method in HTTP the basic information of the page have to be retrieved.</p><p>for eg. my server url is <a href=""http://172.17.3.90/RMALite/RLHandler.ashx"" rel=""nofollow"">http://172.17.3.90/RMALite/RLHandler.ashx</a></p><p>and the basic response from the get method have to be like this.</p><pre><code>&lt;!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN""&gt;&lt;HTML&gt;&lt;HEAD&gt;&lt;META http-equiv=Content-Type content=""text/html; charset=windows-1252""&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;/BODY&gt;&lt;/HTML&gt;</code></pre><p>Unfortunately i am getting nothing</p><p>but whenever i changed the url to open other sites it work fine and i got the response in text html format.</p><p>So my Question is, Android require some stuff to handle ASP.NET handler or ashx file as compare to other sites or URL's?</p>","510617","","","","","2011-07-30 17:43:00","Does Android Support a server made on ashx or ASP.NET Web Handler file","<android>","1","0","","",""
"4850179","1","","","2011-01-31 11:10:08","0","2561","<p>i am trying to draw a line between 2 geopoints.  i am able to show to geopoints on the map.Its working fine. but i am not able to draw a line between 2 points. program has no error but line is not getting displayed. can anyone tell me what i have to change.</p><pre><code>public class HelloMapView extends MapActivity {/** Called when the activity is first created. */ LinearLayout linearLayout;MapView mapView; MapController mc;GeoPoint p,p1;class MapOverlay extends com.google.android.maps.Overlay{    @Override    public boolean draw(Canvas canvas, MapView mapView,     boolean shadow, long when)     {        super.draw(canvas, mapView, shadow);                           //---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.a);                     canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null);          //Coordinates 2       //---translate the GeoPoint to screen pixels---        Point screenPts1 = new Point();        mapView.getProjection().toPixels(p1, screenPts1);        //---add the marker---        Bitmap bmp1 = BitmapFactory.decodeResource(            getResources(), R.drawable.b);                     canvas.drawBitmap(bmp1, screenPts1.x, screenPts1.y-50, null);         //----------- Start--------------//        Projection projection = mapView.getProjection();        Path path = new Path();        Point from = new Point();        Point to = new Point();        projection.toPixels(p, from);        projection.toPixels(p1, to);        path.moveTo(from.x, from.y);        path.lineTo(to.x, to.y);        Paint mPaint = new Paint();        mPaint.setStyle(Style.FILL);        mPaint.setColor(0xFFFF0000);        mPaint.setAntiAlias(true);        canvas.drawPath(path,mPaint);        super.draw(canvas, mapView, shadow);                 return true;    }} @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mapView = (MapView) findViewById(R.id.mapview);    mapView.setBuiltInZoomControls(true);    mapView = (MapView) findViewById(R.id.mapview);    mapView.displayZoomControls(true);    mc = mapView.getController();    String coordinates[] = {""12.958998"", ""77.658998""};    double lat = Double.parseDouble(coordinates[0]);    double lng = Double.parseDouble(coordinates[1]);    p = new GeoPoint(        (int) (lat * 1E6),         (int) (lng * 1E6));    String coordinates1[] = {""12.95967"",""77.64918""};    double lat1 = Double.parseDouble(coordinates1[0]);    double lng1 = Double.parseDouble(coordinates1[1]);    p1 = new GeoPoint(        (int) (lat1 * 1E6),         (int) (lng1 * 1E6));    mc.animateTo(p);    mc.animateTo(p1);    mc.setZoom(16);   //---Add a location marker---    MapOverlay mapOverlay = new MapOverlay();    List&lt;Overlay&gt; listOfOverlays = mapView.getOverlays();    listOfOverlays.clear();    listOfOverlays.add(mapOverlay);            mapView.invalidate();}@Overrideprotected boolean isRouteDisplayed() {    return false;}          }</code></pre>","596712","","548526","","2012-12-11 06:11:38","2012-12-11 06:11:38","Drawing a line between 2 geopoints using Android 2.3","<android>","2","0","","",""
"4850192","1","4850298","","2011-01-31 11:11:41","10","26856","<p>I am new to the Android app development. Now I am designing an app, in that I have an <code>Activity</code> which is containing some content but these content is some what more so the content is out of the screen. Now I wanna show that content to the user, but I don't know how to keep scrollers to the <code>Activity</code>. </p><p>How to show the total content to the end user with the scroller using <code>RelativeLayout</code>?</p>","563593","","810368","","2012-12-04 14:55:36","2013-01-31 04:59:45","How to add scroll bar to the Relative Layout?","<android><android-layout><android-ui>","5","0","5","",""
"4850235","1","4850340","","2011-01-31 11:16:04","0","1336","<pre><code>public class ConnectDatabase extends Activity {    private SimpleDBAdapter mDbHelper;    private ListView list;    private String[] values;    private String[] list1;    private int i=0;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        list=(ListView )findViewById(R.id.simpleListView);        mDbHelper = new SimpleDBAdapter(ConnectDatabase.this);        mDbHelper.createDatabase();        mDbHelper.open();        values = mDbHelper.getEditTextValue();        mDbHelper.close();        for(i=0;i&lt;10;i++) {            String tempvalue;            tempvalue=values[i];            list1[i]=tempvalue;            Log.v(""log_tag"","" tempvalue   ""+tempvalue);            Log.v(""log_tag"", ""list1 is""+list1[i]);            //Log.v(""log_tag"","" list1""+list1[i]);         }        list.setAdapter(new ArrayAdapter&lt;String&gt;(this,            android.R.layout.simple_list_item_1, values));        //list.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);        //list.setTextFilterEnabled(true);        list.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();                /*for(int i=0;i&lt;values.length;i++) {                    String templist=values[i];                    list1[i]=templist;                }*/                String fname=values[position];                Log.v(""log_tag"", ""The fname is""+ fname);                Intent intent=new Intent(ConnectDatabase.this, Userinfo.class);                intent.putExtra(""FirstName"",fname );                startActivity(intent);            }        });    // to remove the last comma    }}</code></pre><p>Here I am doing <code>ListView</code> from SQLite database and want to display in <code>ListView</code> with only the first 10 ListView rows at the time but I get the error at the line <code>list1[i]=tempvalue;</code> so I can't copy array here anyone can help me to do copy the array name values where I get all the Column index values from my SQLite database.</p><p>Hope anyone have an idea to do this.</p>","596725","","418183","","2011-01-31 12:08:43","2011-01-31 12:08:43","Populating ListView from a SQLite database","<android><sqlite><listview>","1","2","1","",""
"4850238","1","4850359","","2011-01-31 11:17:01","2","3459","<p>I have created a layout xml file where I have two <code>RadioButton</code>s.</p><p>By default, <code>RadioButton</code> 1 is selected and I am displaying a <code>DatePicker</code> component on the screen but when the user selects <code>RadioButton</code>2 the <code>DatePicker</code> should disappear from the screen.</p><p>How can I handle the scenario? Should I make the change in layout / Java code?</p>","443141","","418183","","2012-06-05 18:07:33","2012-06-05 18:07:33","How to make UI components disappear when a certain RadioButton is selected","<android><radio-button><visibility>","1","0","","",""
"4850255","1","4850566","","2011-01-31 11:19:19","0","1500","<p>I have Listview whose data is coming from  website.data. It displays properly in a Listview, but its onListItemClick not firing properly.</p><pre><code>public class OutKrys extends ListActivity   {private ProgressDialog progress;ListView listView1;private ArrayList&lt;Post&gt; listItems = new ArrayList&lt;Post&gt;();private PostAdapter post_Adapter;public static DefaultHttpClient httpclient = new DefaultHttpClient();private class PostAdapter extends ArrayAdapter&lt;Post&gt; {    private ArrayList&lt;Post&gt; items = new ArrayList&lt;Post&gt;();    public PostAdapter(Context context, int textViewResourceId,            ArrayList&lt;Post&gt; items) {        super(context, textViewResourceId, items);        this.items = items;    }     @Override    public View getView(int position, View convertView, ViewGroup parent) {        try {            View v = convertView;            if (v == null) {                LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);                v = vi.inflate(R.layout.outkrys, null);            }            Post o = items.get(position);            if (o != null) {                TextView tt = (TextView) v.findViewById(R.id.Story);                TextView bt = (TextView) v.findViewById(R.id.userName);                TextView tm = (TextView) v.findViewById(R.id.Time);                ImageView iv=(ImageView)v.findViewById(R.id.OutKryImageView01);                if (tt != null) {                    tt.setText(o.getStory());                }                if (bt != null) {                    bt.setText(o.getUserName());                }                if (tm != null) {                    tm.setText(o.getTime());                    if(iv!=null)                    {                          Drawable drawable = LoadImageFromWebOperations(""abc.com/""+o.getImagePath());                            iv.setImageDrawable(drawable);                    }                }            }            return v;        } catch (Exception e) {            progress.dismiss();            return null;        }    }}private Drawable LoadImageFromWebOperations(String url){    try    {        InputStream is = (InputStream) new URL(url).getContent();        Drawable d = Drawable.createFromStream(is, ""src name"");        return d;    }catch (Exception e) {        System.out.println(""Exc=""+e);        return null;    }}@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    // Get the item that was clicked    Object o = this.getListAdapter().getItem(position);    String keyword = o.toString();    Toast.makeText(this, ""You selected: "" + position, Toast.LENGTH_LONG)            .show();}@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //setContentView(R.layout.listitems);    //listView1 = (ListView) findViewById(R.id.ListView01);    try {        progress = ProgressDialog.show(OutKrys.this, ""Please wait..."",                ""Loading list"", true);        Thread t = new Thread() {            public void run() {                listItems=getList();                pHandler.post(mUpdateResults);            }            };        t.start();    } catch (Exception e) {        //progress.dismiss();        Toast.makeText(OutKrys.this, ""dsadsadsa""+e, Toast.LENGTH_LONG).show();    }}final Handler pHandler = new Handler();// Create runnable for postingfinal Runnable mUpdateResults = new Runnable() {    public void run() {        updateTabData();    }};private void updateTabData() {    try {        this.post_Adapter = new PostAdapter(this, android.R.layout.simple_list_item_checked,                listItems);        this.setListAdapter( new PostAdapter(this, R.layout.outkrys,                listItems));        progress.dismiss();    } catch (Exception e) {        //progress.dismiss();    }}private ArrayList&lt;Post&gt; getList() {    try {        String loginURI = ""abcd.com"";        HttpPost httpost = new HttpPost(loginURI);        List&lt;NameValuePair&gt; nvps = new ArrayList&lt;NameValuePair&gt;();        nvps.add(new BasicNameValuePair(""authenticate"", ""authenticate""));        nvps.add(new BasicNameValuePair(""tab"", ""Recent""));        httpost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));        HttpResponse response = null;        response = KryAbout.httpclient.execute(httpost);        HttpEntity entity = response.getEntity();        Post p = new Post();        String line = """";        if (entity != null) {            InputStream resContent = response.getEntity().getContent();            line = KryAbout.ReadInputStream(resContent).toString().trim();        } else {        }        listItems.removeAll(listItems);        JSONArray ja = new JSONArray(line);        for (int i = 0; i &lt; ja.length(); i++) {            p = new Post();            JSONObject jo = (JSONObject) ja.get(i);            p.setStory(jo.getString(""story""));            p.setFavorite(false);            p.setTime(jo.getString(""time""));            p.setPid(Integer.parseInt(jo.getString(""pid"")));            p.setUserName(jo.getString(""username""));            p.setImagePath(jo.getString(""profilepicture""));            listItems.add(p);        }    } catch (Exception e) {        progress.dismiss();    }    return listItems;}    }</code></pre>","593523","","3041194","","2013-12-20 06:07:56","2013-12-20 06:07:56","Android:Listview onClick not working properly?","<android>","1","0","","",""
"4850321","1","5232714","","2011-01-31 11:26:36","0","1083","<p>I am developing an application using C2DM. I have received registration id. How can I send it to a Server. Can anyone explain me with code.?</p>","587012","","932307","","2012-04-30 22:03:10","2012-04-30 22:03:10","Android C2DM Application","<android>","2","3","2","",""
"4850322","1","","","2011-01-31 11:26:39","1","1242","<p>Actually i want 4 tabs in my app but i dont want to show default tabs. i Want to have something like dragging tabs. when i click on first tab and does not pick my finger up and drags to next tab and so on.</p><p><img src=""http://i.stack.imgur.com/lcES5.png"" alt=""enter image description here""></p><p>The tab bar like this below..when i press on one tab i can move to another tab as well by this moving of finger.</p>","383597","","383597","","2011-01-31 11:58:09","2012-03-05 07:57:45","Android custom tabs","<android>","1","3","0","",""
"4850389","1","4864040","","2011-01-31 11:34:59","0","368","<p>I am currently working on media player. When I am clicking the next button (for the next song) a number of times my application hangs up.</p><p>How do I handle this behavior and keep my app from handing up?</p>","411359","","3340","","2012-08-16 18:12:00","2012-08-16 18:12:00","Prevent android application from hanging up?","<java><android>","1","4","","",""
"4850392","1","","","2011-01-31 11:35:08","0","414","<p>I have searched for answer regarding this problem with no success. What is the situation?</p><p>I have TabWidget with two tabs. First one has activity that display video in VideoView. Second one displays images in GridView. When a GridView picture is clicked new Activity is started. It displays image in ImageView. The problem is: when I press back button, this last Activity holds for about 4,5 seconds before returning to tabs. I can see in LogCat that during that time MediaPlayerService starts the video that is in the first tab. I'm sure that this is the reason for that delay.</p><p>My question is: why does MediaPlaterService starts? It should display the tab that has nothing to do with VideoView. I'm obviously missing something, so please help.</p><p>Thanks in advance,</p><p>Shone</p>","596773","","","","","2011-02-24 08:51:48","MediaPlayerService starts in background and blocks activity for a few seconds","<android><tabs><widget><videoview>","2","0","","",""
"4850404","1","4850455","","2011-01-31 11:35:52","0","1519","<p>I have Activity2 which is a TabActivity having child activities Activity3 and Activity4.Acticity2 is called from Activity1.I want results from child activity(Activity3 or Activity4) in Activity2.Any help on this...?</p>","550982","","","","","2011-02-01 09:18:55","How to get result of child activities in a parent tab activity?","<android><activity><tabview>","1","0","","",""
"4850425","1","4991021","","2011-01-31 11:37:55","0","3757","<p>I am trying to turn off the internet connectivity thru android app like GPRS/EDGE/3G. When needed I need to turn on the same. But I could not find how to do that.</p><p>What is the API which supports this. Please help me.</p>","368999","","","","","2011-02-14 10:22:00","how to turn internet connection (GPRS/EDGE/3G) on/off","<android>","2","2","","",""
"4850450","1","","","2011-01-31 11:41:15","0","329","<p>I have created an Android application that uses the 2.1 sdk as target and Min SDK Version is set to 7. The application runs fine on the emulator for both 2.1 and 2.2. And it runs fine on my phone with 2.2.1. However the app won't install when I try to run it on the emulator with Android 2.3.</p><p>What could cause this?</p><p>UPDATE:I ran the program on another computer and it installed fine on a 2.3 AVD. So it seems to be a small problem then.</p>","336150","","336150","","2011-02-14 10:42:25","2011-02-14 10:42:25","Android app created for 2.1 doesn't work with 2.3","<android><android-emulator>","1","1","","",""
"4850463","1","","","2011-01-31 11:42:42","2","557","<p>I have a problem which took my 2 days but i m unable to solve it... The problem is, i have more than 1 activities in my application.... lets say i have Activity A and B and a receiver C.</p><p>B is always started from C. A is always the starter activity (Authentication). Now the problem is when i exit from the application, C still is active and receiving... (i also want it to be like this).... As application is not running and C starts the activity B based on some incoming event, now i press back button and activity B destroys now if i long press HOME button and start the application it starts the activity B but i want that A should be the starting activity.... Any one can help... </p><p>plz ask if you dont understand the problem.</p><p>regards,</p>","578215","","","","","2011-01-31 11:48:33","Wrong activity started on pressing home button","<android><activity>","1","0","","",""
"4850493","1","4850534","","2011-01-31 11:47:36","6","17344","<p>i have a button and i would like to open a dialog as i press it.this is my code:</p><pre><code>Button more = (Button) findViewById(R.id.more);more.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {            //Intent myIntent = new Intent(view.getContext(), agones.class);            //startActivityForResult(myIntent, 0);            AlertDialog alertDialog = new AlertDialog.Builder(this).create();            alertDialog.setTitle(""hi"");            alertDialog.setMessage(""this is my app"");            alertDialog.setButton(""Continue.."", new DialogInterface.OnClickListener() {               public void onClick(DialogInterface dialog, int which) {                  // here you can add functions               }            });        }    });</code></pre>","519526","","","","","2011-01-31 12:29:13","open a dialog when i click a button","<android><dialog>","2","5","0","",""
"4850556","1","","","2011-01-31 11:55:15","1","830","<p>Ok, I'm officially at my wit's end here.  Working on an Android app that uses AdMob.  Everything is set up to the letter following <a href=""http://www.admob.com/docs/AdMob_Android_SDK_Instructions.pdf"" rel=""nofollow"">their instructions</a>, no errors, etc.</p><p>Problem is:  I only see ads when the phone is in landscape orientation.</p><p>I've searched online and done every last thing I can think of to test this:  </p><ul><li>Tried it in test mode and normal mode</li><li>Removed the orientation configChanges from my main activity's manifest and their handlers in the code, in case they were causing it</li><li>Removed all functionality of the app so that onCreate looked like the one in the instructions above</li><li>Tried every possible change of main layout - placing it in different locations, removing other widgets, different layouts, etc</li></ul><p>These are just a summary of a few hours of testing, every time the result is the same.  Portrait shows no ad, landscape shows the ad (as/where expected - not stretched, but the max width issue is well known and not a problem).</p><p>Logcat shows everything to be working properly in both orientations:  Requests are made, ads are returned.  I can click on the ads that appear in landscape, but tapping the area they're meant to be in portrait does nothing.</p><p>It's driving me mental!  Any ideas?</p><p><strong>Edit:  Okay, the problem is gone but I'm afraid I can't really call it a ""fix"".</strong>  I remembered ads working fine in a previous but similar app.  It was using a different version of the AdMob SDK - I don't know any details, but admob-sdk-android.jar is 77kb rather than 136kb.</p><p>I copied the 77kb one from the old app into the new app, along with the attrs.xml file, which necessitated changing the primaryTextColor attribute in the AdView to textColor, and that's it.  Works perfectly now - and as a bonus, the ads stretch horizontally across the whole screen in landscape view as well!</p><p>I'm posting this as an edit rather than an answer since it seems more appropriate and I'd still love to know if anyone can shed some light on the issue.  Was it an AdMob SDK issue?</p>","593886","","593886","","2011-01-31 12:09:03","2014-03-07 11:29:06","AdMob AdView only appearing in landscape orientation","<android><orientation><admob><adview>","2","3","","",""
"4850637","1","","","2011-01-31 12:04:53","0","2321","<p>I am developing an android application which involves shaking sensor in android emulator.I have implemented functionality and 4 screens.Now I am facing problem how to implement shake listener in android.Can anybody tell me in advance.Regards Tushar</p>","475349","","","","","2011-01-31 12:11:20","shake sensor in android","<android>","2","0","1","",""
"4850641","1","","","2011-01-31 12:05:26","4","3325","<p>I have been using robotium to test my android application.Testing was successful but i want to know that is there any way to view test results in a separate file. </p>","594720","","","","","2014-03-12 10:40:52","How to generate test result report using robotium?","<android><robotium>","5","0","1","",""
"4850644","1","","","2011-01-31 12:06:17","0","645","<p>What is the best way to implement data exchange between two devices through Wai-Fai?</p>","596819","","","","","2011-01-31 18:26:47","Android: data exchange through Wai-Fai","<android><data><exchange-server><wifi>","1","3","","",""
"4850701","1","4850758","","2011-01-31 12:12:41","1","70","<p>I am developing an Android application which involves splash screen.</p><p>There is a screen containing four <code>Button</code>s and four <code>Tab</code>s. Now U am facing a problem when I have to show an image in a list.</p><p>Can anyone help me in this regard.</p>","475349","","418183","","2011-01-31 12:17:08","2011-01-31 12:18:49","Placing images in a list","<android>","1","1","1","",""
"4850705","1","","","2011-01-31 12:13:08","0","4205","<p>Here is the scenario that i want take two addresses dynamically from user, consider one of them as source and other as destination and find driving directions between source and destination.</p><p>i googled and got some stuffs not familiar to me..such as writing script using Google Maps JavaScript API V3, and the direction out put will be in json or xml format...i have tried google.map.directionrenrender and directionservice api's in my code but it is saying no such classes in google.map..as i am new to scripting language i am not understanding how to start ....i am using eclipse ide, where i want to build an <strong>android</strong>  app that takes addresses and gives driving directions between those two points..</p><p>i want the program almost similar to this <a href=""http://stackoverflow.com/questions/3896871/google-map-driving-direction-source-code-for-their-example/3898785#3898785"">Google map driving direction source code for their example ?</a>  but here they have used some html code and why that is actually  required..?</p><p>please help me in writing the code </p><p>Thanks in advance</p>","505580","","569101","","2013-09-09 08:40:51","2013-09-09 08:40:51","Finding driving directions using Google Maps JavaScript API V3","<javascript><android><google-maps><direction>","1","5","","",""
"4850798","1","4851133","","2011-01-31 12:23:15","0","529","<p>im currently porting my iphone app to android. this app makes heavy use of sqlite data. on the iphone i populate my custom objects with sqlite data, open and close my connection to the database multiple times on demand</p><p>however on the android, i have not come across many tutorials which follow this approach. they simply use a cursor and show the data directly without making use of custom objects and collections</p><p>i wanted to know if there was any particular reason for this on the android? what would you suggest me to here? ie: is it feasible to have an always on connection / cursor the the sqlite db on the android and display the data directly OR go the iphone way that is to populate collection of custom objects from sqlite and have the UI data bound to this collection instead of the sqlite cursor</p><p>thanks in advance folks</p>","83027","","","","","2011-01-31 12:58:51","android sqlite best practises for performance (direct data access via always open connection / cursor VS on demand access and custom objects)","<iphone><android><sqlite>","1","0","1","",""
"4850802","1","4850842","","2011-01-31 12:23:56","0","841","<p>I have a listview which has a scrollbar. Inside the listview each item/row has 2 textviews of which the third textview is scrollable. </p><p>i am setting the data to the listview using an Array Adapter.</p><p>But i am not able to scroll the textview.</p><p>My listview looks like:- </p><pre><code>&lt;ListView android:id=""@+id/list"" android:layout_width=""480dip"" android:cacheColorHint=""#00000000""        android:layout_height=""60dip""  android:scrollbarFadeDuration=""1000000""/&gt;</code></pre><p>My xml which i am using to inflate the view is</p><pre><code>&lt;LinearLayout android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:id=""@+id/rowlayout_row2""    android:orientation=""horizontal"" android:weightSum=""1.0""    android:gravity=""center""&gt;    &lt;TextView android:id=""@+id/textview1""        android:layout_width=""0dip"" android:gravity=""center""        android:layout_weight=""0.3"" android:layout_height=""wrap_content""        android:textColor=""#5C5C5C"" android:text=""Commenmts ""        android:textSize=""12dip"" android:typeface=""sans"" android:paddingTop=""3dip""        android:paddingLeft=""3dip"" /&gt;    &lt;TextView android:id=""@+id/review_data_id"" android:scrollbars = ""vertical""        android:layout_width=""0dip"" android:gravity=""left"" android:maxLines=""2""        android:layout_weight=""0.6"" android:layout_height=""wrap_content""         android:layout_toRightOf=""@+id/textview1"" android:textColor=""#5C5C5C""        android:textSize=""12dip"" android:typeface=""sans"" android:paddingTop=""3dip""        android:paddingLeft=""3dip"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>I have tried to make it fosuble but that did not work..</p>","544631","","","","","2011-01-31 12:44:04","Scrolling in a TextView Inside a ListView","<android><listview><textview>","1","0","","",""
"4850843","1","4850947","","2011-01-31 12:28:46","-1","338","<p>My application needs a database. The database contains only one table i.e. for password. Password will be inserted only one time, and there's no need for delete and upgrade. Can anybody help for code? For this password database, user will insert only one time, and database will be closed. And when the user inserts next time, the password will be checked against the database password.</p>","595646","","1128737","","2012-01-13 14:48:15","2012-01-13 14:48:15","Database in Android","<android>","4","0","","",""
"4850873","1","4850915","","2011-01-31 12:31:33","2","652","<p>I'm currently creating an application that adds rows to an existing table. The code looks like this:</p><pre><code>TextView exampleTextView = (TextView) messageView.findViewById(R.id.exampleLabel);exampleTextView.setText(locationMsg.getMessageContent());TableRow tr = (TableRow) messageView.findViewById(R.id.tableRow);tr.addView(exampleTextView);table.addView(tr);</code></pre><p>In the XML I've got a table layout that's inside a linearLayout thats inside a frameLayout thats inside a tabwidget and it looks like this:</p><pre><code>&lt;TableLayout android:id=""@+id/distanceTable""  android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:layout_gravity=""center"" android:background=""#DDDDDD"" android:stretchColumns=""1"" &gt; &lt;TableRow&gt;  &lt;TextView  android:textColor=""#000000""  android:text=""@string/label_device""  android:layout_gravity=""center""  android:padding=""3dip""  android:textSize=""18sp"" /&gt;  &lt;TextView  android:textColor=""#000000""  android:text=""@string/label_distance""  android:layout_gravity=""center""  android:padding=""3dip""  android:textSize=""18sp"" /&gt;  &lt;TextView  android:textColor=""#000000""  android:text=""@string/label_time""  android:layout_gravity=""center""  android:padding=""3dip""  android:textSize=""18sp"" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id=""@+id/tableRow"" &gt;  &lt;TextView  android:id=""@+id/exampleLabel""  android:textColor=""#000000""  android:layout_gravity=""center""  android:padding=""3dip""  android:textSize=""18sp"" /&gt;  &lt;TextView  android:id=""@+id/anotherExampleLabel""  android:textColor=""#000000""  android:layout_gravity=""center""  android:padding=""3dip""  android:textSize=""18sp"" /&gt;  &lt;TextView  android:id=""@+id/someOtherLabel""  android:textColor=""#000000""  android:layout_gravity=""center""  android:padding=""3dip""  android:textSize=""18sp"" /&gt; &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>Creating those labels works fine, but when I want to add the text to a row, the application crashes and I get an ""IllegalStateException"", the detailed message is: </p><blockquote>  <p>The specified child already has a parent. You must call removeView()  on the child's parent first.</p></blockquote><p>I don't quite get it. When I look at a tutorial like <a href=""http://en.androidwiki.com/wiki/Dynamically_adding_rows_to_TableLayout"" rel=""nofollow"">this</a> there isn't anything that has to be removed first.So what exactly am I doing wrong?</p>","596827","","1564449","","2013-10-08 06:40:09","2013-10-08 06:40:09","IllegalStateException when adding a view to a TableRow on Android","<android><table><illegalstateexception>","2","0","","",""
"4850889","1","4853038","","2011-01-31 12:32:48","3","5028","<p>We've recently released our game onto Android Market but are suffering from a major issue. We are getting emails and bug reports from people all over the world that they aren't able to download our game.</p><p>Searching the web for people with similar issues we've found that some are experiencing similar problems, though they can't download any applications at all from the Market. The people we have been dealing with can download everything else except for our game. The people reporting issues have enough memory on their devices both internal and external.</p><p>Does anyone have any clue to what the problem can be?</p><p>Best Regards,Alex</p><p>Edit:Since the problem is download related we've been speculating in that its the Android Manifest file we've have.</p><p>What is the first thing that happens when a user downloads an application from Android Market? Because when we try downloading our product the download ""starts"" and then the error message ""Download Unsuccessful"" flashes over the bar.</p><p>Our product is a paid application and the transaction is successful but then when the user tries to download it they get the error.</p><p>It seems as if the error started occurring after we submitted our first updated, though minor and not any game changing I really don't understand how this can effect the Market behavior.</p>","596838","","596838","","2011-01-31 15:42:23","2012-04-26 23:42:53","People can't download our specific product in Android Market","<android><google-play>","2","9","4","",""
"4850918","1","","","2011-01-31 12:35:40","1","956","<p>hi i am an android developer.</p><p>i am making a camera application in android.i have a sony Experia X10. version 2.1i am launching a hardware camera. but when thepreview is start it come with noise in portrait mode or 90 degree anticlockwisebut in landscape it comes better.</p><p>but if i checked same appliction in sony Experia X8. version 2.1preview comes good in both mode landscape or portrait.</p>","596846","","","","","2011-02-28 15:03:38","Orientation Problem in Camera","<android>","1","0","","",""
"4850923","1","","","2011-01-31 12:36:01","0","432","<p>just wondering if it's possible to modify the android menu layout. Eg, with different color backgrounds, font size, etc.</p><p>I know we can add icons, but I was hoping for something more.</p><p>Also, can we make the menu display more than 6 items a time?</p><p>How can this be achieved? Are there perhaps some XML tags?</p><p>If anyone has a link to all the different XML tags for me, that would be awesome too.</p><p>Regards,</p><p>Rich.</p>","596841","","","","","2011-01-31 12:43:47","Android menu modification?","<android><xml><layout><menu>","1","1","","",""
"4850944","1","","","2011-01-31 12:38:07","1","1479","<p>Hi~ I'm a beginner of android .And I try to get the registeration id by using the google's simple c2dm code...and here is my code...</p><pre><code>Intent registrationIntent = new Intent (""com.google.android.c2dm.intent.REGISTER"");     registrationIntent.setPackage(""com.imei""); //""com.imei""   registrationIntent.putExtra(""app"", PendingIntent.getBroadcast(this, 0, new Intent   (), 0));      registrationIntent.putExtra(""sender"", ""corxxxxx@gmail.com"");       Log.d(""WelcomeScreen"",""corxxxxx@gmail.com"");      TextView textview = (TextView)this.findViewById(R.id.textview);      textview.setText(""The Show Start..."");      Button mbutton = (Button)this.findViewById(R.id.button); //set a button to jump          mbutton.setOnClickListener(new View.OnClickListener(){  public void onClick(View v)  {    System.out.println(""adds"");  //just for check   startService(registrationIntent);   Intent intent = new Intent(imei.this, showthinga.class);   startActivity(intent);   handleRegistration(getApplicationContext(), registrationIntent);    System.out.println(""end"");  //just for check    }  }); }private void handleRegistration(Context context, Intent intent) </code></pre><p>{<br>     String registration = intent.getStringExtra(""registration_id"");<br>     if (intent.getStringExtra(""error"") != null)      {<br>      // Registration failed, should try again later.       Log.e(""ERROR"", ""ERROR"");<br>      } else if (intent.getStringExtra(""unregistered"") != null) {<br>      // unregistration done, new messages from the authorized sender will be rejected            Log.e(""unregistered"", ""unregistered"");<br>      }       else if (registration != null)       {<br>       // Send the registration ID to the 3rd party site that is sending the    messages.<br>       // This should be done in a separate thread.<br>       // When done, remember that all registration is done.<br>      Log.e(""registration"", registration);<br>       }<br>     }<br>  }  </p><p>But everytime When I look at my logcat message...It always shows ...""Unable to start service intent {act=com.google.android.c2dm.intent.REGISTER pkg=com.imei(has extras):not find}""I've been refreshed my avd to ""Google APIS by Google Inc,Android API8,revision 2""...But it still not working &amp; that message alwaysed shown up ... so...Is there anything I missed or somthing I did wrong ?</p>","517011","","","","","2011-02-15 13:28:42","Get registration id by using c2dm on emulator","<android><push>","1","1","","",""
"4850974","1","","","2011-01-31 12:41:04","19","9791","<p>I want to use traceview in android in eclipse. I have a few questions:1. Does my emulator phone need to have a sd card for traceview to work?2. Is there anyway to start traceview directly from eclipse ide?</p><p>I did try to put sd card memory in my avd device but still i cannot find the folder marked sdcard.</p><p>thanks in advance.</p>","590849","","","","","2013-01-07 16:04:18","how to use traceview in eclipse for android development?","<android>","4","0","5","",""
"4850985","1","4851589","","2011-01-31 12:41:58","2","715","<p>i am picking images on my app with android, and i dont know why, sometimes i got an exception, i think it's allways i select a image with more than 400 or 500 kb's but i am not sure. Why? because when i select small images of 100 kb i dont get the exception, and when i get images with high KB or MB, it crash WITH <code>java.lang.OutOfMemoryError: bitmap size exceeds VM budget</code>.  <strong>BUT VERY IMPORTANT: it crashes on the emulator but ALSO CRASH ON MY PHONE, is not a failure of the emulator.</strong></p><p>this is my code: </p><pre><code>changeImageButton.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                Intent i = new Intent(Intent.ACTION_PICK,                        android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);                startActivityForResult(i, ACTIVITY_SELECT_IMAGE);            }        }); protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {         super.onActivityResult(requestCode, resultCode, imageReturnedIntent);         switch(requestCode) {        case 1:        {            setResult(1);            finish();            }        case ACTIVITY_SELECT_IMAGE:            if(resultCode == RESULT_OK){                  Uri selectedImage = imageReturnedIntent.getData();                String[] filePathColumn = {MediaStore.Images.Media.DATA};                Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null);                cursor.moveToFirst();                int columnIndex = cursor.getColumnIndex(filePathColumn[0]);                String filePath = cursor.getString(columnIndex);                cursor.close();                selectedPhoto = BitmapFactory.decodeFile(filePath);                //profileImage.setImageBitmap(selectedPhoto);                profileImage.setImageBitmap(Bitmap.createScaledBitmap(selectedPhoto, 80, 80, false));            }        }    }</code></pre><p>profileImage is a ImageView of my layout. and i use scaled butmap to resice the image to 80x80</p><p>please give me some help with this exception, i need to solve it</p><p>this is the exception:</p><pre><code> 01-31 12:38:37.531: ERROR/AndroidRuntime(1025): Uncaught handler: thread main exiting due to uncaught exception    01-31 12:38:37.552: ERROR/AndroidRuntime(1025): java.lang.OutOfMemoryError: bitmap size exceeds VM budget    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:375)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:171)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:196)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at com.GPSLoc.Configuration.onActivityResult(Configuration.java:253)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at android.app.Activity.dispatchActivityResult(Activity.java:3595)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3001)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3047)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at android.app.ActivityThread.access$2300(ActivityThread.java:112)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1721)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at android.os.Handler.dispatchMessage(Handler.java:99)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at android.os.Looper.loop(Looper.java:123)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at android.app.ActivityThread.main(ActivityThread.java:3948)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at java.lang.reflect.Method.invokeNative(Native Method)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at java.lang.reflect.Method.invoke(Method.java:521)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)    01-31 12:38:37.552: ERROR/AndroidRuntime(1025):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","479886","","479886","","2011-01-31 12:51:02","2011-01-31 13:48:24","Exception picking a image from gallery (SD Card) for use on my app... java.lang.OutOfMemoryError: bitmap size exceeds VM budget","<android><android-gallery>","1","1","","",""
"4851013","1","4851058","","2011-01-31 12:45:16","0","4630","<p>I have a simple server running on my pc and a simple client on my htc desire running android 2.2.</p><p>The server and client both use the same port. I hard code the servers ip into the clients code. When I try to connect to the running server via the client on android the client throws this exception: </p><pre><code>IOException ...: java.net.SocketException: The operation timed out.</code></pre><p>Here are parts of the client and server codes:</p><p>client code</p><pre><code>  InetAddress addr;  Socket socket = null;  byte [] ipAddress = new byte[] {(byte)82,(byte)168,(byte)175,(byte)141};  try{   addr = InetAddress.getByAddress(ipAddress);   socket = new Socket(addr, 1234);   System.out.println(""socket = ""+socket);   BufferedReader in = new BufferedReader(            new InputStreamReader(             socket.getInputStream()));   PrintWriter out = new PrintWriter(            new BufferedWriter(             new OutputStreamWriter(socket.getOutputStream())),true);        out.println(""hello"");        socket.close();  } catch (UnknownHostException e) {   System.out.println(""UnknownHostException ...: ""+e);  } catch (IOException e) {   System.out.println(""IOException ...: ""+e);  }</code></pre><p>,</p><p>server code</p><pre><code>    ServerSocket ss = new ServerSocket(PORT);  System.out.println(""Started:""+ss);  try{   //block until a connection occures   Socket socket = ss.accept();   try{    System.out.println(""Conncetion accepted:""+socket);    InputStream IS = socket.getInputStream();    InputStreamReader ISR = new InputStreamReader(IS);    BufferedReader in = new BufferedReader(ISR);    OutputStream OS = socket.getOutputStream();    OutputStreamWriter OSR= new OutputStreamWriter(OS);    BufferedWriter BW = new BufferedWriter(OSR);    //output automatically flushed by PrintWriter    PrintWriter out = new PrintWriter(BW,true);    while(true){     String str = in.readLine();     System.out.println(""Client: ""+str);     out.println(""hi"");    }   }finally{    System.out.println(""Closing..."");    socket.close();   }  }finally{   ss.close();  }</code></pre><p>This code is working using wifi but not through 3g.</p><p>Any help is welcome...and thank you in advance.</p>","263481","","546999","","2011-01-31 12:49:29","2011-01-31 12:55:12","how to get simple android client and pc server get working","<android><client><timeoutexception>","1","0","","",""
"4851021","1","4851738","","2011-01-31 12:46:23","4","1898","<p>I want to parse a text for some links (url and phone numbers) and I've tried code </p><pre><code>String message = ""text text www.evz.ro test 1234567 test www.220.ro test Http://emm.ro"";SpannableString ss = new SpannableString(message);Linkify.addLinks(ss, Linkify.ALL);Object[] spans = ss.getSpans(0, ss.length() - 1, null)</code></pre><p>What parameter should I use instead of null? What class type?I just need to know from where the link starts and where it ends</p>","517558","","","","","2011-01-31 14:02:54","android getSpans parameters","<android><parsing><hyperlink>","1","0","1","",""
"4851034","1","4851074","","2011-01-31 12:47:16","0","1798","<p>I have an .apk that has a <code>Service</code> and an <code>Activity</code> that I want to share preferences. I guess I use <code>getSharedPreferences(""somename"", MODE_PRIVATE)</code> to do that. A couple of questions though:</p><ol><li><p>Is <code>MODE_PRIVATE</code> OK?  Does that mean it's private for the application or the Activity/Service?</p></li><li><p>I have a <code>PreferenceActivity</code>. How do I tell it to manage ""somename"" instead of the default preferences?</p></li></ol><p>Thanks!</p>","446347","","418183","","2011-01-31 12:50:40","2011-01-31 12:51:27","Sharing preferences between an Activity and a Service","<android><android-sdk-2.1><sharedpreferences>","1","0","","",""
"4851051","1","5521633","","2011-01-31 12:49:09","0","3006","<p><img src=""http://i.stack.imgur.com/ydJs4.jpg"" alt=""enter image description here""></p><p>I want to scroll a text automatically in horizontal way. I tried the method below, but the text was not scrolling.</p><pre><code>   &lt;TextView      android:id=""@+id/text""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:layout_alignParentBottom=""true""    android:background=""@drawable/bg_1""    android:textColor=""#cc0000""    android:scrollHorizontally=""true""    android:singleLine=""true""     android:ellipsize=""marquee""    android:marqueeRepeatLimit =""marquee_forever""    android:focusable=""true""    android:focusableInTouchMode=""true""   /&gt;</code></pre><p>So please tell me how to scroll a text and if there is any need to add some code in the class file also.</p>","745367","","469983","","2012-11-19 14:00:46","2014-03-15 05:13:15","Scroll a text automatically on horizontal","<android><xml><textview><scrollview>","3","0","","",""
"4851109","1","4851130","","2011-01-31 12:56:04","1","4055","<p>hi how to build ndk application...now i am using linux os and i am new for android application please tell me simply....</p>","486554","","558433","","2011-01-31 13:12:25","2011-02-13 10:26:02","how to build ndk application?","<android><build><android-ndk>","2","5","1","",""
"4851175","1","4851222","","2011-01-31 13:04:25","7","3422","<p>I have a TextView and I want to apply a Style which I use for all TextView elements plus another style which I only use within a specific Activity. Is there any possibility to do that?</p>","358114","","358114","","2012-02-23 11:45:58","2012-02-23 11:45:58","How to apply two different styles to one element in android?","<android><view><coding-style><styles>","3","0","2","",""
"4851273","1","4851631","","2011-01-31 13:17:48","1","166","<p>I've been following a tutorial for working with SQL databases, I think I'm having issues with it because it has been written a while ago. </p><p>For example it had this.createDatabase which had to be replaced with this.openOrCreateDatabase, I found this with Google. There are other problems that I cannot find the solutions to: Query, Results, Next, setListAdapter all show errors. </p><p>Is this in fact the problem, that the tutorial has been created for an earlier SDK? Can someone please tell me where to go to see deprecated methods and their replacements or point out what I should be replacing the above with? </p><p>Apologies I'm just starting out with this, hopefully you understand what I mean. Help is very much appreciated.</p><p>EDIT:Tutorial is here: <a href=""http://www.anddev.org/novice-tutorials-f8/working-with-the-sqlite-database-cursors-t319.html"" rel=""nofollow"">http://www.anddev.org/novice-tutorials-f8/working-with-the-sqlite-database-cursors-t319.html</a></p><p>The problems are in the code below, c.first, results.add, c.next, this.setListAdapter and most of the last line have errors</p><pre><code>if (c.first()) {                            int i = 0;                            /* Loop through all Results */                            do {                                    i++;                                    /* Retrieve the values of the Entry                                     * the Cursor is pointing to. */                                    String firstName = c.getString(firstNameColumn);                                    int age = c.getInt(ageColumn);                                    String ageColumName = c.getColumnName(ageColumn);                                    /* Add current Entry to results. */                                    results.add("""" + i + "": "" + firstName                                   + "" ("" + ageColumName + "": "" + age + "")"");                            } while (c.next());                    }            }    } catch (FileNotFoundException e) {    } finally {            if (myDB != null)                    myDB.close();    }    this.setListAdapter(new ArrayAdapter&lt;String&gt;(this,            android.R.layout.simple_list_item_1_small, results));</code></pre><p>}}</p>","590672","","590672","","2011-01-31 21:41:56","2011-01-31 21:45:19","Android SQL Errors","<android><sql><sdk>","2","1","","",""
"4851295","1","4851660","","2011-01-31 13:19:46","2","3109","<p>Is it possible for my application to receive an SMS from a specific phone number, without letting it trig a system notification, but let all other messages pass to the default SMS application to be treated normally?</p><p>If so, how can the system know which process is first on queue to pick which messages to receive?</p>","300963","","","","","2012-11-07 04:11:09","Android: Receiving SMS from specific phone number","<android><sms>","5","0","1","",""
"4851394","1","4851430","","2011-01-31 13:31:10","1","1226","<p>I've specified a class, based on another one in an existing Android project. The addRow() method is supposed to dynamically add rows to a table.When creating a new TextView to add to my row and also when creating that row, I'm supposed to specify the ""context"". The current way, trying ""getApplicationContext()"" throws a NullPointerException.So where am I supposed to get that context from?</p><pre><code>public class DistanceTableView extends ContactListActivity{    public void addRow(LocationMessage locationMsg){        View messageView = theInflater.inflate(R.layout.homepage, null);        TableLayout table = (TableLayout)messageView.findViewById(R.id.distanceTable);        TextView senderNameTextView = new TextView(getApplicationContext());        senderNameTextView.setText(locationMsg.getSenderName());        TableRow tr = new TableRow(getApplicationContext());        tr.addView(distanceTextView);        table.addView(tr);        rows.addFirst(messageView);    }}</code></pre><p>The class that my view is extending:</p><pre><code>public class ContactListActivity extends MapActivity implements        ConnectionListener {}</code></pre>","596827","","","","","2011-01-31 13:35:03","getApplicationContext() throws an exception when used","<android><exception><context>","2","1","","",""
"4851437","1","","","2011-01-31 13:35:18","1","81","<p>For my application., I must add a button to start myappl. on key lock screen between unlock button.How can I do this?Thanks</p>","596912","","","","","2011-01-31 13:39:50","Addin a Button on keylock screen ANDROID","<android>","1","0","","",""
"4851456","1","","","2011-01-31 13:37:25","0","277","<p>I am new to this android development i imported a project in eclipse when i try to run the project it is giving the following error,</p><p>Launch configuration Bootstrap references non-existing project Projectname.</p><p>Please guide me.</p><p>Thanks,Balaram.</p>","563593","","","","","2011-01-31 13:41:16","Project import Problem","<android>","1","0","","",""
"4851494","1","4851523","","2011-01-31 13:40:09","3","252","<p>Is there a clever way to parse a tag found in two different areas?</p><pre><code>@Overridepublic void startElement(String namespaceURI, String localName,String qName, Attributes atts) throws SAXException {    if (localName.equals(""item"")) {       this.in_item = true;    }}</code></pre><p>example:</p><pre><code>&lt;xml&gt;   &lt;item&gt;      &lt;test1 /&gt;      &lt;item /&gt;      &lt;test2 /&gt;   &lt;/item&gt;&lt;/xml&gt;</code></pre>","470006","","","","","2012-11-09 17:14:15","Sax parsing with localname more than one appearance","<java><android><xml><parsing><sax>","3","0","1","",""
"4851625","1","","","2011-01-31 13:52:23","0","48","<p>I just enter for Android programming. I install Eclipse and android SDK. I made Hello World Program but my concern how will i run it in Android phone environment. When i am running it from Eclipse environment ( Run as Android Application), my android is loading but program is not running. How will i run directly it (Hello world project) in android phone.</p><p>I have mentioned i just enter in Android programing So it may be simple question.</p>","518537","","","","","2011-01-31 13:52:23","Android running problem in windows","<android>","0","4","","",""
"4851629","1","4852029","","2011-01-31 13:52:47","3","1512","<p>How can we apply effects like a sepia filter to our camera images?</p>","304961","","53114","","2011-01-31 14:14:47","2011-06-21 17:48:38","How to apply effects to camera images?","<android><android-camera>","1","1","1","",""
"4851659","1","","","2011-01-31 13:56:27","15","29283","<p>Does any one know how to wrap text in TextView in Android platform. i.e if the text in textview exceed the screen length it should be displayed in the second line.</p><p>I have searched and tried the following:</p><pre><code>android:scrollHorizontally=""false"",android:inputType=""textMultiLine"",android:singleLine=""false""</code></pre><p>But none work..</p><p>Can anyone suggest how can i do it..i am relatively new to android platform..</p>","562674","","244296","","2011-01-31 14:02:26","2013-11-26 12:13:04","how to wrap text in textview in android","<android><textview><wrap>","8","2","0","",""
"4851706","1","7344968","","2011-01-31 14:00:22","1","2864","<p>I am trying to get swipe gestures working with a tab layout in an android app. What I am working with is a single activity with a different view for each tab. Rather than having them contained in a FrameLayout, I am using a ViewFlipper for my tab content. I want to make left/right swipe gestures change the active tabs the active tab to the one to the left or right of the current one. </p><p>The problem arises when swiping to and from my third list after items have been added to it. I'm seeing a behavior where the third list is displayed, but is overlaid on the list I was on previously. </p><p>Any ideas why this is happening?</p><p>My java code for switching views/tabs:</p><pre><code>public void onSwipe(int direction) {         switch (direction) {             case SimpleGestureFilter.SWIPE_RIGHT : swipeRight(); break;        case SimpleGestureFilter.SWIPE_LEFT :  swipeLeft(); break;    }    }private void swipeLeft() {      viewFlipper.setInAnimation(this,R.anim.slide_in_right);    viewFlipper.setOutAnimation(this,R.anim.slide_out_left);    viewFlipper.showNext();    tabHost.setCurrentTab( (tabHost.getCurrentTab()+1 ) % NUMTABS );}private void swipeRight() {    viewFlipper.setInAnimation(this, android.R.anim.slide_in_left);     viewFlipper.setOutAnimation(this,android.R.anim.slide_out_right);    viewFlipper.showPrevious();    tabHost.setCurrentTab( (tabHost.getCurrentTab()+(NUMTABS-1) ) % NUMTABS ); //loop around to avoid -1}</code></pre><p>My layout:</p><pre><code>&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;RelativeLayout    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""        android:layout_alignParentTop=""true"" /&gt;    &lt;ViewFlipper        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_below=""@android:id/tabs""        android:layout_above=""@+id/search_button""        android:padding=""5dp"" &gt;                   &lt;ListView android:id=""@+id/list1""          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:choiceMode=""multipleChoice""          android:layout_alignParentTop=""true""          android:textFilterEnabled=""true""/&gt;         &lt;ListView android:id=""@+id/list2""          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:choiceMode=""multipleChoice""          android:layout_alignParentTop=""true""          android:textFilterEnabled=""true""/&gt;         &lt;ListView android:id=""@+id/list3""          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""           android:layout_alignParentTop=""true""/&gt;     &lt;/ViewFlipper&gt;     &lt;Button android:id=""@+id/search_button""              android:layout_width=""fill_parent""              android:layout_height=""wrap_content""              android:layout_alignParentBottom=""true""              android:text=""Search"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p></p>","2371514","","2371514","","2011-02-03 15:16:56","2013-08-05 13:38:26","Android- Gesture enabled tab layout with lists","<android><layout><tabs><gesture><swipe>","2","1","0","",""
"4851830","1","4854860","","2011-01-31 14:11:11","6","603","<p>I have a form with many EditTexts, and when I press a certain button, I need to retrieve all these controls and put them into a HashMap so the key is the name (key1 int the following code)</p><pre><code>&lt;EditText android:id=""@+id/key1""         style=""@style/keys"" /&gt; </code></pre><p>and the value, whatever text the user enters.</p><p>My question is, how can I retrieve the name of the EditText for the Hashmap's keys ? getId() returns a number.</p><p>Thanks</p>","253944","","","","","2011-01-31 18:58:34","How to retrieve EditText's xml id","<android><edittext><identifier>","3","2","","",""
"4851847","1","4922833","","2011-01-31 14:12:56","0","617","<p>I've a straight forward question, I think I'm missing some point. My test app is being deployed on emulator, within an AVD with a virtual SD Card of 30megs.When I call the following from my main activity:</p><pre><code>DatabaseManager.Initialize(this);DatabaseManager.getEntities();</code></pre><p>My app crashes and debugger says no such table ! The table <strong>ITEM</strong> is created in the onCreate() of my database helper and <strong>is</strong> correctly called (Step by step debug). What am I missing there ?</p><p><strong>database manager</strong></p><pre><code>public class DatabaseManager {public static final String ITEM_CONTACT = ""CONT"";public static final String ITEM_FILE = ""FILE"";public static final String ITEM_APP = ""AAPP"";public static final String ITEM_OPT = ""OPTS"";private static final String DATABASE_NAME = ""androfast.sqlite3.db"";private static final Integer DATABASE_VERSION = 1;private static final String TABLE_ITEM = ""ITEM"";private static final String TABLE_KEYWORD = ""KEYWORD"";private static final String DATABASE_SCHEMA_FILE = ""schema.sql"";public static final String ITEM_COLUMN_ID = ""id"";public static final String ITEM_COLUMN_NAME = ""name"";public static final String ITEM_COLUMN_PACKAGE = ""pkg"";public static final String ITEM_COLUMN_TYPE = ""kind"";public static final String ITEM_COLUMN_PRIORITY = ""karma"";public static final String KEYWORD_COLUMN_ID = ""id"";public static final String KEYWORD_COLUMN_VALUE = ""word"";public static final String KEYWORD_COLUMN_PRIORITY = ""karma"";private static SQLiteDatabase dbSqlite;private static DatabaseHelper dbHelper;private static Context context;public static void Initialize(Context ctx) throws IOException{    context = ctx;    InputStream is = ctx.getAssets().open(DATABASE_SCHEMA_FILE);    BufferedReader r = new BufferedReader(new InputStreamReader(is));    StringBuilder strQuery = new StringBuilder("""");    String s;    while ((s = r.readLine()) != null){        strQuery.append(s);    }    r.close();    dbHelper = new DatabaseHelper(ctx, DATABASE_NAME,null, DATABASE_VERSION, strQuery.toString());    dbSqlite = dbHelper.getWritableDatabase();}public static SQLiteDatabase getSqliteDatabase(){    return dbSqlite;}public static void runQuery(String strQuery){    dbSqlite.execSQL(strQuery);}public static List&lt;Item&gt; getEntities(){    ArrayList&lt;Item&gt; items = new ArrayList&lt;Item&gt;();    Cursor cursor;    dbSqlite.execSQL(""INSERT INTO ITEM (name, pkg, kind) VALUES('Don Coreleone', 'life.thug.jail', 'CONT')"");    dbSqlite.execSQL(""INSERT INTO ITEM (name, pkg, kind) VALUES('slavery.png', 'life.thug.jail', 'FILE')"");    dbSqlite.execSQL(""INSERT INTO ITEM (name, pkg, kind) VALUES('Alcatraz', 'life.thug.jail', 'AAPP')"");    dbSqlite.execSQL(""INSERT INTO ITEM (name, pkg, kind) VALUES('BLUETOOTH', 'life.thug.jail', 'OPTS')"");    dbSqlite.execSQL(""INSERT INTO ITEM (name, pkg, kind) VALUES('Che Guevara', 'life.thug.jail', 'CONT')"");    cursor = dbSqlite.query(TABLE_ITEM, null,null,null,null,null,null);    if (cursor.moveToFirst()){        do{            Log.d(""APP/DB"", cursor.getString(cursor.getColumnIndex(ITEM_COLUMN_NAME)));        }while(cursor.moveToNext());    }    cursor.close();    return items;}}</code></pre><p><strong>database helper</strong></p><pre><code>public class DatabaseHelper extends SQLiteOpenHelper{private static final String LOG_TAG = ""SQLiteOpenHelper"";private String dbCreateQuery;public DatabaseHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version, String dbCreate) {    super(context, name, factory, version);    dbCreateQuery = dbCreate;}@Overridepublic SQLiteDatabase getWritableDatabase() {    return super.getWritableDatabase();    //To change body of overridden methods use File | Settings | File Templates.}@Overridepublic SQLiteDatabase getReadableDatabase() {    return super.getReadableDatabase();    //To change body of overridden methods use File | Settings | File Templates.}@Overridepublic void close() {    super.close();    //To change body of overridden methods use File | Settings | File Templates.}@Overridepublic void onCreate(SQLiteDatabase sqLiteDatabase) {    sqLiteDatabase.execSQL(dbCreateQuery);}@Overridepublic void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {    Log.w(LOG_TAG,""Upgrading database from version "" + i + "" to version "" + i1);    // No need to do drops of tables, these must be included in the schema.sql file    onCreate(sqLiteDatabase);}@Overridepublic void onOpen(SQLiteDatabase db) {    super.onOpen(db);}}</code></pre><p>Thanks for your directions fellas</p><p>Kind regards,</p><p>Miloud B.</p>","429059","","135152","","2011-05-25 02:59:44","2011-05-25 02:59:44","Android 2.3 Sqlite Troubles with while inserting","<android><sqlite><android-emulator>","1","7","","",""
"4851896","1","","","2011-01-31 14:17:38","2","4019","<p>I would like to use horizontall scrolling items in a vertically scrolling Listview.</p><p>My naive take on this was to put the contents of the listview items inside a scrollView. The items are wider horizontally than the scrollview, but not higher than the scrollview. Since the listview is a normal vertically scrolling listview, I figured that dragging vertically would scroll in the list, while dragging horizontally would scroll in the items. </p><p>However that didn't work. The list scrolls fine vertically and shows the items correctly, but scrolling horizontally does not work (nothing happens). Unfortunately I am really not sure where to go from here.</p><p>Note that the items should scroll horizontally independently of the other items, i.e the whole list should not scroll sideways when dragging sideways.</p><p>As a reference, I would like the list to behave similar to what it does in the app 'Pulse', in case you have seen it.</p>","596964","","321731","","2013-10-31 18:00:17","2013-10-31 18:00:17","Android: How can I make horizontally scrollable items in a vertical listview?","<android><listview><scrollview>","4","0","","",""
"4851906","1","4851969","","2011-01-31 14:19:05","2","433","<p>I need to create a Bi-directional spinner in Android .Providing the following sample:</p><p><img src=""http://i.stack.imgur.com/d80hC.png"" alt=""enter image description here""></p><p>Can anyone provide any inputs ?</p><p>Thanks in Advance.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2011-01-31 15:06:10","Develop Bi-directional Spinner in Android","<android>","2","0","1","",""
"4851986","1","4852634","","2011-01-31 14:26:31","2","709","<p>I know I can get screen width/height in a browser, can I get any other information about the device?  Device name, OS, carrier, etc?</p>","356708","","356708","","2011-01-31 15:25:26","2011-01-31 15:30:06","What information can I get from the android browser JavaScript?","<javascript><android><browser>","2","0","1","",""
"4851997","1","4852036","","2011-01-31 14:27:25","2","1373","<p>I am developing an Android app and want to get the road distance between 2 locations.If I understand correctly, the options are:</p><ol><li>Using the distanceTo() or distanceBetween() methods of the Location class — but this only provides the direct line instance.</li><li>Using the Google Directions API — but this only seems to be available to Javascript, and I am developing in Java.</li></ol><p>Are there any other options available? If so, an example would be appreciated.</p>","396707","","2291","","2012-05-30 19:18:56","2012-05-30 19:18:56","Road Distance calculation available to Java","<android><driving-directions>","1","0","","",""
"4852027","1","","","2011-01-31 14:30:09","0","2172","<p>I have an android app installed in mobile phone. What I want to do is, when user connects the phone and go to sync screen of the app and click on sync, I want to access mdb file from pc. </p><p>is it feasible?</p><p>-- Edit --</p><p>Here is an example scenerio:</p><p>I have an existing desktop application in vb that is using .mdb file as database installed in lap top.</p><p>I have created an android app to use some of the features of the app to android. since android doesn't support mdb, I've converted the important tables to sqlite database and using the same while showing android app</p><p>Now I want some automated way to sync the sqlite db in single way as android app is read only. </p><p>we can use a button in desktop app to sync db in phone but I don't want any manual work from user.</p><p>Not sure what is the best way to deal with this</p>","560940","","560940","","2011-02-01 07:30:58","2011-02-01 17:57:07","Sync sqlite db in phone from mdb in network location, is it feasible?","<android><sqlite>","2","0","1","",""
"4852099","1","4854526","","2011-01-31 14:36:09","0","1982","<p>I am trying to implement zoom functionality on an ImageView, similar to the built-in Photos app on iOS (I don't have a physical android device to make a more suitable analogy).  Pinch-to-zoom would be nice to have, but zoom on double-tap is essential.</p><p>I've tried some sample code (ex. <a href=""http://android-journey.blogspot.com/2010/01/android-gestures.html"" rel=""nofollow"">http://android-journey.blogspot.com/2010/01/android-gestures.html</a>), but this does not work for me, for some reason; none of the event handlers fire (I may be omitting something simple?).  </p><p>Can someone point me in the right direction?</p><p>For troubleshooting purposes, I used sample code unmodified from the above link, on an Android 2.3 emulator in an application with android:minSdkVersion=7 and the following layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ImageView  xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:src=""@drawable/android""    android:id=""@+id/image""    /&gt;</code></pre>","534173","","","","","2011-01-31 18:23:13","Double tap to zoom on ImageView","<android><android-emulator><android-layout>","1","1","0","",""
"4852281","1","4852468","","2011-01-31 14:52:46","15","12808","<p>Is there any way, in code, to make a button flash continually and then stop flashing when pressed?</p>","538847","","20712","","2013-10-12 14:02:29","2013-10-12 14:03:46","android - How can I make a button flash?","<android>","3","0","11","",""
"4852307","1","4852389","","2011-01-31 14:55:23","3","25453","<p>i have a listview and i would like to go to a new activity from every list item i press.this is my code..</p><pre><code>public class DialogActivity extends Activity { private ListView lv1; private String lv_arr[]={""SuperLeague 2010-2011"",""Olympiakos on YouTube"",""Olympiakos Web Site"",""Find Karaiskaki on map"",""Reserve Tickets""};    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.dialog);        lv1=(ListView)findViewById(R.id.dialog_list);        // By using setAdpater method in listview we an add string array in list.        lv1.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1 , lv_arr));        lv1.setOnItemClickListener(new OnItemClickListener() {      public void onItemClick(AdapterView&lt;?&gt; parent, View view,          int position, long id) {      //  Intent newActivity = new Intent(view.getContext(),agones.class);                 //     startActivity(newActivity);      }    });    }</code></pre><p>}</p>","519526","","","","","2013-10-15 08:42:30","listView onclick goes to a new activity","<android><listview>","4","2","5","",""
"4852347","1","4852364","","2011-01-31 14:59:21","0","800","<p>I am trying to make an application in which there are few tabs &amp; one of the tab contains map. </p><p>Till now I was able to create the tabs and map on one of the tab. So when I click on the 1st tab I can see the map which shows a default city (Las Vegas). </p><p>My question is if now I want to create the same menu items (Search, Directions, Places etc.) which already exists in the default Google Map application in the emulator, Do I need to write the logic for all those menu items? </p><p>Its like I want the whole google map application in one of my tab. Is it possible?</p><p>Right now I have created the map with zoom-in / zoom-out functionality. Now I want to add the search feature which will search for the place and locate it on the map. So do I need to write the whole code and ui for it? I am feeling like its re-inventing the wheel.</p><p>I am new in Android so please bare with me if I am missing any obvious thing about maps.</p><p>thnx !</p>","596990","","","","","2011-01-31 15:12:13","Google Map on Android in a Tab","<android><search><google-maps><map><android-mapview>","2","0","","",""
"4852570","1","8015284","","2011-01-31 15:22:04","0","1012","<p>The libs are packaged in the apk in the lib directory.</p>","498346","","","","","2011-11-05 08:11:29","Adding a prebuilt APK that requires shared libraries","<android><shared-libraries><apk>","1","4","","",""
"4852573","1","","","2011-01-31 15:22:24","4","8059","<p>HiHow can i add title to this custom dialog??</p><p><img src=""http://i.stack.imgur.com/luw1g.jpg"" alt=""enter image description here""></p><p>I have tried like this</p><pre><code>public void customDialog() {  Dialog dialog=new Dialog(this);  dialog.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);  dialog.getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.string.app_name );  dialog.setContentView(R.layout.dialog_submit);  TextView edit_model=(TextView) dialog.findViewById(R.id.edit_model);  edit_model.setText(android.os.Build.DEVICE);  dialog.show(); }//end of custom dialog function</code></pre><p>I have tried to set title like this too..<code>dialog.setTitle(""Enter Details"");</code> but this too didn't yielded any result. So how can i set title to this custom dialog??</p><p>This is my dialog_submit.xml file used for the custom dialog.</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/layout_root""          android:orientation=""vertical""           android:layout_width=""fill_parent""          android:layout_height=""fill_parent""          android:padding=""10dp""          &gt;  &lt;TextView android:id=""@+id/txt_name""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:textColor=""#FFF""          android:text=""Name""          android:textStyle=""bold""          /&gt;  &lt;EditText android:id=""@+id/edit_name""          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:layout_below=""@+id/txt_name""          /&gt;&lt;TextView android:id=""@+id/txt_model""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:textColor=""#FFF""          android:layout_below=""@+id/edit_name""          android:text=""Phone Model""          /&gt;&lt;TextView android:id=""@+id/edit_model""          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:layout_below=""@+id/txt_model""          /&gt;&lt;Button android:id=""@+id/but_cancel""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:layout_below=""@+id/edit_model""          android:text=""Cancel""               /&gt;&lt;Button android:id=""@+id/but_submit""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:layout_below=""@+id/edit_model""          android:layout_toRightOf=""@+id/but_cancel""              android:text=""Submit""               /&gt;                       &lt;/RelativeLayout&gt;</code></pre>","466474","","","","","2013-08-23 00:37:30","How to add title to the custom Dialog?","<android><dialog>","5","0","3","",""
"4852580","1","","","2011-01-31 15:23:27","0","614","<p>I've got an android app that uses a map activity and serves up content based on map location.</p><p>I'm looking for a way to allow the user to search for a location by name (anything from 'New York' to 'Eiffel Tower') - e.g. have a text input field into which they could type 'Rome' - after pressing a button, the user would be brought to the coordinates of Rome on the map. What would be the best way to go about this?</p><p>I've looked into the google geocoding api (http://code.google.com/apis/maps/documentation/geocoding/), but it has limitations of 2,500 geolocation requests per day - I'm presuming this is per API key? Or is it per user/source IP? 2,500 requests for one android app woudln't last long.</p><p>Ideally, I would be able to search for English and foreign names of countries.</p><p>Thanks in advance!r3mo</p>","421636","","","","","2011-03-31 21:21:48","Android: Maps - Best way to provide 'search for location' feature?","<android><google-maps><geocoding>","1","0","","",""
"4852598","1","","","2011-01-31 15:25:05","3","853","<p>This has been asked before, but I have found no solution that worked for me yet:</p><p>When adding rows to a table from code, the rows are not showing up in the application. There is one row I specified in XML, that one is showing up, but nothing below it.</p><p>This is the code, I've added the constructor of my class aswell:</p><pre><code>private LayoutInflater theInflater;private LinkedList&lt;View&gt; rows;private Context thisContext;public DistanceTableView(LayoutInflater vi, Context context){  theInflater = vi;  rows = new LinkedList&lt;View&gt;();  thisContext = context;    }public void addRow(LocationMessage locationMsg){  View messageView = theInflater.inflate(R.layout.homepage, null);  TableLayout table = (TableLayout)messageView.findViewById(R.id.distanceTable);  TextView senderNameTextView = new TextView(thisContext);  senderNameTextView.setText(locationMsg.getSenderName());  TableRow tr = new TableRow(thisContext);  tr.addView(distanceTextView);  table.addView(tr);  rows.addFirst(messageView);}</code></pre><p>homepage.xml contains this, I removed some elements and parameters:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout&gt;    &lt;TabHost&gt;    &lt;TabWidget /&gt;        &lt;FrameLayout&gt;        [..]                    &lt;LinearLayout&gt;                      [..]                &lt;TableLayout                android:id=""@+id/distanceTable""                 android:layout_height=""wrap_content""                android:layout_width=""wrap_content""                android:layout_gravity=""center""                android:background=""#DDDDDD""                android:stretchColumns=""1"" &gt;                    &lt;TableRow&gt;                        &lt;TextView                        android:textColor=""#000000""                        android:text=""@string/label_device""                        android:layout_gravity=""center""                        android:padding=""3dip""                        android:textSize=""18sp"" /&gt;                        &lt;TextView                        android:textColor=""#000000""                        android:text=""@string/label_distance""                        android:layout_gravity=""center""                        android:padding=""3dip""                        android:textSize=""18sp"" /&gt;                        &lt;TextView                        android:textColor=""#000000""                        android:text=""@string/label_time""                        android:layout_gravity=""center""                        android:padding=""3dip""                        android:textSize=""18sp"" /&gt;                    &lt;/TableRow&gt;                &lt;/TableLayout&gt;            &lt;/LinearLayout&gt;        &lt;/FrameLayout&gt;    &lt;/TabHost&gt;&lt;/LinearLayout&gt;</code></pre><p>Unfortunately hierarchyviewer.bat doesn't work for me in order to check if the rows are there but just not visible. In the debugger it looks fine to me.</p>","596827","","596827","","2011-02-01 09:56:54","2011-02-01 09:56:54","Rows added to table are not showing up","<android><table>","1","2","1","",""
"4852612","1","4852712","","2011-01-31 15:26:42","0","280","<p>It is my understanding (please correct me if i'm way off the mark) that my using threads correctly will allow an application to seem to multitask despite high processor load.</p><p>In my application I have a thread in which I process images taken from the camera preview and attempt to do real-time face detection with a great deal of success. The problem lies when at the same time as this I want to be able to have a button on the screen which can be pressed and some action taken without any relation to what is going on to the camera detection methods. </p><p>The problem is the face detection is pretty quick, but when I go to press the button it takes a good second or so to respond to this. Without the face detection thread being activated (i.e. the start() method never being called) the button is very quick. Below is a stripped version of my code as it's too long just to post straight as it is:</p><pre><code>public void surfaceCreated(SurfaceHolder holder) {        mCamera = Camera.open();        faceThread = new Thread(new Runnable(){            public void run(){                //Get camera preview image and detect faces            }        });        faceThread.start();    }public void onClickShoot(View v) throws InterruptedException,            media = new MediaPlayer();    media.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {        public void onCompletion(MediaPlayer mp) {            media.stop();            media.reset();        }    });    media.setDataSource(this, dataPath);    media.prepare();    media.start();            //And some other stuff here too.    }</code></pre><p>Is it just a limitation that I have this delay on the fact it's a mobile platform and i'm expecting too much? Or is there a way of making this work? I'f you need more info about what i'm doing please just ask :).</p><p><strong>Edit (more code to address problem):</strong></p><pre><code>mCamera.setPreviewCallback(new PreviewCallback() {                    public void onPreviewFrame(final byte[] _data, Camera _camera) {                        Camera.Parameters parameters = mCamera.getParameters();                        int format = parameters.getPreviewFormat();                        // YUV formats require more conversion                        if (format == ImageFormat.NV21) {                            int w = parameters.getPreviewSize().width;                            int h = parameters.getPreviewSize().height;                            // Get the YuV image                            YuvImage yuv_image = new YuvImage(_data, format, w, h, null);                            // Convert YuV to Jpeg                            Rect rect = new Rect(0, 0, w/3, h); // Rect of the image in which to search for the face                            final ByteArrayOutputStream output_stream = new ByteArrayOutputStream();                            yuv_image.compressToJpeg(rect, 10, output_stream);                            // Convert from Jpeg to Bitmap                            detectFaces(BitmapFactory.decodeByteArray(                                    output_stream.toByteArray(), 0,                                    output_stream.size()));                            Log.v(""TEST"", ""TEST"");                        }                    }                });public void detectFaces(Bitmap bmp) {        FaceView faceView = new FaceView(this, bmp);}</code></pre>","400406","","400406","","2011-02-01 10:04:04","2011-02-01 10:04:04","Problem with a laggy application using threads","<java><android><multithreading>","1","0","","",""
"4852740","1","4868040","","2011-01-31 15:41:55","4","12343","<p>I'm trying to code an app that uses the camera. I'm getting a NullPointerException when trying to get the surfaceHolder that i eventually pass to the surfaceCreated() that starts up the camera. is there any situation when the getHolder() returns NULL?</p><p>thanks.</p><pre><code>package com.tecmark;import java.io.IOException;import android.app.Activity;import android.graphics.PixelFormat;import android.hardware.Camera;import android.os.Bundle;import android.util.Log;import android.view.SurfaceHolder;import android.view.SurfaceView;import android.view.Window;import android.view.WindowManager;public class cameraView extends Activity implements SurfaceHolder.Callback{    SurfaceView mSurfaceView;    SurfaceHolder mSurfaceHolder;    Camera mCamera;    boolean mPreviewRunning; /** Called when the activity is first created. */    @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.camera_surface);           mSurfaceView = (SurfaceView) findViewById(R.id.surface_camera);        Log.i(""surfaceholder = "", ""about to get surface holder"");        try{        mSurfaceHolder = mSurfaceView.getHolder();        }catch(Exception e){         e.printStackTrace();        }        Log.i(""surfaceholder = "", """"+mSurfaceHolder.toString());        mSurfaceHolder.addCallback(this);        mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);        setContentView(R.layout.camera_surface);        surfaceCreated(mSurfaceHolder);    } @Override public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {  if (mPreviewRunning) {   mCamera.stopPreview();   }   Camera.Parameters p = mCamera.getParameters();   p.setPreviewSize(w, h);   mCamera.setParameters(p);   try {   mCamera.setPreviewDisplay(holder);   } catch (Exception e) {   e.printStackTrace();   }   mCamera.startPreview();   mPreviewRunning = true;   } @Override public void surfaceCreated(SurfaceHolder holder) {  try{   Log.i(""camera "", ""about to open camera"");         mCamera = Camera.open();         Log.i(""camera "", "" camera opened"");         mCamera.getParameters();         mCamera.setPreviewDisplay(holder);         mCamera.startPreview();   } catch (IOException e) {    e.printStackTrace();   }  Log.i(""camera "", ""ok""); } @Override public void surfaceDestroyed(SurfaceHolder holder) {  mCamera.stopPreview();  mPreviewRunning = false;  mCamera.release(); }}//end of activity01-31 15:29:17.773: WARN/System.err(9144): java.lang.NullPointerException01-31 15:29:17.778: WARN/System.err(9144):     at com.tecmark.cameraView.onCreate(cameraView.java:42)01-31 15:29:17.778: WARN/System.err(9144):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)01-31 15:29:17.778: WARN/System.err(9144):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)01-31 15:29:17.783: WARN/System.err(9144):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)01-31 15:29:17.783: WARN/System.err(9144):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)01-31 15:29:17.783: WARN/System.err(9144):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)01-31 15:29:17.783: WARN/System.err(9144):     at android.os.Handler.dispatchMessage(Handler.java:99)01-31 15:29:17.783: WARN/System.err(9144):     at android.os.Looper.loop(Looper.java:123)01-31 15:29:17.783: WARN/System.err(9144):     at android.app.ActivityThread.main(ActivityThread.java:4363)01-31 15:29:17.783: WARN/System.err(9144):     at java.lang.reflect.Method.invokeNative(Native Method)01-31 15:29:17.788: WARN/System.err(9144):     at java.lang.reflect.Method.invoke(Method.java:521)01-31 15:29:17.788: WARN/System.err(9144):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)01-31 15:29:17.788: WARN/System.err(9144):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)01-31 15:29:17.788: WARN/System.err(9144):     at dalvik.system.NativeStart.main(Native Method)01-31 15:29:17.793: DEBUG/AndroidRuntime(9144): Shutting down VM01-31 15:29:17.793: WARN/dalvikvm(9144): threadid=3: thread exiting with uncaught exception (group=0x4001b180)01-31 15:29:17.793: ERROR/AndroidRuntime(9144): Uncaught handler: thread main exiting due to uncaught exception01-31 15:29:17.803: ERROR/AndroidRuntime(9144): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tecmark/com.tecmark.cameraView}: java.lang.NullPointerException01-31 15:29:17.803: ERROR/AndroidRuntime(9144):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)01-31 15:29:17.803: ERROR/AndroidRuntime(9144):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)01-31 15:29:17.803: ERROR/AndroidRuntime(9144):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)01-31 15:29:17.803: ERROR/AndroidRuntime(9144):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)01-31 15:29:17.803: ERROR/AndroidRuntime(9144):     at android.os.Handler.dispatchMessage(Handler.java:99)01-31 15:29:17.803: ERROR/AndroidRuntime(9144):     at android.os.Looper.loop(Looper.java:123)01-31 15:29:17.803: ERROR/AndroidRuntime(9144):     at android.app.ActivityThread.main(ActivityThread.java:4363)01-31 15:29:17.803: ERROR/AndroidRuntime(9144):     at java.lang.reflect.Method.invokeNative(Native Method)01-31 15:29:17.803: ERROR/AndroidRuntime(9144):     at java.lang.reflect.Method.invoke(Method.java:521)01-31 15:29:17.803: ERROR/AndroidRuntime(9144):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)01-31 15:29:17.803: ERROR/AndroidRuntime(9144):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)01-31 15:29:17.803: ERROR/AndroidRuntime(9144):     at dalvik.system.NativeStart.main(Native Method)01-31 15:29:17.803: ERROR/AndroidRuntime(9144): Caused by: java.lang.NullPointerException01-31 15:29:17.803: ERROR/AndroidRuntime(9144):     at com.tecmark.cameraView.onCreate(cameraView.java:47)01-31 15:29:17.803: ERROR/AndroidRuntime(9144):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)01-31 15:29:17.803: ERROR/AndroidRuntime(9144):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)01-31 15:29:17.803: ERROR/AndroidRuntime(9144):     ... 11 more</code></pre>","532462","","532462","","2011-02-01 19:53:07","2011-02-01 21:16:59","surfaceView.getHolder not returning SurfaceHolder","<android>","2","0","4","",""
"4852764","1","","","2011-01-31 15:43:28","0","168","<p>My gridview does not renders if I am using my derived GridClass, It does render when I add GridView object to myLayout but not when I add My Grid Object/ :( .Here's is the code</p><pre><code>        public class parentClass extends MyotherClass        {        Grid _gridV = null;            public void createGridMenu(GridViewAdapter adp )            {              _gridV = (Grid) inflater.inflate(R.layout.Mygridmenu, null);           _gridV.setAdapter(adp);             MyLinearLayout.add(_gridV);               }        class Grid extends GridView{            Grid()            {            super(myContext);                   }                    @Override            protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)            {                super.onMeasure(widthMeasureSpec, heightMeasureSpec);            }         }        //My other methods        }</code></pre>","340353","","","","","2011-01-31 17:31:35","Gridview does not comes up using custom class","<android>","1","2","","",""
"4852776","1","4914040","","2011-01-31 15:44:26","9","4515","<p>Android Market now allows you to upload screenshots in three sizes: 320x480, 480x800, or 480x854.  Which size should I use?</p><p>The 320x480 screenshots look pretty blurry on my 480x800 Nexus One. But I'm afraid that if I use larger images, they will be illegible on 320x480 (my screens have a lot of text on them).</p><p>Looking at <a href=""http://developer.android.com/resources/dashboard/screens.html"">http://developer.android.com/resources/dashboard/screens.html</a> it only shows densities, not screen sizes.  Those densities are split equally between ""Normal/HDPI"" and ""Normal/MDPI"".</p><p>Would it be possible to upload both and have the market serve 320x480 images only to phones that need them?</p>","54829","","","","","2011-06-26 23:03:32","What size of screenshot should I use in the Android Market?","<android><google-play>","3","1","3","",""
"4852828","1","4852967","","2011-01-31 15:48:20","1","2526","<p>I have an android.R.layout.simple_list_item_multiple_choice with checkboxes an want so initiate some of them. How can I do that?I have the following code:</p><pre><code>    private void fillList() {    Cursor NotesCursor = mDbHelper.fetchAllNotes();    startManagingCursor(NotesCursor);    String[] from = new String[] { NotesDbAdapter.KEY_TITLE, NotesDbAdapter.KEY_BODY, NotesDbAdapter.KEY_CHECKED };    int[] to = new int[] {     android.R.id.text1,     android.R.id.text2,     //How set checked or not checked?     };    SimpleCursorAdapter notes = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_multiple_choice, NotesCursor,            from, to);    setListAdapter(notes);}</code></pre>","570168","","","","","2011-01-31 17:31:44","Android: How to set List item checked?","<android><list><checkbox><adapter>","1","1","1","",""
"4852837","1","4863242","","2011-01-31 15:49:00","2","8069","<p>I'm coming from the world of GWT and UIBinder, where I'm used to defining custom components by extending Composite, and then putting all the UI layout code in a MyComponent.ui.xml file. This is a very nice way to build up components from smaller pieces.</p><p>I'm trying to achieve the same effect on Android with custom Views. I've been able to programmatically extend <code>View</code>, and then add objects by calling <code>addView(textView)</code>. I'd like to be able to do that in XML, but I don't see how to associate an xml layout file with the view (apart the primary <code>res/layout/main.xml</code> file, which provides the primary layout for the app.</p><p>How can I layout my custom views in XML?</p><p><strong>Edit:</strong> My question was unclear. What I'm looking to do is associate a <code>my_widget.xml</code> file with my customized view. Then in my_widget.xml I'd like to define various TextViews, etc, and plug them into my View class.</p>","93995","","93995","","2011-01-31 16:36:46","2011-02-01 13:37:55","Android: how to use XML for custom view layout","<android><android-layout>","3","0","","",""
"4852867","1","6496632","","2011-01-31 15:51:14","21","16057","<p>I'm using a GridView for a game board. Recently some users have had problems with the board scrolling vertically (on Samsung Galaxy / Vibrant phones running 2.2) -- This bug does not occur on my Nexus One.</p><p>One user produced some <a href=""http://imgur.com/a/PiaUg"">screenshots</a> of the problem.</p><p>How could I lock the GridView in place? Is there a way to disable scrolling?</p>","478044","","1288","","2013-02-12 13:31:08","2013-02-12 13:31:08","How to disable GridView scrolling in Android?","<android><gridview>","2","0","8","",""
"4852919","1","4853177","","2011-01-31 15:54:49","0","481","<p>Anyway, although I like the IntelliJ's way of not adding Min SDK Version into the manifest file (Eclipse adds it by default), I wonder if there is a way to add it during a new project creation?</p><p>At the moment I add the SDK limit manually into the manifest file which is ok most of time, but not with the current project. </p>","437039","","","","","2011-01-31 16:16:30","Add 'Min SDK Version' in IntelliJ during project creation","<android><intellij-idea>","1","0","1","",""
"4852983","1","4853138","","2011-01-31 15:59:20","4","1128","<p>I'm making a simple music application for android.It's working fine, but when I want to change the multimedia volume I can't make it directly from the application. If I click the volume up/down button it changes the Phone calls volume, so I should go to another application (game) and when clicking again on those buttons it changes Multimedia volume.</p><p>Do you know any way to select that those volume buttons works just for multimedia volume in my application instead of whole phone?</p><p>Thank you very much</p>","474684","","","","","2012-04-05 20:36:45","Multimedia volume instead of Phone volume in Android","<android><volume>","3","0","1","",""
"4853011","1","4853025","","2011-01-31 16:01:09","48","72940","<p>I am trying to sign my apk file. I can't figure out how to do it. I can't find good in-depth directions. I have very little programing experience, so any help would be appreciated.</p>","595137","","952925","","2011-12-23 14:59:10","2014-03-25 12:15:54","How to sign an android apk file","<android><apk><signing>","5","3","13","",""
"4853090","1","5428461","","2011-01-31 16:08:45","3","1314","<p>I'm using the SliderDrawer in Android. Inside the drawer I have a layout which contains a inflated layout. Here's the end result:</p><p><img src=""http://i.stack.imgur.com/6Vcny.gif"" alt=""enter image description here""></p><p>Notice how the content of the drawer (in gray) doesn't take the whole width of the parent (black area).</p><p>Here's the drawer code (main_layout.xml):</p><p>[UPDATE 2, added the whole code:]</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;LinearLayout android:id=""@+id/banner"" android:orientation=""horizontal""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:gravity=""center"" android:padding=""3px""&gt;    &lt;ImageView android:src=""@drawable/title""      android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" /&gt;    &lt;TextView android:layout_width=""wrap_content"" android:text=""@string/title""      android:layout_height=""wrap_content"" android:textSize=""18sp""      android:gravity=""center_vertical"" android:paddingLeft=""4px""      android:textStyle=""bold"" /&gt;  &lt;/LinearLayout&gt;  &lt;LinearLayout android:layout_below=""@id/banner"" android:id=""@+id/middle"" android:orientation=""vertical""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;View android:layout_width=""fill_parent"" android:layout_height=""1dip""      android:background=""#FF555555"" /&gt;    &lt;ListView android:id=""@android:id/list"" android:layout_width=""fill_parent""      android:layout_height=""fill_parent"" android:padding=""3px""      android:layout_weight=""1"" /&gt;    &lt;TextView android:id=""@android:id/empty"" android:layout_width=""fill_parent""      android:layout_height=""fill_parent"" android:text=""@string/no_items""      android:padding=""3px"" android:layout_weight=""1"" /&gt;  &lt;/LinearLayout&gt;  &lt;LinearLayout android:id=""@+id/LinearLayout01"" android:layout_alignParentBottom=""true""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:orientation=""vertical"" android:gravity=""center_horizontal|bottom""&gt;    &lt;SlidingDrawer android:id=""@+id/drawer"" android:background=""#22222222""       android:layout_height=""110dip"" android:handle=""@+id/handle""      android:content=""@+id/media_player_container"" android:layout_width=""fill_parent""&gt;      &lt;ImageView android:id=""@+id/handle"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:src=""@drawable/tray"" android:scaleType=""centerCrop""/&gt;      &lt;LinearLayout android:id=""@+id/media_player_container""        android:layout_width=""fill_parent"" android:layout_height=""wrap_content""        android:gravity=""bottom|center_horizontal"" /&gt;    &lt;/SlidingDrawer&gt;  &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>Here's the code of the inflated area (media_player_container.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:gravity=""bottom|center_horizontal"" android:orientation=""vertical""  android:background=""#FF555555"" android:padding=""3px""&gt;  &lt;SeekBar android:id=""@+id/progress"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:paddingBottom=""3px"" android:progress=""1000"" /&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;ImageButton android:id=""@+id/speakerhandset"" android:src=""@drawable/handset"" android:layout_width=""60dip"" android:layout_height=""wrap_content"" android:scaleType=""center""/&gt;    &lt;ImageButton android:id=""@+id/rewind"" android:src=""@android:drawable/ic_media_rew"" android:layout_width=""60dip"" android:paddingRight=""3px"" android:layout_height=""wrap_content"" android:scaleType=""center""/&gt;    &lt;ImageButton android:id=""@+id/play"" android:src=""@android:drawable/ic_media_play"" android:layout_width=""60dip"" android:paddingRight=""3px"" android:layout_height=""wrap_content"" android:scaleType=""center""/&gt;    &lt;ImageButton android:id=""@+id/pause"" android:src=""@android:drawable/ic_media_pause"" android:layout_width=""60dip"" android:paddingRight=""3px"" android:layout_height=""wrap_content"" android:visibility=""gone""  android:scaleType=""center""/&gt;    &lt;ImageButton android:id=""@+id/fastforward"" android:src=""@android:drawable/ic_media_ff"" android:layout_width=""60dip"" android:paddingRight=""3px"" android:layout_height=""wrap_content"" android:scaleType=""center""/&gt;  &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Can you spot what I'm doing wrong??</p><p>[Update 1] Here's the code (inside onCreate()) where I inflate the layout: </p><pre><code>LinearLayout container = (LinearLayout) this.findViewById(R.id.media_player_container);LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);LinearLayout layout = (LinearLayout) layoutInflater.inflate(R.layout.media_player, null, false);container.addView(layout);</code></pre>","442512","","442512","","2011-03-24 20:34:46","2013-06-19 22:47:11","Layout issue: SliderDrawer doesn't fill parent width","<android><android-layout>","4","2","2","",""
"4853132","1","4853270","","2011-01-31 16:11:59","1","190","<p>I've written a turn-based game the allows a mixture of AI and human players.  The order in which each player takes his turn will be different in each round.  Currently it's working in a really non-Android-friendly manner, running through the AI in an activity's onCreate function.  Obviously I want to change this so my idea is as follows -</p><p>From the main menu I'd like to create an activity which sets up a thread on which I'll run all game logic.  The thread will cycle through the players, displaying the outcome of their go after each one.  Each AI player will update its logic here.  For a human player, though, it will need to create an activity as the player is able to change, view and update many details.  How am I able to do this from a thread, and allow the thread to continue processing the other players once the human has finished his activity?</p>","574740","","","","","2011-01-31 16:24:32","Calling (and returning from) activities in a game thread","<android><multithreading>","2","0","","",""
"4853152","1","4856806","","2011-01-31 16:13:42","2","1526","<p>i want to open a map when i click a button but unfortunately my app forces down...this is my logcat:</p><pre><code>01-31 18:11:49.465: VERBOSE/InputDevice(2836): ID[0]=0(0) Up(1=&gt;0)01-31 18:11:49.606: WARN/dalvikvm(6111): Class resolved by unexpected DEX: Lkostas/menu/olympiakos/GoogleMaps;(0x486356d8):0x22f5d8 ref [Lcom/google/android/maps/MapActivity;] Lcom/google/android/maps/MapActivity;(0x486356d8):0x21dca001-31 18:11:49.606: WARN/dalvikvm(6111): (Lkostas/menu/olympiakos/GoogleMaps; had used a different Lcom/google/android/maps/MapActivity; during pre-verification)01-31 18:11:49.606: WARN/dalvikvm(6111): Unable to resolve superclass of Lkostas/menu/olympiakos/GoogleMaps; (67)01-31 18:11:49.606: WARN/dalvikvm(6111): Link of class 'Lkostas/menu/olympiakos/GoogleMaps;' failed01-31 18:11:49.610: DEBUG/AndroidRuntime(6111): Shutting down VM01-31 18:11:49.610: WARN/dalvikvm(6111): threadid=1: thread exiting with uncaught exception (group=0x4001d7d0)01-31 18:11:49.641: ERROR/AndroidRuntime(6111): FATAL EXCEPTION: main01-31 18:11:49.641: ERROR/AndroidRuntime(6111): java.lang.NoClassDefFoundError: kostas.menu.olympiakos.GoogleMaps01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at kostas.menu.olympiakos.DialogActivity$1.onItemClick(DialogActivity.java:47)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at android.widget.AdapterView.performItemClick(AdapterView.java:284)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at android.widget.ListView.performItemClick(ListView.java:3672)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:1812)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at android.os.Handler.handleCallback(Handler.java:587)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at android.os.Handler.dispatchMessage(Handler.java:92)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at android.os.Looper.loop(Looper.java:123)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at java.lang.reflect.Method.invokeNative(Native Method)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at java.lang.reflect.Method.invoke(Method.java:521)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at dalvik.system.NativeStart.main(Native Method)01-31 18:11:49.641: ERROR/AndroidRuntime(6111): Caused by: java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at dalvik.system.DexFile.defineClass(Native Method)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:209)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:203)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)01-31 18:11:49.641: ERROR/AndroidRuntime(6111):     ... 13 more01-31 18:11:49.660: WARN/ActivityManager(2836):   Force finishing activity kostas.menu.olympiakos/.DialogActivity</code></pre><p>thats the way i m calling the map activity:</p><pre><code>Intent newActivity111 = new Intent(DialogActivity.this, GoogleMaps.class);                                     startActivity(newActivity111);</code></pre>","519526","","519526","","2011-01-31 16:26:00","2012-05-02 21:58:57","Force Down error in MapView","<android><google-maps><android-mapview>","3","1","","",""
"4853371","1","","","2011-01-31 16:32:14","1","929","<p>I have a HTC Wildfire , and i have updated my android from 2.1 to 2.2 as i was developing application which creates the livewallpaper.</p><p>Now the problem is inside my application there a option to launch Livewallpaper chooser , but when i try to lunch it its giving me following error while testing on actual device.</p><blockquote>  <p>android.content.ActivityNotFoundException:  No Activity found to handle Intent {  act=android.service.wallpaper.LIVE_WALLPAPER_CHOOSER  }</p></blockquote><p>apart from this since i have updated to android 2.2 i haven't seen the livewallpaper option in my HTC wildfire phone.</p><p>There is only ""HTC Wallpaper"" and ""Gallery"" Option under ""Select wallpaper from"".</p><p>so i don't know if there isn't any livewallper in HTC wildfire then how to get it.</p>","405383","","","","","2011-02-05 16:42:32","Livewallpaper on HTC Wildfire","<android><htc>","0","0","","",""
"4853505","1","4853734","","2011-01-31 16:42:41","3","2599","<p>I want my Android application to behave like below.1) Portrait mode: With title bar2) Landscape mode: Without title bar (because of height limitation)</p><p>I know I can realize 1) using requestWindowFeature(Window.FEATURE_NO_TITLE), buthow can I dynamically change from 1) to 2) when I rotate my phone?</p>","210110","","","","","2011-01-31 17:03:25","Android: how to disable FEATURE_NO_TITLE","<android>","2","0","1","",""
"4853518","1","4853688","","2011-01-31 16:44:11","0","857","<p><strong>WHAT I HAVE DONE NOW:</strong> i am picking images on my app with android, and showing them on a ImageView of my layout, and sometimes i got an exception <code>java.lang.OutOfMemoryError: bitmap size exceeds VM budget</code>. This happens when the photos are higher than 500kb.</p><p><strong>WHAT I NEED TO DO (AND I DONT KNOW HOW TO DO IT):</strong>then, what i want to do is to allow the user only to select photos of maximum 500kb. And if the user selects a photo Higher than 500kb, then, my app should show a toast telling the user that only can select photos of max 500kb.... ¿how to do it?</p><p>this is my code: </p><pre><code>changeImageButton.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                Intent i = new Intent(Intent.ACTION_PICK,                        android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);                startActivityForResult(i, ACTIVITY_SELECT_IMAGE);            }        }); protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {         super.onActivityResult(requestCode, resultCode, imageReturnedIntent);         switch(requestCode) {        case 1:        {            setResult(1);            finish();            }        case ACTIVITY_SELECT_IMAGE:            if(resultCode == RESULT_OK){                  Uri selectedImage = imageReturnedIntent.getData();                String[] filePathColumn = {MediaStore.Images.Media.DATA};                Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null);                cursor.moveToFirst();                int columnIndex = cursor.getColumnIndex(filePathColumn[0]);                String filePath = cursor.getString(columnIndex);                cursor.close();                selectedPhoto = BitmapFactory.decodeFile(filePath);                //profileImage.setImageBitmap(selectedPhoto);                profileImage.setImageBitmap(Bitmap.createScaledBitmap(selectedPhoto, 80, 80, false));            }        }    }</code></pre><p>profileImage is a ImageView of my layout. and i use scaled butmap to resice the image to 80x80</p><p>please give me some help to do that, im searching on google and i can't find nothing</p>","479886","","","","","2011-01-31 17:26:11","Picking images from gallery (SD Card) on my app… ¿How to allow only max 500kb photos?","<android><bitmap><imageview><android-gallery>","2","0","","",""
"4853621","1","4854012","","2011-01-31 16:52:21","1","2767","<p>I have a button widget. I want to play sound when the button is pressed and when the user releases the button (takes his finger off the button) the audio playback should be stopped. I have used the following code but it doesn't work.</p><pre><code>public boolean onTouch(View v, MotionEvent me) {    int action = me.getAction();    if(action == MotionEvent.ACTION_DOWN) {        playSound();    } else if (action == MotionEvent.ACTION_UP) {        stopSound();    }    return false;}</code></pre>","421372","","","","","2011-01-31 17:31:29","Touch events in Android","<android><button><touch>","1","2","","",""
"4853622","1","","","2011-01-31 16:52:30","5","4085","<p>I'm trying to catch NFC tag in broadcast receiver so I wrote a simple BR that prints ""asd"" in the onReceive(). In the manifest xml it's desribed like that:</p><p></p><p>                            </p><p>and I receive only this and no print at all....</p><pre><code>01-31 16:37:18.980: ERROR/MediaPlayer(990): setAudioStream called in state 801-31 16:37:18.980: ERROR/MediaPlayer(990): error (-38, 0)01-31 16:37:18.980: ERROR/MediaPlayer(990): start called in state 001-31 16:37:18.980: ERROR/MediaPlayer(990): error (-38, 0)01-31 16:37:18.988: ERROR/MediaPlayer(990): Error (-38,0)</code></pre><p>When I use activity to handle the intent like this:</p><pre><code>&lt;activity android:name=""TagViewer""            android:theme=""@android:style/Theme.NoTitleBar""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.nfc.action.TAG_DISCOVERED""/&gt;                &lt;category android:name=""android.intent.category.DEFAULT""/&gt;            &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>The activity is started and working perfectly, so how can I make it work with BroadcastReceiver?</p>","575438","","575438","","2011-01-31 17:04:30","2011-08-10 07:38:28","Android NFC tag received with broadcastreceiver","<android><broadcastreceiver><nfc>","2","6","2","",""
"4853695","1","4876334","","2011-01-31 16:59:07","5","4601","<p>I have an Android App which contains an external dependend jar library. This external library contains some png-bitmaps which I want to show on some ImageViews in my application.</p><p>Looking inside the apk file of my application I can find the images in a sub directory (""aq\img"") as expected.</p><p>What is the best way to show an image (insight the classpath) on a ImageView.</p><p>I tried this </p><pre><code>    ImageView imgView01 = (ImageView) findViewById(R.id.imageView1);    Drawable d = Drawable.createFromPath(""aq/img/sample.png"");    imgView01.setImageDrawable(d);</code></pre><p>and this</p><pre><code>    InputStream is = ClassLoader            .getSystemResourceAsStream(""sample.png"");    Bitmap bm = BitmapFactory.decodeStream(is);    imgView01.setImageBitmap(bm);</code></pre><p>but it did not work (I did not really expect it to be that simple).The image remains empty.</p><p>Thanks for help!</p><p>Regards Klaus</p>","367285","","","","","2011-02-02 22:19:05","How to load image for Android ImageView from classpath?","<android>","1","0","","",""
"4853866","1","4854075","","2011-01-31 17:16:45","0","1107","<p>I added the controller's container to the layout. When I try to call the controller.setVisible(true) (in the touch event), I get this exception:</p><blockquote>  <p>java.lang.RuntimeException: view  android.widget.ZoomButtonsController$Container@44c1e490  being added, but it already has a  parent</p></blockquote><p>Here's the code to add the controller:</p><pre><code>final TextView xView = (TextView)findViewById( R.id.xView);final ZoomButtonsController controller = new ZoomButtonsController(xView );ViewGroup zoomControlContainer = controller.getContainer();LinearLayout layout = (LinearLayout) findViewById(R.id.parent_layout);layout.addView(zoomControlContainer);controller.setAutoDismissed(true);</code></pre><p>Code to handle touch event:</p><pre><code>   xView.setOnTouchListener(new View.OnTouchListener() {        @Override        public boolean onTouch(View v, MotionEvent event) {            controller.setVisible(true);            return false;        }    });</code></pre><p>If I don't add the container, controller.setVisible(true) has no effect anyways. Any pointers?</p>","368416","","142162","","2011-01-31 17:27:30","2011-04-07 21:03:38","ZoomButtonsController not working","<java><android>","2","0","","",""
"4853874","1","4854005","","2011-01-31 17:17:15","3","2722","<p>In Eclipse you can change your simulated location using the Emulator Control view (Window > Show View > Other... > Android > Emulator Control).</p><p>Image:<img src=""http://i.stack.imgur.com/0Uolh.png"" alt=""enter image description here""></p><p>Where can I find this view/tab in IntelliJ?</p><p>PS. I know that I can use DDMS, but I wonder if there is a tab in IntelliJ, like there is in Eclipse. </p>","437039","","437039","","2011-01-31 17:27:19","2012-11-29 21:10:26","Where is Emulator Control View in IntelliJ?","<android><intellij-idea>","3","0","","",""
"4853952","1","","","2011-01-31 17:25:39","10","6966","<p>I'm totally new to posting questions on here, however I have been reading a lot on here for years. Normally I always am able to find my answers by thoroughly searching the web, but this time I am at a loss...</p><p>After having spent yet another day of trying to figure out why this is not working I decided to ask for help, hoping you guys can give me a few pointers, or better, a solution.</p><p>The problem:In an Android game I have come to the point where I have to make the application remember its state when a user e.g. presses the HOME-screen button. After some searches I realised that in order to make my classes initialize back to their appropriate states after re-opening the application I had to support the Parcelable interface to pass them with the Bundle.</p><p>In my onStop and onStart functions I respectively save and restore the game state to and from a Bundle, however when I call the putParcelable and getParcelable functions on the Bundle the object's writeToParcel and createFromParcel functions are never called.</p><p>Fearing that this may have been due to the relative complexity of the game I figured I had best create a very simple application to try to get it to work.</p><p>Based on many Parcelable examples I have seen online, this became my class:</p><pre><code>public class ParcelableTest implements Parcelable {  int id;  public ParcelableTest(int newID)  {    id = newID;  }  private ParcelableTest(Parcel in) {      readFromParcel(in);  }  public void writeToParcel(Parcel out, int arg1) {      writeToParcel(out);  }  public void writeToParcel(Parcel out) {    Log.v(""ParcelableTest"",""Writing to parcel"");      out.writeInt(id);  }  public void readFromParcel(Parcel in) {      id = in.readInt();  }  public int describeContents() {      return 0;  }  public static final Parcelable.Creator&lt;ParcelableTest&gt; CREATOR = new  Parcelable.Creator&lt;ParcelableTest&gt;() {      public ParcelableTest createFromParcel(Parcel in) {          Log.v(""ParcelableTest"",""Creating from parcel"");              return new ParcelableTest(in);      }      public ParcelableTest[] newArray(int size) {              return new ParcelableTest[size];      }  };}</code></pre><p>And from my Main activity I would call the following functions to save / restore the data:</p><pre><code>public Bundle saveToBundle(Bundle savedState)    {      savedState.putParcelable(""Test1"",mTest1);      savedState.putParcelable(""Test2"",mTest2);      return savedState;    }    public void restoreFromBundle(Bundle savedState)    {      mTest1 = savedState.getParcelable(""Test1"");      mTest2 = savedState.getParcelable(""Test2"");    }</code></pre><p>But for some reason neither of the functions (with the putParcelable and getParcelable functions) will result in the appropriate Parcelable calls in my test class.</p><p>The strangest thing is that it does somehow read the correct values (I have tried with more variables in the class), but my debugging and my log shows that tha application never gets to writeToParcel and createFromParcel.</p><p>What am I missing here?</p><p>Any help / thoughts would be appreciated.</p>","597197","","","","","2013-11-16 08:10:31","Android: Parcelable.writeToParcel and Parcelable.Creator.createFromParcel are never called","<java><android><bundle><parcelable>","3","1","3","",""
"4854047","1","","","2011-01-31 17:34:32","1","1212","<p>I have the following problem. From what I have seen if I put my resources in the drawable folder the sdk will scale them automatically if I don't have the anyDensity option in the manifest, but this does not look good on the Galaxy Tab (the icons look too small).I have some specific resources for the 320x480, 480x800, 600x1024. If i put them in the specific drawable folders and not set anyDensity to true they look too big. If I set anyDensity to true they seem to look ok.But the question is, if I don't have resources of different sizes for all the resources can i put some of them in the drawable folder (so the sdk makes the prescaling) and the other ones in the specific drawable folder or I need specific resources for all the resolutions and all the resources.</p><p>Thank you.</p>","597241","","21234","","2011-01-31 17:43:42","2011-01-31 17:49:15","how to use resources from drawable and drawable-hdpi at the same time?","<android><drawable>","1","0","","",""
"4854121","1","","","2011-01-31 17:40:37","1","1045","<p>I have a simple PreferenceActivity with an EditTextPreference.My problem is that I set the default text to be a phone number (such as +14047771000)but when the preference is clicked it is shown as a double (in the above example - 1.404771E10).  What can I do to prevent this and display the text as String?thanks, Joel  </p><p>edit: Here is the xml:  </p><p></p><pre><code>&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android"" android:title=""IMS Preferences""&gt; &lt;PreferenceCategory android:title=""Sip User""&gt;  &lt;EditTextPreference android:key=""PublicId""   android:title=""Public ID"" android:defaultValue=""+14047771000""/&gt; &lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;</code></pre><p>EDIT:anyone? any idea?</p>","597249","","597249","","2011-02-01 13:55:42","2011-06-07 12:52:35","Android: EditTextPreference converts String to numeric","<android><edittext><preferenceactivity>","1","2","","",""
"4854197","1","","","2011-01-31 17:47:25","9","8353","<p>As you know, when app is nomally installed, icon is created at launcher menu screen.What I want to do is create icon at user home screen during installation.(without pressing icon for 5 seconds.)</p><p>I heard this from another source to just add</p><pre><code>&lt;category android:value=""android.intent.category.HOME"" /&gt;</code></pre><p>to AndroidManifest.xml file, but it didn't work.</p><p>Is there any other way to do it?</p>","597255","","284606","","2011-01-31 17:52:14","2012-09-26 10:30:53","How can I place app icon on launcher home screen?","<android>","3","5","6","",""
"4854203","1","13101215","","2011-01-31 17:48:35","1","133","<p>When user checks in a <code>CheckBox</code> and sets time in a <code>TimePickerDialog</code> and when time has come a service is started through a <code>BroadcastReceiver</code> and music is playing every 6 seconds. Thanks to this is a <code>Service</code> even if I restart the app the music is still playing every 6 secs.Similarly I created another Service to save the state of the CheckBox, because if time has not come and user closes and then opens the app the CheckBox still must be checked in. I created a global variable to manage the state of the checkbox:</p><p>main.java:</p><pre><code>Intent intentA = new Intent(main.this, AlarmReceiverA.class);PendingIntent pendingIntentA = PendingIntent.getBroadcast(main.this, 0,         intentA, PendingIntent.FLAG_ONE_SHOT);alarmManagerA = (AlarmManager) getSystemService(ALARM_SERVICE);Calendar now = Calendar.getInstance();alarmManager.set(AlarmManager.RTC_WAKEUP, now.getTimeInMillis(), pendingIntentA);Toast.makeText(main.this, ""Present time: "" +         String.valueOf(now.getTime()), Toast.LENGTH_SHORT).show();</code></pre><p>This is easy <code>AlarmReceiver</code> starts service:</p><pre><code>public final class AlarmReceiverA extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {        Toast.makeText(context, ""AlarmA worked."", Toast.LENGTH_LONG).show();         context.startService(new Intent(context, MyServiceA.class));     }}</code></pre><p>And this is the MyServiceA.class:</p><pre><code>@Overridepublic void onCreate() {    Toast.makeText(this, ""My ServiceA Created"", Toast.LENGTH_LONG).show();    Log.d(TAG, ""onCreate"");    GlobalVars.setTimeWatch(1);}@Overridepublic void onDestroy() {    Toast.makeText(this, ""My ServiceA Stopped"", Toast.LENGTH_LONG).show();    Log.d(TAG, ""onDestroy"");}@Overridepublic void onStart(Intent intent, int startid) {    Toast.makeText(this, ""My ServiceA Started"", Toast.LENGTH_LONG).show();    Log.d(TAG, ""onStart"");    GlobalVars.setTimeWatch(1);}</code></pre><p>I get the ""My ServiceA Started"" toast message, so this has been working so far. Problem is even if I set the variable to 1 <code>GlobalVars.setTimeWatch(1)</code> I am not getting it back when I restart the app.</p><p>In main.java I am inspecting the value of this variable:</p><pre><code>public void onResume() {    super.onResume();    Toast.makeText(main.this, String.valueOf(GlobalVars.getTimeWatch()),            Toast.LENGTH_SHORT).show();}</code></pre><p>But all I am getting is 0. Problem must with the service, because when I open up a new screen (e.g. by click on a button) and then go back, I get the Toast message with the value of ""1"".</p><ol><li>Is this the way to save the state of a CheckBox?</li><li>What is wrong with the code?</li></ol><p>I am also trying with this:</p><pre><code>  @Override  public void onSaveInstanceState(Bundle savedInstanceState) {    savedInstanceState.putBoolean(""MyBoolean"", cbstate);    super.onSaveInstanceState(savedInstanceState);  }  @Override  public void onRestoreInstanceState(Bundle savedInstanceState) {   super.onRestoreInstanceState(savedInstanceState);   myb = savedInstanceState.getBoolean(""MyBoolean""); }</code></pre><p>cbstate is boolean variable. In the onCreate method i am inspecting the value of cbstate:</p><pre><code> if (myb == true)        {            cb1.setChecked(true);            Toast.makeText(main.this, ""checked"", Toast.LENGTH_SHORT).show();        }        else        {            cb1.setChecked(false);            Toast.makeText(main.this, ""Not checked"", Toast.LENGTH_SHORT).show();        }  </code></pre><p>After restarting app i always get ""Not checked"".</p>","571648","","571648","","2011-01-31 18:25:42","2012-10-27 14:50:07","Service question","<android><service><checkbox>","1","0","","",""
"4854220","1","4873836","","2011-01-31 17:50:33","7","8688","<p>I'm going to make a presentation of an Android application, and since it will have a large audience assisting, I'll probably need to stream the Android screencast to a PC. Do you know any tool (free or paid) able to do it? Thank you.</p>","590525","","1131435","","2013-04-24 06:27:55","2013-12-17 12:03:38","Stream Android screencast to PC","<android><stream>","2","10","3","2013-04-24 08:48:43",""
"4854326","1","4854745","","2011-01-31 18:01:26","0","263","<p>i'm encodding images with Base64 into Strings, and i am uploading these images into a remote database, in a row of the table USER. That row is TEXT, because i dont know if there is anothr String type with more space than TEXT.</p><p>When i store very small images, with 5 or 10 KB of space, they store OK, and when i get these images back from the sql DB into my app, i can decode them into BitMap and show them into a ImageView.</p><p><strong>THE PROBLEM:</strong> When i store images with for example 110 KB of space, i think they doesn't store OK in the TEXT row of my table USER in the SQL DB, because when i try to decode them, i got an error, they can't be decoded, but i dont know why, because the decode function of Base64 simply returns null when he can't decode.</p><p>There is a way to solve it?</p><p>How munch KB can have a image to be stored into the row of a databse?</p><p>The better option for the row is to be TEXT ? or there is another Type that can store more higher Strings?</p><p>thanks</p>","479886","","","","","2011-01-31 18:48:43","How munch KB can have a image that you want to store with Base64 encode into a row of a SQL DB?","<android><sql><bitmap><base64>","2","0","","",""
"4854360","1","4854470","","2011-01-31 18:05:18","3","727","<p>I have a edit text. i want to enter the decimal values in it. </p><p>that is when i have enter a first number. it should be like this: .01</p><p>then i have enter a second number. it should be like this: .12</p><p>then  for third one. it should be like this: 1.23</p><p>it will go like this.... how to implement this scenario. Any Idea?</p>","267269","","267269","","2011-02-08 06:21:30","2011-02-08 06:21:30","Entering Decimal values in Edittext?","<java><android><android-edittext>","2","0","1","",""
"4854361","1","","","2011-01-31 18:05:21","3","383","<p>Is it possible to get gesture code to work with Android and C++? If so, how can it be done?</p>","552853","","","","","2013-01-19 02:09:44","Android C++ Gesture Code","<c++><android><mobile><gesture-recognition><gesture>","1","0","1","",""
"4854442","1","4854637","","2011-01-31 18:13:26","38","41387","<p>What is the preferred way to embed the zxing library to provide scanning without having the Barcode Scanner app installed? I am looking to embed it in android without having to prompt the user for any extra installs. (Similar to the way the iPhone src works).</p>","510395","","","","","2014-02-01 22:48:58","Embed Zxing library without using Barcode Scanner app","<android><zxing>","5","2","30","",""
"4854492","1","","","2011-01-31 18:18:46","5","9273","<p>Can anyone help me how to set the width of <code>TextView</code> to <code>wrap_content</code> through code and not from XML?</p><p>I am dynamically creating a <code>TextView</code> in code ,so is there anyway to how to set its width to <code>wrap_content</code> through code?</p>","429501","","268093","","2014-03-09 00:49:44","2014-03-09 00:49:44","Setting width to wrap_content for TextView through code","<android><textview>","2","0","1","",""
"4854509","1","4854535","","2011-01-31 18:20:38","2","490","<p>I have all of my intents in activity groups so I can navigate easily using tabs. I've now encountered the problem where I need to pass information to another activity and I don't know how to approach because the activity isn't loaded the normal way.</p><p>Here is how I call the new activity:</p><pre><code>setContentView(view);</code></pre><p>Thanks in advance.</p><p><strong>Edit:</strong> I put up a custom method because I'm stupid. Fixed now.</p>","348261","","348261","","2011-01-31 18:33:55","2011-01-31 18:33:55","Is there a way to pass data between activities in an activity group?","<android><activity><android-intent><activitygroup>","1","3","","",""
"4854517","1","4855261","","2011-01-31 18:21:39","1","2046","<p>I am making an app that sends a picture taken from the Camera app however the image it returns seems to be only a thumbnail how can I get it to turn the whole image?</p><p>The following code gets an image, but it's  too small.</p><pre><code>public class OnTheJobActivity extends Activity{ private static final int CAMERA_PIC_REQUEST = 1337; private Button takePictureButton; private Button sendPictureButton; private Bitmap thumbnail;  /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  this.setRequestedOrientation(          ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);  setContentView(R.layout.onthejob);  takePictureButton = (Button) findViewById(R.id.takePictureButton);  takePictureButton.setOnClickListener(takePictureButtonListener);  sendPictureButton = (Button) findViewById(R.id.sendPictureButton);  sendPictureButton.setOnClickListener(sendPictureButtonListener); } protected void onActivityResult(int requestCode, int resultCode, Intent data) {       if (requestCode == CAMERA_PIC_REQUEST) {    thumbnail = (Bitmap) data.getExtras().get(""data"");    ImageView image = (ImageView) findViewById(R.id.photoResultView);    image.setImageBitmap(thumbnail);  sendPictureButton.setVisibility(Button.VISIBLE);     }   }   private OnClickListener takePictureButtonListener = new OnClickListener() {  @Override  public void onClick(View arg0){      Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);      startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);    }     };     private OnClickListener sendPictureButtonListener = new OnClickListener() {  @Override  public void onClick(View arg0){      Intent i = new Intent(Intent.ACTION_SEND);      i.putExtra(Intent.EXTRA_EMAIL, ""abc@gmail.com"");      i.putExtra(Intent.EXTRA_SUBJECT,""On The Job"");      i.putExtra(Intent.EXTRA_STREAM, thumbnail);      i.setType(""image/bmp"");      startActivity(Intent.createChooser(i,""Emailfile""));  }     };}</code></pre>","180825","","180825","","2011-01-31 19:29:48","2011-08-20 20:26:37","When using the Camera app in Android, how can I return the whole image instead of just the thumbnail?","<android>","2","2","1","",""
"4854581","1","6366294","","2011-01-31 09:07:31","0","550","<p>I recently developed a web app which used the JavaScript window.location property to redirect the browser. This worked fine on PC browsers, but did not function at all on both of the Android browsers I tried it on.</p><p>The unsupported browsers were: Browser (built-in) and Dolphin Browser.</p><p>I discovered that location.replace() does work on these browsers, as well as on the PC.</p><p>Is this Android limitation documented anywhere, and what other redirect methods are available on the Android platform?</p>","37481","Symmetric","","","","2011-06-16 01:49:46","What kinds of browser redirects are supported in Android?","<browser><javascript><android>","2","2","","",""
"4854606","1","","","2011-01-31 18:31:49","0","529","<p>The android application I am developing needs to read the info from the sensors, mostly the accelerometer. I want my application to be able to get the info from the sensors, but I do not want the phone's screen to be constantly on because this drains the battery very fast. I need to find a way for the phone to read the info from the sensors, but remain locked or in sleep. The application is supposed to be running in the background constantly and be reading this info. Any ideas?</p>","597302","","","","","2011-01-31 18:39:11","Android Application drains battery too fast","<android><accelerometer><battery>","2","0","","",""
"4854629","1","4854800","","2011-01-31 18:34:04","6","2567","<p>I am trying to use <code>getDisplayNames()</code> on a Calendar object in my Android code.  I have <code>java.util.Calendar</code> included and haven't had any troubles using any other public members of the Calendar class (i.e. Calendar.MONTH).  Now I am attempting the following line...</p><pre><code>mReminderCal.getDisplayName(Calendar.DAY_OF_MONTH, Calendar.LONG, Locale.US)</code></pre><p>And Eclipse is telling me <code>Calendar.LONG</code> or <code>Calendar.SHORT</code> don't exist.  </p><p>According to the documentation here they should exist: <a href=""http://developer.android.com/reference/java/util/Calendar.html#LONG"">http://developer.android.com/reference/java/util/Calendar.html#LONG</a></p><p>Any insight?</p>","580556","","","","","2013-01-14 14:24:30","Use of Calender.LONG in getDisplayNames() unresolved","<android><calendar><unresolved>","3","0","","",""
"4854657","1","4855585","","2011-01-31 18:37:22","1","571","<p>I'm getting a KML file containing shuttle routes and positions from my school's shuttle tracking server. I want to parse this KML in my Android application, but when I pass the file into the VTD-XML 2.9 parser, it fails, telling me that the XML is not properly terminated. I ran the file through a schema validator and although it doesn't conform to the <a href=""http://code.google.com/apis/kml/schema/kml21.xsd"" rel=""nofollow"">KML 2.1 Schema</a> (doesn't like the folder element), it is well-formed.</p><p>I don't think there's anything else wrong with the document, but I also don't see where there could be a problem with my code:</p><pre><code>byte[] doc = new byte[32000];URL url = new URL(""http://shuttles.rpi.edu/displays/netlink.kml"");HttpURLConnection conn = (HttpURLConnection) url.openConnection();InputStream is = conn.getInputStream();is.read(doc);VTDGen vg = new VTDGen();vg.setDoc(doc);vg.parse(true);</code></pre>","370556","","370556","","2011-01-31 22:38:29","2011-02-01 05:35:48","VTD-XML produces ""XML not terminated properly"" error when parsing KML file","<java><android><xml><vtd-xml>","1","1","1","",""
"4854678","1","4854734","","2011-01-31 18:40:06","4","4937","<p>I am a new Android developer and I would like to create an application using only C/C++ code for Android but I have found the documentation to be very limited. I can create an Android C/C++ project in eclipse, but it uses a lot of java code.</p><p>I'm using NativeActivity (new to 2.3) and I need help setting up my project. Does anyone know how to do this?</p><p><a href=""http://developer.android.com/reference/android/app/NativeActivity.html"" rel=""nofollow"">http://developer.android.com/reference/android/app/NativeActivity.html</a></p>","552853","","","","","2011-03-04 09:46:33","Android C++ Native Code","<c++><android><eclipse><mobile><native>","2","2","1","",""
"4854708","1","4855741","","2011-01-31 18:43:52","0","986","<p>Below is my Java code and my XML code. Can someone please tell me why my <code>onReceieve</code> method is never getting called.</p><p>Java:</p><pre><code>public class PopUPSMS extends Activity {    String RECEIVE_SMS = ""RECEIVE_SMS"";    private static final String LOG_TAG = ""PopUPSMS"";    static final String ACTION = ""android.provider.Telephony.SMS_RECEIVED"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Log.i(LOG_TAG, ""onCreate"");        registerReceiver(new BroadcastReceiver() {            @Override            public void onReceive(Context context, Intent intent) {                Log.i(LOG_TAG, ""onReceive"");            }        }, new IntentFilter(RECEIVE_SMS));    }}</code></pre><p>XML:</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""    package=""com.smith.johnathan.phone""    android:versionCode=""1""    android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".PopUPSMS""            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.READ_SMS"" /&gt;    &lt;uses-permission android:name=""android.permission.RECEIVE_SMS"" /&gt;    &lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;/manifest&gt; </code></pre>","589450","","418183","","2011-01-31 19:31:48","2011-01-31 20:30:48","onReceive never getting called","<java><android><sms>","3","1","","",""
"4854752","1","","","2011-01-31 18:49:24","0","144","<p>I have been working on a simple hangman game. It is envoked from a main menu. The activity has worked perfectly for several days, but now the app crashes (in the emulator) when envoking the hangman activity. I have the activity in the androidmanifest.xml. I even loaded an older version of the activity, but it still crashes. The other activities work fine. All the menu items are in a ListView.</p><p>The activity is defined in the androidmanifest.xml:</p><pre><code>&lt;activity android:name="".Hangman""&gt;&lt;/activity&gt; </code></pre><p>Any advice is appreciated.</p><p>Example code:</p><pre><code>@Overridepublic void onListItemClick(ListView parent, View v,  int position, long id) {switch(position){case 0: intent = new Intent(v.getContext(), VoiceManager.class); startActivityForResult(intent, 0);break;  case 2:   intent = new Intent(v.getContext(), Hangman.class);    startActivityForResult(intent, 0); // Crashes here.   break;  case 3:   finish();   break;}}</code></pre>","276503","","180538","","2011-01-31 18:51:56","2011-01-31 18:51:56","Android java crashes when envoking activity","<android><listview><activity>","0","3","","",""
"4854807","1","4854830","","2011-01-31 18:53:55","6","8594","<p>I know the BroadcastReceiver can't be used if defined as Activity's inner class. But I wonder why? Is it because the system would have to instantiate a large Activity object to just have instantiated a recevier instance? </p>","473070","","473070","","2011-01-31 18:56:47","2011-07-01 11:58:22","BroadcastReceiver as inner class","<android><broadcastreceiver>","1","0","3","",""
"4854846","1","","","2011-01-31 18:57:50","0","305","<p>I'm trying to open a file and creat it if it does not exist.  My code throws an exception that says file does not exist, but I thought with the rw option, it will creat it</p><pre><code>// save dATA   try {    RandomAccessFile f=new RandomAccessFile(""ted.dat"", ""rw"");    f.write(cGlobals.mBoard[0], 0, cGlobals.fBoardSize* cGlobals.fBoardAmount);    f.close();} catch (FileNotFoundException e) {// TODO Auto-generated catch blocke.printStackTrace();</code></pre>","564653","","133203","","2011-01-31 19:02:41","2011-02-01 15:35:08","Program throws an exception when I try to create a file in Android","<java><android><file>","2","1","","",""
"4854935","1","4855037","","2011-01-31 19:06:08","9","5828","<p>How can we specify a TextView's shadowDx/Dy/Radius values in dip? Right now I have:</p><pre><code>&lt;style name=""foo""&gt;  &lt;item name=""android:shadowDx""&gt;-1&lt;/item&gt;  &lt;item name=""android:shadowDy""&gt;-1&lt;/item&gt;  &lt;item name=""android:shadowRadius""&gt;1&lt;/item&gt;&lt;/style&gt;</code></pre><p>I can't seem to specify ""1dip"" in these places. Is there a way to do it other than setting them in code and doing the device density multiplication ourselves?</p><p>Thanks</p>","291701","","","","","2013-07-10 08:33:23","TextView:shadowDx/Dy/Radius in dip?","<android>","3","0","2","",""
"4854947","1","5266527","","2011-01-31 19:07:40","12","8044","<p>Does anyone know of a good Java Microsoft Office API capable or running on an Android?  I know there is an OpenOffice Java API, but I haven't heard of anyone using it on Android.</p><p>I know that using intents is another option, but how common are pre-installed office viewers on the varying Android distributions?  Would it be reasonable for a developer to expect the user to have one of these viewers installed?  Is it reasonable to request that they install one of these applications if they don't already have one?</p>","313207","","496830","","2011-10-28 13:21:31","2012-12-04 05:30:21","Android Microsoft Office Library (.doc, .docx, .xls, .ppt, etc.)","<java><android><ms-office><openoffice.org>","2","1","5","",""
"4855008","1","4855376","","2011-01-31 19:16:06","23","16939","<p>I have an Android app that displays a comic book. To make use of the built-in zoom controls, I am loading the pictures in a webview like so:  </p><pre><code>webView.loadUrl(""file:///android_asset/page1.jpg"");</code></pre><p>This is working just fine, however, since the images are in the assets folder, they are not being compressed which makes my .apk enormous. I was wondering how to reference resource files (from the res/drawable folder) with a file path like I did above with the assets. Does anyone know what that path would look like? I've tried things like ""file:///res/drawable/pagetitle.jpg"" with no success. Thanks for the help.</p><p>Update: I found that ""file:///android_res/drawable/page1.jpg"" was the path that I was looking for.</p>","431327","","431327","","2011-02-02 22:01:00","2013-10-14 14:59:09","Loading an Android resource into a webview","<android><android-webview>","2","2","10","",""
"4855144","1","5569087","","2011-01-31 19:31:43","1","1656","<p>So <a href=""http://stackoverflow.com/questions/4837889/android-setting-window-background-on-launched-activity"">I figured out</a> the proper way to set the Activities background, so that I could show a 'fake' background image to the user while the Activity loaded, per <a href=""http://developer.android.com/resources/articles/window-bg-speed.html"" rel=""nofollow"">this blog post by Romain Guy</a>.  I can verify this works by loading a test layout on the launched Activity, so I know the background image is being set.</p><p>My issue is this: I have a ListView that launches an Activity that can take up to 5 seconds (in fairly rare cases) to draw several shapes to a custom View via a canvas and onDraw.  When the user selects an item from the ListView, the screen simply sits there showing the ListView, waiting for the 2 - 5 seconds while the drawing is taking place.  Some details:</p><p>XML of the Activity, canvas_view.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:layout_width=""match_parent""    android:layout_height=""match_parent""&gt;    &lt;com.package.name.CanvasView    android:id=""@+id/canvas""    android:layout_width=""match_parent""        android:layout_height=""match_parent""        android:focusable=""true"" /&gt;&lt;/FrameLayout&gt;</code></pre><p>In the Activity onCreate(), I inflate the above XML, and in onResume(), I initiate the drawing method that writes to the custom CanvasView:</p><pre><code>@Overrideprotected void onResume() {super.onResume();    mCanvas = (CanvasView) findViewById(R.id.canvas);    .    .    .    doDrawing();}</code></pre><p>doDrawing() sends data to the CanvasView class, and triggers that classes onDraw.  </p><p>So, my feeling is that the Activities' View isn't being shown because the canvas drawing is using the UI thread... I tried moving the drawing to onResume, hoping that the Activity would draw the layout inflated in onCreate first BEFORE onResume was called, but no dice.  What I'd like to happen is:</p><ol><li>User clicks on ListView item</li><li>Activity gets launched, showing the 'fake' background image</li><li>Activity draws to canvas</li><li>Canvas draws to View, displaying it to the user</li></ol><p>What is happening:</p><ol><li>User clicks on ListView item</li><li>Screen sits there on ListView while activity draws to canvas</li><li>View with drawn canvas is displayed to user</li></ol><p>I had also thought about using an AsyncTask to do the drawing, and maybe that is the right solution here, but trying to keep this as simple as possible as there is really only a delay for very large drawing sets, which I expect to be fairly rare.</p><p>Thanks,</p><p>Paul</p><p>EDIT:</p><p>Per Romain's question, some details on doDrawing().  doDrawing() opens an XML file, reads in some data that describe various path shapes, then sends that data to the CanvasView via a public method, addPath():</p><pre><code>private final void doDrawing() {    // open XML file, read data in, package it up into a Path object, path    {snipped}    // send the data to the CanvasView via a public method    mCanvas.addPath(path);}</code></pre><p>Now, in the CanvasView, here is the code for addPath():</p><pre><code>public void addPath(Path path) {    mPaths.add(path);// do we need to update the CanvasView?if (mIsVisible) {     invalidate();}}</code></pre><p>Finally, in the onDraw method in the CanvasView, onDraw loops through the mPaths ArrayList, writing each of the Paths to the canvas.</p>","357801","","357801","","2011-01-31 20:11:15","2011-04-06 15:39:27","Draw Window Background with a Canvas-Based Activity","<android><background><android-layout>","2","0","","",""
"4855155","1","4855233","","2011-01-31 19:32:59","2","427","<p>I am building a hosted mobile application so I can write once and deploy to many mobile platforms. My plan is to write a native application with a single screen that is a browser that navigates to my hosted application. Of course this is so our application is in the <a href=""http://en.wikipedia.org/wiki/App_Store_%28iOS%29"" rel=""nofollow"">App Store</a>, <a href=""http://en.wikipedia.org/wiki/Android_Market"" rel=""nofollow"">Android Market</a>, etc.</p><p>Is it possible to use the <a href=""http://en.wikipedia.org/wiki/PhoneGap"" rel=""nofollow"">PhoneGap </a> JavaScript so my hosted applications can use local APIs? For example, I would like to be able to upload pictures taken from the camera.</p>","30099","","63550","","2012-02-27 21:20:26","2012-02-27 21:20:26","Can a hosted application leverage the PhoneGap API?","<iphone><android><windows-phone-7><mobile><phonegap>","3","0","","",""
"4855156","1","4855323","","2011-01-31 19:33:08","4","2811","<p>I'm working on an augmented reality app for Android. I'm implementing Tom Gibara's <a href=""http://www.tomgibara.com/computer-vision/CannyEdgeDetector.java"" rel=""nofollow"">canny edge detector class</a> and have replaced BufferedImage, which is not supported by Android, with Bitmap.</p><p>The method ""follow"" (posted below) is causing a StackOverflow error for me. It's a recursive function, but what baffles me is that it will work correctly for about 10-15 seconds before crashing, on the device. </p><p>From Google, it looks like people have successfully implemented this class in Java, but I'm wondering if, for whatever reason, it doesn't work on Android. Gibara's code specifies that it is for single-threaded use only; could this be part of the problem? If not that, is my error obvious to anyone?</p><p>Thank you!</p><pre><code>private void follow(int x1, int y1, int i1, int threshold) {      int x0 = x1 == 0 ? x1 : x1 - 1;      int x2 = x1 == width - 1 ? x1 : x1 + 1;      int y0 = y1 == 0 ? y1 : y1 - 1;      int y2 = y1 == height -1 ? y1 : y1 + 1;    data[i1] = magnitude[i1];      for (int x = x0; x &lt;= x2; x++) {          for (int y = y0; y &lt;= y2; y++) {              int i2 = x + y * width;              if ((y != y1 || x != x1) &amp;&amp; data[i2] == 0                     &amp;&amp; magnitude[i2] &gt;= threshold) {                  follow(x, y, i2, threshold);                  return;              }          }      }  }</code></pre>","597368","","418183","","2011-01-31 19:38:54","2011-01-31 19:47:19","Canny edge detector for Android -- StackOverflow on recursive function","<java><android><stackoverflow><edge-detection>","1","0","1","",""
"4855316","1","","","2011-01-31 19:46:31","1","424","<p>I'm developing an app for Android Tablet PC and I need to allow user to run only exact applications.1. Is there any way to deny other applications execution?2. Is it possible to show some block screen with password prompt and deny user to run anything until the authentication will be passed?</p><p>Unfortunately I haven't find any info :(</p>","597385","","","","","2011-02-02 18:00:42","Block an android device","<java><android><blocking>","2","2","","",""
"4855447","1","4855917","","2011-01-31 19:59:10","4","10048","<p>I have a remote database with MySQL, and I am storing photos of the users of my app on the database as a row of the database with LONGTEXT type.</p><p>I transform the photos to a string with Base64.</p><p>I connect to my remote database with JSON and PHP, because this, I have to use Base64, because as I know, JSON and PHP need to send strings on the parameters, and with Base64 I can transform the photo into a string.</p><p>It works ok, but it's very slow. When I am loading a photo of 100 KB, it takes a lot of time, but when I am loading a photo of 5 KB it takes only two or three seconds.</p><p>A friend told me to use BLOB instead of Base64, but how do I use BLOB with JSON and a PHP connection to the database? Also, I need to store the images on a row of the table <code>USER</code>. This is because the users don't have privileges to upload files into the remote server, but they can upload photos by uploading them as a string in a row of the table <code>USER</code>.</p><p>thanks</p><p>EDIT:</p><p>this is the code where it takes a looot time waiting (it waits in the line: <code>while ((line = reader.readLine()) != null) {</code> , it is waiting on <code>reader.readLine()</code>  )</p><p>this code gets one user from the remote database, it takes a loooooot of time to show the user on my app</p><pre><code>public Friend RetrieveOneUser(String email){    Friend friend=null;    String result = """";    //the parameter data to send    ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();    nameValuePairs.add(new BasicNameValuePair(""email"",email));    //http post    InputStream is=null;    try{            HttpClient httpclient = new DefaultHttpClient();            HttpPost httppost = new HttpPost(this.BaseURL + this.GetOneUser_URL);            httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));            HttpResponse response = httpclient.execute(httppost);            HttpEntity entity = response.getEntity();            is = entity.getContent();    }catch(Exception e){            Log.e(""log_tag"", ""Error in http connection ""+e.toString());    }    //convert response to string    try{            BufferedReader reader = new BufferedReader(new InputStreamReader(is,""iso-8859-1""),8);            StringBuilder sb = new StringBuilder();            String line = null;            while ((line = reader.readLine()) != null) {                    sb.append(line + ""\n"");            }            is.close();            result=sb.toString();    }catch(Exception e){            Log.e(""log_tag"", ""Error converting result ""+e.toString());    }    //parse json data    try{            JSONArray jArray = new JSONArray(result);            for(int i=0;i&lt;jArray.length();i++)            {                    JSONObject json_data = jArray.getJSONObject(i);                    friend=new Friend(json_data.getString(""email""),json_data.getString(""password""), json_data.getString(""fullName""), json_data.getString(""mobilePhone""), json_data.getString(""mobileOperatingSystem""),"""",json_data.getString(""photo""));            }    }    catch(JSONException e){            Log.e(""log_tag"", ""Error parsing data ""+e.toString());    }    return friend;}</code></pre>","479886","","479886","","2011-01-31 20:17:43","2012-10-30 11:24:01","How to use BLOB with JSON and PHP?","<php><android><json><blob><base64>","4","5","","",""
"4855503","1","4855828","","2011-01-31 20:04:29","0","1282","<p>I am working on supporting multiple screen sizes in my Android app and I need to know the physical screen size of the device.</p><p>On a Sony Ericsson X10, I'm querying the physical screen resolution and density and trying to calculate the screen size (resolution/density = size) but the result is about 1.5 times the actual size!</p><p>Here's the code:</p><pre><code>    DisplayMetrics metrics = c.getResources().getDisplayMetrics();    mPhysicalScreenWidth  = metrics.widthPixels  / metrics.xdpi;    mPhysicalScreenHeight = metrics.heightPixels / metrics.ydpi;    Log.d(TAG, ""DisplayMetrics: widthPixels="" + metrics.widthPixels + "" xdpi="" + metrics.xdpi +            "" heightPixels="" + metrics.heightPixels + "" ydpi="" + metrics.ydpi);    Log.d(TAG, ""Physical screen width="" + mPhysicalScreenWidth + ""\"", height="" + mPhysicalScreenHeight + ""\"""");</code></pre><p>The output in the log:</p><pre><code>DisplayMetrics: widthPixels=480 xdpi=160.41878 heightPixels=854 ydpi=159.49677Physical screen width=2.9921684"", height=5.3543406""</code></pre><p>This actual size is only 2"" (wide) x 3.5"" (high)!?</p><p>Am I doing something wrong?</p><p>I am using the Android 1.6 SDK and I've set all the &lt;supports-screens> attributes in the manifest to true.</p>","564626","","564626","","2011-02-02 17:45:19","2014-03-28 10:07:12","Calculating physical screen size on Sony Ericsson X10? (it's coming out 1.5x too big)","<android><screen><screen-size><x10>","2","2","","",""
"4855627","1","","","2011-01-31 20:16:34","4","4271","<p>I am trying to determine the Mime/Media Type of files stored on an Android device (actually a virtual device I'm using with the emulator). I found this resource <a href=""http://www.rgagnon.com/javadetails/java-0487.html"" rel=""nofollow"">Get the MIME Type from a File</a> which recommends the <code>javax.activation.MimetypesFileTypeMap</code>, however when I run the following code I get <code>application/octet-stream</code> for all file types:</p><pre><code>MimetypesFileTypeMap map = new MimetypesFileTypeMap();  File dir = Environment.getExternalStorageDirectory();  File[] files = dir.listFiles();  String mimeType;  for( int i = 0; i &lt; files.length; ++i ) {      if( files[i].isDirectory() == false ) {          mimeType = map.getContentType(files[i]);          if( mimeType.toLowerCase().equals(""application/octet-stream"") ) {              Log.d(""mytag"",                 String.format( ""Unable to determine the mime type of file %s."",                files[i].getName()));          }       }  }  </code></pre><p>I have tested this with files having the following extensions: jpg, txt, doc, xslx and pdf and they all return the same thing.  Is there something I have to do to initialize the map? Can this library not find the list of supported mime-types on Android?  Is there a better way to get the mime type of a file on Android?</p>","597407","","418183","","2011-01-31 20:22:05","2014-04-07 20:48:41","Java MimetypesFileTypeMap always returning application/octet-stream on Android emulator","<java><android><mime-types>","1","1","","",""
"4855662","1","4887120","","2011-01-31 20:19:40","1","245","<p>I'm creating an alarm in my app from the <code>ItemEdit Activity</code>.  Its where one can edit/view their note/todo item, they can also set a reminder/alarm for the item there.  I set the alarm with the following code:</p><pre><code>private void createAlarm() {     Intent intent = new Intent(this, ReminderReceiver.class);     intent.putExtra(""reminder_message"", ""Reminder Received!"");     intent.putExtra(""item_id"", mRowId);     PendingIntent sender =          PendingIntent.getBroadcast(                 getApplicationContext(),                  ALARM_ID,                  intent,                  PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT);     // Get the AlarmManager service     AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);     // Set alarm to the time given by the user.     am.set(AlarmManager.RTC_WAKEUP, mReminderCal.getTimeInMillis(), sender);}</code></pre><p>And here is the Receiver</p><pre><code>    public class ReminderReceiver extends BroadcastReceiver {    private static final String TAG = ""MyApp"";    @Override    public void onReceive(Context context, Intent intent) {        try {            Bundle bundle = intent.getExtras();            String message = bundle.getString(""reminder_message"");            Log.v(TAG, message);        } catch(Exception e) {            Log.v(TAG, ""OH SNAP!"");            e.printStackTrace();        }    }</code></pre><p>Edit: Also I have the following in my manifest:</p><p><code>&lt;receiver android:process="":remote"" android:name=""ReminderReceiver""&gt;&lt;/receiver&gt;</code></p><p>If I stay in the <code>Activity</code> where I set the alarm it is received fine.  If I hit the back button to return to my <code>ListActivity</code> where all the items are listed or leave the app entirely the alarm never triggers.  Have I done something wrong in setting up my alarm that it only triggers from the Activity that set it?</p><p>Thanks.</p>","580556","","580556","","2011-01-31 20:25:46","2011-02-03 14:07:20","Alarm only triggers when I'm in the Activity that set it","<android><activity><alarm>","1","4","1","",""
"4855724","1","","","2011-01-31 20:28:42","0","5297","<p>I need to add another overlay item to a mapview. I have used the standard android developers guide to google maps. I currently have the mapview within a tab. I would really appreciate any ideas. Thanks.</p><p>Below are my java classes:</p><pre><code>public class Mapview extends MapActivity {    protected boolean isRouteDisplayed(){        return false;    }    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.mapview);        MapView mapView = (MapView) findViewById(R.id.mapview);        mapView.setBuiltInZoomControls(true);        // JD sports marker begin        List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();        Drawable drawable = this.getResources()                .getDrawable(R.drawable.jd_sports_logo);        //Passes drawable(jd sports logo) into HelloItemizedOverlay class        HelloItemizedOverlay itemizedoverlay =                 new HelloItemizedOverlay(drawable);        double latitude = 51.545538;        double longitude = -0.477247;        GeoPoint point = new GeoPoint((int)(latitude * 1e6),                 (int)(longitude * 1e6));        OverlayItem overlayitem = new OverlayItem(point, ""JD Sports"",                 ""This is a sports shop"");        itemizedoverlay.addOverlay(overlayitem);        mapOverlays.add(itemizedoverlay);        // JD sports marker ends        // Fitness first marker begin        List&lt;Overlay&gt; mapOverlays1 = mapView.getOverlays();        Drawable drawable1 = this.getResources()                .getDrawable(R.drawable.fitness_first_logo);        HelloItemizedOverlay itemizedoverlay1 =                 new HelloItemizedOverlay(drawable);        double latitude1 = 51.545157;        double longitude1 = -0.477247;        GeoPoint point1 = new GeoPoint((int)(latitude * 1e6),                 (int)(longitude * 1e6));        OverlayItem overlayitem1 = new OverlayItem(point, ""JD Sports"",                ""This is a sports shop"");        itemizedoverlay.addOverlay(overlayitem);        mapOverlays.add(itemizedoverlay);        // Fitness first marker ends    }}</code></pre><p>My HelloItemizedOverlay class:</p><pre><code>public class HelloItemizedOverlay extends ItemizedOverlay {    private ArrayList&lt;OverlayItem&gt; mOverlays = new ArrayList&lt;OverlayItem&gt;();    private ArrayList&lt;OverlayItem&gt; mOverlays1 = new ArrayList&lt;OverlayItem&gt;();    public HelloItemizedOverlay(Drawable defaultMarker) {        super(boundCenterBottom(defaultMarker));    }    public void addOverlay(OverlayItem overlay) {        mOverlays.add(overlay);        populate();    }    public HelloItemizedOverlay(Drawable defaultMarker, Context context) {        super(defaultMarker);        Context mContext = context;    }    @Override    protected OverlayItem createItem(int i) {        // TODO Auto-generated method stub        return mOverlays.get(i);    }    @Override    public int size() {        // TODO Auto-generated method stub        return mOverlays.size();    }    @Override    protected boolean onTap(int index) {        OverlayItem item = mOverlays.get(index);        Context mContext = null;        AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);        dialog.setTitle(item.getTitle());        dialog.setMessage(item.getSnippet());        dialog.show();        return true;    }}</code></pre>","597439","","418183","","2011-01-31 20:41:56","2013-09-11 00:41:04","How to add another overlay item to a android mapview","<android><android-mapview><itemizedoverlay>","2","1","","",""
"4855789","1","4855849","","2011-01-31 20:35:26","10","22835","<p>I have been searching everywhere for an answer to this question.  I'm new to Android and attempting to add items to a relative layout programmatically through java instead of xml.  I have created a test class to try it out but the items keep stacking instead of formatting correctly.  I simply want one TextView under the other for now (eventually I will use the left of and right of parameters but I am starting simple.  What am I missing?</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    ScrollView sv = new ScrollView(this);    RelativeLayout ll = new RelativeLayout(this);    ll.setId(99);    sv.addView(ll);    TextView tv = new TextView(this);    tv.setText(""txt1"");    tv.setId(1);    TextView tv2 = new TextView(this);    tv2.setText(""txt2"");    tv2.setId(2);    RelativeLayout.LayoutParams lay = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);    lay.addRule(RelativeLayout.ALIGN_PARENT_TOP);    ll.addView(tv, lay);    RelativeLayout.LayoutParams p = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);    p.addRule(RelativeLayout.ALIGN_BOTTOM, tv.getId());    ll.addView(tv2, p);  this.setContentView(sv);};</code></pre>","597436","","","","","2011-01-31 20:43:43","Programmatically adding items to a relative layout","<android><android-layout><relativelayout>","3","0","","",""
"4855805","1","","","2011-01-31 20:36:34","1","259","<p>If I try to do a screen output (Toast or setContentView) before a Thread.sleep it will not be displayed until after the sleep (or all the sleeps in the thread).  This means that if I do an output after the Thread.sleep it will overwrite the first output.  If I so a forceLayout on the View before calling the Thread.sleep it does no good.  It appears that Android stores up all the output and displays them at the end of the program.  If I run such code as straightforward Java apps on the PC it works as just fine as intended.</p>","597449","","","","","2011-01-31 20:46:22","force screen output before a Thread.sleep","<java><android>","2","0","","",""
"4855874","1","","","2011-01-31 20:43:19","7","5772","<p>I'm trying to add just a few simple sounds (<em>beep, boop, click, etc</em>) to an Android app, so I was just wondering if there are any built-in sounds in the Android OS or SDK that could be utilized. If so, how might they be accessed? My only guesses have been somewhere in the mediastore or soundpool classes... I'm pretty new, so any help/tips you could offer would be greatly appreciated. Thank you.</p>","597458","","","","","2011-03-24 12:22:14","Are there any built-in/default sounds that can be utilized in an App?","<android><sounds>","3","0","2","",""
"4855904","1","","","2011-01-31 20:46:16","10","1060","<p>I recently bought a new computer and am now setting up the tools required for Android application development.  I have previously installed the tools on other computers with no problem.</p><p>I find now after everything is ready for developing, that when I open an XML file for editing inside Eclipse, I receive an error:<img src=""http://i.stack.imgur.com/aa0pq.png"" alt=""error image""></p><p>If i close the tab for this XML file and then re-open it, i can edit it as expected.  this happens for all XML files in my project.  first time opening it there is an error, second time it is working normally.</p><p>To troubleshoot a little bit before posting here, i attempting to install different versions of eclipse. 3.4, 3.5, 3.6, all encountering the same error.  I even tried installing the tools on different computers with different operating systems: windows 7 and mac os x.</p><p>I tried clearing the .metadata folder in my workspace in hopes it was some weird eclipse settings that got out of wack, no luck.</p><p>Also, after successfully opening an XML file, my editor looks like this:<img src=""http://i.stack.imgur.com/cj1aK.png"" alt=""enter image description here""></p><p>I cannot seem to view my layout in its graphical form even while in the Graphical Layout tab.</p><p><strong>My question:</strong>How can I edit my XML files with no fuss?</p><ul><li>I want the files to be opened as you would expect, and not run into these exception errors.</li><li>I also want to have to ability to view the Graphical Layout of my layout files.</li></ul>","416412","","","","","2013-05-04 21:26:40","Eclipse IDE with Android - exceptions while opening XML files for the first time","<android><eclipse>","4","3","1","",""
"4855928","1","","","2011-01-31 20:48:38","0","6099","<p>this is a very unusual problem. I am having trouble getting an Android Emulator to just connect to the internet. I know it is just supposed to ""work"" after you install it, but so far I am running into difficulties. What is interesting is that I have installed and run the emulator on another machine where the internet worked perfectly. The only differences are these. The machine with problems is a WIN XP 32bit machine. The internet worked on a WIN 7 64bit machine.Now this is not an issue with an app not seeing the internet. The emulator simply cannot see any network. I've been researching this issue for awhile and have been unable to resolve it. The forum I found that perfectly matched my issue ended with a strange fix that I have not had any success with. <a href=""http://stackoverflow.com/questions/4104675/emulator-unable-to-connect-to-internet"">Emulator unable to connect to internet</a> (the issue was resolved by disabling you USB WiFi dongle). I don't know whether I have such a dongle on my android emulator (have tried to find it to disable it with no luck).</p><p>I have also tried adding the old  line to my hello, Android's manifest file with no luck.</p><p>I've also tried various SD card sizes up to 3000Mb in size!I've tried nearly all the emulators available on my AVD manager from 1.5 up to 2.3.I've also tried adding firewall exceptions then tried turning off the firewall.</p><p>any ideas or suggestions? </p>","597467","","","","","2012-02-17 18:27:12","Android Emulator cannot connect to network","<android><connection><internet><emulator>","3","0","","",""
"4855986","1","","","2011-01-31 20:54:39","1","950","<p>I have a Landscape background image in place. How do I lock it into position, but allow forground views to be rotated, e.g. a Dialog.</p><p>At the moment, either I lock the orientation so the dialog doesn't rotate, or I don't lock it and the background becomes tiny as I rotate the screen and it fills the narrow width of the screen.</p>","330770","","","","","2011-05-05 03:16:30","Android: Lock the Background image but rotate foreground views","<android><locking><orientation><background-image>","1","0","","",""
"4856099","1","4996471","","2011-01-31 21:06:55","1","1084","<p>I have an app that uses bluetooth SPP (RFCOMM) to communicate with a piece of hardware. The app and the bluetooth connection work great. The problem is when another app is started that also uses SPP and then one of the apps is stopped. Once either of the apps is stopped, either by quitting the app or by using a task killer, the phone slows down to a near halt. Most of the time I have to pull the battery.</p><p>I have seen this with Pandora, which uses SPP, probably as part of its Ford Sync support, and with my app. I have also seen this with the sample apps for SPP. It doesn't matter which apps I use. Any two apps that use SPP cause this.</p><p>I have seen this on Android 2.1, HTC device on ATT. I did not see this on a Motorola Droid running 2.2.1 stock, however I did see this on the same phone while running 2.2 and LFY 1.95 ROM with a custom kernel.</p><p>I have logs from the debugger if anyone needs to see them, but I see nothing in there that points out the problem. Once either SPP apps is stopped the slow down starts immediately. I still get logs but nothing at all indicating a problem. The slow down does not stop until the phone is rebooted.</p>","548949","","","","","2011-03-31 21:57:58","Android Multiple SPP / RFCOMM Connections Causes Massive Slow Downs","<android><bluetooth><rfcomm>","1","1","","",""
"4856101","1","4856250","","2011-01-31 21:07:00","6","5840","<p>Im trying to create toast like control based on textview, and i found very strange behavior of textview in case when it have nine patch drawable as background.</p><p>This is xml definition:</p><pre><code>&lt;by.pplware.view.QuickInfo    android:id=""@+id/quickinfo""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:layout_alignParentTop=""true""    android:layout_centerHorizontal=""true""    android:padding=""20px""    android:textSize=""20px""    android:textStyle=""bold""    android:typeface=""serif""    android:background=""#FFFF0000""/&gt;</code></pre><p>this is textview with color background:<img src=""http://i.stack.imgur.com/LLkJO.png"" alt=""enter image description here""></p><p>this is textview with drawable background :<img src=""http://i.stack.imgur.com/lnkEu.png"" alt=""enter image description here""></p><p>As i understand, in case of ninepatch background android make padding transparent and use drawable only as background for text. But I want to include padding into area covered with ninepatch background.</p><p>Is there any solution for this issue ? </p>","318936","","1281930","","2013-02-02 04:15:43","2013-02-02 04:15:43","Padding arround textview with nine patch background have no visual effect","<android><textview><nine-patch>","1","0","3","",""
"4856119","1","4856229","","2011-01-31 21:08:36","0","927","<p>I'm trying to create a function that tints a Bitmap,</p><p>this works... </p><pre><code> imgPaint = new Paint();    imgPaint.setColorFilter(new LightingColorFilter(color,0));//when image is being drawncanvas.drawBitmap(img,matrix,imgPaint);</code></pre><p>However, when the bitmap has to be drawn constantly (every frame) , I start to see screen lag, because this didn't occur before the color filter was set, I believe that it is applying the filter every time I need the canvas drawn.</p><p>Is there a way to apply the paint once to the bitmap and have it permanently changed?</p><p>Any help appreciated :)</p>","559475","","","","","2011-01-31 21:18:07","Tint Bitmap with Paint?","<java><android>","1","1","0","",""
"4856165","1","4856212","","2011-01-31 21:12:23","0","229","<p>first, I spend all day finding the answers by myself, with no luck.</p><p>So, I am learning to develop for Android. I setup SDK, got everything running. I am also new to java and OOP itself. I have benn programming before, I know several Assemblers and C very well. </p><p>So, what I dont really understand is, in every game tutorial, game loop and SurfaceView is started like a new thread. But why? Why to start new thread for this, instead just let it flow from activity start method?</p><p>Thanks. </p>","307797","","","","","2011-01-31 21:16:32","Java, android - help me understand code please","<java><android>","1","0","","",""
"4856210","1","4892403","","2011-01-31 21:16:27","9","12402","<p>I'm trying to access the sqlite database file on the device. I mean, I've launched the app on the device via adb. And now I wanto to download this file as I did before on emulator via DDMS. But when I select the device on DDMS and open the folder data, it is empty. </p><p>Is it the right way to do? Or there is another way to download this db file.</p><p>Thanks.</p>","399459","","135152","","2011-05-25 02:59:28","2013-01-07 10:21:14","Access sqlite database on android device","<android><sqlite><nexusdb>","3","1","10","",""
"4856308","1","4895383","","2011-01-31 21:25:50","12","13582","<p>I'm having trouble getting <code>@font-face</code> to behave in any mobile Webkit browser I've tested--Safari on an iPhone 3GS, the default Android 2.2 browser, and Dolphin browser on Android.</p><p>It works in all desktop browsers, from IE7 to IE9, FF3.5, Safari 4, and Opera.</p><p>The fonts and CSS are from FontSquirrel:</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#webfontFHzvtkso') format('svg');    font-weight: normal;    font-style: normal;}@font-face {    font-family: 'LatinModernRoman10Bold';    src: url('../fonts/lmroman10-bold-webfont.eot');    src: local('?'),        url('../fonts/lmroman10-bold-webfont.woff') format('woff'),        url('../fonts/lmroman10-bold-webfont.ttf') format('truetype'),        url('../fonts/lmroman10-bold-webfont.svg#webfonthCDr6KZk') format('svg');    font-weight: normal;    font-style: normal;}@font-face {    font-family: 'LatinModernRoman10BoldItalic';    src: url('../fonts/lmroman10-bolditalic-webfont.eot');    src: local('?'),        url('../fonts/lmroman10-bolditalic-webfont.woff') format('woff'),        url('../fonts/lmroman10-bolditalic-webfont.ttf') format('truetype'),        url('../fonts/lmroman10-bolditalic-webfont.svg#webfontegrLi3sm') format('svg');    font-weight: normal;    font-style: normal;}</code></pre><p>I've checked the SVG ID in the SVG font source, and they all match up.</p><p>Could it be because I've got some letter-spacing rules later on in the CSS?</p><p>Thanks!</p>","343520","","324381","","2012-03-09 21:49:43","2012-03-09 21:49:43","@font-face not working in mobile Webkit","<iphone><android><css><font-face><mobile-webkit>","1","0","9","",""
"4856457","1","","","2011-01-31 21:41:54","0","808","<p>What exactly means getMobileRxBytes () ?Get the total number of bytes received through the mobile interface.Total number since when ? Device boot, phone unplug ?</p><p>Also getTotalRxBytes ?Get the total number of bytes received through all network interfaces.What interfaces beside mobile and WI-FI ? If only these two, it's okay to assume thatgetTotalRxBytes - getMobileRxBytes  = WI-FI traffic ?</p>","467780","","","","","2011-03-15 11:16:29","Meaning of getMobileRxPackets and getTotalRxBytes in TrafficStats","<android><interface><byte><traffic>","1","0","","",""
"4856510","1","4953039","","2011-01-31 21:47:50","13","5606","<p>i have this error in my map app.do you know what is wrong?i have checked and the package is right in my .java files and also i have put the uses-libraries of google maps into my  application tag in the manifest.xml..please help,im trying hours to solve it..</p>","519526","","","","","2011-10-11 11:11:56","NoClassDefFoundError in mapActivity","<android>","3","1","1","",""
"4856539","1","4856629","","2011-01-31 21:50:34","17","6054","<p>Is there a way to dynamically change the starting activity in Android based upon a conditionally?  What I attempted to do (that didn't work) was the following:</p><ol><li>remove the LAUNCHER category as defined in my AndroidManifest.xml</li><li>create a custom Application class that the app uses</li><li>override the onCreate method of my Application class to define some code like the following:</li></ol><p>.</p><pre><code>if (condition) {    startActivity(new Intent(this, MenuActivity.class));} else {    startActivity(new Intent(this, LoginActivity.class));}</code></pre>","107277","","","","","2012-08-03 12:29:37","Dynamic start activity in Android?","<android><activity><android-intent><launcher>","2","1","8","",""
"4856625","1","","","2011-01-31 21:58:07","2","519","<p>As per my title I'm having JQTouch issues on Android. I have several drop down menus that are completely unresponsive on the device. They open on iphone and any desktop browser I've tried. The one thing that might be worth noting is that I've added a background image to the dropdowns to fit my theme. </p><p>Is this something that's come up for anyone, I haven't been able to find any documentation on this at all.</p><p>Any help is greatly appreciated. </p>","597546","","179850","","2011-02-21 18:47:05","2011-04-07 04:48:32","JQTouch causing issues on Android","<jquery><iphone><android><jqtouch>","1","1","2","",""
"4856668","1","","","2011-01-31 22:03:00","2","808","<p>I have the following situation:I want to draw an rectangle on a canvas and inside the rectangle a text of a certain size.How can I make the rectangle have 1/4 width of the screen on all screen sizes, and how can I know what setTextSize to give to the inside text in order to not exceed the rectangle boundaries ?I have read <a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">http://developer.android.com/guide/practices/screens_support.html</a> but I'm not fully clear with the concepts. </p>","467780","","154112","","2012-06-03 04:16:37","2012-06-03 04:17:40","Draw on canvas on different screen resolutions and densities","<android><draw><android-canvas><screens>","0","3","1","",""
"4856726","1","4858986","","2011-01-31 22:09:45","5","827","<p>I'm doing unit testing using the ActivityInstrumentationTestCase2. Is there a way to add extras to the activity so when the activity gets to a line like this</p><pre><code> Bundle extras = getIntent().getExtras();</code></pre><p>it will return extras?</p>","202064","","","","","2011-02-01 04:44:50","Is there a way to add Extras to Activity using ActivityInstrumentationTestCase2","<android><unit-testing><activity>","1","0","","",""
"4856760","1","4857236","","2011-01-31 22:14:09","0","870","<p>Please go through the code below.</p><p><code>String[] Info</code> contains 2 values like this: </p><ul><li><code>shiftDirection &amp; 1</code> or </li><li><code>currGear &amp; 5</code> and similar pairs. </li></ul><p>If I receive <code>shiftDirection &amp; 0</code>, I should display the previously received value of <code>currGear</code>. </p><p>So I create <code>PresentGear</code> as a global variable and when <code>currGear</code>is received, I store it's value in <code>PresentGear</code>. </p><p>Then when I receive <code>shiftDirection &amp; 0</code>, I try to display <code>PresentGear</code> but nothing gets displayed. </p><p><code>PresentGear</code> is assigned no value. It would be very helpful if someone could suggest why this is happening or if my approach is wrong, kindly suggest an alternative way.</p><p>Cheers,</p><p>Madhu </p><pre><code>public class Images extends Activity {    /** Called when the activity is first created. */    //LinearLayout mLinearLayout;    //ImageView showImage;    String PresentGear = """";    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);                Bundle extras = getIntent().getExtras();        String[] Info = extras.getStringArray(""MsgInfo"");        Log.d(""TCP"",""in DA Images. Message name: "" + Info[0] + "", value: "" + Info[1]);        if (Info[0].equals(""currGear"")) {               PresentGear = Info[1];            setContentView(R.layout.image);            TextView text_bottom = (TextView) findViewById(R.id.textView2);            text_bottom.setText(Info[1]);        }        Log.d(""TCP"",""in DA Images. Present gear1: "" + PresentGear);        DataAction(Info[0], Info[1]);                }    public void DataAction (String mName, String mVal)  {        String _mName = mName;        String _mVal = mVal;        if (_mName.equals(""shiftDirection"") &amp;&amp; _mVal.equals(""1"")) {            setContentView(R.layout.image);            //TextView text_top = (TextView) findViewById(R.id.textView1);            ImageView showImage = (ImageView) findViewById(R.id.imageView1);                        //text_bottom.setText(Info[1]);            showImage.setImageResource(R.drawable.shift_up);                    } else if (_mName.equals(""shiftDirection"") &amp;&amp; _mVal.equals(""-1"")) {            setContentView(R.layout.image);            //TextView text_bottom = (TextView) findViewById(R.id.textView2);            ImageView showImage = (ImageView) findViewById(R.id.imageView1);                        //text_bottom.setText(Info[1]);            showImage.setImageResource(R.drawable.shift_down);                  } else if (_mName.equals(""recomGear"") &amp;&amp; _mVal != null) {            Integer msgValue = Integer.parseInt(_mVal);            Integer CurrentGear = (msgValue) - 1;            Log.d(""TCP"",""in DA Images. Current gear: "" + CurrentGear);            String Gear = Integer.toString(CurrentGear);            setContentView(R.layout.image);            TextView text_top = (TextView) findViewById(R.id.textView1);            TextView text_bottom = (TextView) findViewById(R.id.textView2);            ImageView showImage = (ImageView) findViewById(R.id.imageView1);                        showImage.setImageResource(R.drawable.shift_up);            text_bottom.setText(Gear);            text_top.setText(_mVal);        //} //else if (_mName.equals(""currGear"") &amp;&amp; _mVal != null) {            //PresentGear = _mVal;                      //Log.d(""TCP"",""in DA Images. Present gear1: "" + PresentGear);            //setContentView(R.layout.image);            //TextView text_bottom = (TextView) findViewById(R.id.textView2);            //text_bottom.setText(_mVal);                               } else if (_mName.equals(""shiftDirection"") &amp;&amp; _mVal.equals(""0"")) {            Log.d(""TCP"",""in DA Images. Present gear: "" + PresentGear);            setContentView(R.layout.image);            TextView text_bottom = (TextView) findViewById(R.id.textView2);            TextView text_top = (TextView) findViewById(R.id.textView1);            text_top.setText(""Go on"");              text_bottom.setText(PresentGear);                   }    }}</code></pre><p>Update:</p><p>Thank you all for the response. I will post the part where I am getting the string array from. It may not be the best designed code. Would be happy if any changes are suggested.</p><pre><code>public class TCPListen extends Activity implements TCPListener {    private TextView mTitle;    public String data[] = new String[2];    public String PGear;    /** Called when the activity is first created. */     @Override           public void onCreate(Bundle savedInstanceState) {               super.onCreate(savedInstanceState);               //setContentView(R.layout.main);                         // Set up the window layout             requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);             setContentView(R.layout.main);             getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);             // Set up the custom title             mTitle = (TextView) findViewById(R.id.title_left_text);             mTitle.setText(R.string.app_name);             mTitle = (TextView) findViewById(R.id.title_right_text);             //TcpServiceHandler handler=new TcpServiceHandler(this);               //handler.execute(""192.168.62.23"");               TcpServiceHandler handler = new TcpServiceHandler(this,this);               Thread th = new Thread(handler);               th.start();      }                   public String[] callCompleted(String source){                 Log.d(""TCP"", ""Std parser "" + source);                //mTitle.setText(source);                //String data[] = new String[2];                 //if (source.matches(""&lt;MSG&gt;&lt;N&gt;.*&lt;/N&gt;&lt;V&gt;.*&lt;/V&gt;&lt;/MSG&gt;""))  {                               Document doc = null;                      try{                       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();                         DocumentBuilder db = dbf.newDocumentBuilder();                         doc = (Document) db.parse(new ByteArrayInputStream(source.getBytes()));                         NodeList n = doc.getElementsByTagName(""N"");                         Node nd = n.item(0);                         String msgName = nd.getFirstChild().getNodeValue();                         NodeList n1 = doc.getElementsByTagName(""V"");                         Node nd1 = n1.item(0);                         String tmpVal = nd1.getFirstChild().getNodeValue();                         data[0] = msgName;                         data[1] = tmpVal;                        Log.d(""TCP"", ""Inside Std parser "" + data[0] + "" "" + data[1]);                       actionOnData(data[0], data[1]);                      }                      catch(Exception e){                      e.printStackTrace();                  }                Log.d(""TCP"", ""Just outside Std parser "" + data[0] + "" "" + data[1]);                return data;                //} else Log.d(""TCP"", ""Message in wrong format "" + source);                //mTitle.setText(""Message in wrong format "" + source);                //return data;            }       //Function to display driver messages/images based on individual messages         public void actionOnData(String name, String value) {            String tempName = name;            String tempVal = value;                             if(tempName.equals(""shiftDirection"") &amp;&amp; tempVal.equals(""1""))    {                    Log.d(""TCP"",""in actionOnData "" + data[0] + "" "" + data[1]);                    //mTitle.setText(""Change to next higher gear"");                    Intent myIntent = new Intent();                    myIntent.setClassName(""com.example.android.TCPListen"", ""com.example.android.TCPListen.Images"");                    myIntent.putExtra(""MsgInfo"", data); // key/value pair, where key needs current package prefix.                    startActivity(myIntent);                     finish();                } else if(tempName.equals(""recomGear"")) {                    Log.d(""TCP"",""in actionOnData "" + data[0] + "" "" + data[1]);                    //mTitle.setText(""Drive like a man"");                                       Intent myIntent = new Intent();                    myIntent.setClassName(""com.example.android.TCPListen"", ""com.example.android.TCPListen.Images"");                    myIntent.putExtra(""MsgInfo"", data); // key/value pair, where key needs current package prefix.                    startActivity(myIntent);                    finish();                } else if(tempName.equals(""shiftDirection"") &amp;&amp; tempVal.equals(""-1""))    {                    Log.d(""TCP"",""in actionOnData "" + data[0] + "" "" + data[1]);                    //mTitle.setText(""Change to next higher gear"");                    Intent myIntent = new Intent();                    myIntent.setClassName(""com.example.android.TCPListen"", ""com.example.android.TCPListen.Images"");                    myIntent.putExtra(""MsgInfo"", data); // key/value pair, where key needs current package prefix.                    startActivity(myIntent);                     finish();                } else if(tempName.equals(""currGear""))  {                    Log.d(""TCP"",""in actionOnData "" + data[0] + "" "" + data[1]);                    //mTitle.setText(""Change to next higher gear"");                    PGear = data[1];                    Intent myIntent = new Intent();                    myIntent.setClassName(""com.example.android.TCPListen"", ""com.example.android.TCPListen.Images"");                    myIntent.putExtra(""MsgInfo"", data); // key/value pair, where key needs current package prefix.                    startActivity(myIntent);                     //finish();                } else if(tempName.equals(""shiftDirection"") &amp;&amp; tempVal.equals(""0"")) {                    Log.d(""TCP"",""in actionOnData "" + data[0] + "" "" + data[1]);                    //mTitle.setText(""Change to next higher gear"");                    data[1] = PGear;                    Intent myIntent = new Intent();                    myIntent.setClassName(""com.example.android.TCPListen"", ""com.example.android.TCPListen.Images"");                    myIntent.putExtra(""MsgInfo"", data); // key/value pair, where key needs current package prefix.                    startActivity(myIntent);                     finish();                } else mTitle.setText(""Just show something"");                //Log.d(""TCP"", ""Just show an image"");            //}         }}</code></pre><p>In fact, in the above code, I have temporarily solved the issue of storing value of currGear and using it in shiftDirection, 0.</p>","487851","","487851","","2011-02-01 10:21:51","2011-02-01 10:21:51","Java: Problem in accessing value of global variable","<java><android><global-variables>","2","4","","",""
"4856773","1","4856880","","2011-01-31 22:16:08","0","1831","<p>i have an android app, that connectos to the remote database with PHP+json</p><p>but now, i have to store photos of the users on the remote server. I need to do it storing the URL of the uploaded photo in a row of the USER TABLE. That is not the problem.  The problem is that i have not idea about with a given path of a photo, how to upload it into a dir of the remote server of my app?</p><p>as i know, i need two things, a function that connects with a PHP and gives to the PHP the photo, and a PHP that receives the photo and uploads it into a dir of the remote database.</p><p>Well....¿can someone help me to do it?</p><p>i check a lot of tutorials of doing this with PHP but i can't find a easy one that how to do it with android+php+mysql, all i am finding is too hard for me.</p><p>can someone give me the code i need to do it?</p><p>thanks</p><p>EDIT:</p><p>there is not exist a simple function and a simple PHP code that does it? simple ones, the examples you are giving me are very hard for my skills with this and i can't apply to my android app and my remote server</p>","479886","","479886","","2011-01-31 22:36:13","2011-01-31 22:36:13","How to upload images into my remote server with PHP?","<php><android><mysql>","2","0","","",""
"4856777","1","","","2011-01-31 22:16:32","0","269","<p>I updated android plug-in in eclipse and after that when I open any layout xml file, it says missing theme, and layout in not showing anything, </p><p>from the last combo box I'm choosing Android 2.2 and it starts showing the layout correctly, but again after closing it and reopen it the same problem happens.</p><p>I checked manifest file and realized that all the options are active except Theme.<img src=""http://i.stack.imgur.com/tLYxB.png"" alt=""enter image description here""></p><p>any suggestion?? thanks...</p>","536853","","536853","","2011-02-01 02:07:04","2011-02-01 12:01:20","Android Theme is inactive after update","<android><themes>","1","1","","",""
"4856842","1","","","2011-01-31 22:25:39","4","384","<p>Is there some way to synchronise emulator time and system time with milliseconds accuracy? So the call <code>System.currentTimeMillis()</code> would return the same time as call <code>gettimeofday()</code> in C?</p>","553379","","476747","","2011-08-17 04:38:57","2013-03-08 03:04:57","android emulator time synchronization","<android><time><emulator><synchronisation>","2","0","3","",""
"4856902","1","4857015","","2011-01-31 22:34:04","2","1770","<p>I have a ListActivity with a ListView populated onStart with data from a database. Each row is a custom view. After the ListView is populated I want to select a specific row and edit it (for example change the background).</p><p>If I try getListView().getChildCount() after it is populated I always get 0. Am I misunderstanding how getChildCount works or have I used it incorrectly?</p>","597521","","","","","2011-01-31 22:48:36","Get child view from a ListView within a ListActivity","<android><listview><listactivity>","1","2","1","",""
"4856910","1","4862702","","2011-01-31 22:35:18","0","162","<p>I have an Android application and I'm playing around with the LocationManager, right now just trying to get some basic functionality going. The problem is that when I send it a Location event, either through DDMS (Eclipse) or by telnet-ing to the emulator and using ""geo"", I'm not getting any response. I have my code below, can anyone please help me figure out what I'm doing wrong? Thanks.</p><pre><code>public class HelloLocation extends Activity {Toast mToast;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Intent intent = new Intent(HelloLocation.this, HelloLocationReceiver.class);        PendingIntent sender = PendingIntent.getBroadcast(HelloLocation.this, 0, intent, 0);        LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);        lm.addProximityAlert(40.000, -74.000, 2500, -1, sender);           if(mToast != null) {             mToast.cancel();        }        mToast = Toast.makeText(HelloLocation.this, ""Alarm set"", Toast.LENGTH_LONG);        mToast.show();    }}</code></pre><p>and my class that's supposed to respond to the Location event:</p><pre><code>public class HelloLocationReceiver extends BroadcastReceiver {    @Override public void onReceive(Context context, Intent intent) {        Toast.makeText(context, ""Alarm set off"", Toast.LENGTH_LONG).show();    }}</code></pre>","459550","","","","","2012-02-21 21:48:21","Why won't my Android app respond to Location events?","<android><android-emulator>","1","0","","",""
"4856955","1","","","2011-01-31 22:42:29","60","26903","<p>I am developing automated tests for an android application (using Robotium). In order to ensure the consistency and reliability of tests, I would like to start each test with clean state (of the application under test). In order to do so, I need to clear the app data. This can be done manually in Settings/Applications/Manage Applications/[My App]/Clear data</p><p>What is the recommended way to get this done programatically?</p>","597603","","","","","2012-10-15 13:08:24","How to programatically clear application data","<android>","5","3","13","",""
"4856998","1","","","2011-01-31 22:46:48","0","461","<p>Im trying to record the number of keystrokes in an edittext in my android app, but im coming up blank with a way to do it. </p><p>Im thinking that a TextWatcher is the way to achieve this, but nothing is working at the moment. Im a novice android developer, so any help much appreciated.</p><pre><code> mainTextBlock.addTextChangedListener(keyCounter);    ...    TextWatcher keyCounter = new TextWatcher() {  public void afterTextChanged(Editable s) {    keyCount++;   TextView keystrokeCount = (TextView)findViewById(R.id.keystrokeCount);   keystrokeCount.setText(keyCount);  }  public void beforeTextChanged(CharSequence s, int start, int count,    int after) {     }  public void onTextChanged(CharSequence s, int start, int before,    int count) {  }    };</code></pre><p>Im getting a force close every time I enter any text into the main text block. Im trying to count the keystrokes, not the number of characters within the edittext, otherwise it would be fairly straight forward... </p><p>Many thanks! </p>","597610","","329692","","2011-01-31 23:11:37","2013-02-12 11:30:20","Android: Key Stroke Count","<android><android-softkeyboard>","3","8","","",""
"4857088","1","5527167","","2011-01-31 22:56:58","1","689","<p>I'm trying to compile Dosbox0.74 for Android with pelya's SDL port (https://github.com/pelya/commandergenius) using the new android-ndk-r5b.Unfortunately the Dosbox ./configure script fails with:</p><pre><code>configure: error: C compiler cannot create executables</code></pre><p>I already had to replace the config.sub and config.guess files with newer ones, so that the --host=arm-linux-androideabi flag get recognized properly. For build setup I used pelya's tutorial, which can be found on the github site pasted above.Has anybody encountered similar errors/problems?</p>","413585","","","","","2011-04-03 02:21:28","android nkd-r5b+pelyaSDL ./configure error: C compiler cannot create executables","<android><sdl><configure><android-ndk-r5><dosbox>","1","0","","",""
"4857165","1","4864860","","2011-01-31 23:06:22","0","2387","<p>I would like the ability to set the systems ringtones from within my Android application.  I face a slightly interesting issue because I never once in my code refer to the sounds directly, and instead am using a setup that refers to them via ints, so the code I have found online for this doesn't quite apply to me.</p><p>I'm not sure whether my code to set the ringtone is correct or not.  It does replace my ringtone, but it never replaces it with the sound I ask it to.  When I was using ""Uri.parse"" and giving it the path to find the correct file, it would replace the ringtone with nothing.  Now, using ""Uri.fromFile"", and referring to the sound via a File, it replaces it with a typical telephone sound, which I assume is some sort of default.</p><p>I don't get any errors from this, but I do get one warning that seems relevant.  </p><pre><code>dataChanged but no participant pkg='com.android.providers.settings' uid=10096</code></pre><p>It seems to me that I am just not referring to the file properly.  I can get the path to the sound in a String, and of course define them as a File, but I must be missing something somewhere.</p><p>Any ideas are appreciated, thank you.</p><p>EDIT ::  Well it seems that error only shows up when you ""change the ringtone"".  So if I were to set the same sound as ringtone again, it would not show up, but if I were to set a different sound it would.  To me this still means that it is seeing everything I am doing, but I am not referencing to the sound properly, so it doesn't know what to put there.</p><p>EDIT :: These are the main points of the errors I get when I try to use the same setup that is posted in other examples of settings ringtones.</p><p>These are when I first try to set it as a ringtone :</p><pre><code>02-01 11:51:20.709: ERROR/MediaPlayerService(1157): Couldn't open fd for content://settings/system/ringtone02-01 11:51:20.709: ERROR/MediaPlayer(13807): Unable to to create media player02-01 11:51:20.709: ERROR/RingtoneManager(13807): Failed to open ringtone content://settings/system/ringtone02-01 11:51:20.709: ERROR/MediaPlayer(13807): Unable to to create media player02-01 11:51:20.716: WARN/Ringtone(13807): Couldn't set the stream type02-01 11:51:20.716: WARN/Ringtone(13807): java.io.IOException: setDataSourceFD failed.: status=0x80000000</code></pre><p>And this is if I go into my volume settings and change the volume of the ringtone :</p><pre><code>02-01 11:51:23.568: ERROR/MediaPlayer(13807): Unable to to create media player02-01 11:51:23.568: ERROR/Ringtone(13807): play() caught 02-01 11:51:23.568: ERROR/Ringtone(13807): java.io.IOException: setDataSourceFD failed.: status=0x80000000</code></pre>","589780","","589780","","2011-02-01 18:00:15","2011-02-01 18:00:15","Setting Ringtones Inside Android App","<android><settings><uri><provider><ringtone>","1","0","","",""
"4857303","1","","","2011-01-31 23:26:31","2","5867","<p>I've got four Image Buttons in screen1.xml.I've defined the webview in screen3.xml.If i click the ImageButton1 or other buttons, the repective URL (in webview) should load in screen3.xml.</p><p>I tried to do this, but it throws forceclose error. But If I try the same this with webview defined in screen1.xml, it works. But the problem is the Image Buttons and the webview appears in the same page and they are overlapped which looks awful!</p><p>Please help me out to open the webview in a new screen. </p><p>BTW, can addView be used for this purpose?</p><pre><code>public class click extends Activity { private WebView webView;    public void onCreate(Bundle savedInstanceState)     {     super.onCreate(savedInstanceState);        setContentView(R.layout.screen1);        webView = (WebView) findViewById(R.id.web_view);        ImageButton i1 = (ImageButton) findViewById(R.id.imagebutton1);        ImageButton i2 = (ImageButton) findViewById(R.id.imagebutton2);        ImageButton i3 = (ImageButton) findViewById(R.id.imagebutton3);        ImageButton i4 = (ImageButton) findViewById(R.id.imagebutton4); }private void openBrowser1()      {      webView.getSettings().setJavaScriptEnabled(true);      webView.loadUrl(""myurl"");     }public void myClickHandler1(View view)         {         openBrowser1();        }</code></pre><p>Screen1.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;  &lt;WebViewandroid:id=""@+id/web_view""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:layout_weight=""1.0"" /&gt; &lt;ImageButton android:id=""@+id/imagebutton1"" android:clickable=""true"" android:onClick=""myClickHandler1""  android:layout_width=""130dip"" android:background=""@null"" android:layout_height=""130dip"" android:layout_x=""21dip""  android:layout_y=""61dip"" &gt;&lt;/ImageButton&gt; &lt;ImageButton android:id=""@+id/imagebutton2"" android:clickable=""true"" android:onClick=""myClickHandler2""  android:layout_width=""130dip"" android:background=""@null""  android:layout_height=""130dip"" android:layout_x=""171dip""  android:layout_y=""61dip"" &gt;&lt;/ImageButton&gt; &lt;ImageButton android:id=""@+id/imagebutton3"" android:clickable=""true"" android:onClick=""myClickHandler3""  android:layout_width=""130dip"" android:background=""@null"" android:layout_height=""130dip"" android:layout_x=""21dip""  android:layout_y=""241dip"" &gt;&lt;/ImageButton&gt; &lt;ImageButton android:id=""@+id/imagebutton4"" android:clickable=""true"" android:onClick=""myClickHandler4""  android:layout_width=""130dip"" android:background=""@null""  android:layout_height=""130dip"" android:layout_x=""171dip""  android:layout_y=""241dip"" &gt;&lt;/ImageButton&gt;&lt;/AbsoluteLayout&gt; </code></pre><p>screen3.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;                 &lt;WebViewandroid:id=""@+id/web_view""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:layout_weight=""1.0"" /&gt;&lt;/AbsoluteLayout&gt; </code></pre>","597622","","142162","","2011-01-31 23:29:34","2012-07-18 08:46:11","Android: How to open the webview in a new screen","<android><webview><android-webview>","2","0","","",""
"4857304","1","4857334","","2011-01-31 23:26:48","3","974","<p>My app uses GPS, so I remove GPS updates in onStop() so it doesn't use up battery when it shouldn't.  However, I noticed that the battery on my test phone was running down if my app was open when the lock screen comes on.</p><p>So to test it, I added a Log.i(...) to the onStop() method of my activity. Sure enough, onStop() does not get called when I press the off button on my HTC Incredible (which turns off the screen).</p><p>Is there any way to listen for the lock screen, or the screen turning off, since it doesn't call onStop() like it should?</p><p>Thanks.</p>","506796","","","","","2011-01-31 23:30:30","Lock screen doesn't cause onStop() to get called","<android>","1","0","0","",""
"4857528","1","4857577","","2011-01-31 23:57:04","0","465","<p>I have an Activity with an ArrayList and also i have extended a View,Activity and View are in seperated classes.</p><pre><code>public class activity extends Activity{private ArrayList&lt;customObject&gt; ar = new ArrayList&lt;customObject&gt;();    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    drawview = new DrawView(this,ar);    setContentView(drawview);//more code}}</code></pre><p>As you see i pass to the constructor of the draview the ArrayList of my activity so i can handle the objects of ArrayList has.i gave the same names of ArrayList in both classes.(if that matters...)</p><pre><code>class DrawView extends View {  private ArrayList&lt;customObject&gt; ar; public DrawView(Context context,ArrayList&lt;customObject&gt; a) {        super(context);            this.ar=a;}//more code}</code></pre><p>And now a very very very weird thing....As far as i know java is call by value,so i can't actually pass memory segments of where i store my arraylist...so the only values should the drawview could see are the ones that i have passed on the constructor....BUT when i add values in the ArrayList of the Activity the values are also an din the aaraylist of the view!!!!Could this be happening??why this is happening...i'am very confused...</p>","587377","","508666","","2012-01-29 13:13:32","2012-01-29 13:13:32","ArrayList dynamically changes?","<android><dynamic><arraylist>","1","0","","",""
"4857678","1","4858769","","2011-02-01 00:21:16","1","522","<p>I got the hello-jni sample to run on my emulator and it will say ""Hello from JNI !"" via hell-jni.c. However when I change </p><pre><code>return (*env)-&gt;NewStringUTF(env, ""Hello from JNI !"");</code></pre><p>to</p><pre><code>return (*env)-&gt;NewStringUTF(env, ""Hello from TEST !"");</code></pre><p>Then I close my emulator, open it back up I will not see the string update. I tried to do Project -> Clean, then run it again and it will not update. Does anyone know why?</p>","552853","","491044","","2011-03-11 12:55:25","2011-03-27 06:47:17","Android C++ NDK Sample not updating","<java><c++><android><native><android-ndk>","2","0","","",""
"4857693","1","","","2011-02-01 00:24:52","1","1296","<p>So I want to make an app to scrape random inspirational quotes from a website, then show me them on my Android phone.  What steps do I need to do this?  Preferably I'd be able to do it in Clojure... if not that, then Ruby, if all else fails Java.</p><p>What do I need to do to write the app and importantly, to deploy it?</p>","47630","","","","","2011-02-01 14:44:49","Writing and deploying Android app","<android><ruby><clojure>","5","3","2","",""
"4857720","1","4857773","","2011-02-01 00:31:02","0","2686","<p>In my program I want to draw a square (with varying opacity, lets say red for arguments sake) onto a textured background. However the square appears the wrong color depending on the background. With alpha=1.0f (opaque) the square should appear red, which it does on a black background but on a white background it appears white (and scales accordingly in-between)</p><p>In my GLActivity have set the following flags:</p><pre><code>gl.glDisable(GL10.GL_LIGHTING);gl.glDisable(GL10.GL_CULL_FACE);gl.glDisable(GL10.GL_DEPTH_BUFFER_BIT);gl.glDisable(GL10.GL_DEPTH_TEST);gl.glEnable(GL10.GL_DITHER);gl.glShadeModel(GL10.GL_SMOOTH);gl.glEnable(GL10.GL_BLEND);gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE);</code></pre><p>Then I draw the background texture:</p><pre><code>gl.glClearColor(0.0f,0.0f,0.0f,1.0f);gl.glBindTexture(GL10.GL_TEXTURE_2D, texturesFPS[1]); gl.glEnable(GL10.GL_TEXTURE_2D); gl.glPushMatrix(); gl.glTranslatef(imageOffSetX, 0, 0); gl.glColor4f(1,1,1,1); gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY); gl.glVertexPointer(3, GL10.GL_FLOAT, 0,vertexBGBuffer); gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBGBuffer); gl.glDrawElements(GL10.GL_TRIANGLES, indices.length,GL10.GL_UNSIGNED_SHORT, indexBuffer); gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY); gl.glDisable(GL10.GL_TEXTURE_2D);</code></pre><p>Then I draw a square onto my background image:</p><pre><code> gl.glPushMatrix(); gl.glTranslatef(x, y, 0); gl.glColor4f(color[0], color[1], color[2], 1.0f); // Set to 1.0f temporarily gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer); gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, GL10.GL_UNSIGNED_SHORT, indexBuffer); gl.glDisableClientState(GL10.GL_VERTEX_ARRAY); gl.glPopMatrix();</code></pre><p>I've tried different values in the glBlendFunc but cannot understand how to achieve what I want. Any help is much appreciated :)</p>","315998","","490961","","2012-03-12 13:31:30","2012-03-12 13:31:30","Android Getting correct opacity/colors with glBlendFunc blending in OpenGL-ES","<java><android><opengl-es>","2","0","","",""
"4857728","1","","","2011-02-01 00:32:20","1","2221","<p>I'm loading images from URLS that are varying sizes.  It seems the smaller ones come through, and a nullPointerException (displayed in the Log.d below) comes through for the larger ones.  How can I get these images to resize?</p><pre><code>                BitmapDrawable drawable = null;                Bitmap bitmap = null;                try {                    bitmap = loadBitmapFromWeb(url);                    System.out.println(""url "" + url);                } catch (IOException e) {                }                int width = 150;                int height = 150;                try {                    drawable = resizeImage(bitmap, height, width);                } catch (Exception e) {                    Log.d(""exception image"", e.toString());                    drawable = getDrawableFromResource(R.drawable.default_backup);                }</code></pre><p>This is what I use to load from a URL: </p><pre><code>    public static Bitmap loadBitmapFromWeb(String url) throws IOException {        InputStream is = (InputStream) new URL(url).getContent();        Bitmap bitmap = BitmapFactory.decodeStream(is);        return bitmap;    }</code></pre><p>This is what I use to resize, where the error appears:</p><pre><code>    public static BitmapDrawable resizeImage(Bitmap bitmap, int w, int h) {        int width = bitmap.getWidth();        int height = bitmap.getHeight();        int newWidth = w;        int newHeight = h;        float scaleWidth = ((float) newWidth) / width;        float scaleHeight = ((float) newHeight) / height;        Matrix matrix = new Matrix();        matrix.postScale(scaleWidth, scaleHeight);        Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height,                matrix, true);        return new BitmapDrawable(resizedBitmap);    }</code></pre>","375566","","","","","2011-02-01 12:19:38","Android 2.2 SDK - bitmap image resize nullPointerException","<android><mobile><bitmap><android-sdk-2.2>","1","1","0","",""
"4857743","1","4857756","","2011-02-01 00:35:01","0","539","<p>I'm having no luck getting a service to start from a preference screen, and can't find any examples online. This is what I'm doing:</p><p>The preference XML:</p><pre><code>&lt;PreferenceScreen    android:title=""Start Service""&gt;    &lt;intent        android:action=""com.test.app.myservice"" /&gt;&lt;/PreferenceScreen&gt;</code></pre><p>The manifest:   </p><pre><code>&lt;service    android:enabled=""true""    android:name="".myservice""&gt;    &lt;intent-filter&gt;        &lt;action            android:action=""com.test.app.myservice"" /&gt;    &lt;/intent-filter&gt;&lt;/service&gt;</code></pre><p>The error:</p><pre><code>ERROR/AndroidRuntime(7912): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.test.app.myservice }</code></pre><p>Any ideas?</p>","491236","","","","","2011-02-01 03:15:39","How to start a service from XML?","<android><xml><service><preferences>","3","0","","",""
"4857823","1","5220989","","2011-02-01 00:53:23","3","1880","<p>It looks like both <a href=""http://stackoverflow.com/questions/4725773/ffmpeg-on-android"">FFmpeg</a> and the <a href=""http://processing.org/reference/libraries/video/MovieMaker.html"" rel=""nofollow"">MovieMaker library</a> in Processing will create a slideshow movie from an array of images. Which is best? Is there a better option?</p><p>I need to output a video to be uploaded to a 3rd party website so I'd like to do it on device and it needs to be a real video not just a gallery slideshow.</p>","341390","","2961","","2011-03-07 14:35:40","2011-11-26 16:57:31","Which image processing library should I use to create a video slideshow?","<android><video><image-processing><ffmpeg><slideshow>","1","0","3","",""
"4857838","1","","","2011-02-01 00:55:50","24","2054","<p>I have three full screen week views that are loaded at one time (previous, next, current). Each week view has 7 columns (one for each day of the week) with a drawable background.</p><p>My drawable resource background is</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;layer-list xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;!-- Grey border on left and right --&gt;&lt;item&gt;&lt;shape&gt;&lt;solid android:color=""#999""/&gt;&lt;/shape&gt;&lt;/item&gt;    &lt;!-- White background (.5pt to not cover border) --&gt;&lt;item android:left="".5pt"" android:right="".5pt""&gt;&lt;shape&gt;solid android:color=""#FFF""/&gt;&lt;/shape&gt;&lt;/item&gt;    &lt;!-- Image that repeats to make a grid --&gt;&lt;item android:left="".5pt"" android:right="".5pt""&gt;&lt;bitmap android:src=""@drawable/grid"" android:tileMode=""repeat"" android:gravity=""center"" /&gt;&lt;/item&gt;    &lt;!-- Times that align left. (12AM, 1AM, etc) --&gt;&lt;item android:left=""1pt"" android:right="".5pt""&gt;&lt;bitmap android:src=""@drawable/grid_times"" android:gravity=""top|left|clip_horizontal"" /&gt;&lt;/item&gt;&lt;/layer-list&gt;</code></pre><p>For some reason, if I have the three sets of seven in front of each other, only the front (visible one) gets the repeating image (actually a gif). If I shift the front over,, you can see the others do not get the repeating image</p><h2>Details</h2><p>The layout is RelativeLayout with three subclasses of RelativeLayout for the children. The three subclasses are identical to each other and override <code>dispatchTouchEvent</code> which allows them to be dragged. They start off right on top of each other so only the front one is visible. They are almost entirely identical except that one of them is on top (at first). </p><p>Here is a top view of the android</p><pre><code>                ' first    '                ' second   '                ' third    '                |          |#&lt;-- The android screen boundaries. Only third is visible.                   ^ ^ ^                    user                  looking                  forward</code></pre><p>when the user uses their finger to drag the view then it ends up like this (the user can see a little of the first pane (previous week) on the left)</p><pre><code>       ' first    '                           ' second   '                  ' third    '                |          |</code></pre><p>The other way looks like this (the user can see a little of the second pane (next week))</p><pre><code>     ' first    '                         ' second   '              ' third    '                |          |</code></pre><p>When the user lets go, they snap to this position (for now,, it will change when we fix this)</p><pre><code>     ' first    '                           ' second   '                ' third    '                |          |</code></pre>","463304","","225647","","2012-09-29 23:25:15","2012-09-29 23:25:15","Android Drawable: layer-list repeat bitmap does not load when entirely covered","<android><bitmap><drawable><repeat>","1","6","1","",""
"4858026","1","4858052","","2011-02-01 01:32:27","31","36489","<p>How can I have one layout for landscape and one for portrait? I want to assume extra width and conserve vertical space when the user rotates the phone over sideways.</p>","463304","","","","","2012-10-05 23:34:57","Android: alternate layout xml for landscape mode","<android><layout><resources><android-layout><orientation>","2","0","10","",""
"4858110","1","4858404","","2011-02-01 01:51:51","3","1421","<p>in my layout xml I have a SeekBar like this:</p><pre><code>        &lt;SeekBar                android:id=""@+id/nbackPrefSeekBar""                android:layout_height=""wrap_content""                android:layout_width=""fill_parent""                android:max=""@integer/maxnback""        /&gt;</code></pre><p>The problem is the user cannot select the maximal value with use of pointer (by clicking, dragging...). It is possible by manually focus the Seekbar with keys (up,down) and set it to the maximal value (right key). Using your finger you can select only the max-1 value.</p><p>E.g. if you have max value 3, you can select only 0, 1 and 2 (and with keys even 3). It is always selecting the value left of your finger and therefore the max value cant be selected as it is on the rightest side of the seekbar.</p><p>I actually tried to modify the width parameter programatically before displaying (hoping that you would be able to select the rightest value if you were able to drag it past the rightest point), but i got stuck on getWidth() returning 0.</p><p>The problem occurs on each platform I tested: 1.5, 1.6, 2.3 and on real 2.1 device as well.</p><p>Any clues? Thanks.</p>","597746","","","","","2011-02-01 02:53:47","In SeekBar a maximal value cannot be selected","<android><max><seekbar>","1","0","","",""
"4858127","1","4858378","","2011-02-01 01:55:42","0","586","<p>Is there a default style reference or something I can use for my custom status bar text color that makes it work properly on different versions of android / phones.</p><p>For example on the Samsung Galaxy S White works well, but on the nexus one white is unreadable but black works best, and vice versa.</p>","117691","","","","","2011-04-04 17:59:56","Default status bar text color in android","<android><user-interface><statusbar>","1","0","1","",""
"4858192","1","","","2011-02-01 02:10:04","0","634","<p>My experience on web technologies aren't good so I want to know if this is possible from you experts.</p><p>Can a serversocket in Android respond to a xmlhttprequest?What I'd want to do is, assuming my PC and my Android are on the same network, can I make a xmlhttprequest from my browser to my Android, and have the Android (running a serversocket service) receive and extract whatever I sent through the xmlhttprequest? Say a text command.</p><p>Is this possible or have I gotten this all wrong?Thank you very much.</p>","455048","","","","","2011-02-01 02:17:42","xmlhttprequest and serversocket in Android","<android><xmlhttprequest><serversocket>","1","0","","",""
"4858318","1","4888492","","2011-02-01 02:32:46","0","2999","<p>I have a TabActivity with a single ListView inside TabHost's FrameLayout. This ListView is shared among my 3 tabs. The items of the list are downloaded from the internet using a Handler, but the list is not being updated when the data come. When I select another tab, the list updates itself, but I want to be able to see it being updated after download. I've already tried to invalidate the ListView, the FrameLayout and the TabHost, but nothing happens. The notifyDataSetChanged() and notifyDataSetInvalidated() methods don't help either. If I put the ListView out of the FrameLayout, it works as expected. Here's the code:</p><pre><code>    &lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;</code></pre><p></p><pre><code>&lt;TabHost android:id=""@android:id/tabhost"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:layout_alignParentTop=""true""&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;ListView xmlns:android=""http://schemas.android.com/apk/res/android""            android:id=""@+id/comments_list_lv""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" /&gt;      &lt;/FrameLayout&gt; &lt;/LinearLayout&gt;</code></pre><p></p><pre><code>    public class CommentsActivity extends TabActivity implements Handler.Callback, OnTabChangeListener {private static final int take = 20;private Handler handler;private CommentsListModel model = null;private ListView listView;private CommentsListAdapter adapter;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.comments_activity);    handler = new Handler(this);    setContentView(R.layout.comments_activity);    listView = (ListView) findViewById(R.id.comments_list_lv);    listView.setTextFilterEnabled(true);    getTabHost().setOnTabChangedListener(this);    buildTabs();    setListView();    requestData();}@Overridepublic boolean handleMessage(Message msg) {   AbstractResponse response = (AbstractResponse) msg.obj;   ResponseStatus status = response.getStatus();   if (status.getResponseCode() == ResponseStatus.OK) {       model = (CommentsListModel) response.getResponseObject();       adapter = new CommentsListAdapter(this, model.getComments());       listView.setAdapter(adapter);      }   return true;}@Overridepublic synchronized void onTabChanged(String tabName) {   if (model != null) {       Resources res = getResources();       CommentsFilter filter = null;       if (tabName.equals(res.getString(R.string.comments_all))) {           filter = new CommentsFilter(model.getComments(), CommentsFilter.ALL);       } else if (tabName.equals(res.getString(R.string.comments_liked))) {           filter = new CommentsFilter(model.getComments(), CommentsFilter.LIKED);       } else if (tabName.equals(res.getString(R.string.comments_disliked))) {           filter = new CommentsFilter(model.getComments(), CommentsFilter.DISLIKED);       }       adapter = new CommentsListAdapter(this, filter.filter());       listView.setAdapter(adapter);  }}private void buildTabs() {  Resources res = getResources();  TabHost tabHost = getTabHost();  String tabName = res.getString(R.string.comments_all);  TabHost.TabSpec spec = tabHost.newTabSpec(tabName);  spec.setIndicator(tabName, null);  spec.setContent(R.id.comments_list_lv);  tabHost.addTab(spec);  tabName = res.getString(R.string.comments_liked);  spec = tabHost.newTabSpec(tabName);  spec.setIndicator(tabName, null);  spec.setContent(R.id.comments_list_lv);  tabHost.addTab(spec);  tabName = res.getString(R.string.comments_disliked);  spec = tabHost.newTabSpec(tabName);  spec.setIndicator(tabName, null);  spec.setContent(R.id.comments_list_lv);  tabHost.addTab(spec);  }private void requestData() {   AbstractRequest request = new CommentsRequest(barcode, 0, take);   request.addListener(handler);   Message msg = new Message();   msg.what = ApplicationActions.ProtocolActions.REQUEST;   msg.obj = request;   msg.setTarget(AsyncRequestController.getInstance().getInboxHandler());    msg.sendToTarget(); }                                                                                                         }</code></pre>","595881","","595881","","2011-02-01 02:47:07","2011-02-03 16:05:48","Can't update a ListView inside a TabHost's FrameLayout","<android><android-widget><android-layout><android-listview><android-tabhost>","1","0","","",""
"4858361","1","","","2011-02-01 02:41:59","4","4419","<p>specifically I need to work with the Shading lenguage GLSL. I have already installed NDK, SDK and everything else and is runing ok, i ran an example with openGLES 2 using NDK and it works fine, the problem is that there are many instructions that I dont't undestand. so i need a tutorial or book that teach me that step by step</p>","597786","","1064959","","2011-12-08 02:52:58","2011-12-08 02:52:58","Some tutorial for OpenGL ES 2 in Android with NDK?","<android><sdk><gpgpu><opengl-es-2.0><android-ndk>","1","0","1","",""
"4858477","1","","","2011-02-01 03:08:38","1","2864","<p>I'm working on writing a small app that will stream mp3 files. I'm using the NPR code, but having a strange problem with mediaPlayer.prepareAsync().</p><p>I'm using a trimmed down version of the <a href=""https://code.google.com/p/npr-android-app/source/browse/trunk/Npr/src/org/npr/android/news/PlaybackService.java"" rel=""nofollow"">PlaybackService</a> from the NPR app, which is getting started correctly. I am getting a reference to the service inside an OnClick handler inside an Activity, and calling listen() with the URL to the MP3 stream. The following (simplified) code is from my PlaybackService:</p><pre><code>public void listen(String url) throws IllegalArgumentException, IllegalStateException, IOException {     if (mediaPlayer == null) {         mediaPlayer = new MediaPlayer();     }     mediaPlayer.setOnBufferingUpdateListener(this);     mediaPlayer.setOnCompletionListener(this);     mediaPlayer.setOnErrorListener(this);     mediaPlayer.setOnInfoListener(this);     mediaPlayer.setOnPreparedListener(this);     synchronized (this) {        mediaPlayer.setDataSource(url);        mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);        mediaPlayer.prepareAsync();    }}// ... lots of other code@Overridepublic void onPrepared(MediaPlayer mp) {     Log.d(LOG_TAG, ""Prepared"");     play();}</code></pre><p>I have the other callbacks defined as well. I can see from LogCat that the MediaPlayer is loading the stream and buffering, as I see the following messages:</p><pre><code>AwesomePlayer  I  calling prefetcher-&gt;prepare()AwesomePlayer  I  prefetcher is done preparing</code></pre><p>But my onPrepared method never gets called. If I add a timer and try to call play() on the MediaPlayer at some point after I see the above log messages, the media players plays, so it is indeed entering into the Prepared state.</p><p>If I replace the call to prepareAsync() with prepare(), the player just works. This is all on 2.2, which I have been reading seems to have some issues, but the problem I'm having doesn't seem related, as the stream works fine when prepare() is used.</p><p>I did notice that the Content-Length on the the stream is quite large (450MB), but since I can call play on the Media Player without getting an exception, it appears to be handling this OK.</p><p>The only other change is that in the NPR app, the service is being bound to and the playback started from inside a View object (while in my app, this happens inside an Activity).</p><p>Any thoughts on what I could be doing wrong?</p>","595284","","","","","2011-12-09 09:44:34","MediaPlayer callbacks not firing after calling prepareAsync() from a Service","<android><service><media-player>","1","1","1","",""
"4858490","1","4858533","","2011-02-01 03:12:02","0","32","<p>Ever since the 2.3 update I cannot find the window that shows all the parts in an xml layout, is this gone, or is my sdk just broken?</p>","531928","","","","","2011-02-01 03:19:29","Where did the ""hierarchal"" view go in the eclipse plugin?","<android><eclipse-plugin>","1","0","","",""
"4858535","1","4858568","","2011-02-01 03:19:34","0","655","<p>I have a simple question about using SimpleCursorAdapter with ListView. I've noticed that my cursor retains it's internal structure, but that the ListView connected with a SimpleCursorAdapter seems to display the objects in the cursor in a odd, or even random, order.</p><p>It's important that my list view display the Cursor's objects in the same order that they appear in the Cursor. Is this possible?</p><p>Thanks for any help!</p><p>EDIT: It appears that issue is not with ListView or Cursor. The issue is that a Cursor returned by using a WHERE IN (x,y,z) clause will not necessarily have the order x, y, z. Sorry for posting the misleading query. </p>","48998","","48998","","2011-02-01 03:52:40","2011-02-01 03:52:40","Ordered Cursor ListView","<android><listview><cursor>","1","2","","",""
"4858643","1","","","2011-02-01 03:38:48","2","507","<p>If the phone <strong><em>does</em></strong> fall asleep as soon as you are done keeping it up, that brings me to the second curiosity question:</p><p>How often can the phone wake up and fall asleep before it becomes inefficient? (more waste than staying on the whole time)</p>","463304","","463304","","2011-03-18 21:25:59","2011-03-18 21:25:59","Android: If you use an AlarmManager to wake up the phone, does the phone go to sleep as soon as your task completes?","<android><sleep><alarm><alarmmanager><android-alarms>","0","0","","",""
"4858730","1","4858754","","2011-02-01 03:57:52","0","149","<p>I have a simple quiz game which is working well but the one problem I am having is that the answer and options to the questions are displayed on buttons but the answer button appears in the same place everytime. </p><p>Is there a way to randomise the positioning through the XML interface or would it be better to handle this on the coding side?</p><p>Below is the code I am using for the XML and the code I use to bind the data value from SQLite to the buttons. Any advice would be much appreciated.</p><pre><code>private void showQuestions(Cursor cursor) {// Collect String Values from QueryStringBuilder questiontxt = new StringBuilder("""");StringBuilder answertxt1 = new StringBuilder("""");StringBuilder answertxt2 = new StringBuilder("""");StringBuilder answertxt3 = new StringBuilder("""");StringBuilder answertxt4 = new StringBuilder("""");while (cursor.moveToNext()) {String question = cursor.getString(2);String answer = cursor.getString(3);String option1 = cursor.getString(4);String option2 = cursor.getString(5);String option3 = cursor.getString(6);questiontxt.append(question).append("""");answertxt1.append(answer).append("""");answertxt2.append(option1).append("""");answertxt3.append(option2).append("""");answertxt4.append(option3).append("""");}// Display answer buttonTextView answer = (TextView) findViewById(R.id.option1_button);answer.setText(answertxt1);//Display questionTextView text = (TextView) findViewById(R.id.text);text.setText(questiontxt);TextView optionbutton1 = (TextView) findViewById(R.id.option2_button);optionbutton1.setText(answertxt2);TextView optionbutton2 = (TextView) findViewById(R.id.option3_button);optionbutton2.setText(answertxt3);TextView optionbutton3 = (TextView) findViewById(R.id.option4_button);optionbutton3.setText(answertxt4);}</code></pre><p>And the XML</p><pre><code>&lt;Buttonandroid:id=""@+id/option1_button""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_above=""@+id/option3_button""/&gt;&lt;Buttonandroid:id=""@+id/option2_button""android:text=""@string/option2_label""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_alignParentRight=""true""android:layout_above=""@+id/option4_button""/&gt;&lt;Buttonandroid:id=""@+id/option3_button""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""@string/option3_label""android:layout_alignParentLeft=""true""android:layout_alignParentBottom=""true""/&gt;&lt;Buttonandroid:id=""@+id/option4_button""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""@string/option4_label""android:layout_alignParentRight=""true""android:layout_alignParentBottom=""true""/&gt;</code></pre>","576576","","","","","2011-02-01 05:29:06","Randomising placement of Buttons","<android>","1","0","","",""
"4858778","1","","","2011-02-01 04:07:03","2","1003","<p>I am writing an Android application that uses a large quantity of numeric information. </p><p>Right now I load the data in through a text file from the ""/res/raw/"" directory and then parse the text into a two dimensional float[][] array.</p><p>Is there any way to save this float[][] array as a resource file that can then be loaded by the program directly? </p><p>This would potentially save lots of time at start-up because the program would not have to parse lots of text, convert each element from text to float, etc.</p><p>Thank you.</p>","597843","","","","","2011-02-01 05:41:00","Any way to save a large float array as an Android resource file for future use?","<android>","1","0","1","",""
"4858917","1","","","2011-02-01 04:35:10","0","578","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2376512/can-i-emulate-a-compass-on-android"">Can I emulate a compass on Android</a>  </p></blockquote><p>I'm developing an Android application whose display depends on the orientation (azimuth specifically) of the phone. I'd like to test the application using the Android emulator, and so I need to change the orientation of the emulator dynamically through its telnet interface.</p><p>I can change its GPS position by issuing commands of the form: geo fix 34 56</p><p>However, I can't work out how to do the same for its azimuth. Is this possible, and if so how?</p><p>Thanks for any help, Martin</p>","304582","","","","","2011-02-01 06:58:02","How do I update the azimuth of orientation of the Android emulator?","<android><orientation><emulator><telnet><azimuth>","1","3","","2011-08-28 02:05:00",""
"4858954","1","","","2011-02-01 04:40:41","0","831","<p>I would like to display a listview when an item is selected in Spinner. The listview should appear just below the spinner in the same layout based on the item selected.</p><p>Ex: When a customer's name is selected in a Spinner, his details should appear in a listview.</p><p>Any help would be appreciated.</p>","564844","","","","","2011-02-01 04:52:27","Spinner On item selected display/get listview","<android>","1","0","","",""
"4859007","1","","","2011-02-01 04:49:06","0","626","<p>I got some answers, and Went ahead and tried the following:</p><pre><code>01 import android.app.Activity;02 import android.media.MediaPlayer;03 import android.os.Bundle;04 import android.os.Handler;05 import android.os.Message;06 import android.media.MediaPlayer;07 import android.media.AudioManager;08 import android.content.Context;09 import java.lang.Runnable;10  11 public class CanvasDrawingActivity extends  Activity   {12      13     private static final int FIRE = 0;14     private int initVolume = 0;15     private Handler handler;16     private MyCanvas v;17     private MediaPlayer mp;18     private AudioManager am;19     private MyRunnable r;// this is our custom runnable!20  21     @Override22     public void onCreate(Bundle savedInstanceState) {23         super.onCreate(savedInstanceState);24          25         am = (AudioManager)this.getSystemService(Context.AUDIO_SERVICE);26               27             // this method gets the current volume setting for music28             initVolume = am.getStreamVolume(AudioManager.STREAM_MUSIC);29               30             // this method sets the volume for music | the 100 is the volume. you can put there either initVolume or whatever value you want31             am.setStreamVolume(AudioManager.STREAM_MUSIC,100,AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE);32          33         mp = MediaPlayer.create(this, R.raw.siren_1);34          35         makeHandler();36         v =new MyCanvas(this);37         setContentView(v);38         r = new MyRunnable();// this needs to create a new MyRunnable39         new Thread(r).start();40         mp.setLooping(true);41         mp.start();42     }43     private void makeHandler()44     {45         handler  = new Handler(){46  47             @Override48             public void handleMessage(Message msg) {49                 switch(msg.what)50                 {51                 case FIRE:52                 {53                     v.invalidate();54                     break;55                 }56                 }57             }58              59         };60          61     }62     private class MyRunnable extends Runnable {// you had this in the wrong spot...63             private boolean doRun = true;64              65             @Override66             public void run(){67             while(doRun)68                 handler.sendEmptyMessage(FIRE);69                 }70         public void stopThread(){71             doRun = false;72         }73     }74     protected void onpause() {75         super.onpause();76         mp.stop();77         r.stopThread();78         finish();79     }80     protected void onfinish() {81         mp.stop();82         r.stopThread();83         finish();84     }85          86     }</code></pre><p>I'm getting an error that runnable cannot be the superclass. Specifically that the type runnable cannot be the superclass of MyRunnable; a superclass must be a class.</p><p>Then in the onpause and onfinish it gives the error: Te method stopThread is undefined for the type runnable. This happens even when extends is changed to implements. </p><p>I also tried:</p><pre><code>01 Runnable MyRunnable = new Runnable(){02        03          04         private boolean doRun = true;05          06         @Override07         public void run(){08             while(doRun)09                 handler.sendEmptyMessage(FIRE);10         }11         public void stopThread(){12             doRun = false;13         }14     }</code></pre><p>I tried also:</p><pre><code>private class MyRunnable implements Runnable \\etc</code></pre><p>that clears up the runnable issue but causes my </p><pre><code>r = new MyRunnable();</code></pre><p>and</p><pre><code>r.stopThread();</code></pre><p>to be errors still which say:the <code>stopThread is undefined for the type runnable, and Type mismatch cannot convert from CanvasDrawingActivity.MyRunnable to Runnable.</code></p><p>Can anyone help me out here. I feel like this is a good option to end the thread, but again, I get some impassable errors...</p>","571866","","11296","","2011-02-01 04:58:57","2011-02-01 08:49:22","Still having trouble ending a thread","<android>","2","2","","",""
"4859011","1","4860239","","2011-02-01 04:50:24","0","1261","<p>I am able to open the gallery and getting the path of gallery as=content://media/external/images/media/2but not able to decode in imageviewthis is my code</p><p>public void onCreate(Bundle savedInstanceState) {                super.onCreate(savedInstanceState);                setContentView(R.layout.main);</p><pre><code>            b=(Button) findViewById(R.id.Button01);            b.setOnClickListener(new OnClickListener() {                public void onClick(View arg0) {                    // in onCreate or any event where your want the user to                    // select a file                    Intent intent = new Intent();                    intent.setType(""image/*"");                    intent.setAction(Intent.ACTION_GET_CONTENT);                    startActivityForResult(intent,IMAGE_PICK);                }            });        }        //UPDATED        public void onActivityResult(int requestCode, int resultCode, Intent data) {            if (resultCode == RESULT_OK) {                if (requestCode == IMAGE_PICK) {                    Uri selectedImageUri = data.getData();                    //OI FILE Manager                    filemanagerstring = selectedImageUri.getPath();                    //MEDIA GALLERY                    selectedImagePath = getPath(selectedImageUri);                    if(selectedImagePath!=null)                    {                        path = selectedImageUri.toString();                         m1.setPath(path);                          BitmapFactory.Options options = new BitmapFactory.Options();                          options.inSampleSize = 4;                             Bitmap yourSelectedImage = BitmapFactory.decodeFile(path, options);                             ImageButton img2=(ImageButton)findViewById(R.id.widget27);                             img2.setImageBitmap(yourSelectedImage);                             Toast.makeText(getBaseContext(), path, 1000).show();                           }                    }            }        }        public String getPath(Uri uri) {        String [] proj={MediaStore.Images.Media.DATA};           Cursor cursor = managedQuery(uri,                   proj, // Which columns to return                   null,       // WHERE clause; which rows to return (all rows)                   null,       // WHERE clause selection arguments (none)                   null); // Order-by clause (ascending by name)           int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);           cursor.moveToFirst();           return cursor.getString(column_index);   </code></pre><p>}}</p><p>Please help thanks in advance</p>","584493","","493193","","2011-02-14 10:53:53","2014-01-17 05:33:31","Not able to pick photo from gallery?","<android><gallery>","2","1","3","",""
"4859233","1","4859413","","2011-02-01 05:26:07","0","1226","<p>I have created rectangle shapes using onDraw method, filled with single colors. Now I have a  requirement to add gradient effects to those rectangles. Now I have to fill each rectangle with multiple colors(i.e gradient effect). Could some one suggest me the way to do that. Any response would be great.</p><p>thanks in advance.</p>","524937","","","","","2011-02-01 05:53:56","how to add gradient to my rectangle shape dynamically in android?","<android>","1","0","","",""
"4859264","1","4859503","","2011-02-01 05:30:10","1","2081","<p>In screen layout as I declared my list view as</p><pre><code> &lt;ListView android:id=""@id/android:list""               android:layout_width=""match_parent""               android:layout_height=""match_parent""               android:background=""#00FF00""               android:layout_weight=""1""               android:drawSelectorOnTop=""false""/&gt;     &lt;TextView android:id=""@id/android:empty""               android:layout_width=""match_parent""               android:layout_height=""match_parent""               android:background=""#FF0000""               android:text=""No data""/&gt;</code></pre><p>And row layout is as </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=""match_parent""     android:layout_height=""wrap_content""     android:orientation=""vertical""&gt;     &lt;TextView android:id=""@+id/text1""         android:textSize=""16sp""         android:textStyle=""bold""         android:layout_width=""match_parent""         android:layout_height=""wrap_content""/&gt;     &lt;TextView android:id=""@+id/text2""         android:textSize=""16sp""         android:layout_width=""match_parent""         android:layout_height=""wrap_content""/&gt; &lt;/LinearLayout&gt;</code></pre><p>My problem is I want to make my list view as multi selected, but when I add attribute in list view <code>android:choiceMode=""multipleChoice""</code> it doesn't work. And one way is there, with java code but when I changed id of listview <code>android:id=""@id/multi_selectable_list</code> as before <code>android:id=""@id/android:list</code> then at loding time of layout it gives error.Is there any way, or in same way I am doing something wrong.Actually I want multisectable list view, rules are </p><ol><li>there is a button if I clicked on that list should be change in multiselected.</li><li>By default list view can not multiselectable.</li></ol>","550966","","550966","","2011-02-01 05:42:28","2012-11-03 09:11:42","How to make list view as multiselectable","<android>","2","0","0","",""
"4859273","1","","","2011-02-01 05:33:07","0","161","<p>When I type a keyword like ""Doing Homework""+""having class"", google would return ""About 4,360 results"".I tried to fetch a webpage but it spent too much time to read and search the source code.</p><p>Could google return a XML file?</p><p>or</p><p>How can I get the counter quickly?</p>","597917","","","","","2011-02-01 05:35:11","How to get google search counter?","<android>","1","0","","",""
"4859287","1","7480879","","2011-02-01 05:36:19","4","5458","<p>I have an app to release which works on all android screen-sizes (except smaller) and densities above SDK version 2.0.</p><p>It will also run on extra large screens. Currently I have added this:</p><pre><code>&lt;supports-screens        android:largeScreens=""true""        android:normalScreens=""true""        android:smallScreens=""false""        android:anyDensity=""true""     /&gt;</code></pre><p>But I also need to add <code>android:xlargeScreens=""true""</code> , to allow it visible in android market on extra large screen devices, since by default it is false.</p><p>But to add <code>android:xlargeScreens</code> I need to change my eclipse targetsettings to 2.3 as this attribute was added from API level 9.</p><p>So what should I do with my target compilation settings for this scenario ? Should it be 2.3 while compiling ? If yes, then will the app not give any problems while running on devices with 2.0 version ?</p>","315619","","1140748","","2012-05-06 16:05:35","2012-05-06 16:05:35","Android compatibilty settings in AndroidManifest.xml","<android><android-manifest><google-play><screen-size>","7","1","2","",""
"4859304","1","4860269","","2011-02-01 05:38:00","0","987","<p>How to write an android program using Google Maps Javascript API V3 Services,i am using eclipse...</p><p><a href=""http://code.google.com/apis/maps/documentation/javascript/services.html#Directions"" rel=""nofollow"">http://code.google.com/apis/maps/documentation/javascript/services.html#Directions</a></p><p>from the above link which i have given i want to try out direction example but they have used some html code over there,but where i have to write html scripting code in my eclipse's  new project  and later how should i link html and android code..</p><p>i have also seen people saying we need to include <a href=""http://maps.google.com/maps/api/js?sensor=false"" rel=""nofollow"">http://maps.google.com/maps/api/js?sensor=false</a> script in our code..how to include this ..?</p><p>please suggest me ,Thanks in advance..</p>","505580","","505580","","2011-02-01 05:46:02","2013-03-29 13:28:48","How to write a program using google map javascript apiv3","<javascript><android><html>","2","0","","",""
"4859353","1","4859378","","2011-02-01 05:44:53","5","6161","<p>I am trying to develop an app in Android which implements accelerometer to detect the shakingof the real device. But i am having problems to test it in emulator. Is emulator supports accelerometer, so that developers can test such kind of application in emulator.I don't know is it possible or not.. though i have tried in find some clues but dint get success yet. If any body knows please help me..</p>","489762","","1471203","","2013-01-10 05:55:29","2013-01-10 05:55:29","accelerometer in Android emulator","<android>","1","1","6","",""
"4859422","1","","","2011-02-01 05:55:32","0","583","<p>hell all</p><p>in my application i have use custom list and data are come from web service, now i want to add functionality to auto search list like auto complete example at <a href=""http://developer.android.com/resources/tutorials/views/hello-autocomplete.html"" rel=""nofollow"">enter link description here</a></p>","562296","","","","","2011-02-01 06:04:04","is it possible to auto search list in android custom list view?","<android><listview>","1","0","","",""
"4859424","1","","","2011-02-01 05:55:44","2","1037","<p>From the Google groups I came to know that android 2.3 is using concurrent garbage collector.From the source code i can see that it uses both copying collector as well as mark and sweep, my question is whether the concurrency has been implemented in mark and sweep GC or in copying GC.please help me soon in this </p>","560937","","21234","","2011-02-03 10:29:03","2012-05-04 14:28:47","garbage collector in android 2.3","<android><garbage-collection>","1","0","3","",""
"4859489","1","","","2011-02-01 06:06:48","0","199","<p>I have developed an Android application. I have implemented all the functionality of the application. When I run the application in emulator it shows this message:</p><blockquote>  <p>[2011-02-01 11:36:39 - Test] WARNING: Application does not specify an API level requirement!  [2011-02-01 11:36:39 - Test] Device API version is 9 (Android 2.3)</p></blockquote><p>How can I resolve this?</p>","475349","","23897","","2011-02-01 06:08:54","2011-02-01 08:04:31","Application not installing on Android simulator","<android>","2","0","","",""
"4859514","1","4859682","","2011-02-01 06:09:40","0","808","<p>I was looking at this page: <a href=""http://developer.android.com/guide/basics/what-is-android.html"" rel=""nofollow"">http://developer.android.com/guide/basics/what-is-android.html</a></p><p>The section about ""Applicatiosn"" says that android ships with ""a set of core applications"" and ""All applications are written using the Java programming language"".</p><ol><li>Is it possible for me to write my own applications is whatever language the ""core applications"" are written in? (I assume that langauge is C).</li><li>Will doing so require me to do a custom build of android and install it on my device?</li><li>Are there any tutorials/documentations telling me how to do this?</li></ol><p>Please lets not debate the disadvantages of this approach - I'm pretty sure there will be many, the first being the development time involved. The purpose of this exercising is to learn, not to build.</p><p>Thanks :)</p>","2119053","","","","","2011-02-01 06:42:21","Can we write core Android apps and do a custom build?","<android>","1","0","","",""
"4859525","1","4859929","","2011-02-01 06:11:03","0","643","<p>I would like to know if there is a way to detect if the page is loaded completely in a webview - and if not loaded completely, automatically reload it again until the page is loaded entirely.</p><p>Is there a way to detect it ?</p><p>Thank you.</p>","438864","","19746","","2011-02-01 09:38:45","2011-02-01 09:38:45","Is it possible to reload the webview if the page is not completely loaded?","<javascript><android><html>","2","1","","",""
"4859528","1","","","2011-02-01 06:11:38","0","1189","<p>I need to read my mobile's Sqlite Date base from remote Access ?? Via network (as like sql Server)</p><p>Note :</p><p>If I have the SQlite DB File in My Phone. From my computer i need to read / edit the Database. </p>","548435","","472270","","2011-02-01 08:24:11","2011-02-01 08:24:11","Is there any way to read the mobile sqlite database in remote?","<android><sqlite>","2","2","","",""
"4859559","1","","","2011-02-01 06:16:51","2","2616","<p>how to track a person's location using open street map via GPS</p>","597954","","298282","","2011-02-01 06:32:09","2011-02-02 16:55:15","android: how to track a person's location using open street map via GPS","<java><android>","4","1","1","",""
"4859687","1","","","2011-02-01 06:37:39","0","335","<p>How to use Google Apps device policy in Android.what are the methods we need to use to provide google apps device policy in Android?</p>","429501","","19750","","2011-08-23 14:39:51","2011-08-23 14:39:51","Google Apps device policy in Android","<android><device-admin>","1","0","","",""
"4859707","1","","","2011-02-01 06:41:54","25","2231","<p>I would like to use more vector drawings in my Android applications.  Providing images isn't as space efficient or as scalable as I would like it to be.</p><p>Android provides a series of <a href=""http://developer.android.com/guide/topics/resources/drawable-resource.html"">Drawable file formats</a>, such as <code>ShapeDrawable</code>, which can be combined in a <code>LayeredDrawable</code>. To go very far down this path, it would be nice if there was a designer for visualizing the results, doing the drawing in, and handling all the resulting files.</p><p>C# WPF has <a href=""http://www.microsoft.com/expression/products/blend_overview.aspx"">Expression Blend</a>, Adobe has Flash CS4, and the iPhone has <a href=""http://likethought.com/opacity/"">Opacity</a>.  So my question is, is there a designer or drawing tool for Android?</p><p>Note: Other questions have talked about using SVG in Android.  Android doesn't have native support for SVG, so the only way to do it is with an external library.  I would like to avoid that and am asking for a developer side tool.  An SVG to <code>Drawable</code> converter would be fine, but I'm not aware of one.</p>","25182","","","","","2011-08-07 08:53:00","Are there any Android Drawable designers?","<android><graphics><drawable><vector-graphics>","2","2","6","",""
"4859784","1","4859867","","2011-02-01 06:54:42","1","518","<p>I have found 'Robolectric' framework to be efficient for testing in android.I am currently using 'netbeans' as my IDE for developing android app.</p><p>So how can I setup Robolectric in netbeans?</p><p>Thanks</p>","435025","","","","","2011-06-20 00:01:31","Android Testing","<android>","2","0","3","",""
"4859786","1","","","2011-02-01 06:55:03","1","2395","<p>I am trying the following code to install apk file saved on the SD Card and getting following exception: ""android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.packageinstaller/.PackageInstallerActivity}"". In the code, <code>file</code> is representing the apk file's SD Card path.</p><pre><code>Intent resultIntent = new Intent(android.content.Intent.ACTION_VIEW);resultIntent.setDataAndType(Uri.fromFile(file),""application/vnd.android.package-archive"");resultIntent.setClassName(""com.android.packageinstaller"", "".PackageInstallerActivity""); startActivity(resultIntent);</code></pre><p>Please let me know how to manage this.</p><p>ThanksJaved khan</p>","598001","","19750","","2011-02-01 06:57:07","2011-04-19 12:32:48","Error installing apk programitacally","<android>","2","1","","",""
"4859953","1","","","2011-02-01 07:20:10","0","366","<p>I need to stream video files, like streamed from this one,</p><p><a href=""http://commonsware.com/misc/test2.3gp"" rel=""nofollow"">http://commonsware.com/misc/test2.3gp</a></p><p>It is cached and can be paused, seeks, partly downloading, so it looks nice in VideoView.</p><p>But using <a href=""http://en.wikipedia.org/wiki/VLC_media_player"" rel=""nofollow"">VLC media player</a> I have a little trouble to make it and can only run live streams with no seek capability and can't be paused...</p>","598026","","63550","","2011-02-02 16:46:55","2011-02-02 16:47:46","Streaming files for Android","<android><stream><video-streaming>","0","2","","",""
"4860020","1","","","2011-02-01 07:33:53","8","14882","<p>I have a TextView in which I must load a message. The TextView has maximum 2 lines (<code>android:lines=""2""</code>). The message may contain an '\n' character.</p><p>How should I load the message in that TextView so that words would be wrapped and if in those 2 lines message does not fit, at the end of last visible word I must add three dots (...)? How can I detect the length of text that fits in that TextView? </p><p>My code for TextView is </p><pre><code>&lt;TextView            a:id=""@+id/tv_message""            a:gravity=""top""            a:layout_width=""wrap_content""            a:layout_height=""wrap_content""            a:layout_alignParentTop=""true""            a:layout_toRightOf=""@id/iv_icon""            a:layout_marginLeft=""2dp""            a:layout_marginTop=""4dp""            a:paddingRight=""7dp""            a:paddingBottom=""5dp""            a:textSize=""12sp""            a:typeface=""sans""            a:ellipsize=""marquee""            a:lines=""2""            a:maxLines=""2""            a:textColor=""@android:color/black""            /&gt;</code></pre><p>But in application, text appears on two lines, even if there is a line containing the signature. The message is like: ""message text"" + ""\nSignature"" but the message can be on 1,2,3 lines, depending of message length.</p>","517558","","469983","","2012-10-15 13:56:58","2014-02-11 11:47:23","Textview show partial text","<android><android-layout><textview><word-wrap>","6","3","1","",""
"4860021","1","","","2011-02-01 07:34:09","20","14068","<p>I have some javascript running in WebView, and I want to receive console messages about errors in JS.In accordance with the instructions at <a href=""http://developer.android.com/guide/webapps/debugging.html"">http://developer.android.com/guide/webapps/debugging.html</a> I overrided methods </p><p><code>WebChromeClient.onConsoleMessage(String message, int lineNumber, String sourceID)</code> </p><p>and </p><p><code>WebChromeClient.onConsoleMessage(ConsoleMessage cm)</code>, </p><p>redirecting messages to logcat. In android 2.1 it works well, but in android 2.2 none of this methods are  called.</p><p>What I am doing wrong?</p><p>Thanks.</p>","299137","","","","","2011-06-08 14:53:22","Android: problem with debugging javascript in webview","<android><android-webview>","2","3","4","",""
"4860056","1","","","2011-02-01 07:39:47","2","1899","<p>When I dial a number on an Android based phone, the following screen comes up:<br><img src=""http://i.stack.imgur.com/zUisJ.gif"" alt=""Dial a number screen""></p><p>Is there a way to <strong><em>change</em></strong> this screen and replace it with a screen of my own? There are other questions on these lines on stackoverflow, but they have been unanswered. Hoping for some different luck.  </p><p>Thanks,<br>Sriram.</p>","350685","","","","","2011-05-26 06:08:30","Changing the dial screen - android","<android><call>","1","2","2","",""
"4860085","1","7596972","","2011-02-01 07:43:19","18","10887","<p>I have a ListView that opens another activity when an item row is clicked via a onItemClick listener.</p><p>I would like that row to stay in its pressed state from the time it is clicked to the time the screen switches to a new activity.  I think this would be a clearer experience for the user and you see this kind of thing with most buttons that open/close dialogs or switch activities.</p><p>I tried setting view.setPressed(true) in the onItemClick() listener but it seems to get called just a moment after the press state changed back to normal because it flickers slightly.</p><p>For example: </p><pre><code>mListView.setOnItemClickListener(new OnItemClickListener() {   @Override   public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {       view.setPressed(true);       //start an activity   }});</code></pre><p>That code almost works except for the flicker (User presses the list item and it turns to its pressed state, then user lets go (completing the click) and it turns back to its normal state for a split second before turning back to the pressed state from the setPressed(true) call)</p><p>Any ideas?</p><p>Thanks</p><p>Edit:  I should mention that I am using an xml drawable selector to define the normal, pressed, selected, etc states for the background of the list.</p>","445348","","971045","","2013-10-18 06:55:06","2014-02-21 15:36:11","Force a ListView item to stay ""pressed"" after being clicked?","<android><listview><onclick>","7","1","11","",""
"4860097","1","","","2011-02-01 07:45:09","4","2271","<p>hi <br>I am writing an application in which I need to Restrict EditText accept only Urls in Android. How can this be done in Android?</p><p>Thanks in Advance,</p>","429501","","","","","2012-06-21 09:45:27","Restrict EditText accept only Urls in Android","<android>","2","0","1","",""
"4860108","1","4860123","","2011-02-01 07:46:33","0","816","<p>This seems like a trivial question, so whoever can answer first and provide me with a resource, I'd be happy to provide you with a green tick :)</p><p>How can I write files from within native code? I want to perform some processing in C++ which will output a .txt file, so I'd like to save that to the SD card. (I tried and it told me permission denied).</p><p>Thanks!</p>","387064","","","","","2011-02-01 07:49:30","Writing files within native code in Android","<android><jni><native-code>","1","0","","",""
"4860143","1","4860196","","2011-02-01 07:51:33","0","1994","<p>I am using ndk r5. Please tell me how to compile application using this ndk in linux os?</p>","486554","","1109425","","2012-08-15 22:51:05","2012-08-15 22:51:05","how to compile ndk application in linux?","<android><compilation><android-ndk>","1","1","1","",""
"4860318","1","4860371","","2011-02-01 08:23:53","0","1400","<p>I want to launch the camera from my application and want to use the captured image as an attachment in my application. The use case is as below:</p><p>Press the capture button in the application->Opens camera application -> capture an image->the image is shown as thumbnail in my application.</p><p>Any suggestions, ideas, would be very helpful.</p>","544631","","","","","2011-04-08 06:38:59","How to capture an image and set it as attachment from an application?","<android><android-camera>","3","2","2","",""
"4860391","1","","","2011-02-01 08:33:04","0","1214","<p>i just succeeded in calling a line of text from a text file in th sdcard and got it to display the text out on the application via textview,</p><p>is there anyway where i could read the characters from the text and then get it to display a image below the character</p><p>like an text to image conversion right below each line of text</p><p>the text are short and simple words</p><p>thanks in advance</p>","578198","","","","","2011-02-01 09:15:02","text to image conversion","<android>","1","0","","",""
"4860404","1","4860886","","2011-02-01 08:34:40","0","1078","<p>I want to create a background thread (execute even if my activity dies) that update my data location et send it to my server with an http resquest. But it occurs an exception:</p><pre><code>02-01 07:50:18.172: ERROR/Exception1(277): Can't create handler inside thread that has not called Looper.prepare()</code></pre><p>My code:</p><pre><code>public class Messagerie extends Activity {private LocationManager locationManager;private String locationProvider = LocationManager.NETWORK_PROVIDER;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.messagerie);    new UpdateLocation().execute();}public void majCoordonnes() {    StringBuilder stringBuilder = new StringBuilder(""Fournisseur :"");    stringBuilder.append(""\n"");    stringBuilder.append(locationProvider);    stringBuilder.append("" : "");    Location location = locationManager.getLastKnownLocation(locationProvider);    if (location != null) {        double latitude = location.getLatitude();        double longitude = location.getLongitude();        String lat = String.valueOf(latitude);        String lon = String.valueOf(longitude);        stringBuilder.append(latitude);        stringBuilder.append("", "");        stringBuilder.append(longitude);                    //Send location to server in an AsyncTask        new sendLocation().execute(lat, lon);    } else {        stringBuilder.append(""Non déterminée"");    }    Log.d(""MaPositionMaj"", stringBuilder.toString());}/** * Ecouteur utilisé pour les mises à jour des coordonnées */class MajListener implements android.location.LocationListener {    public void onLocationChanged(Location location) {        majCoordonnes();    }    public void onProviderDisabled(String provider){    }    public void onProviderEnabled(String provider){    }    public void onStatusChanged(String provider, int status, Bundle extras){    }};//Requête GET, mise à jour des infosprivate class UpdateLocation extends AsyncTask&lt;String, Void, String&gt; {    String resp;    @Override    protected String doInBackground(String... params) {        try {        //Recuperation Location        String locationContext = Context.LOCATION_SERVICE;        locationManager = (LocationManager) getSystemService(locationContext);        if (locationManager != null &amp;&amp; locationProvider != null) {            majCoordonnes();            locationManager.requestLocationUpdates(locationProvider, 120000, 500, new MajListener());        }        } catch (Exception e){            Log.e(""Exception1"", e.getMessage());        }        return resp;    }    @Override    protected void onPostExecute(String result) {    }    @Override    protected void onPreExecute() {    // Things to be done before execution of long running operation. For example showing ProgessDialog    }    @Override    protected void onProgressUpdate(Void... values) {    }}</code></pre><p>EDIT: I think I have to use a Service instead of an asyncTask.</p>","420574","","420574","","2011-02-01 08:54:09","2012-10-27 16:08:50","Can't call handler in an AsyncTask?","<android><multithreading><handler><android-asynctask><loc>","2","2","","",""
"4860415","1","","","2011-02-01 08:35:28","5","2469","<p>I retrieved battery temperature and voltage information using the intent <code>Intent.ACTION_BATTERY_CHANGED</code> and the values I got are pretty weird. I could not get any clue: <code>temperature=270</code> and <code>voltage=3782</code>!</p><p>What are these values? Do they have any units like celsius, fahrenheit or milli or micro volt?</p>","596317","","418613","","2012-06-07 02:50:41","2012-06-07 02:50:41","What are the units for battery temperature and voltage when Intent.BATTERY_ACTION_CHANGED on android device?","<java><android><power-management><temperature>","1","0","2","",""
"4860484","1","","","2011-02-01 08:44:28","1","7491","<p>Is it possible to download a file to a user defined directory from android webview.Currently the file is being downloaded   in SDCard/downloads. Is it possible to override the default download location? </p><p>I am currently using the following code to download a file</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW Uri.parse(""download file location""));startActivity(intent); </code></pre>","463721","","473070","","2011-02-01 09:31:59","2012-04-01 10:36:27","Download a file from webview to a custom folder","<android><file-download>","1","4","","",""
"4860681","1","","","2011-02-01 09:07:31","0","696","<p>Recently I ran into another problem with PhoneGap. I try to use network.isReachable, but this method doesn't work for me. After debugging, I found that in phonegap.js in <code>Phonegap.exec()</code> is called <code>PluginManager.exec()</code>, which should return a value from Java code. For <code>network.isReachable</code> an empty value is returned, though. Next lines of code in Phonegap.exec() get executed only if result is not empty, but I get empty value returned for network.isReachable. What am I doing wrong? Please note, I am using phonegap version 0.9.3. on Android.</p>","593636","","703019","","2012-03-04 12:59:42","2012-03-04 12:59:42","Phonegap android - network.isReachable is not working?","<android><exec><phonegap>","1","0","","",""
"4860712","1","","","2011-02-01 09:11:06","0","336","<p>Could we write a program that can generate voice? The code would allow us to manipulate the voice too. What are the requirements? I am basically interested in generating voice through iPhone and Android. </p><p>All ideas are welcome.</p><p>Thank you.</p>","106245","","106245","","2011-02-01 10:24:47","2011-02-01 10:24:47","Generate voice programatically - Sound processing","<iphone><android><objective-c>","1","9","","",""
"4860716","1","4860843","","2011-02-01 09:11:21","1","4410","<p>Anybody know the working of zoombutton in android?</p><p>I have found some tutorials, but they mention onlyabut .xml file where we can add zoombutton. But I did not get its working in a class.</p><p>I want to zoom one image using zoombutton.</p><p>Please help me..</p><p>Thank you..</p>","523058","","","","","2011-02-01 09:25:05","ZoomButton in android","<android><zoom>","1","0","2","",""
"4860811","1","4860848","","2011-02-01 09:21:35","6","13780","<p>I am trying to transfer data from one page to another but some problem is coming below is the code. I am trying to transfer value of variable using bundle from first activity to second but something is wrong please tell me whats going wrong.</p><p>below is first activity:-</p><pre><code>package route.planning;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.Toast;public class login extends Activity {    /** Called when the activity is first created. */    Context mCtx;    final static int START =0;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mCtx = this;        Button btn = (Button)findViewById(R.id.btn);        btn.setOnClickListener(new OnClickListener(){        //  @Override        public void onClick(View v)        {            String fromLat = new String();            String fromLong = new String();            String toLat = new String();            String toLong = new String();            fromLat=String.valueOf(R.id.FromLatitude);            fromLong=String.valueOf(R.id.FromLongitude);            toLat=String.valueOf(R.id.ToLatitude);            toLong=String.valueOf(R.id.ToLongitude);            Intent intent = new Intent(mCtx, MapRouteActivity.class);            /*Sending some arguments*/             Bundle bundle = new Bundle();              bundle.putString(""fromLat"",fromLat );              bundle.putString(""fromLong"",fromLong );              bundle.putString(""toLat"",toLat );              bundle.putString(""toLong"",toLong );              intent.putExtras(bundle);            /*Start Activity*/            mCtx.startActivity(intent);            /*Start ActivityForResult*/            ((Activity)mCtx).startActivityForResult(intent, 2);        }    });    }    @Override    protected void onActivityResult(int requestCode, int resultCode, Intent data) {        // TODO Auto-generated method stub        super.onActivityResult(requestCode, resultCode, data);        if(requestCode == START)        {            Toast.makeText(mCtx, Integer.toString(resultCode), Toast.LENGTH_SHORT).show();        }    }    @Override    public void onDestroy(){        super.onDestroy();        finish();    }}</code></pre><p>Below is part of second activity where i am trying to get value from above</p><pre><code>import java.io.IOException;import java.io.InputStream;import java.net.MalformedURLException;import java.net.URL;import java.net.URLConnection;import java.util.ArrayList;import java.util.List;import org.ci.geo.route.Road;import org.ci.geo.route.RoadProvider;import route.planning.R;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graphics.Point;import android.os.Bundle;import android.os.Handler;import android.widget.LinearLayout;import android.widget.TextView;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;public class MapRouteActivity extends MapActivity {        LinearLayout linearLayout;        MapView mapView;        private Road mRoad;        @Override        public void onCreate(Bundle savedInstanceState) {                super.onCreate(savedInstanceState);                setContentView(R.layout.routeplanning);                mapView = (MapView) findViewById(R.id.mapview);                mapView.setBuiltInZoomControls(true);                Bundle extras = this.getIntent().getExtras();                final String fLat=extras.getString(""fromLat"");                final String fLong=extras.getString(""fromLong"");                final String tLat=extras.getString(""toLat"");                final String tLong=extras.getString(""toLong"");                new Thread() {                        @Override                        public void run() {                            double fromLat=Double.parseDouble(fLat);                            double fromLon=Double.parseDouble(fLong);                            double toLat=Double.parseDouble(tLat);                            double toLon=Double.parseDouble(tLong);                              //double fromLat = 28.6353, fromLon = 77.2250, toLat = 30.7313, toLon = 76.7754;                                /***url contains the path to fetch the kml file from the internet*/                                String url = RoadProvider                                                .getUrl(fromLat, fromLon, toLat, toLon);                                InputStream is = getConnection(url);                                mRoad = RoadProvider.getRoute(is);                                mHandler.sendEmptyMessage(0);                        }                }.start();        }</code></pre>","569938","","473070","","2011-02-01 09:23:18","2012-06-19 06:03:48","How to transfer data from one activity to another?","<android>","3","3","0","",""
"4860890","1","4860978","","2011-02-01 09:30:00","3","422","<p>Is it possible to change the location of the res folder so it's not in the Eclipse project? </p><p>I know I can link the src folder of the project to another location, but can I do the same for the res folder.</p><p>I had some issues when I included the Eclipse project into svn, so I would like to keep them separate like I do on any Flash/Flex builder project.</p>","553462","","553462","","2011-02-01 10:12:59","2011-02-01 10:12:59","Eclipse - res location","<android><eclipse>","1","3","","",""
"4860970","1","4860997","","2011-02-01 09:38:55","0","313","<p>I have 11 videos to include in my App. Each of them is around 9MB. Besides those, I have to a few sound files and image files in the app. Therefore the app size is going 100+MB. Is there any way to accommodate all the files so that app size does not become an issue for me?</p>","525004","","","","","2011-02-01 10:24:07","Android App size problem","<android><size><apk><max>","5","1","","",""
"4860989","1","4861409","","2011-02-01 09:42:09","0","856","<p>I have a problem with an URL that starts with https. It's showing a blank white screen whereas links, starting with http, loads successfully in Android webview. </p><p>With logs I'm sure that data is coming from HTTPS also but is not displaying in the view. Please help me. Some sample code or link will be most appreciated.</p>","463586","","312172","","2012-01-14 08:49:14","2012-01-14 08:49:14","Android webview giving blank screen when loading data from HTTPS","<android>","1","0","0","",""
"4861146","1","4861229","","2011-02-01 09:59:52","2","324","<p>Is it possible for every Android mobile to be upgraded to its latest version or are there any limitations?</p><p>I have seen ad-tags for many mobile devices saying ""Upgradeable to 2.2"", or ""Upgradeable to 2.1"". Isn't upgrading a mobile OS just like upgrading a desktop OS?</p>","598175","","","","","2011-02-01 11:05:26","Android upgrade possible for every device?","<android>","1","1","","",""
"4861203","1","4861281","","2011-02-01 10:05:50","0","3013","<p>What causing this Android RuntimeException?  </p><pre><code>02-01 15:13:41.316: ERROR/AndroidRuntime(3989): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cccc.xxxx/com.cccc.xxxx.ActivityMyScreen}: java.lang.IllegalArgumentException: contentView required: pkg=com.cccc.xxxx id=3145728 notification=Notification(vibrate=null,sound=null,defaults=0x0)</code></pre><p>I am starting this activity from other activity as follows:  </p><pre><code> Intent intent = new Intent(); intent.setClass(mContext, ActivityMyScreen.class); intent.putExtra(""username"", mUserName); startActivity(intent);</code></pre><p>What might be cause of this Exception?  </p><p>Thanks,<br>PP.</p>","314247","","","","","2011-02-01 10:12:54","What causing this Android RuntimeException","<android>","1","0","1","",""
"4861320","1","4861355","","2011-02-01 10:17:23","3","359","<p>I am planning to deploy a website on IIS 7.0 with the SSL certificate with the encryption of 128 bit. Now, my concern is if, any user visits my website through any of the smartphones' web browsers, are there any pitfalls or all goes good?</p>","159945","","173773","","2011-02-01 10:24:11","2011-02-01 10:28:08","Accessing SSL based website on iPhone, BlackBerry, Android, WP7","<iphone><android><iis><blackberry><ssl>","2","0","1","",""
"4861335","1","","","2011-02-01 10:19:04","1","140","<blockquote>  <p>I am trying to fit graphics of a game  on multiple screens. So I have  specific graphic for 320x480, 480x800,  600x1024 and i put them in the hdpi,  mdpi and default drawable folder. In  the manifest I set minsdkversion=1 and  suport-screens for normal and large.   The problem is that the graphic for  480x800 and 600x1024 looks bigger on  the screen than it should so I guess  that the sdk does an automatic  prescaling. How can I avoid this? I  tried setting the anyDensity value to  true and the images look ok now, but  for the images in the drawable default  folder is not done any scaling any  more.  How can I get around this so  that the sdk scales the images from  the drawable default folder but not  the ones from the hdpi, mdpi etc.</p>    <p>Thank you.</p></blockquote>","597241","","424413","","2011-02-01 10:22:27","2011-02-01 10:22:27","Graphic for multiple screens does not scale correctly","<android><drawable>","0","1","","",""
"4861359","1","","","2011-02-01 10:22:19","2","810","<p>i have 4 buttons that i want to show in a gridview. I want them to fill the screen as much as possible, but i never make it. I've tried all kind of ScaleTypes and it won't work. Right now i have the scale type in FIT_CENTER but i get an unexpected result. Here's the code i have so far:</p><p><strong>Main.java</strong></p><pre><code>@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Display screenSize = getWindowManager().getDefaultDisplay();        int screenWidth = screenSize.getWidth();        int screenHeight = screenSize.getHeight();        int iconWidth =  screenWidth/4;        int iconHeight=  screenHeight/2;        GridView gridview = (GridView) findViewById(R.id.gridview);        gridview.setAdapter(new ImageAdapter(this, iconWidth, iconHeight));        }</code></pre><p><strong>ImageAdapter.java</strong></p><pre><code>public View getView(final int position, View convertView, ViewGroup parent) {        ImageView imageView;        if (convertView == null) {            imageView = new ImageView(m_Context);            imageView.setLayoutParams(new GridView.LayoutParams(m_width, m_height));            imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);            imageView.setPadding(8, 8, 8, 8);        } else {            imageView = (ImageView) convertView;        }        imageView.setImageResource(mThumbIds[position]);        return imageView;    }</code></pre><p><strong>GridViewLayout.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/gridview""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:verticalSpacing=""10dp""    android:horizontalSpacing=""10dp""    android:columnWidth=""90dp""    android:stretchMode=""columnWidth""    android:gravity=""center""    android:numColumns=""2""    android:background=""#FFFFFF""/&gt;</code></pre><p><strong>The result of the code looks like this:</strong></p><p><img src=""http://i.stack.imgur.com/hrve7.jpg"" alt=""wrong result""></p><p><strong>This is what i would like it to look like:</strong></p><p><img src=""http://i.stack.imgur.com/5fsWA.jpg"" alt=""desired result""></p><p>Note that the last screen shot is hard coded which is obviously not my wish. I want this to work in every screen size without hard coding.  </p>","526924","","302328","","2011-02-01 11:13:56","2011-02-01 11:13:56","button resize problem android","<android><gridview>","0","2","","",""
"4861379","1","4861449","","2011-02-01 10:24:10","0","1935","<p>I have 3 webviews in my search engine app.When the user enters his query, by default he gets Google results, followed by yahoo and Ask buttons at the bottom, on clicking either of them, he gets results for that query from those sites. Now I want to give the user the privilege to change the default result site. I have created 3 radiobuttons. Upon confirmation, say he chooses Yahoo, how can i set it as Yahoo till the next time he changes it to some other site, </p>","466590","","","","","2012-04-05 00:35:48","Android SharedPreferences","<android>","2","0","1","",""
"4861392","1","4861443","","2011-02-01 10:25:54","3","1051","<p>if u have any kind of link or example about this please send me...</p>","554830","","","","","2011-02-01 10:38:00","how to pass data in webservice using JSON object","<android>","2","0","1","2011-12-24 05:04:43",""
"4861438","1","","","2011-02-01 10:30:24","6","759","<p>After installing an update on Android SDK and moving to Eclipse 3.6, when an exception occurs while my code is running, I'm only prompted for what seems to be Android source code, in stread of showing the line in my code and the exception details in logcat.</p><p>I now resort to try..catch - ing everything, but it's not practical.</p><p>Why is it prompting for the source code?</p><p>Many thanks for any help!!</p><p>Nothing in Log Cat:<img src=""http://i.stack.imgur.com/i9I1e.jpg"" alt=""Nothing in the log cat""></p><p>Prompting for source file:<img src=""http://i.stack.imgur.com/JIljX.jpg"" alt=""Prompting for source file""></p>","181098","","","","","2011-02-01 11:07:57","Android: Eclipse - Not showing exceptions","<android><eclipse>","1","0","1","",""
"4861483","1","4861781","","2011-02-01 10:35:07","0","636","<p>I am writing a small featurecontrol-application, which has several feature settings stored and managed. All applications use my featurecontrol-application to retrieve settings like whether feature-x is enabled or not or what is feature-x-value . Can I use contentprovider for this or are there any other alternatives?</p>","1381481","","","","","2011-02-02 12:30:54","Can android content provider be used for simple data such as name:value pairs","<android><android-contentprovider>","1","0","","",""
"4861493","1","","","2011-02-01 10:36:04","1","558","<p>The docs say to put XML state files for buttons in ""the"" ""drawable"" folder - which one of at least three?! (Putting it in res/drawable gives an out of sync filesystem error and putting it in each of the drawable-*dpi where * is l, m, h is an error too.)</p>","283311","","283311","","2011-02-01 10:46:57","2011-03-03 09:10:36","Android button state files","<android><state><drawable>","3","4","","",""
"4861546","1","4861586","","2011-02-01 10:42:39","0","261","<p>A content provider is expected, according to various documentation like <a href=""http://developer.android.com/guide/topics/providers/content-providers.html"" rel=""nofollow"">http://developer.android.com/guide/topics/providers/content-providers.html</a>,to define final Strings for the URI name and the column names, so that client can access them.This suggests that clients have direct access to the class public fields.But a class can not directly access classes in other apks.How can I write a custom content provider accessible from classes in other apks and how can the clients get the URI and column names ?</p>","598227","","","","","2011-02-01 11:05:29","content provider public fields access","<android>","2","0","","",""
"4861698","1","4861982","","2011-02-01 10:59:57","4","2588","<p>I am currently writing a simple webapp to view tweets in the Android browser. I am using this code to focus the caret after the current text:</p><pre><code>var oldContent = document.tweetBox.tweet.value;document.tweetBox.tweet.value = '';document.tweetBox.tweet.focus();document.tweetBox.tweet.value = oldContent + to;</code></pre><p>This code works flawlessly in Chrome, Fluid, Opera, Firefox en Safari.<br>The weirdest part is that the cursor starts blinking AFTER the 'to' text if I use my hardware keyboard but the text that I enter starts where I was typing before the JS above was executed.<br>If I use the soft keyboard the text entering starts at the start of the textarea.  </p><p>p.s The javascript is part of a suggestion for followers, so if you start typing @gn it will suggest @gnur_nl in a seperate div and when you press enter this entry is chosen.</p><p><strong>Update:</strong> This behaviour seems to be the result of a browser bug, <a href=""http://code.google.com/p/android/issues/detail?id=15245"" rel=""nofollow"">a bug report has been filed</a>.</p>","596602","","2603","","2011-03-04 19:24:02","2011-03-04 19:24:02","Focus textarea with caret after text in Android browser","<javascript><android><html>","2","3","","",""
"4861710","1","4862139","","2011-02-01 11:01:43","1","8883","<p>I am trying to include a ProgressDialog in my application. But it is not showing up.</p><p>Here's the code snippet where i use the ProgressDialog:</p><pre><code>public class abcActivity extends Activity {    public boolean onOptionsItemSelected(MenuItem item) {        case XYZ:            ProgressDialog dialog = ProgressDialog.show(abcActivity.this, """", ""Please wait for few seconds..."", true);            callSomeFunction();            dialog.dismiss();            showToast(getString(R.string.SomeString));            break;    }}</code></pre><p>Does anyone know why the dialog is not showing up? Any clues?</p>","308131","","","","","2011-11-17 07:51:25","ProgressDialog not showing up in activity","<android><progressdialog>","3","5","","",""
"4861729","1","4861893","","2011-02-01 11:03:50","0","4225","<p>Hi i am integrating twitter to android through twitter4j.I can successfully read tht tweets posted by me.</p><hr><p>Now i amtrying to posting tweet from it.but i cant.</p><hr><p>I am getting strange warning as below:</p><hr><pre><code>    02-01 16:28:43.298: WARN/System.err(729): 401:Authentication credentials were missing or incorrect.02-01 16:28:43.308: WARN/System.err(729): {""request"":""\/1\/statuses\/update.json"",""error"":""Read-only application cannot POST""}02-01 16:28:43.308: WARN/System.err(729): TwitterException{exceptionCode=[15bb6564-00e54a7f], statusCode=401, retryAfter=0, rateLimitStatus=null, version=2.1.7-SNAPSHOT(build: fd76317d18a608269f0566f73bbb827420c4c77e)}02-01 16:28:43.308: WARN/System.err(729):     at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:309)02-01 16:28:43.318: WARN/System.err(729):     at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:72)02-01 16:28:43.318: WARN/System.err(729):     at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:103)02-01 16:28:43.318: WARN/System.err(729):     at twitter4j.Twitter.updateStatus(Twitter.java:501)02-01 16:28:43.330: WARN/System.err(729):     at com.T4J_OAuth.activities.Main$1.onClick(Main.java:69)02-01 16:28:43.330: WARN/System.err(729):     at android.view.View.performClick(View.java:2364)02-01 16:28:43.330: WARN/System.err(729):     at android.view.View.onTouchEvent(View.java:4179)02-01 16:28:43.339: WARN/System.err(729):     at android.widget.TextView.onTouchEvent(TextView.java:6541)02-01 16:28:43.339: WARN/System.err(729):     at android.view.View.dispatchTouchEvent(View.java:3709)02-01 16:28:43.339: WARN/System.err(729):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)02-01 16:28:43.349: WARN/System.err(729):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)02-01 16:28:43.349: WARN/System.err(729):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)02-01 16:28:43.349: WARN/System.err(729):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)02-01 16:28:43.359: WARN/System.err(729):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)02-01 16:28:43.359: WARN/System.err(729):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)02-01 16:28:43.359: WARN/System.err(729):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)02-01 16:28:43.369: WARN/System.err(729):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)02-01 16:28:43.369: WARN/System.err(729):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)02-01 16:28:43.378: WARN/System.err(729):     at android.os.Handler.dispatchMessage(Handler.java:99)02-01 16:28:43.378: WARN/System.err(729):     at android.os.Looper.loop(Looper.java:123)02-01 16:28:43.378: WARN/System.err(729):     at android.app.ActivityThread.main(ActivityThread.java:4363)02-01 16:28:43.378: WARN/System.err(729):     at java.lang.reflect.Method.invokeNative(Native Method)02-01 16:28:43.389: WARN/System.err(729):     at java.lang.reflect.Method.invoke(Method.java:521)02-01 16:28:43.389: WARN/System.err(729):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-01 16:28:43.398: WARN/System.err(729):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-01 16:28:43.398: WARN/System.err(729):     at dalvik.system.NativeStart.main(Native Method)</code></pre><hr><p>though i have set my application in twitter as read and write ,it says me can tpost by read only app.</p><hr><hr><p>pls help me to sort it out</p>","544537","","","","","2012-01-27 07:32:07","twitter,update status","<android><twitter><integration>","3","1","3","",""
"4861787","1","5276734","","2011-02-01 11:10:45","1","551","<p><strong>Summary</strong>: synchronisation of multiple SQLite databases with server side sequentially.</p><p>I'm working on an Android application that is bound to be modular: we have a launcher that fires off intents, based on user choice, to start different application modules (separate installable packages). As it is now, each module has its own SQLite database and that works fine. The task I'm assigned to requires making data synchronisation between handheld and server side (SQL Server 2008 R2) using MS Sync Framework 4.0 (currently October CTP). I had developed android lib according to Sync Framework specs and that works too. </p><p>The issue I have is that because of this loosely coupled design (and some other restrictions) I need to have a button in launcher, that forces all modules to synchronise their databases one-by-one (order doesn't matter for now).</p><p>My current approach is to have an abstract BroadcastReceiver &amp; Service (I only now discovered IntentService) classes that are inherited in each modules. So in launcher I broadcast intent, each module picks it up using customized BroadcastReceiver and syncs its database using, again, customized Service... In parallel. I have checked ordered broadcasts, but as I have a service doing the actual work it doesn't really help. The only other way I can currently think of is to have a system-wide mutex and use it to lock sync call in every service.</p><p>This is my first Android related task so there probably is a better way to solve this, I wouldn't run from redesigning synchronisation part if that makes our teams future life a bit easier.</p><p>[<strong>EDIT</strong>] So it looks like Java doesn't support named mutexes.</p><p>[<strong>EDIT2</strong>] By modules (or separate installable packages) I meant different APK for each module. So when starting a module you actually start a new process for it.</p>","181714","","181714","","2011-02-01 12:41:34","2011-03-11 18:15:22","One ""application"", multiple packages, database synchronisation","<android><architecture><service>","2","9","1","",""
"4861805","1","4912686","","2011-02-01 11:13:04","5","5318","<p>Is there any way to play a video from a bytes stream in Android?I'm using an specific communications middleware so I can't just pass the http/rtsp link to the MediaPlayer object.</p><p>I was wondering if I can wrap my stream with a local http/rtsp link so I can play the stream instead of waiting until the file is downloaded to play it.</p><p>My middleware works over TCP so I've also thought that I can wrap my rtsp datagrams with a tcp datagram and interpret them on the client somehow, after removing the TCP headers.</p><p>I'm really surprised that I can't just pass a bytes stream to the MediaPlayer.Thanks in advance.</p>","483362","","","","","2011-02-06 10:17:22","Play video in Android from a bytes stream","<android><http><streaming><video-streaming><rtsp>","1","3","3","",""
"4861859","1","4862164","","2011-02-01 11:17:38","3","13645","<p>I am developing a game application in android. I have designed all the views, implemented all the functionality. Now in the last screen I have to play sound in android. Can anybody tell me how to pursue with it?</p>","475349","","1011995","","2012-01-30 19:38:33","2013-12-01 05:11:46","implement sound in android application","<android>","4","0","5","",""
"4861974","1","","","2011-02-01 11:29:49","0","2795","<p>I am new at Android. I have been trying from many days to make very basic google map application but unable to complete it yet... :(<br>There are no errors in code, emulator running fine from terminal, Map key also fine but still I am unable to see the map. When I run my app only grid appears and map is not displayed. Here is the code, can any body please help me.</p><pre><code>public class HelloGoogleMaps extends MapActivity {     /** 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);     }     protected boolean isRouteDisplayed(){         return false;     } } </code></pre><p>main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;com.google.android.maps.MapView             xmlns:android=""http://schemas.android.com/apk/res/android""             android:id=""@+id/mapview""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""             android:layout_weight=""1""             android:clickable=""true""             android:apiKey=""0fyF-qSuCtdQinoUGoFbLxZoTx10Tm-YV6m6A8g"" /&gt; </code></pre><p>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.GoogleMaps""     android:versionCode=""1""     android:versionName=""1.0""&gt;     &lt;uses-permission android:name=""android.permission.INTERNET""/     &lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION""/&gt;     &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""/&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-permission android:name=""android.permission.INTERNET""/&gt;         &lt;activity android:name="".HelloGoogleMaps""               android:label=""@string/app_name""               android:theme=""@android:style/Theme.NoTitleBar""&gt;         &lt;!--&lt;activity android:name="".HelloGoogleMaps""                   android:label=""@string/app_name""&gt;--&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=""4"" /&gt; &lt;/manifest&gt; </code></pre><p>Don't know where is anything wrong. I am using eclipse and android 1.6</p>","598238","","436938","","2012-03-22 19:02:31","2012-10-20 03:55:20","google map in android application","<android><google-maps>","6","4","","",""
"4861986","1","4999224","","2011-02-01 11:31:22","1","1319","<p>I am new to phonegap and jqTouch, I am using these for developing Android application.</p><p>The problem is, the touch event on textfields working fine on iPhone, but not working on Android, nothing happens when we tap on textfield.</p><p>Edit: I came to know that the problem is because the iScroll plugin is being used. When I remove this, the functionality works fine, but I need to use this in my application.</p><p>Can anyone tell me what is wrong with iScroll and Android textfields?</p><p>Thanks in Advance.</p>","202461","","202461","","2011-02-03 06:03:43","2011-02-15 01:52:56","Virtual Keyboard does not appear while clicking on text field in Android after using iScroll.js plugin","<android><scroll><touch><phonegap><textfield>","1","3","2","",""
"4862009","1","5281559","","2011-02-01 11:35:17","2","498","<p>i have been playing around with apache SOLR since last 3 weeks and very happy with the results. now we are trying to replicate the faceted search we offer on our website to our ipad, iphone and android apps</p><p>since these apps have their local sqlite db for offline access, i cannot go for an online xml web service based approach to compute the faceted search results</p><p>wondering if there is any lightweight solution like apache SOLR for tablet / mobile platforms which can index the data from sqlite?</p><p>thanks in advance</p>","83027","","","","","2011-03-12 08:45:00","faceted search for ipad / iphone / android platform","<iphone><android><ipad><search><mobile>","1","0","1","",""
"4862072","1","4875247","","2011-02-01 11:41:59","0","733","<p>we have an app which is available for ipad, iphone, android as well as samsung bada. since all of these platforms support sqlite, this app makes extensive use of sqlite for saving and reading data. </p><p>we now face quite a lot of issues whenever we need to update our app, that is punch in the same data access code across 4 different apps. we might also be looking to publish this app for windows mobile at a future date</p><p>i was wondering if there is a way to atleast have a completely independent library to manage our data access part so that we can just code and update this library once and simply use it across all 4 platforms</p><p>it would be awesome to achieve that and it would save us plenty of hours of coding and debugging and testing</p>","83027","","","","","2011-02-02 13:55:10","platform independent sqlite data access layer for ipad / iphone / android / samsung bada","<iphone><android><ipad><sqlite><mobile>","1","1","1","",""
"4862099","1","4862158","","2011-02-01 11:45:03","1","219","<p>I know there are a lot of posts about storing images on disk, both for Android and iPhone. What I would like to know is how to hide these files from user (disable access from both device itself and PC sd-card reader).</p><p>I want my app to download copyrighted images that should be only accessed using my application.</p><ul><li>Android &amp; iPhone, </li><li>multiple images (I'm guessing around 50-200, maybe more)</li><li>image size +/- 150-300 KB, various size but less than 1000x1000.</li></ul>","475861","","","","","2011-02-01 11:52:45","iPhone/Android - securing images downloaded by app","<iphone><android><security><image><storage>","2","0","","",""
"4862127","1","","","2011-02-01 11:47:34","1","1125","<p>can anybody help me how to store 6:00pm(time with am or pm) in sqlite database in android</p>","555910","","","","","2011-02-01 12:51:41","how to store 6:00pm in sqlite database in android","<android>","4","0","1","2012-11-15 13:04:22",""
"4862207","1","4862246","","2011-02-01 11:55:10","5","993","<p>i am trying to send JSON object to my php webservice.</p><p>I have referred this url :- <a href=""http://www.josecgomez.com/2010/04/30/android-accessing-restfull-web-services-using-json/"" rel=""nofollow"">http://www.josecgomez.com/2010/04/30/android-accessing-restfull-web-services-using-json/</a></p><p>In my web service,  I have to pass username and password but i don't know, </p><p>what is the  GSON. can you tell why GSON use in this.????</p><p>I am new in json. if you know about json please guide me to solve this problem.</p>","452611","","","","","2011-02-01 11:58:31","send json object using http post method for android application","<android>","1","0","1","",""
"4862287","1","4862975","","2011-02-01 12:02:12","-1","771","<p>I am  using ListView which include one TextView and one Radio Button.. I use Custom Adapter Method to Inflate View..</p><p>I am having one Radio Button for each List....First i select Radio Button in List 1 then i select Radio Button of List 2.. If i select Radio Button of List 2 previous selection should be disabled.. Also i want to get the Position of radio Button selected which is inside the List..</p><p>My UI will be in this way:</p><hr><p>LIST 1:</p><h2>TextView                     RadioButton</h2><p>LIST :2</p><h2>TextView                     Radio Button</h2><p>MY code:</p><p>class MultiLine extends BaseAdapter implements RadioGroup.OnCheckedChangeListener        {</p><pre><code>        LayoutInflater mInflater;               String name;        String TAG = ""MultiLine"";        int i = -1;        int j = -1;        int k = -1;        String[] VAL_CardNumber;        public MultiLine(Context context, String[] value1) {            try {                mInflater = LayoutInflater.from(context);                VAL_CardNumber = value1;            } catch (Exception e) {                Log.v(TAG, ""dom"" + e);            }        }        public int getCount() {            return VAL_CardNumber.length;        }        public Object getItem(int arg0) {            return arg0;        }        public long getItemId(int arg0) {            return arg0;        }    public View getView(int position, View convertView, ViewGroup arg2) {        if (convertView == null) {            convertView = mInflater.inflate(R.layout.credit_card_list_view,null);            holder = new ViewHolder();            holder.text = (TextView) findViewById(R.id.credit_card_listtext);            //holder.mRadioGroup=(RadioGroup)convertView.findViewById(R.id.menu);            //holder.icon = (ImageView) convertView.findViewById(R.id.deal_icon);            convertView.setTag(holder);        } else {            holder.text = (TextView) convertView.findViewById(R.id.deal_title);            //holder.mRadioGroup=(RadioGroup)convertView.findViewById(R.id.menu);        }        holder.text.setText(VAL_CardNumber[position]);        //holder.mRadioGroup.setOnCheckedChangeListener(this);         iconContextMenu.setOnClickListener(new IconContextMenu.IconContextMenuOnClickListener() {                @Override                public void onClick(int menuId) {                    switch(menuId) {                    case MENU_ITEM_1_ACTION:                        Toast.makeText(getApplicationContext(), ""You've clicked on menu item 1"", 1000).show();                        credit_card_edit=true;                        Log.v(""Test"", ""YES BOSS COMING INSIDE A"");                           //startActivity(new Intent(Credit_Card_List.this,Credit_Card_Main.class));                        break;                    case MENU_ITEM_2_ACTION:                        Toast.makeText(getApplicationContext(), ""You've clicked on menu item 2"", 1000).show();                        credit_card_delete=true;                        Log.v(""Test"", ""YES BOSS COMING INSIDE B"");                         // startActivity(new Intent(Credit_Card_List.this,Credit_Card_Main.class));                        break;                    case MENU_ITEM_3_ACTION:                        credit_card_change=true;                        Log.v(""Test"", ""YES BOSS COMING INSIDE C"");                         // startActivity(new Intent(Credit_Card_List.this,Deal_Purchase_Checkout.class));                        break;                    case MENU_ITEM_4_ACTION:                        break;                      }                }            });        return convertView;    }    @Override    public void onCheckedChanged(RadioGroup arg0, int arg1) {        // TODO Auto-generated method stub        list_selected_position=arg1;        credit_card_list.getPositionForView(arg0);        credit_card_list.getCheckedItemPosition();        Log.v(""test"",""""+credit_card_list.getSelectedItemPosition());        Log.v(""tes1111"",""""+credit_card_list.getCheckedItemPosition());    }    }</code></pre>","555221","","555221","","2011-02-01 15:55:41","2011-02-01 15:55:41","Android Radio Buttons issue","<android>","1","3","","",""
"4862366","1","","","2011-02-01 12:09:54","2","1537","<p>Okay so I have followed instructions on earlier questions in order to offline install the Android SDK, platform-tools and tools, and now I am trying to install an Android platform. (When I run ""android list targets"", it returns that there are no available targets, and the platforms folder is empty).</p><p>What types of files are actually IN the platforms directory? I have files from the repository like ""system.img"" and ""kernel-qemu"", but I don't know where to put them.</p><p>Could someone let me know what their C:\Android\platforms folder structure actually looks like for a working installation?</p><p>(NB: for background, I am able to get to the URL ""dl-ssl.google.com"" through my browser and even the Eclipse internal browser, but for some reason it can't be accessed from the SDK manager, so I can't download any components or platforms!!)</p>","191761","","","","","2011-02-01 12:38:20","offline installation of an Android PLATFORM on Windows?","<android>","1","1","","",""
"4862378","1","4862665","","2011-02-01 12:10:52","0","1546","<p>Is there any way of parsing an XML file without knowing the tags present in the XML file ?</p><p>An XML file is given as input and it has to be parsed .. As we do not know the tags present in it , I found it difficult to parse using either DOM Parser or SAX parser.</p><p>Is there any way of getting this ??</p><p>Thanks,Siva Kumar</p>","598331","","","","","2011-12-28 15:34:04","Parsing an XML dynamically in Android?","<java><android><xml><parsing>","3","2","","",""
"4862430","1","4862512","","2011-02-01 12:15:53","1","1299","<p>Is it possible to make an installed app auto start itself?</p><p>thanks</p>","62898","","","","","2011-02-01 12:23:02","make an android app autostart","<android><autostart>","3","1","","",""
"4862451","1","","","2011-02-01 12:17:24","-1","650","<p>hii every buddy,</p><p>i have a xml tag like ""Yes,No,Dontknow ""  am parsing the xml file &amp; getting the data from xml,,now i need to display each options in saperate textview i.e 'yes' should be displayed in one textview, 'No' should be displayed in other text view &amp; 'Dontknow' should be displayed in another textview, but how can i do this, can any one give me some idea(am new to android),,,thanx in advance  </p>","571256","","","","","2011-02-02 09:12:27","loading data to text view in android","<android><xml><textview>","5","8","0","",""
"4862576","1","","","2011-02-01 12:29:16","3","5613","<p>How to convert <strong>.apk</strong> files to <strong>.dex</strong> files?</p><p>Please help.</p>","583259","","457982","","2011-02-01 14:31:04","2011-12-06 16:09:31","apk to dex conversion","<android><apk><dex>","2","0","0","",""
"4862607","1","","","2011-02-01 12:33:19","4","5018","<p>Is it possible to remove intent filters from activity based on user preference? Say dial intent filter is added and then at later point of time user decides the application should not handle dial. </p><p>Edit:Removed add part in question description</p>","119031","","119031","","2011-02-01 12:41:40","2011-06-28 09:29:09","How to add or remove intent filter programmatically in android?","<java><android><activity><intentfilter>","2","1","","",""
"4862644","1","","","2011-02-01 12:36:25","0","330","<p>I have a problem with getting data from 2 tables by inner join method where i have same column names and i would like to get data from each one. I've tried to use select with new column names using ""AS"" but exception occurs. I use rawQuery from SQLIteDatabase.Example of query:select t1._id, t2._id from...Thanks in advance.</p>","598370","","","","","2011-02-01 12:36:25","Getting data from database with same column names","<android><database><sqlite><sqlite3>","0","4","","",""
"4862697","1","4862820","","2011-02-01 12:42:09","-1","1356","<p>How do I create a  XMPP chat client in Android for Yahoo, Gmail, AOL, etc., How do Nimbizz, eBuddy, Fring do it?</p>","421372","","","","","2011-02-01 13:00:20","Creating a multi-chat client","<android><xmpp><instantmessenger>","3","2","2","",""
"4862710","1","","","2011-02-01 12:43:52","2","779","<p>I am wondering if there is a way to use Game Kit p2p connmunication between an iPhone and Android.</p><p>Thanks in advance for your help,</p><p>Regards,</p>","230632","","","","","2011-02-01 13:25:11","use game kit p2p communication between iPhone and Android","<iphone><android><p2p><gamekit>","1","1","","",""
"4862745","1","","","2011-02-01 12:47:07","2","771","<p>This is my web service Login url :- <a href=""http://www.cricutchecklist.com/iphone/login.php"" rel=""nofollow"">http://www.cricutchecklist.com/iphone/login.php</a></p><p>i have to pass username and password.</p><p>do you  have android correct code for sending this two parameter perfectly?</p><pre><code>username- chandreshkanetiyapassword- 9375051117</code></pre><p>php webservice parameter is username and password.</p><p>My code always returned me :- <code>{""response"" : {""success"":false,""error"":{""code"":2,""description"":""Incorrect script parameters""}}}</code> if i pass correct username and password.</p><p>i am expecting this:-- <code>{""response"" : {""success"":true,""error"":{""code"":2,""description"":""Incorrect script parameters""}}}</code></p><p>if you solve this problem let me know.thank you.</p>","452611","","881286","","2013-08-18 02:04:16","2013-08-18 02:04:16","send json object using http post method for android application","<android>","0","3","","",""
"4862807","1","","","2011-02-01 12:53:11","0","329","<p>When i'm trying to install android plugin in eclipse i got this error</p><p>"" An error occurred while collecting items to be installedsession context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).Unable to read repository at <a href=""http://downloads.myeclipseide.com/downloads/products/eworkbench/helios/9.0M1/plugins/org.maven.ide.eclipse.maven_embedder_0.10.0.me201003101716.jar"" rel=""nofollow"">http://downloads.myeclipseide.com/downloads/products/eworkbench/helios/9.0M1/plugins/org.maven.ide.eclipse.maven_embedder_0.10.0.me201003101716.jar</a>.Read timed out  ""</p><p>please any one can give me a solution</p>","559122","","21234","","2011-02-26 10:32:24","2011-02-26 10:32:24","I'm unable install the android plug in Eclipse helio in windows","<android><eclipse-plugin>","1","0","","",""
"4862857","1","4862913","","2011-02-01 12:58:59","8","7684","<p>I want to record call from android phone.I am using android.media.MediaRecorder pckg.</p><p>Also used following code:</p><pre><code>mrec.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);mrec.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);mrec.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);</code></pre><p>But I didn't succeed in recording an incoming call.Can anyone recommend a tested code snippet?</p><p>Also,Is this true?<a href=""http://groups.google.com/group/android-developers/browse_thread/thread/c2bc85eb60ae2aa5?pli=1"">http://groups.google.com/group/android-developers/browse_thread/thread/c2bc85eb60ae2aa5?pli=1</a>http://code.google.com/p/android/issues/detail?id=2117#c226</p><p>Thanks in Advance.</p>","546142","","766441","","2011-06-29 09:54:25","2011-08-08 12:39:13","How to record call in android? Is it possible?","<android><telephony><system-calls>","2","0","","",""
"4862889","1","4864813","","2011-02-01 13:02:48","2","940","<p>On several phones like a Nexus or a HTC phone you can add a quick contact shortcut to the home screen.  When you press the persons image you get the little bouncy popup that has various icons in it.  I am trying to duplicate this behavior.</p><p>Here is some logging of the intent that is fired when the quick contact is launched from a shortcut:</p><pre><code>02-01 06:55:58.460: INFO/ActivityManager(1259): Starting activity: Intent { act=com.android.contacts.action.QUICK_CONTACT dat=content://com.android.contacts/contacts/lookup/2795i4464ea058cf583f3/177 flg=0x14200000 cmp=com.motorola.blur.contacts/com.android.contacts.ui.QuickContactActivity bnds=[18,253][108,340] (has extras) }</code></pre><p>I have tried to duplicate this without success:</p><pre><code>final Intent shortcutIntent = new Intent(""com.android.contacts.action.QUICK_CONTACT"");shortcutIntent.addFlags(0x14200000);Uri uri = Uri.parse(""content://com.android.contacts/contacts/lookup/2795i694f803d0e56adba/182"");shortcutIntent.setData(uri);final Intent intent = new Intent();intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, contact.name);intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, contact.icon);</code></pre><p>This makes a shortcut just fine and the logs are almost identical except for the [extras].  I have not figured out what the extras I need to be sending.</p><pre><code>02-01 07:01:53.147: INFO/ActivityManager(1259): Starting activity: Intent { act=com.android.contacts.action.QUICK_CONTACT dat=content://com.android.contacts/contacts/lookup/2795i694f803d0e56adba/182 flg=0x14200000 cmp=com.motorola.blur.contacts/com.android.contacts.ui.QuickContactActivity bnds=[245,252][355,382] }02-01 07:01:53.280: ERROR/AndroidRuntime(12317): java.lang.NullPointerException02-01 07:01:53.280: ERROR/AndroidRuntime(12317):     at com.android.contacts.ui.QuickContactActivity.onNewIntent(QuickContactActivity.java:77)</code></pre><p>Does anyone know the correct way to call the quick contact from a shortcut or what the extras I need to send are?</p>","242904","","","","","2011-02-01 15:58:54","Starting quick contact from a home screen shortcut?","<android>","1","0","","",""
"4862899","1","4863488","","2011-02-01 13:04:10","0","600","<p>I have a question about transferring data through <code>Intent()</code> to a MapView.</p><pre><code>String coorx = temptItem.getCordx();String coory = temptItem.getCordy();goTomap.putExtra(""x"", coorx);goTomap.putExtra(""y"", coory);System.out.println(coorx);startActivity(goTomap);</code></pre><p>where goTomap is my Intent:    goTomap = new Intent(this,MyMap.class);But after I click on the ListView to go to another class, it gives:</p><pre><code>java.lang.RuntimeException: Unable to start activity .....java.lang.NullPointerException</code></pre><p>My manifest is from many sample codes around the web.</p><pre><code>&lt;activity android:name="".MyMap""             android:label=""location""&gt;           &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;/intent-filter&gt;        &lt;/activity&gt;</code></pre><p>Anyway to solve this?</p><p><strong>EDIT</strong>Added MyMap</p><pre><code>package com.nyp.stud084839L.isbconnects;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 android.os.Bundle;public class MyMap extends MapActivity{    private MapView mapView;    private MapController mc;    /** 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.map_view);        String coordinates[] = {""40.747778"", ""-73.985556""};        double lat = Double.parseDouble(coordinates[0]);        double lng = Double.parseDouble(coordinates[1]);        GeoPoint p = new GeoPoint(            (int) (lat * 1E6),             (int) (lng * 1E6));        mc = mapView.getController();        mc.animateTo(p);        mc.setZoom(17);         mapView.invalidate();            }    @Override    protected boolean isRouteDisplayed() {        // TODO Auto-generated method stub        return false;    }}</code></pre>","575349","","575349","","2011-02-01 13:30:11","2011-02-01 14:03:34","Android Google Map Api Error","<android><xml><google-maps>","1","4","","",""
"4863027","1","4863057","","2011-02-01 13:18:34","0","216","<p>I was trying to do an adapter on a ListView as an exercise but I get a strange error on the row layout:</p><pre><code>error: Error parsing XML: unbound prefix</code></pre><p>What is wrong with this very simple 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=""wrap_content""&gt;    &lt;TextView        android:id=""@+id/station""        android:text=""Stazione DI""        android:layout_alignParentTop=""true""        android:padding=""3dip""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;     &lt;TextView         androdi:id=""@+id/time""        android:text=""Time:""        android:layout_alignParentLeft=""true""         android:below=""@id/station""/&gt;    &lt;TextView         androdi:id=""+id/late""        android:text=""Time:""        android:layout_toRightOf=""@id/time""        android:below=""@id/station""/&gt;    &lt;TextView         androdi:id=""+id/rail""        android:text=""Rail:""        android:below=""@id/station""        android:layout_toRightOf=""@id/late""/&gt;  &lt;/RelativeLayout&gt;</code></pre>","269931","","","","","2011-02-01 13:20:29","Relative Layout not compiling!","<android><xml><layout><relativelayout>","1","0","","",""
"4863102","1","","","2011-02-01 13:24:27","0","1417","<p>if i capture any image from android camera ,, how can i perform different -2 type of effect on image? Effect should be like ""sepia"", ""Old cam"" etc... These effect must be perform after capturing the image... </p>","304961","","423823","","2011-02-01 13:34:43","2011-02-01 13:50:13","Android image effect","<android><image-processing>","1","4","","",""
"4863103","1","","","2011-02-01 13:24:28","0","116","<p>hii every buddy,</p><p>am displaying parsed xml contents to a textview here i faced a problem, i have a tag like Yes,No,DontKnow  in  xml file,i can able to parse the data &amp; display it in a textview, but i need to display each data which are seperated by comma(,) to seperate textviews   like 'yes' should be displayed in a text view &amp; 'No' should be displayed in other textview,&amp; 'dontknow' should be displayed in another textview, how to do that, can any buddy give some idea ,,,,,,thanx in advance(I am new to android) </p>","571256","","","","","2011-02-01 13:27:18","loading data which are seperated by comma(,) to seperate textviews in android","<android><xml><textview>","0","0","0","",""
"4863161","1","","","2011-02-01 13:29:49","1","1020","<p>I have an app that uses the LocationManage functions which works well until the app is stopped or paused. The location listener function is still carrying on in the background. Relevant bits of code follow. When I click home or back the onstop() function is being triggered correctly.</p><pre><code>package uk.cr.anchor;import android.app.Activity;import android.content.Context; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.media.MediaPlayer;import android.media.RingtoneManager;import android.net.Uri;import android.os.Bundle;import android.view.View;import android.widget.EditText;import android.widget.TableRow;import android.widget.Toast;import android.widget.ToggleButton;import android.content.SharedPreferences; import android.graphics.Color;public class main extends Activity {    /** Called when the activity is first created. */    private LocationManager mlocManager;     private LocationListener mlocListener;     @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);         LocationListener mlocListener = new MyLocationListener();         mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, mlocListener); }    @Override     protected void onStop(){          stoplistening();        super.onStop();    }/* Class My Location Listener */ public class MyLocationListener implements LocationListener {     @Override     public void onLocationChanged(Location loc)     {         loc.getLatitude();         loc.getLongitude();         etc etc etc    }    private void stoplistening() {        if (mlocManager != null) {            Toast.makeText( getApplicationContext(),                 ""kill"",                 Toast.LENGTH_SHORT ).show();             mlocManager.removeUpdates(mlocListener);        }        else {            Toast.makeText( getApplicationContext(),                 "" not kill"",                 Toast.LENGTH_SHORT ).show();            }    }}</code></pre><p>I always get the ""not kill"" message.</p><p>Can anyone help me!</p>","598447","","213269","","2011-02-02 12:55:44","2012-10-16 16:58:16","I cannot get mlocManager.removeUpdates(mlocListener); to work","<android><locationlistener>","4","1","","",""
"4863204","1","4863511","","2011-02-01 13:33:29","0","1182","<p>Hi i have this in a html page android(2.1) webkit</p><pre><code>    &lt;SELECT  id=""my_id""  onclick=""my_click();"" &gt;    &lt;/SELECT&gt;</code></pre><p>If you click on the combo box an empty list is displayed on android emulator.</p><p>I do not want to display a empty list , if its empty. I want to intercept this in the on click event. The onclick event is not firing. The onchange event is working.  only the onchange event fires , onmousedown, onmouseup etc don't fire.</p><p>This works in chrome and in iphone webkit ..</p><p>anyideas?mike</p>","334106","","334106","","2011-02-04 13:58:28","2011-02-04 13:58:28","android webkit onclick event not firing in select list","<javascript><android><html><webkit><onclick>","1","2","","",""
"4863227","1","","","2011-02-01 13:36:04","3","942","<p>I have been recently studying on why the Browser in the android OS does not support accessing IPv6 websites through IPv6 URLs and I think it is due to the native method <code>getaddrinfo</code> called by <code>android/dalvik/libcore/luni/src/main/java/java/net/ InetAddress.java</code> which is then called by the Browser application throws an <code>UnknownHostException</code> when trying to convert an IPv6 URL to its addresses. </p><p>Begin from line 507, the code of <code>InetAddress.java</code> is:</p><pre><code>try {       InetAddress[] addresses = bytesToInetAddresses(getaddrinfo(host), host);       addressCache.put(host, addresses);       return addresses;</code></pre><p>and the native method is declared at line 516 as: </p><pre><code>private static native byte[][] getaddrinfo(String name)         throws UnknownHostException; </code></pre><p>But I haven't found any hint about where the implementation of this native method <code>getaddrinfo</code> is although I found there are two files named <code>getaddrinfo.c</code>. Does here follow the rules of JNI or NDK? If so, a statement of <code>System.loadLibary(""NameOfTheLibrary"")</code> should be found but I didn't find it.<br>Any one could give me a hint on finding the implementation of this native method <code>getaddrinfo</code>?</p><p>The complete source file of <code>InetAddress.java</code> can be found at <a href=""http://ooowjc.wikispaces.com/Attachments"" rel=""nofollow"">http://ooowjc.wikispaces.com/Attachments</a></p>","598451","","418183","","2011-02-01 22:06:20","2011-10-27 06:56:01","Where is the implementation of ""getaddrinfo"" called by InetAddress.java","<android><ipv6>","1","0","","",""
"4863238","1","","","2011-02-01 13:37:35","0","204","<p>I need to run a process for 30 seconds and while it is running I have to store the output in a text file. After 30 seconds I'd have to destroy the process. I know how to run the process and how to store data in a file but don't know how to do it for 30 seconds only (the process would take much longer if not stopped).</p><p>Thanks.</p>","598011","","562906","","2011-02-01 22:06:09","2011-02-01 22:06:09","Execute one process for 30 seconds and get the output","<java><android><process><timeout><execute>","1","0","","",""
"4863392","1","","","2011-02-01 13:52:43","0","642","<p>i would like to have a button that on click will direct the user to the wifi settings of the device..any idea for the onclick code please?</p>","519526","","","","","2011-07-25 08:36:35","How to move ""onClick"" from a button to the wifi settings","<android><wifi><android-wifi>","2","2","","",""
"4863463","1","","","2011-02-01 14:00:28","3","2266","<p>I have a WebView, and I have the following code:</p><pre><code>webview.setInitialScale(75);</code></pre><p>I also have zooming disabled:</p><pre><code>webview.getSettings().setSupportZoom(false);</code></pre><p>Both of these pieces of code work very well until any sort of textbox (input field) is selected within the WebView, then the application scales to 100%.</p><p>I'm trying to figure out how to intercept and stop the scale from taking place when a textbox is selected, however I've had no luck with the following: </p><p><a href=""http://developer.android.com/reference/android/view/View.html#onCheckIsTextEditor%28%29"" rel=""nofollow""><code>onCheckIsTextEditor()</code></a> - This doesn't seem to fire when the textbox is clicked</p><p>I can change the Scale back to 75% after the page scales by Overriding the <a href=""http://developer.android.com/reference/android/webkit/WebViewClient.html"" rel=""nofollow""><code>onScaleChanged()</code></a> method within the WebViewClient class.  However this can only be done by looping through with the <a href=""http://developer.android.com/reference/android/webkit/WebView.html#zoomOut%28%29"" rel=""nofollow""><code>zoomOut()</code></a> method until the proper scale is met.</p><p>To me it seems there must be a location where the click actually fires the event to focus the textbox and redraw the view to scale it (and <code>onScaleChanged()</code> is called), I just haven't been able to locate it yet.</p><p>Any help would be greatly appreciated.</p>","158557","","","","","2011-02-01 14:00:28","Android completely stop WebView from scaling","<android><webview><scaling>","0","5","1","",""
"4863499","1","","","2011-02-01 14:05:02","0","484","<p>i use a MediaPlayer to play an audio file and the TTS-Engine to output a Text. No i want to set the volume of the two types to the same level. I have tried to set the MediaPlayers setVolume-Method and the more general setVolumeControlStream but with no effort. Has anybody an idea or sample code for that problem?</p><p>Fesp</p>","566994","","168868","","2012-01-01 21:55:53","2012-01-01 21:55:53","Android MediaPlayer TTS Problem","<android><media-player><text-to-speech>","1","0","","",""
"4863518","1","4863551","","2011-02-01 14:06:28","6","6196","<p>Can any one help to combine two bitmap images into single bitmap </p><p>in android (Side by side).</p><p>Thanks,Yuvaraj</p>","598487","","","","","2013-05-04 02:39:57","Combining two bitmap image (side by side)","<android>","1","0","2","",""
"4863544","1","4863743","","2011-02-01 14:09:57","0","877","<p>hii need to show the tweets from twitter ,no posting , i have the keys , username password.What is the steps for retrieveing the tweets from twitter ?</p>","487219","","","","","2011-02-01 14:28:42","Android show Tweets","<android>","3","0","","",""
"4863589","1","4863881","","2011-02-01 14:13:48","1","1580","<p>I ve the following scenario. I ve a viewgroup and two views (one draws a rectshape, an ovalshape the other). The viewgroup and the two views implements the OnTouchListener interface. But when a touch on a view, both the Viewgroup.onTouch(..) and the RectView.onTouch() and the OvalView.onTouch() are called. My question is.. if I want to know wich view has been touched what i need to do? Could please provide me some information or example?</p><p>Thanks in advance,</p>","501696","","","","","2011-02-28 22:41:56","Views in ViewGroup","<android><view><viewgroup>","2","0","","",""
"4863595","1","4863746","","2011-02-01 14:14:30","2","841","<p>I have a button that onclick reads and shows to the user a list with rss news.  I would like to add a progress bar until finish loading.  My problem is that, if I add a bar, it works properly at first but if I press the back button, the bar starts again and it can't stop.  Any help or a tutorial that demonstrates a progressbar would be appreciated.  Thanks!</p><pre><code>ProgressBar myProgressBar;  int myProgress = 0; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) {  super.onCreate(icicle);  setContentView(R.layout.main1);  Button nea = (Button) findViewById(R.id.nea);   nea.setOnClickListener(new View.OnClickListener() {   public void onClick (View view) {    setContentView(R.layout.bar);     myProgressBar=(ProgressBar)findViewById(R.id.bar);           new Thread(myThread).start();    Intent myIntent = new Intent(view.getContext(), nea.class);    startActivityForResult(myIntent, 0);    }    });}private Runnable myThread = new Runnable(){        @Override    public void run() {     // TODO Auto-generated method stub     while (myProgress&lt;100){      try{       myHandle.sendMessage(myHandle.obtainMessage());       Thread.sleep(1000);      }      catch(Throwable t){      }     }    }    Handler myHandle = new Handler(){     public void handleMessage(Message msg) {      // TODO Auto-generated method stub      myProgress++;      myProgressBar.setProgress(myProgress);     }    };      };</code></pre>","519526","","473070","","2011-02-01 14:30:22","2011-02-01 14:37:20","Progress Bar problem","<android><progressdialog>","3","4","","",""
"4863598","1","","","2011-02-01 14:15:10","0","216","<p>I have got a service, which should be made generic by using data files provided by other services (providers). I prefer the providers to be as simple as possible, and the data they provide should be stored in asset files. Data will be constant and only be read once by the client.</p><p>Because I have no experience with 'intent' or 'contentProviders' I would like suggestions on which way to go.  </p><p>More specific:</p><p>Is ContentProviders too complicated for this ? The samples I looked at were all using databases.</p><p>Is it possible to pass a sort of file pointer to an asset file from one service to another, or do the provider have to read its asset file and pass the data to the client in an object ?</p>","598417","","","","","2011-02-01 16:24:35","pass an asset file from one service to another","<android><android-intent><assets>","1","2","","",""
"4863618","1","4863690","","2011-02-01 14:17:16","0","832","<p>I am working on an application that runs a service. This service starts automatically when the system boots or the app is started. My manager asked me to check if it is still running periodically (eg. every 5 minutes) or each time the screen is turned off and then start the service again if not running.</p><p>The closest solution I found was this:http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/</p><p>This restarts the service only if the application is still running, which is unlikely if the user stopped it or killed it with some task manager.</p><p>Is it possible to have the service restarted other than boot-up or activity registered receiver? (Thinking about it as a User, I would not really like to have an application running all the time weather I wanted it or not.)</p>","510944","","","","","2011-02-01 14:24:47","Starting a service automatically on screen off in android","<android><android-service>","1","2","","",""
"4863642","1","","","2011-02-01 14:19:41","0","624","<p>I have read that when you reboot with Android all of your AlarmManagers are deleted and they need to be remade. So I created a BootReciever class that will restart all my alarms by calling a WakefulIntentService like so:- </p><pre><code>public class BootReciever extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {        Log.v(""MessageDelay"", ""Reboot message Recieved"");        try {            WakefulIntentService.sendWakefulWork(context, BootSetter.class);                } catch (Exception e) {             Toast.makeText(context, ""There was an error somewhere, but we still received an alarm"", Toast.LENGTH_SHORT).show();             e.printStackTrace();            }    } }</code></pre><p>In the Manifest I declared it and put an intent filter so it only runs when the boot is completed like so:-</p><pre><code>  &lt;receiver android:name="".BootReciever""&gt;         &lt;intent-filter&gt;          &lt;action android:name=""android.intent.action.BOOT_COMPLETED"" /&gt;         &lt;/intent-filter&gt;        &lt;/receiver&gt;</code></pre><p>Now after tearing my hair out trying to fix an issue with this not working as intented, I have come to realise that my BootReciever class is not being called after a boot as it should be. Instead my other class named RecieverHandler is being called for everything. What’s more puzzling is the Intent passed to my RecieverHandler on startup actually has valid data that can be used without error.</p><p>My RecieverHandler looks like this:-</p><pre><code>public class RecieverHandler extends BroadcastReceiver{    @Override    public void onReceive(Context context, Intent intent)     {        try {             Bundle bundle = intent.getExtras();             Log.v(""MessageDelay"", ""RecieverHandler is doing boot jobs"");             Intent newIntent = new Intent(context, MessageDispatcher.class);             newIntent.putExtras(bundle);            // newIntent.addFlags(Intent.FLAG);             //context.startService(newIntent);             WakefulIntentService.sendWakefulWork(context, newIntent);                } catch (Exception e) {             Toast.makeText(context, ""There was an error somewhere, but we still received an alarm"", Toast.LENGTH_SHORT).show();             e.printStackTrace();            }    }}</code></pre><p>It is declared in the manifest like so:</p><pre><code>&lt;receiver android:name="".RecieverHandler""&gt;        &lt;/receiver&gt;</code></pre><p>While it might be okay in another situation I need to have different Recievers for when the phone is on and when the phone has booted.</p><p>To summarize myquestions are :-</p><p>Why is RecieverHandler dealing with the Boot completed Intent and my BootReciever is never being called?</p><p>How can Intent data set before a reboot still be valid after a reboot?</p><p>Is their a way to delay any actions until the SMS sending abilities of a device are ready?</p>","518118","","","","","2011-02-24 12:01:53","Boot Reciever never being called after boot but RecieverHandler is, and with data?","<android><broadcastreceiver><boot>","1","0","","",""
"4863653","1","5056338","","2011-02-01 14:20:40","7","7401","<p>I would like to read contacts from ContactsContract API which belongs only to Phone / SIM and would like to avoid contacts synced from other apps like facebook and gmail. I tested my code on simulator and it works fine but on real devices it doesn't returns any result.</p><pre><code>ContentResolver cr = AndroidContext.getContext()                    .getContentResolver();Cursor nativeContacts = cr.query(RawContacts.CONTENT_URI,                    new String[] { RawContacts._ID, RawContacts.VERSION, RawContacts.CONTACT_ID },                    RawContacts.DELETED + ""&lt;&gt; 1 AND "" + RawContacts.CONTACT_ID                            + "" IS NOT NULL AND "" + RawContacts.ACCOUNT_NAME + "" IS NULL AND ""                            + RawContacts.ACCOUNT_TYPE + "" IS NULL"", null, null);</code></pre><p>I guess on devices the account type and name for default account is not null, what is the solution?</p>","473655","","","","","2013-11-28 13:32:25","What is the default Account Type / Name for contacts on Android Contact Application?","<android><contacts><contactscontract>","3","2","3","",""
"4863660","1","4863702","","2011-02-01 14:21:10","34","22530","<p>I've just uploaded a new app to the android market. However when I try to download it to my phone through the Android market, it doesn't appear!</p><p>Please can someone with knowledge of this let me know how I can get my app to appear in the search results.</p>","395974","","309086","","2014-01-08 11:31:59","2014-02-17 03:17:45","Just uploaded Android App: How long before app shows in Android Market search?","<android><google-play>","6","3","1","2013-08-26 17:58:32",""
"4863722","1","4864094","","2011-02-01 14:27:09","1","8355","<p>I'm using ListActivity to set up my listview. What I want to do is I want to display listview in upper portion and a linearlayout at parent bottom.</p><p>Since I'm using ListActivity, I'm not laying out any layout file. Still what I managed to do is getting the listview instance but when I'm trying to set it in linearLayout I'm getting an error: </p><pre><code>java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first</code></pre><p>I'm using the following code:</p><pre><code>  final ListView lv = getListView();      LinearLayout root = new LinearLayout(this);  root.setOrientation(LinearLayout.VERTICAL);  root.setLayoutParams(new LayoutParams(  LinearLayout.LayoutParams.FILL_PARENT,  LinearLayout.LayoutParams.FILL_PARENT));  root.addView(lv);  setContentView(root);</code></pre><p>Can anybody please help?</p><p>Thanx in advance.</p>","227943","","","","","2011-02-01 14:59:01","Add listview and a linearlayout inside a ListActivity android","<android><layout><listactivity>","2","0","3","",""
"4863725","1","","","2011-02-01 14:27:30","0","243","<p>My code here works fine . It changes  the image in my gallery at certain times , but i dont think this is the best approach , especially using thread.sleep() . How can i write a better code for that ? What am i missing ?Thanks..</p><p>@Override    protected void onResume() {        paraThread = true;        workThread = new LooperFoto(""MyWorkThread"");        workThread.setPriority(Thread.MIN_PRIORITY);        workThread.start();        super.onResume();    }</p><pre><code>@Overrideprotected void onStop() {    Log.i(TAG, ""thread state: "" + workThread.getState());    paraThread = false;    workThread = null;    super.onStop();}class LooperFoto extends HandlerThread {    public LooperFoto(String name) {        super(name);    }    @Override    public void run() {        while (paraThread) {            try {                this.sleep(2000);                mudaFoto.sendMessage(new Message());            } catch (InterruptedException e) {                e.printStackTrace();            }        }    }}Handler mudaFoto = new Handler() {    public void handleMessage(Message msg) {        Random generator = new Random();        int randomIndex = generator.nextInt(thumbImgGallery.getAdapter()                .getCount());        thumbImgGallery.setSelection(randomIndex);    };};</code></pre>","569873","","","","","2011-02-01 14:29:55","Changing the image in a android gallery at certain times ... help","<java><android><handler><image-gallery>","1","0","","",""
"4863916","1","","","2011-02-01 14:43:35","1","319","<p>Problem in showing progress bar while executing insert statement in android. While calling this try block its showing blank screen. Not even xml is called while executing this statement.</p><pre><code>try {    while ((str = in.readLine()) != null) {    try {                                    db.execSQL(str);                       } catch (Exception e) {    }}   </code></pre><p>Thanks,Yuvaraj</p>","598487","","473070","","2011-02-01 15:09:14","2011-02-12 20:51:18","Problem in showing progress bar while executing insert statement in android","<android><progressdialog>","3","0","","",""
"4863976","1","4869006","","2011-02-01 14:48:57","0","629","<p>I got to try an exercise 1 of notepad application just yesterday and passed through all the steps to the last one - running in an emulator.</p><p>As I am new to Android platform, I'm not a noob. I have set my android emulator, have all the SKDs, etc. Project was created for 2.2 platform and so was the emulator.</p><p>After I hit Run As -> Android application the emulator starts, but it stays only on home screen (or last screen I was on before closing the emaulator). Problem is that I cannot find this notepad application. I thought that the emulator will start up with this app running so I could check it out immediately.</p><p>I do not know much about the manifest XMLs, but when looked in it I've found that there is an activity registered, so I really don't know what (or where) the problem is. I was googling for an hours and tried every link where a problem with running sth in emulator occured, but no result...</p><p>So I'm asking You and hope somebody will help me!</p><p>Many thanks in advance!!!</p><p>shadyyx.</p>","598500","","","","","2011-02-05 15:30:52","Cannot run Android notepad exercise 1 in emulator","<android><android-emulator><emulator><notepad>","2","1","","",""
"4864178","1","","","2011-02-01 15:06:06","6","4915","<p>I am working android application.How can i play youtube in android videoview.help me........</p><p>Thanks............</p>","533787","","","","","2011-07-13 19:08:12","how to display Youtube Video in android VideoView?","<android>","1","1","1","2011-07-13 19:20:48",""
"4864241","1","4864760","","2011-02-01 15:11:26","0","283","<p>I have edittext view with default text value  like 'Enter Value' at the time of user touch  edittext  I want to clear edittext value   and show virtul keypad to user </p><p>I done like this but still not working can anybody tell how to do?</p><pre><code>@Override    public boolean onTouch(View arg0, MotionEvent arg1) {        // TODO Auto-generated method stub        edtsearch.setText("""");        //((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(edtsearch, 0);          InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);        mgr.showSoftInput(edtsearch, InputMethodManager.SHOW_IMPLICIT);        return true;    }</code></pre><p>the above code didn't show keypad  can anybody tell how to clear the value and show keypad to the user </p><p>even i used android:hint at the time of keypad clicking only it clear the value .I want if user touch the edit text box clear the value and show keypad to the user</p>","426344","","","","","2011-02-01 15:54:43","virtual key pad problem","<android>","1","0","","",""
"4864273","1","4876287","","2011-02-01 15:14:05","0","3186","<p>I´m have written a parser wich parses a xml file from a from a HttpURLConnection. This works fine. </p><p>Problem: I need to rewrite this so that the xml file is loaded from local resources instead of from the internet, but I cant get this to work... Just to give yo an idea how the original web parser looks: </p><pre><code>InputStream in=null;URLConnection connection = url.openConnection(); HttpURLConnection httpConnection = (HttpURLConnection)connection; int responseCode = httpConnection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) {    in = httpConnection.getInputStream();    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();     DocumentBuilder db = dbf.newDocumentBuilder();   Document dom = db.parse(in);        Element docEle = dom.getDocumentElement();   NodeList nl = docEle.getChildNodes();   for (int i = 0; i &lt; nl.getLength(); i++) {    Node node = nl.item(i);    //START PARSING......</code></pre><p>Now heres the code I am using to try to parse from a local resource placed at xml/myfile.xml in the resources folder:</p><pre><code>InputStream in=null;in = mParentActivity.getResources().openRawResource(R.xml.myfile);DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();DocumentBuilder builder = factory.newDocumentBuilder();Document dom = builder.parse(in); // THIS IS WHERE I GET AN SAXParseExceptionElement root = dom.getDocumentElement();NodeList nl = root.getChildNodes();for (int i = 0; i &lt; nl.getLength(); i++) {    Node node = nl.item(i); //START PARSING......</code></pre><p>The local xml file and the web file are exactly the same... If anyone would take a look at it: <a href=""http://agens.no/Eniro/Android/SEWheel/Category2.plist.xml"" rel=""nofollow"">http://agens.no/Eniro/Android/SEWheel/Category2.plist.xml</a></p><p>And heres the stacktrace: 02-01 16:08:45.546: WARN/System.err(19703): org.xml.sax.SAXParseException: name expected (position:START_TAG @1:309 in java.io.InputStreamReader@47668728) </p><p>Preciate all yor help :)</p>","457401","","234723","","2011-02-01 15:39:04","2011-02-02 15:28:06","problem loading and parsing xml from resources","<java><android><xml><resources><local>","1","3","","",""
"4864426","1","","","2011-02-01 15:28:04","0","348","<p>In my project I want to use scrolling for rendering the pdf in landscape mode.I have used onscroll method in Android, but when I run the application on a Samsung Galaxy device the scrolling is not smooth.Can anybody suggest how to get fine and smooth scrolling, and are there any methods other than onscroll?</p>","493244","","183172","","2011-10-05 22:16:53","2011-10-05 22:16:53","Scrolling in Android","<android>","1","1","","",""
"4864447","1","4875508","","2011-02-01 15:29:56","0","278","<p>I'm writing a custom view to be able to draw on a bitmap and I'd like to be able to pass a menu selection from my activity to have the onTouch do different things. For instance, if you select circle from the menu then the onTouch will draw a circle, if rectangle, a rectangle etc.  Am I going about this the right way? Is there a way to pass the menu item selection to the view?</p>","598618","","","","","2011-02-02 14:22:48","Sending a menu item selection to a custom view's onTouch method","<android>","1","0","","",""
"4864556","1","4864938","","2011-02-01 15:37:56","0","1072","<p>In my xml i have 3 view at first </p><p>i have to hide one view then after that i have to unhide that in program.</p><p>When i hide that view the other must adjust and when i unhide it have to adjust</p>","510491","","","","","2011-02-01 16:09:14","Dynamic Views in Layout","<android><android-layout>","1","0","1","",""
"4864586","1","4865856","","2011-02-01 15:40:35","0","691","<p>Ok I am getting this FC error. </p><p>I have gone over the code three times and have tried two re-writes. Here is the most efficient code that I was able to learn. But I am still getting FC. I would appreciate any help as I am trying to get to play around 50 sound files for my program. between fifteen to twenty per activity.</p><pre><code>implements OnClickListener {MediaPlayer mp1;MediaPlayer mp2;MediaPlayer mp3;MediaPlayer mp4;MediaPlayer mp5;MediaPlayer mp6;MediaPlayer mp7;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.verbs);    mp1 = MediaPlayer.create(this, R.raw.play);    mp2 = MediaPlayer.create(this, R.raw.eat);    mp3 = MediaPlayer.create(this, R.raw.can);    mp4 = MediaPlayer.create(this, R.raw.go);    mp5 = MediaPlayer.create(this, R.raw.help);    mp6 = MediaPlayer.create(this, R.raw.practice);    mp7 = MediaPlayer.create(this, R.raw.use);    final Button button1 = (Button) findViewById(R.id.play_button);    button1.setOnClickListener(this);    final Button button2 = (Button) findViewById(R.id.eat_button);    button2.setOnClickListener(this);    final Button button3 = (Button) findViewById(R.id.can_button);    button3.setOnClickListener(this);    final Button button4 = (Button) findViewById(R.id.go_button);    button4.setOnClickListener(this);    final Button button5 = (Button) findViewById(R.id.Thelp_button);    button5.setOnClickListener(this);    final Button button6 = (Button) findViewById(R.id.pract_button);    button6.setOnClickListener(this);    final Button button7 = (Button) findViewById(R.id.use_button);    button7.setOnClickListener(this);    final Button button8 = (Button) findViewById(R.id.Back_Button);    button8.setOnClickListener(this);}  public void onClick(View v) {    switch(v.getId()) {    case R.id.play_button:        mp1.start();        Toast.makeText(VerbsActivity.this, ""PLAY"",                Toast.LENGTH_LONG).show();        break;    case R.id.eat_button:        mp2.start();        Toast.makeText(VerbsActivity.this, ""EAT"",                Toast.LENGTH_LONG).show();        break;    case R.id.can_button:        mp3.start();        Toast.makeText(VerbsActivity.this, ""CAN"",                Toast.LENGTH_LONG).show();        break;    case R.id.go_button:        mp4.start();        Toast.makeText(VerbsActivity.this,""GO"",                Toast.LENGTH_LONG).show();        break;    case R.id.Thelp_button:        mp5.start();        Toast.makeText(VerbsActivity.this,""HELP"",                Toast.LENGTH_LONG).show();        break;    case R.id.pract_button:        mp6.start();        Toast.makeText(VerbsActivity.this, ""PRACTICE"",                Toast.LENGTH_LONG).show();        break;    case R.id.use_button:        mp7.start();        Toast.makeText(VerbsActivity.this, ""USE"",                Toast.LENGTH_LONG).show();        break;    case R.id.Back_Button:        finish();        break;    }}@Overrideprotected void onDestroy() {      mp1.release();      mp2.release();      mp3.release();      mp4.release();      mp5.release();      mp6.release();      mp7.release();    super.onDestroy();}</code></pre><p>}</p>","577265","","577265","","2011-02-05 07:04:41","2011-02-05 07:04:41","MediaPlayer causes FC error","<android><audio><media-player>","3","2","","",""
"4864739","1","4864761","","2011-02-01 15:52:55","2","4736","<p>Today is February 1, 2011. I am trying to generate a date string for Android in the format ""MM/DD/yyyy"" using SimpleDateFormat. Here is my code:</p><pre><code>Date d = new Date();String date = (new SimpleDateFormat(""MM/DD/yyyy"")).format(d);</code></pre><p>It returns the following string:</p><pre><code>02/32/2011</code></pre><p>What is going on here? I can't see anything that I'm doing wrong.</p>","321435","","","","","2011-02-01 15:54:48","SimpleDateFormat in Android giving current date as 02/32/2011","<java><android><date><simpledateformat>","2","0","1","",""
"4864781","1","","","2011-02-01 15:56:49","1","749","<p>I am looking to upload a photo on facebook from my android application ( not to the wall but to a albumn ) along with the tags</p><p>However I am getting no help on the net and totally stuck...</p><p>Please help</p>","598664","","","","","2011-06-20 18:07:25","Posting image to Facebook ( not wall ) using android","<android><facebook>","0","0","","",""
"4864875","1","4864957","","2011-02-01 16:03:51","0","8295","<p>I am trying to create a temporary file in /data/local/tmp directory. The path is correct and I have added permission WRITE_EXTERNAL_PERMISSION also. But still I get an error from native code saying that file can't be created.</p><p>The code is as below.</p><pre><code>File *file = fopen(""mytxt.txt"", ""/data/local/tmp/"");</code></pre><p>The return value file always contains a null value and no file is created. Is there anything else needed to do? </p><p>Is there any other temporary folder that i can use for this purpose in android?</p><p>Thanks for any help that i can get.</p>","574911","","","","","2012-01-20 08:13:46","Folder for temporary files creation in android, Why does /data/local/tmp doesn't work for me?","<android><android-emulator>","2","0","2","",""
"4864908","1","4864944","","2011-02-01 16:06:40","0","207","<p>Hy!</p><p>JSON:</p><pre><code>{   ""responseData"":{      ""countries"":[         {            ""name"":""\u00d6sterreich"",            ""id"":""1"",            ""channels"":[               {                  ""name"":""ARD"",                  ""id"":""3""               },               {                  ""name"":""ORF 1"",                  ""id"":""1""               },               {                  ""name"":""ORF 2"",                  ""id"":""2""               }            ]         },         {            ""name"":""Deutschland"",            ""id"":""2"",            ""channels"":[               {                  ""name"":""ARD"",                  ""id"":""3""               }            ]         }      ]   },   ""responseDetails"":null,   ""responseStatus"":200}</code></pre><p>Java Code:</p><pre><code>JsonObject obj = new JSONParse(text);JSONObject menuobj = this.getJSONObject(""responseData"");</code></pre><p>How to access the array with the countries?</p><p>THX</p>","547995","","342852","","2011-02-01 16:11:15","2011-02-01 16:12:24","JSON Array Logic Problem","<java><android><json>","1","3","","",""
"4864963","1","","","2011-02-01 16:11:08","9","748","<p>Does anyone successfully implemented Hunspell spell-checker on Android platform? Is it even possible? Did you try it? What about the results?</p><p>Thank you in advance. </p>","598700","","","","","2012-11-29 09:42:16","Hunspell on Android","<android><jna><hunspell>","3","0","2","",""
"4865121","1","4865377","","2011-02-01 16:24:51","0","358","<p>Following the <a href=""http://developer.android.com/resources/tutorials/views/hello-gridview.html"" rel=""nofollow"">example of GridView</a> how I could run a new query of images in the event onItemClick?I could make a casting of my BaseAdapter in that event ?</p>","532567","","","","","2011-02-01 16:46:34","GridView x BaseAdapter and reload in onItemClick","<java><android>","1","0","","",""
"4865176","1","","","2011-02-01 16:28:47","3","509","<p>I got an application that on <a href=""http://market.android.com/publish/"" rel=""nofollow"">http://market.android.com/publish/</a> shows around 20k active installs / 30k total installs. However, google analytics for the app (that's not really doing anything weird. It's just using the normal api, collecting fairly standard data). Is showing 100k+ unique visitors since launch (around 37k so far this month).</p><p>What should I trust? How can I find out what's right and whats wrong?</p>","461421","","172322","","2011-02-01 20:35:23","2012-01-09 09:49:32","android market download statistics dwarfing google analytics numbers","<android><google-analytics><analytics><google-play>","1","3","3","",""
"4865180","1","","","2011-02-01 16:29:09","0","348","<p>iam a newbie for this kind of development. im trying to create an android application which involves GPS tracking. i am using Nutiteq because i have to use openstreetmap as the default map. please help me.</p>","597954","","358328","","2013-03-16 08:08:50","2014-01-13 15:14:45","Nutiteq GPS tracking","<android><nutiteq>","2","0","","",""
"4865199","1","","","2011-02-01 16:30:54","3","946","<p>I added a system service (<strong>not</strong> an app) into the Android framework (hence running in the system_process). Via Binder.getCallingUid() I can determine the calling process/app. So far so good.But if my service tries to use other system services (e.g. the LocationManager) a SecurityException is thrown because LocationManager thinks it is called by the original app that called my service.</p><p>From what I understood, system services have all permissions by default, so this should not be the case, should it?</p><blockquote>  <p>From programming4.us/Mobile/1304.aspx:  Binder services are free to make other  binder calls, but these calls always  occur with the service’s own identity  (UID and PID) and not the identity of  the caller.</p></blockquote><p>Here some code to illustrate the problem:</p><pre><code>public class MyService implements IInterface {    public IBinder asBinder() {        return mBinder;    }    private final IMyService.Stub mBinder = new IMyService.Stub() {        public void doSomething() {          int uid = Binder.getCallingUid(); // uid of the calling app          int myUid = Process.myUid(); // my uid == 1000          ...          try {           ILocationManager lm = ILocationManager.Stub.asInterface(ServiceManager.getService(""location""));           Location myLocation = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);          } catch (Exception e) {             SecurityException is thrown. Requires ACCESS_FINE_LOCATION          }        }    };}</code></pre><p>Thanks in advance for any help or comments!</p>","598728","","","","","2011-05-20 14:31:47","Android Framework: System service does not get permission(s)","<android>","1","1","1","",""
"4865216","1","4865353","","2011-02-01 16:33:09","1","585","<p>I would like to know whether there is an intent(like ""android.intent.action.WALLPAPER_CHANGED""-notifies when a wallpaper has been changed)  that would notify my broadcast receiver <strong><em>when a ringtone has been changed</em></strong> or a <strong>when a new ringtone has been set</strong>.</p><p>If there isn't Is there any other way to notify my BroadcastReceiver that the ringtone has been changed</p>","598714","","21234","","2011-02-01 16:36:59","2011-02-01 16:44:29","Android Ringtone change intent","<android><android-intent>","1","0","","",""
"4865219","1","4866944","","2011-02-01 16:33:30","0","584","<p>I am beginner in android. I am working on porting ffmpeg to android and i am able to display the picture, which looks really odd. I am providiing the links to pictures please advice me what really went wrong in my case.</p><p>In the native code I call sws_scale function to convert image from native format to rgb 565 and I use this rgb565 frame to be displayed using canvas and bitmap in java code.</p><p>I am guessing this is interlacing problem, but not sure. Need suggestions . Please help.</p>","574911","","574911","","2011-03-22 14:45:34","2011-03-22 14:45:34","android decoding video frame not displayed properly - interlacing problem?","<android><android-emulator><ffmpeg>","1","0","0","",""
"4865244","1","4865350","","2011-02-01 16:35:02","17","13479","<p>I'm making an android application, where there is a view composed of hundreds of buttons, each with a specific callback. Now, I'd like to set these callbacks using a loop, instead of having to write hundreds of lines of code (for each one of the buttons). </p><p>My question is: How can I use findViewById without statically having to type in each button id? Here is what I would like to do:</p><pre><code>    for(int i=0; i&lt;some_value; i++) {       for(int j=0; j&lt;some_other_value; j++) {        String buttonID = ""btn"" + i + ""-"" + j;        buttons[i][j] = ((Button) findViewById(R.id.buttonID));        buttons[i][j].setOnClickListener(this);       }    }</code></pre><p>Thanks in advance!</p>","573536","","100957","","2011-02-01 16:56:14","2011-02-01 16:56:14","Android: Using findViewById() with a string / in a loop","<android><button><clicklistener>","6","0","9","",""
"4865289","1","4865343","","2011-02-01 16:39:55","2","2163","<p>I need to override <code>onMeasure</code> method but when trying to override I get error:<code>The method OnMeasure(int, int) of type DrawLnClass.DrawLn must override a superclass method</code></p><p>Here is my code:</p><pre><code>public class DrawLnClass extends Activity {    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(new DrawLn(this));    }    public class DrawLn extends View {        Paint _paint;        int _height;        int _width;        Bitmap _bitmap;        Canvas _canvas;        Point[] xLine;        Point[] yLine;        public DrawLn(Context context) {            super(context);            _paint = new Paint();            _paint.setColor(Color.CYAN);            _paint.setStyle(Paint.Style.STROKE);        }        @Override        protected void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)        {            //super.onMeasure(widthMeasureSpec, heightMeasureSpec);            _width = View.MeasureSpec.getSize(widthMeasureSpec);            _height = View.MeasureSpec.getSize(heightMeasureSpec);            Toast.makeText(getContext(), ""Width = "" + _width, Toast.LENGTH_SHORT).show();            Toast.makeText(getContext(), ""Height = "" + _height, Toast.LENGTH_SHORT).show();            setMeasuredDimension(_width, _height);              //_bitmap = Bitmap.createBitmap(_width, _height, Bitmap.Config.ARGB_8888);            //_canvas = new Canvas(_bitmap);            //calcLinePlacements();            //drawBoard();        }</code></pre>","598741","","418183","","2011-02-01 16:45:14","2011-02-01 16:45:14","Can't override onMeasure method","<android><custom-view>","1","0","","",""
"4865437","1","","","2011-02-01 16:51:43","0","1427","<p>this is my question/problem:</p><p>I'm making a URL request to a server that authenticates by SSL through https, but when I get the answer always returns empty when I convert the input to string.Another call without parameters always runs smoothly</p><p>Any ideas?</p><p>URL: https://www.server.com/api/getResources.php?res[]=Argentina&amp;res[]=Australia&amp;res[]=Bolivia</p><p>And the code:</p><pre><code>HttpURLConnection http = conectar(URL);    InputStream urlInputStream = null;    try {        urlInputStream = http.getInputStream();    } catch (IOException e) {    }</code></pre><p>conectar method:</p><pre><code>private HttpURLConnection conectar(String surl) {    URL url = null;    try {        url = new URL(surl);    } catch (MalformedURLException e) {    }    HttpURLConnection http = null;    if (url.getProtocol().toLowerCase().equals(""https"")) {        trustEveryone();        HttpsURLConnection https = null;        try {            https = (HttpsURLConnection) url.openConnection();        } catch (IOException e) {        }        // https.setHostnameVerifier(DO_NOT_VERIFY);        http = https;    } else {        try {            http = (HttpURLConnection) url.openConnection();        } catch (IOException e) {        }    }    Authenticator.setDefault(new MyAuthenticator());    return http;}</code></pre><p>trustEveryone method:</p><pre><code>HttpsURLConnection                .setDefaultHostnameVerifier(new HostnameVerifier() {                    public boolean verify(String hostname,                            SSLSession session) {                        return true;                    }                });        SSLContext context = SSLContext.getInstance(""TLS""); // TLS        context.init(null, new X509TrustManager[] { new X509TrustManager() {            public void checkClientTrusted(X509Certificate[] chain,                    String authType) throws CertificateException {            }            public void checkServerTrusted(X509Certificate[] chain,                    String authType) throws CertificateException {            }            public X509Certificate[] getAcceptedIssuers() {                return new X509Certificate[0];            }        } }, new SecureRandom());        HttpsURLConnection.setDefaultSSLSocketFactory(context                .getSocketFactory());</code></pre>","598761","","","","","2011-02-01 17:51:22","Problems to receive JSON from https server on Android","<android><json><ssl><https>","1","2","","",""
"4865469","1","4870801","","2011-02-01 16:55:09","3","4574","<p>I want make a dynamic loaded kernel module for android.I don't want to install a linux, I just have cygwin and android NDK.</p>","84325","","648313","","2011-07-22 20:17:09","2011-07-22 20:17:09","Can the android NDK compile kernel module source?","<android><android-ndk>","3","2","3","",""
"4865597","1","6848284","","2011-02-01 17:05:25","3","2292","<p>I am using ZXing via intent to scan 1D bar-codes.  ZXing sends me back the type of 1D barcode that was scanned (UPC-A, Code 39, etc...) and the string that is encoded in the barcode.  I would like to take the type and string and generate and image of the 1D barcode and display it in an ImageView in an activity.  </p><p>I am also open to displaying the barcode in a TextView using a font similar to ""Free 3 of 9"", but I cannot figure out how to do this.</p><p>I noticed that there is an activity in ZXing called EncodeActivity that can perform what I need, but only for QR codes.  </p><p>Any help would be appreciated.</p><p>Thanks.</p>","274817","","","","","2013-06-27 10:03:56","How to display a 1-D barcode from string in Android?","<android><barcode><barcode-scanner><zxing>","2","9","2","",""
"4865617","1","","","2011-02-01 17:07:01","1","310","<p>I have the following main class and thread-TCP Client. The client runs in a loop, receives messages and passes it to main class. In the main class, I parse the message and try to show different images based on the name and value of the message received.Ex: shiftDirection1name: shiftDirection &amp; value: 1</p><p>But I can show only the image corresponding to the first received message and the images corresponding to the remaining received messages cannot be displayed. </p><p>Please go through the code below and kindly suggest the mistake/problem and alternative ways.</p><p>Thank you for your time and efforts.</p><p>Madhu</p><p>main class: </p><pre><code>public class TCPListen extends Activity implements TCPListener {    private TextView mTitle;    public String recData[] = new String[2];    String PresentGear = ""0"";       /** Called when the activity is first created. */     @Override           public void onCreate(Bundle savedInstanceState) {               super.onCreate(savedInstanceState);                              TcpServiceHandler handler = new TcpServiceHandler(this,this);               Thread th = new Thread(handler);               th.start();               }                   public String[] callCompleted(String source){                 //Log.d(""TCP"", ""Std parser "" + source);                //mTitle.setText(source);                //String data[] = new String[2];                 //if (source.matches(""&lt;MSG&gt;&lt;N&gt;.*&lt;/N&gt;&lt;V&gt;.*&lt;/V&gt;&lt;/MSG&gt;""))  {                               Document doc = null;                      try{                       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();                         DocumentBuilder db = dbf.newDocumentBuilder();                         doc = (Document) db.parse(new ByteArrayInputStream(source.getBytes()));                         NodeList n = doc.getElementsByTagName(""N"");                         Node nd = n.item(0);                         String msgName = nd.getFirstChild().getNodeValue();                         NodeList n1 = doc.getElementsByTagName(""V"");                         Node nd1 = n1.item(0);                         String tmpVal = nd1.getFirstChild().getNodeValue();                         recData[0] = msgName;                         recData[1] = tmpVal;                       if (recData[0].equals(""currGear""))   PresentGear = recData[1];                       Log.d(""TCP"", ""Inside Std parser "" + recData[0] + "" "" + recData[1]);                       actionOnData(recData[0], recData[1]);                      }                      catch(Exception e){                      e.printStackTrace();                  }                                   Log.d(""TCP"", ""Just outside Std parser "" + recData[0] + "" "" + recData[1]);                return recData;                //} else Log.d(""TCP"", ""Message in wrong format "" + source);                //mTitle.setText(""Message in wrong format "" + source);                //return data;            }       //Function to display driver messages/images based on individual messages         public void actionOnData(String name, String value) {            String tempName = name;            String tempVal = value;             setContentView(R.layout.image);            ImageView showImage = (ImageView) findViewById(R.id.imageView1);            //Log.d(""TCP"", ""------------&gt;"" + tempName + ""  "" + tempVal);                        if (tempName.equals(""shiftDirection"") &amp;&amp; tempVal.equals(""1"")) {                //setContentView(R.layout.image);                //TextView text_top = (TextView) findViewById(R.id.textView1);                //showImage = (ImageView) findViewById(R.id.imageView1);                            //text_bottom.setText(Info[1]);                showImage.setImageResource(R.drawable.shift_up);                Log.d(""TCP"", ""1------------&gt;"" + showImage);             } else if (tempName.equals(""shiftDirection"") &amp;&amp; tempVal.equals(""-1"")) {                                 //setContentView(R.layout.image);                //TextView text_bottom = (TextView) findViewById(R.id.textView2);                //Resources res = getResources();                //Drawable drawable = res.getDrawable(R.drawable.shift_down);                //showImage = (ImageView) findViewById(R.id.imageView1);                            //text_bottom.setText(Info[1]);                showImage.setImageResource(R.drawable.shift_down);                           } else if (tempName.equals(""recomGear"") &amp;&amp; tempVal != null) {                 Log.d(""TCP"", ""3------------&gt;"" + tempName + ""  "" + tempVal);                Integer msgValue = Integer.parseInt(recData[1]);                //Integer CurrentGear = (msgValue) - 1;                //Log.d(""TCP"",""in DA Images. Current gear: "" + CurrentGear);                //String Gear = Integer.toString(CurrentGear);                setContentView(R.layout.image);                TextView text_top = (TextView) findViewById(R.id.textView1);                TextView text_bottom = (TextView) findViewById(R.id.textView2);                showImage = (ImageView) findViewById(R.id.imageView1);                          showImage.setImageResource(R.drawable.shift_up);                text_bottom.setText(PresentGear);                text_top.setText(tempVal);             } else if (tempName.equals(""currGear"") &amp;&amp; tempVal != null) {                 Log.d(""TCP"", ""4------------&gt;"" + tempName + ""  "" + tempVal);                PresentGear = tempVal;                          //Log.d(""TCP"",""in DA Images. Present gear1: "" + PresentGear);                setContentView(R.layout.image);                TextView text_bottom = (TextView) findViewById(R.id.textView2);                text_bottom.setText(PresentGear);                                    } else if (tempName.equals(""shiftDirection"") &amp;&amp; tempVal.equals(""0"")) {                 Log.d(""TCP"", ""5------------&gt;"" + tempName + ""  "" + tempVal);                Log.d(""TCP"",""in DA Images. Present gear: "" + PresentGear);                setContentView(R.layout.image);                TextView text_bottom = (TextView) findViewById(R.id.textView2);                //TextView text_top = (TextView) findViewById(R.id.textView1);                //text_top.setText(""Go on"");                  text_bottom.setText(PresentGear);                        }                    }}</code></pre><p>Only the image corresponding to the first if case is displayed. The program control enters the second if loop but does not show the image there.</p><p>Interface:</p><pre><code>public interface TCPListener {    public String[] callCompleted(String msg);}</code></pre><p>Thread (TCP Client):</p><pre><code>public class TcpServiceHandler implements Runnable {       TCPListener _listener;                 private Activity _act;      public BufferedReader in;     public TcpServiceHandler(TCPListener listener, Activity act){             _listener = listener;           _act = act;       }             public synchronized void run() {           // TODO Auto-generated method stub                    //if(socket==null){                 try {                   //InetAddress serverAddr = InetAddress.getByName(""192.168.178.25"");                   Socket socket = new Socket(""192.168.62.23"", 1200, true);           //                   //while(true){                    try {                                                    in = new BufferedReader(new InputStreamReader(socket.getInputStream()));                           final int delay = 100;                         final Timer _timer = new Timer();                         _timer.scheduleAtFixedRate(new TimerTask() {                                                   public void run(){                                String str;                                try {                                    str = in.readLine();                                    _listener.callCompleted(str);                                } catch (IOException e) {                                    // TODO Auto-generated catch block                                    e.printStackTrace();                                }                            }                         }, 0, delay);                          //final String str = in.readLine();                           //this._act.runOnUiThread(new Runnable(){                           //public void run() {                          //   _listener.callCompleted(str);                             //  }                                                         //});                                                                    }                    catch(Exception e){                        e.printStackTrace();                    }                   //}               } catch (UnknownHostException e) {                   // TODO Auto-generated catch block                   e.printStackTrace();               } catch (IOException e) {                   // TODO Auto-generated catch block                   e.printStackTrace();               }       }     }</code></pre>","487851","","508666","","2012-01-29 13:13:23","2012-01-29 13:13:23","Android: Cannot show more than one image","<android><uiimage><image-manipulation>","1","0","","",""
"4865724","1","4865999","","2011-02-01 17:16:43","17","8313","<p>I am preparing my app to work smoothly with honeycomb. I have an small aesthetics question regarding with the android theme. </p><p>For honeycomb it is recommended that the following theme is used. </p><pre><code>android:theme=""@android:style/Theme.Holo.Light"" </code></pre><p>How can I make my app use another theme when it is used in a previous version? </p><p>Thanks in advance </p>","217527","","750987","","2011-05-29 06:47:26","2012-09-29 19:34:13","Change theme according to android version","<android><android-3.0-honeycomb>","1","0","14","",""
"4865763","1","4866012","","2011-02-01 17:20:16","4","1170","<p>I have code like this;</p><pre><code>   AnimationSet s1 = new AnimationSet(true);        TranslateAnimation tr1 = new TranslateAnimation(0, 0, -100, -200);         tr1.setDuration(6500);        s1.addAnimation(tr1); Paint paint = new Paint();    Bitmap b = Bitmap.createBitmap(90, 90, Bitmap.Config.ARGB_8888);    Canvas c1 = new Canvas(b);    c1.drawCircle(50, 100, 20, paint);AnimationSet s2 = new AnimationSet(true);        TranslateAnimation tr2 = new TranslateAnimation(0, 0, -140, -260);         tr2.setDuration(6500);        s1.addAnimation(tr2);    Canvas c2 = new Canvas(b);    c2.drawCircle(150, 140, 20, paint);</code></pre><p>How can I start animations s1 on canvas c1 and animation s2 on canvas c2? If I subsclass View class then I can call startAnimation method on the view class but how can I tie aboves canvases with above animations using View class? Sample code would be very helpful. I could not find a clean Android API that allows me to specify the target of animation. There should be an API that given a sequence of animations specify any target graphic object -- which in my case is the canvas object --  (not just the built-in graphic objects such as Button) on which the animation sequence is to be operated on. </p>","574122","","","","","2011-02-01 17:42:06","How to animation Canvas that is drawn with code in Android?","<android>","1","0","","",""
"4865887","1","4866240","","2011-02-01 17:30:26","0","669","<p>I want to set 2 tabs in above layout and 4 tab below layout as shown followis it possible in android.<img src=""http://i.stack.imgur.com/U9UOR.png"" alt=""enter image description here""></p>","484073","","","","","2011-02-01 18:34:20","Is it possible to set the position of a tab in android?","<android><android-tabhost><android-style-tabhost>","2","0","","",""
"4865902","1","4865962","","2011-02-01 17:32:12","1","1508","<p>Five months later, i am near to finish my Android app, but now i noticed that in the folder of resources, i have a lot of non used old XML's and a lot of non used old .png's on the sub-folders LAYOUT and DRAWABLE</p><p>Is there a way on eclipse to remove all these unused resources at once?</p>","479886","","244296","","2011-02-01 17:41:53","2011-02-01 17:41:53","How to remove with eclipse all the resources (images, mp3, xml) that are not been used on the app?","<android><eclipse>","1","0","","",""
"4865997","1","","","2011-02-01 17:40:53","0","3187","<p>My widget is just a battery monitor.But i want to open a full screen activity with more info.</p><p>here is the AndroidBatteryWidgetProvider.java:</p><pre><code>package cogiloo.widget;import android.app.PendingIntent;import android.appwidget.AppWidgetManager;import android.appwidget.AppWidgetProvider;import android.content.ComponentName;import android.content.Context;import android.content.Intent;import android.widget.RemoteViews;public class AndroidBatteryWidgetProvider extends AppWidgetProvider {    @Override    public void onUpdate(Context context, AppWidgetManager appWidgetManager,            int[] appWidgetIds) {        // TODO Auto-generated method stub        updateWidget(context);        context.startService(new Intent(context, MyBatteryReceiver.class));         }    public void updateWidget(Context context){        RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.androidbatterywidget_layout);        updateViews.setTextViewText(R.id.level, ""waiting!"");        ComponentName myComponentName = new ComponentName(context, AndroidBatteryWidgetProvider.class);        AppWidgetManager manager = AppWidgetManager.getInstance(context);        manager.updateAppWidget(myComponentName, updateViews);    }}////////////////////////////////////////////////////////////////////////////</code></pre><p>Here Battery.java (The Activity i want to open by clicking on my widget):</p><pre><code>package cogiloo.widget;import android.app.Activity;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.os.BatteryManager;import android.os.Bundle;import android.widget.TextView;public class Battery extends Activity {    private TextView batteryLevel, batteryVoltage, batteryTemperature,                 batteryTechnology, batteryStatus, batteryHealth;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        batteryLevel = (TextView)findViewById(R.id.batterylevel);        batteryVoltage = (TextView)findViewById(R.id.batteryvoltage);        batteryTemperature = (TextView)findViewById(R.id.batterytemperature);        batteryTechnology = (TextView)findViewById(R.id.batterytechology);        batteryStatus = (TextView)findViewById(R.id.batterystatus);        batteryHealth = (TextView)findViewById(R.id.batteryhealth);        this.registerReceiver(this.myBatteryReceiver,                 new IntentFilter(Intent.ACTION_BATTERY_CHANGED));    }    private BroadcastReceiver myBatteryReceiver     = new BroadcastReceiver(){        @Override        public void onReceive(Context arg0, Intent arg1) {            // TODO Auto-generated method stub            if (arg1.getAction().equals(Intent.ACTION_BATTERY_CHANGED)){                batteryLevel.setText(""Level: ""                        + String.valueOf(arg1.getIntExtra(""level"", 0)) + ""%"");                batteryVoltage.setText(""Voltage: ""                        + String.valueOf((float)arg1.getIntExtra(""voltage"", 0)/1000) + ""V"");                batteryTemperature.setText(""Temperature: ""                        + String.valueOf((float)arg1.getIntExtra(""temperature"", 0)/10) + ""c"");                batteryTechnology.setText(""Technology: "" + arg1.getStringExtra(""technology""));                int status = arg1.getIntExtra(""status"", BatteryManager.BATTERY_STATUS_UNKNOWN);                String strStatus;                if (status == BatteryManager.BATTERY_STATUS_CHARGING){                    strStatus = ""Charging"";                } else if (status == BatteryManager.BATTERY_STATUS_DISCHARGING){                    strStatus = ""Dis-charging"";                } else if (status == BatteryManager.BATTERY_STATUS_NOT_CHARGING){                    strStatus = ""Not charging"";                } else if (status == BatteryManager.BATTERY_STATUS_FULL){                    strStatus = ""Full"";                } else {                    strStatus = ""Unknown"";                }                batteryStatus.setText(""Status: "" + strStatus);                int health = arg1.getIntExtra(""health"", BatteryManager.BATTERY_HEALTH_UNKNOWN);                String strHealth;                if (health == BatteryManager.BATTERY_HEALTH_GOOD){                    strHealth = ""Good"";                } else if (health == BatteryManager.BATTERY_HEALTH_OVERHEAT){                    strHealth = ""Over Heat"";                } else if (health == BatteryManager.BATTERY_HEALTH_DEAD){                    strHealth = ""Dead"";                } else if (health == BatteryManager.BATTERY_HEALTH_OVER_VOLTAGE){                    strHealth = ""Over Voltage"";                } else if (health == BatteryManager.BATTERY_HEALTH_UNSPECIFIED_FAILURE){                    strHealth = ""Unspecified Failure"";                } else{                    strHealth = ""Unknown"";                }                batteryHealth.setText(""Health: "" + strHealth);            }        }    };}/////////////////////////////////////////////////////////////</code></pre><p>Here my BatteryReceiver:</p><pre><code>package cogiloo.widget;import android.app.Service;import android.appwidget.AppWidgetManager;import android.content.BroadcastReceiver;import android.content.ComponentName;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.os.BatteryManager;import android.os.IBinder;import android.widget.RemoteViews;public class MyBatteryReceiver extends Service {    private int batterylevel = 0;    private String batteryStatus ="""";    private BroadcastReceiver myReceiver = new BroadcastReceiver()    {        @Override        public void onReceive(Context context, Intent intent)        {            String action = intent.getAction();            if (action.equals(Intent.ACTION_BATTERY_CHANGED))            {                batterylevel = intent.getIntExtra(""level"", 0);                int status = intent.getIntExtra(""status"", BatteryManager.BATTERY_STATUS_UNKNOWN);                String strStatus;                if (status == BatteryManager.BATTERY_STATUS_CHARGING){                    batteryStatus = ""Charging"";                 } else if (status == BatteryManager.BATTERY_STATUS_DISCHARGING){                    batteryStatus = ""Dis-charging"";                } else if (status == BatteryManager.BATTERY_STATUS_NOT_CHARGING){                    batteryStatus = ""Not charging"";                } else if (status == BatteryManager.BATTERY_STATUS_FULL){                    batteryStatus = ""Full"";                } else {                    batteryStatus = """";                }                updateAppWidget(context);            }        }        public void updateAppWidget(Context context){            RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.androidbatterywidget_layout);            updateViews.setTextViewText(R.id.level,                     ""Cogiloo Battery\n\n"" +                    ""Bat. Status:\n"" +                    ""Level: "" + batterylevel + ""%\n"" +                    ""Status: "" + batteryStatus);            ComponentName myComponentName = new ComponentName(context, AndroidBatteryWidgetProvider.class);            AppWidgetManager manager = AppWidgetManager.getInstance(context);            manager.updateAppWidget(myComponentName, updateViews);        }    };    @Override    public IBinder onBind(Intent arg0) {        // TODO Auto-generated method stub        return null;    }    @Override    public void onCreate() {        // TODO Auto-generated method stub        super.onCreate();        IntentFilter intentFilter = new IntentFilter();        intentFilter.addAction(Intent.ACTION_BATTERY_CHANGED);        registerReceiver(myReceiver, intentFilter);    }    @Override    public void onDestroy() {        // TODO Auto-generated method stub        super.onDestroy();        unregisterReceiver(myReceiver);    }    //borrar esto y el activity Battery y en el maniffest    public void onClick() {        // TODO Auto-generated method stub        Intent i = new Intent(this, Battery.class);        startActivity(i);    }//hasta aqui}/////////////////////////////////////////////////////////</code></pre><p>The widget works well, but i couldn´t find any way to make is clickable!</p>","598831","","213269","","2011-02-01 17:43:10","2011-02-01 17:59:51","How to make my widget clickable?","<android><widget><clickable>","3","0","","",""
"4866080","1","","","2011-02-01 17:47:49","2","377","<p>Does Android browser support IDN websites?</p><p>Also is this support available for 3rd party applications? In other words can I connect to a webservice hosted on an IDN website from an Android App?</p><p>Thanks!</p>","598841","","","","","2011-02-01 19:02:10","IDN support in Android","<android><idn>","1","0","","2011-07-29 12:47:20",""
"4866149","1","","","2011-02-01 17:54:06","5","2640","<p>Bit of a confusing problem for me here:</p><p>I've got a home screen widget which, when clicked, starts my main app Activity with a few extras put in the intent:</p><pre><code>Intent start = new Intent(context, Main.class);start.putExtra(""action"", ""showXYZ"");start.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);context.startActivity(start);</code></pre><p>This all works fine, it starts my activity and my activity receives the extras as expected. It processes these extras and starts another activity.</p><p>Once a user has clicked the home screen widget and started the Main activity in this way, going into the app through the 'Recent applications' method (holding down the 'home' key) starts the Main activity with the extras - causing processing to happen which I don't want (and leading to the second activity to open, rather than for the Main activity to just be shown).</p><p>Is there any work-around for this? When starting the app from the 'recent applications' method, I want to simply start the Main activity without the last set of extras.</p><p>Many thanks for the help!r3mo</p><p>Note: I'm on android 1.5</p><p>EDIT:</p><p>Found a workaround here:<a href=""http://stackoverflow.com/questions/3140072/android-keeps-caching-my-intents-extras-how-to-declare-a-pending-intent-that-kee"">Android keeps caching my intents Extras, how to declare a pending intent that keeps fresh extras?</a></p><p>I'm going to timestamp the intent being set off by the widget, and check that the timestamp is recent in Main.java. If it is, i'll proceed with the processing. If not, i'll just show the Main.java activity.</p><p>Keen to hear if there are any official solutions to this.</p>","421636","","421636","","2011-02-01 19:24:28","2012-11-14 17:24:51","Android: Starting app from 'recent applications' starts it with the last set of extras used in an intent","<android><activity><android-intent><extras>","3","0","2","",""
"4866182","1","4868390","","2011-02-01 17:58:25","1","376","<p>i have some items on my map.</p><p>Some of them, friends, have to show some info on a dialog when the user press on them. And some of them, my current possition, have to show nothing.</p><p>i tryed removing all the code of the onTap function of ImtemizedOverlay for my position, but it doesnt works.... why? because if my position is near of a friend, if i try to press on the friend, doesn't happens nothing... ¿why? because my position onTap area it's mixed with the friend onTap area, and when i'm trying to press the onTap of the friend, it's pressing the empty onTap of my possition.</p><p>There is a way to solve this?</p><p>thanks</p>","479886","","","","","2011-02-01 21:54:33","How to inhabilite the onTap area of the item on a mapview?","<android><android-mapview><itemizedoverlay>","1","0","","",""
"4866191","1","4866366","","2011-02-01 17:59:29","0","755","<p>Based on this question: <a href=""http://stackoverflow.com/questions/550905/access-pictures-from-pictures-app-in-my-android-app"">Access pictures from Pictures app in my android app</a></p><p>You can access either the internal or external memory for images. But i'm wondering if there's a way to access just a collection of both internal and external, so I don't have to deal with the possibility that some phones have images on an SD card and some have them on internal memory. I'd rather not add another step to my UI.</p>","515502","","","","","2011-02-01 18:16:37","How to access all pictures on an Android phone?","<android><image><android-intent>","1","0","","",""
"4866238","1","4866293","","2011-02-01 18:04:13","0","127","<p>I have 2 tables with a few columns: </p><pre><code>parent (id, name, a) child (id, parent_id, name)</code></pre><p>I cannot manage to find the proper SQL query to delete all parents that have no children and a&lt;10. This is for SQLite shipped with Android 2.1. Anybody could help?</p>","490961","","573261","","2011-02-01 18:45:58","2011-02-01 18:45:58","Deleting rows that have no associated row in another table","<android><sql><sqlite3>","2","0","","",""
"4866245","1","4866276","","2011-02-01 18:04:45","0","911","<p>Hy!</p><p>I have a Treemap  and i want to set all strings in the map to the ListView</p><p>Code:</p><pre><code>TreeMap&lt;String, Integer&gt; map = json.getChannels(lv.getItemAtPosition(arg2).toString());ListView lv2 = new ListView(Channellist.this);Set st = map.keySet();lv2.setAdapter(new ArrayAdapter&lt;String&gt;(Channellist.this,android.R.layout.simple_expandable_list_item_1,st));</code></pre><p>My Problem is that the ArrayAdapter doesn't support a Set.</p><p>Are there any Solutions?</p><p>THX</p>","547995","","","","","2011-02-01 18:19:33","Treemap and List View","<java><android>","1","0","","",""
"4866305","1","12919066","","2011-02-01 18:09:22","3","6147","<p>Based on <a href=""http://www.helloandroid.com/files/xmaswidget/android_howto-hellowidget.pdf"" rel=""nofollow"">this</a> tutorial i created a widget that should show the time. The java way works, but the service way doesn't.</p><p>HelloWidget.java:</p><pre><code>public class HelloWidget extends AppWidgetProvider {@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {    Intent intent = new Intent(context, UpdateService.class);    context.startService(intent);}</code></pre><p>UpdateService.java:</p><pre><code>public final class UpdateService extends Service {@Overridepublic void onStart(Intent intent, int startId) {    RemoteViews updateViews = new RemoteViews(this.getPackageName(), R.layout.main);    Date date = new Date();    java.text.DateFormat format = SimpleDateFormat.getTimeInstance(            SimpleDateFormat.MEDIUM, Locale.getDefault());            updateViews.setTextViewText(R.id.widget_textview, ""Current Time "" + format.format(date));    ComponentName thisWidget = new ComponentName(this, HelloWidget.class);    AppWidgetManager manager = AppWidgetManager.getInstance(this);    manager.updateAppWidget(thisWidget, updateViews);}@Overridepublic IBinder onBind(Intent intent) {    // TODO Auto-generated method stub    return null;}</code></pre><p>}</p><p>The hello_widget_provider.xml has this row: android:updatePeriodMillis=""1000""</p><p>Problem: The widget shows the current time but it's not updating (the java-way is).</p><p>My main goal is to update the widget at e.g. 18:56 every day.Idk if this is the good way, but i tried to modify the onUpdate method like below, but it has a problem with ALARM_SERVICE: ALARM_SERVICE cannot be resolved to a variable</p><pre><code>public class HelloWidget extends AppWidgetProvider {@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {    AlarmManager alarmManager;    Intent intent = new Intent(context, AlarmReceiver.class);    PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0,      intent, PendingIntent.FLAG_UPDATE_CURRENT);    alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);    Calendar cal = Calendar.getInstance();    cal.set(Calendar.HOUR_OF_DAY, 18);    cal.set(Calendar.MINUTE, 56);    cal.set(Calendar.SECOND, 0);    cal.set(Calendar.MILLISECOND, 0);    alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), 86400, pendingIntent);</code></pre><p>}}</p><p>Any help is appreciated.</p>","571648","","","","","2012-10-16 16:16:20","Android Widget update","<android><widget>","2","0","3","",""
"4866336","1","","","2011-02-01 18:13:12","2","1334","<p>i just updated eclipse using Help > Check for Updates, but after i restarted eclipse, everything Android related in it just went missing, i can't create an Android project, can't find my AVD manager, etc. i tried reinstalling the ADT plugin using Help > install new software, but it says that the ADT was already installed.</p><p>i'm lost here, anybody can help? thank you so much</p>","598872","","","","","2014-03-03 05:16:31","android missing in eclipse","<android><eclipse>","3","4","","",""
"4866341","1","5144976","","2011-02-01 18:13:29","1","913","<p>I am trying to test the getType method of my contentprovider, particularly when an invalid uri is passed in. Currently I throw an IllegalArgumentException, but no exception is caught in my test.</p><p>Here is my test</p><pre><code>public void testIllegalArgumentExceptionThrownForInvalidUri() {    Uri badUri = Uri.parse(""content://"" + NoteProvider.AUTHORITY  + ""/somethingelse"");    try {        String type = mockResolver.getType(badUri);        fail(""No exception thrown"");    } catch (Exception ex) {        assertEquals(IllegalArgumentException.class, ex.getCause().getClass());    }}</code></pre><p>and the implementation of getType</p><pre><code>@Overridepublic String getType(Uri uri) {    switch (uriMatcher.match(uri)) {        case URI_NOTES:            return Notes.CONTENT_TYPE;        case URI_NOTE_ID:            return Notes.CONTENT_ITEM_TYPE;        default:            throw new IllegalArgumentException(""Unknown URI "" + uri);    }}</code></pre><p>I have stepped through it and can see that the exception is thrown, but in the test the fail() method is being called instead of the catch block.</p><p>Does the MockContentResolver swallow exceptions?</p><p><em>Disclaimer:</em> I am new to android and java although have been coding in C# for quite a few years now, so I may be doing something completely stupid. :D</p>","257975","","","","","2011-02-28 16:55:36","How to test exception thrown in Android ContentProvider","<java><android><android-contentprovider>","1","0","","",""
"4866421","1","5509306","","2011-02-01 18:23:16","0","514","<p>I need to add an OnLongClickListener to an EditText view.</p><p>I can get it to work alongside some default events, but I don't want the default events to trigger at all. As default behavior a dialog will appear to select Input Method.</p><p>I thought I had found a solution with setting the android:longClickable attribute in the view xml to false, but apparently that did nothing.</p>","558721","","558721","","2011-02-03 20:49:41","2011-04-01 04:55:04","EditText OnLongClickListener triggering multiple events","<android>","1","0","","",""
"4866464","1","4866536","","2011-02-01 18:28:44","0","683","<p>Hy!</p><p>I have a JSON Array with the tv channels and the lenght of the array is three, but after transmitting into a treemap the Value is only one.</p><p>Please Help</p><p>Code:</p><pre><code>try            {                JSONObject menuobj = this.getJSONObject(""responseData"");                Log.e(""XXX"", menuobj.toString());                JSONArray array = menuobj.getJSONArray(""countries"");                TreeMap&lt;String, Integer&gt; map = new TreeMap&lt;String, Integer&gt;();                for (int i = 0; i &lt; array.length(); i++)                {                    JSONObject obj = new JSONObject();                    obj = array.getJSONObject(i);                    if (obj.getString(""name"").equals(country))                    {                        Log.e(""XXX2"", obj.toString());                        JSONArray arr = obj.getJSONArray(""channels"");                        Log.e(""XXX3"", String.valueOf(arr.length()));                        for (int j = 0; j &lt; arr.length(); j++)                        {                            JSONObject obj2 = new JSONObject();                            obj2 = arr.getJSONObject(i);                            map.put(obj2.getString(""name""), obj2.getInt(""id""));                        }                        Log.e(""XXX4"", String.valueOf(map.size()));                        return map;                    }                }</code></pre><p>LogCat:</p><pre><code>02-01 18:24:20.277: ERROR/XXX(3784): {""countries"":[{""id"":""1"",""channels"":[{""id"":""3"",""name"":""ARD""},{""id"":""1"",""name"":""ORF 1""},{""id"":""2"",""name"":""ORF 2""}],""name"":""Ã?sterreich""},{""id"":""2"",""channels"":[{""id"":""3"",""name"":""ARD""}],""name"":""Deutschland""}]}02-01 18:24:20.288: ERROR/XXX2(3784): {""id"":""1"",""channels"":[{""id"":""3"",""name"":""ARD""},{""id"":""1"",""name"":""ORF 1""},{""id"":""2"",""name"":""ORF 2""}],""name"":""Ã?sterreich""}02-01 18:24:20.297: ERROR/XXX3(3784): 302-01 18:24:20.307: ERROR/XXX4(3784): 1</code></pre>","547995","","","","","2011-02-01 18:36:24","JSON Array Problem","<java><android><json>","3","0","","",""
"4866479","1","4866534","","2011-02-01 18:30:40","0","743","<p>I use lots of transparent buttons in my apps. The button graphical area is on the background. </p><blockquote>  <p>On iPhone there is </p>    <blockquote>    <p>""Shows Touch on Highlight""</p>  </blockquote></blockquote><p>which is really super to easily get a good touch effect without lots of work.</p><p>Is there something like this on Android? So far I found </p><blockquote>  <p>color scheme changes of the  Button-Text or the buttom area on  Android</p></blockquote><p>which in most cases doesn't really look good since the ""button"" area on the graphics is not really a rectangle. The ""Shows on highlight""-effect on iPhone seems to be the perfect solution. It would be nice to also have that on android. Thanks very much!</p>","387184","","","","","2011-02-01 18:36:13","Is there something like ""Shows Touch on Highlight"" (iPhone Interface Builder) on Android Platform?","<iphone><android><button>","1","0","","",""
"4866500","1","4867148","","2011-02-01 18:33:13","3","2661","<p>I'm using an AlertDialog with 2 buttons (one positive, one negative).I've set a handler for those buttons which doesn't mention dismiss. Indeed after clicking, I don't want the dialog to close. However, it seems that as soon as we click on a positive/negative button on an AlertDialog, it always get closed.</p><p>Is there a way to prevent the dialog from closing after clicking on any button ?</p><p>Thanks,</p><p>Vincent</p>","575481","","","","","2011-02-01 19:51:32","AlertDialog buttons always close the dialog once clicked","<android><button><alertdialog>","3","1","","",""
"4866635","1","4883514","","2011-02-01 18:45:13","2","2544","<ol><li><p>I have made a set of 3 images that will represent the move of a animal. Each image represents a frame and consists only in the animal with transparent background.</p></li><li><p>I have made a AnimationDrawable in code and created the animation:</p><pre>AnimationDrawable staticAnimation = new AnimationDrawable();staticAnimation.addFrame(ctx.getResources().getDrawable(""frame1""),150);staticAnimation.addFrame(ctx.getResources().getDrawable(""frame2""),150);staticAnimation.addFrame(ctx.getResources().getDrawable(""frame3""),150);</pre></li><li><p>I set the animation as a background for a Imageview and start it</p><pre>imgAnimal.setBackgroundDrawable(staticAnimation );staticAnimation.start()</pre></li></ol><p>Because the frames have different width (the drawing needs to recreate steps move) looks like the Imageview resizes the images in the animation. Better to say, if frame1 is bigger then frame2, frame 1 is displayed ok but frame 2 is stretched to be as big as frame1 was. Looks really awful. </p><p>Any suggestions on how to stop this behavior ? Thank you.</p>","379865","","418183","","2011-02-01 18:58:12","2011-02-03 07:38:21","Android Imageview with AnimationDrawable source changes size","<android><animation><drawable>","1","0","0","",""
"4866653","1","4866712","","2011-02-01 18:47:39","5","2150","<p>I'm trying to read in a .jpg using BitmapFactory. I want to get a RGB888 formatted bitmap, but I keep seeming to get RGB565. Is there anyway to change this?</p>","598922","","","","","2011-02-01 18:53:13","Read in JPG as RGB888 on Android","<android><bitmap><jpeg>","1","0","","",""
"4866656","1","","","2011-02-01 18:47:57","2","636","<p>Ok, so now after reading I do actually have a menu on long press like I wanted...the only problem is that it doesn't actually get the sound file and save it</p><p>I am wondering what did I do wrong now? Here is the code I used:</p><pre><code>Button SoundButton1 = (Button) findViewById(R.id.money);          registerForContextMenu(SoundButton1);    }     @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"");     }      @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){              Toast.makeText(this, ""Ringtone saved"", Toast.LENGTH_SHORT).show();          }          public void function2(int id){              Toast.makeText(this, ""Notification saved"", Toast.LENGTH_SHORT).show();          }</code></pre>","598925","","","","","2012-08-13 10:49:19","I need help making a longpress Context menu on android","<android><contextmenu>","2","0","","",""
"4866675","1","","","2011-02-01 18:49:31","1","333","<p>A fellow developer and I have started to question whether a broadcast announcement is guaranteed to be received by the appropriate broadcast receiver.</p><p>We have a broadcast receiver which receives messages that should be put on to the screen. Occasionally we notice that some messages never make it to the screen.</p><p>Even with the debugger, it has been hard to tell for certain if the receiver is not getting the broadcast or if it due to our own bugs that the broadcast is never sent.</p><p>So I wanted to ask generally if there are any known reasons why the broadcast receiver would not receive an announcement?</p>","340","","340","","2011-02-01 19:24:20","2011-02-01 19:24:20","Are broadcast receivers guaranteed to receive every broadcast announcement intended for them?","<android><broadcastreceiver>","1","0","","",""
"4866679","1","4867746","","2011-02-01 18:50:01","0","2427","<p>I am developing an application in which i need to download a file(.zip / .txt / .jpg etc) size- 5 to 50 MB.. Application based on Android 2.2.  </p><p>The user provides the <strong>URL</strong> and triggers the download but then the downloading process runs in background until complete.</p><p><strong>streaming</strong> should be used for downloading file.<br>I want to know how can this be done using <strong>HTTP connections</strong>.<br>what <strong>classes</strong> can be used for this?<br>Does android 2.2 provides an API for this?  </p><p>Any kind of help is appreciated....</p>","598927","","944657","","2012-11-19 02:57:46","2012-11-19 02:57:46","Download data file 5-40 MB in android 2.2 from URL. Which classes to use for development?","<android><streaming><file-download><android-2.2-froyo><progressive-download>","1","0","1","",""
"4866698","1","","","2011-02-01 18:51:56","0","715","<p>I've encountered my first SIGSEGV on my Android app project and I'm trying to get the reason behind this error.</p><p>My project is a webapp packaged using PhoneGap and works fine on Android 2.2. On 2.1, it launches, passes the splashscreen, displays part of the first screen (toolbar, fields, but no images) and crashes.</p><p>I tried passing the logcat addresses entries to stack.py and parse_stack, but with no success. I must be doing something wrong...</p><p><strong>stack.py</strong></p><pre><code>macbookair:Dropbox alexandre$ python stack.py crash.logmake: build/core/envsetup.mk: No such file or directorymake: *** No rule to make target `build/core/envsetup.mk'.  Stop.Searching for native crashes in crash.logReading symbols from pid: 249, tid: 255  &gt;&gt;&gt; com.xxxxxx.xxxxx &lt;&lt;&lt;signal 11 (SIGSEGV), fault addr 00000000  r0 00000000  r1 00000001  r2 00000000  r3 00000000  r4 0056c0b8  r5 4693f90c  r6 ac1435a4  r7 0056c140  r8 00000001  r9 0056c140  10 00000001  fp 4693f970  ip 00000001  sp 4693f8d8  lr 00000001  pc ac03f030sh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundsh: arm-eabi-addr2line: command not foundStack Trace:  ADDR      FUNCTION   FILE:LINE  0003f030  (unknown)  (unknown)  0003e188  (unknown)  (unknown)  00043b78  (unknown)  (unknown)  00043388  (unknown)  (unknown)  000433fc  (unknown)  (unknown)  00086c88  (unknown)  (unknown)  0004c54c  (unknown)  (unknown)  0011f046  (unknown)  (unknown)  00113c6e  (unknown)  (unknown)  00113f6e  (unknown)  (unknown)  00113f80  (unknown)  (unknown)  0011ec68  (unknown)  (unknown)  0011a246  (unknown)  (unknown)  00118564  (unknown)  (unknown)  00155612  (unknown)  (unknown)  0014ff28  (unknown)  (unknown)  0014ff7c  (unknown)  (unknown)  001503d2  (unknown)  (unknown)  00148536  (unknown)  (unknown)  00145844  (unknown)  (unknown)  00184854  (unknown)  (unknown)  00138b26  (unknown)  (unknown)  0013a67a  (unknown)  (unknown)  0018be6e  (unknown)  (unknown)  00167686  (unknown)  (unknown)  001454b6  (unknown)  (unknown)  001485b4  (unknown)  (unknown)  00145844  (unknown)  (unknown)  00169354  (unknown)  (unknown)  001453ee  (unknown)  (unknown)  001454c4  (unknown)  (unknown)  001485b4  (unknown)  (unknown)Stack Data:  ADDR      VALUE     FILE:LINE/FUNCTION  4693f898  0056c0b8    4693f89c  0256c0b8    4693f8a0  4693f970    4693f8a4  00000001    4693f8a8  4693f970    4693f8ac  ac04bfd8  (unknown)                      (unknown)  4693f8b0  00000000    4693f8b4  00000001    4693f8b8  4693f970    4693f8bc  ac04c2cc  (unknown)                      (unknown)  4693f8c0  0056c0b8    4693f8c4  4693f90c    4693f8c8  ac1435a4  (unknown)                      (unknown)  4693f8cc  00000000    4693f8d0  df002777    4693f8d4  e3a070ad    4693f8d8  00000000    4693f8dc  00000000    4693f8e0  00000000    4693f8e4  3f800000    4693f8e8  00000000    4693f8ec  004dc590    4693f8f0  00000000    4693f8f4  afe157e5  (unknown)                      (unknown)  4693f8f8  4693fc14    4693f8fc  afe1697d  (unknown)                      (unknown)  4693f900  00545a2a    4693f904  00463473    4693f908  00000002    4693f90c  4693f94c    4693f910  00000002    4693f914  00000000    4693f918  00000002    4693f91c  00000000    4693f920  00000002    4693f924  41900000  (unknown)                      (unknown)  4693f928  00000000    4693f92c  00000001    4693f930  003b2478    4693f934  00000000    4693f938  00000000    4693f93c  00000002    4693f940  afe3bb74    4693f944  4693f970    4693f948  004dc590    4693f94c  0038a81c    4693f950  004890c8    4693f954  00000003    4693f958  42f2ce50    4693f95c  42f2ce38    4693f960  0011d058    4693f964  ac03e18c  (unknown)                      (unknown)  4693f968  00000001    4693f96c  00000000    4693f970  00000000    4693f974  00000000    4693f978  00000000    4693f97c  00000000    4693f980  00000000    4693f984  00000000    4693f988  00000001    4693f98c  00000001    4693f990  00000001    4693f994  00010003    4693f998  00000001    4693f99c  0038a7f8    4693f9a0  0038a81c    4693f9a4  00000001    4693f9a8  46940d80    4693f9ac  ac043b7c  (unknown)                      (unknown)</code></pre><p><strong>parse_stack</strong></p><pre><code>macbookair:Dropbox alexandre$ python parse_stack.py crash.logTraceback (most recent call last):  File ""parse_stack.py"", line 41, in &lt;module&gt;    asm, stack = sys.argv[1],sys.argv[2]IndexError: list index out of range</code></pre><p>I'm running this from a specific folder on my laptop (Dropbox in this case), should I be running this in another folder, perhaps the Android SDK?</p><p>Thanks!</p>","528096","","","","","2011-02-22 21:31:38","Can't extract stack trace from logcat","<android><android-emulator><stack><sigsegv>","1","3","","",""
"4866705","1","","","2011-02-01 18:52:53","5","1079","<p>In my application there are 14 activities. Out of that 9 activity contains custom title bar and tab pane. so here I need to write this common code at one place instead of redundant code in each activity that contain custom title bar and tab pane code (i.e layout and it's activity specific code)</p><p>What are the possible ways to do this?</p>","181135","","238688","","2011-02-01 19:03:11","2012-02-23 14:11:57","How do I create common code for parts of Android activities?","<android><activity>","2","0","2","",""
"4866746","1","4866895","","2011-02-01 18:56:00","6","24425","<p>I have a file in my assets folder... how do I read it?</p><p>Now I'm trying:</p><pre><code>      public static String readFileAsString(String filePath)        throws java.io.IOException{            StringBuffer fileData = new StringBuffer(1000);            BufferedReader reader = new BufferedReader(                    new FileReader(filePath));            char[] buf = new char[1024];            int numRead=0;            while((numRead=reader.read(buf)) != -1){                String readData = String.valueOf(buf, 0, numRead);                fileData.append(readData);                buf = new char[1024];            }            reader.close();            return fileData.toString();        }</code></pre><p>But it cast a null pointer exception...</p><p>the file is called ""origin"" and it is in folder assets </p><p>I tried to cast it with:</p><pre><code>readFileAsString(""file:///android_asset/origin"");</code></pre><p>and</p><pre><code>readFileAsString(""asset/origin"");``</code></pre><p>but both failed... any advice?</p>","269931","","56285","","2013-12-29 15:28:21","2013-12-29 15:28:21","How to read a text file from ""assets"" directory as a string?","<java><android><file-io><android-assets>","5","0","3","",""
"4866785","1","4873954","","2011-02-01 18:58:35","0","541","<p>hi againsearch around but cant find a way to start developing thisWanted to send an image to my phone (ftp) and when the image hasarrived and saved to my CD card i would like to have the phone ringing likeit was someone calling. When i answer the image will fill the screen.</p><p>What i have done so fare is is that the image is received and saved to CD card.Only the Phone call thing missing If you can give me a hint about what I need to do im happyI know I can start a phone call activity with this code</p><pre><code>    Intent callIntent = new Intent(Intent.ACTION_CALL);    callIntent.setData(Uri.parse(""tel:123456789""));    startActivity(callIntent);</code></pre><p>Maybe it can be modified to create a dummy call?</p>","538837","","538837","","2011-02-02 08:30:49","2011-02-02 11:34:54","android howto create an (incoming phone call) but not for talking","<android>","1","0","","",""
"4866846","1","4867810","","2011-02-01 19:05:03","17","30876","<p>I have a <code>ListActivity</code> which launches another <code>Activity</code> based on the list selection.  This second <code>Activity</code> needs to load a fair bit of data from the internet and as such there is a noticeable delay between when the user clicks on an item and when the <code>Activity</code> displays.</p><p>This is a problem because I currently have no way to indicate to the user that their click is being processed (even just changing the colour of the selected list item would be sufficient but I can't find a good way to do that).  Ideally I'd be able to display an indeterminate <code>ProgressDialog</code> while the second <code>Activity</code> is loading.</p><p>I've tried a few different approaches for this but nothing seems to work as desired.  </p><hr><p>I've tried the following:</p><ul><li>Retrieving the serializable data (not all of it but some part) in an <code>AsyncTask</code> in the first <code>Activity</code> and passing it as an extra to the second. This didn't really work well as a <code>ProgressDialog</code> I created in <code>onPreExecute()</code> didn't display immediately (it seems delayed by the processing done in <code>doInBackground()</code> for some reason.)</li></ul><p>Here is the code for that:</p><pre><code>AsyncTask&lt;String, Void, String&gt; read = new AsyncTask&lt;String, Void, String&gt;() {    Dialog progress;    @Override    protected void onPreExecute() {        progress = ProgressDialog.show(SearchActivity.this,                 ""Loading data"", ""Please wait..."");        super.onPreExecute();    }    @Override    protected String doInBackground(String... params) {        DatasetReader reader = new DatasetReader();        reader.setFundID(params[0]);        reader.addDatsets(FundProfile.datasets);        reader.populate();        return reader.toString();    }    @Override    protected void onPostExecute(String result) {        super.onPostExecute(result);        progress.dismiss();    }};read.execute(selectedItem.getUniqueID());try {    action = new Intent(SearchActivity.this, FundProfile.class);    action.putExtra(""data"", read.get());} catch(Exception ex) {    ex.printStackTrace();}</code></pre><ul><li><p>In the second Activity's <code>onCreate()</code> method (this does not work at all):</p><pre>requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);setProgressBarVisibility(true);</pre></li></ul><p>Here is the <code>onCreate()</code> method for the second approach:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    this.setTitleColor(Color.WHITE);    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);    setProgressBarVisibility(true);    try {        setContentView(R.layout.fund_profile);        // init some data        setProgressBarVisibility(false);    } catch(Exception ex) {        FundProfile.this.finish();    }}</code></pre>","534173","","418183","","2011-02-01 21:31:14","2012-11-07 15:17:13","Show a progress bar when an Activity is loading","<android><android-asynctask><progressdialog>","3","3","6","",""
"4866928","1","4867893","","2011-02-01 19:13:53","1","1237","<p>I'd like to know what is the exact range of the radius in the shadowRadius property. In the documentation, they only say this value must be a float. That's fine but what is the range for the radius in Android? I mean, how do I set a 120º radius for instance?</p><p>Same problem for the visibility for TextView. In the documentation, they say I have to set a #aarrggbb hexadecimal color code. That's fine but again, what is the range for the visibility in Android? The value 100 (= 64 in hexadecimal) doesn't correspond at all to a maximum opacity. So what are the minimum / maximum opacities in Android?</p><p>Thanks in advance!</p>","544659","","","","","2011-02-01 21:02:34","Ranges for radius in shadowRadius and visiblity in TextView","<android><transparency><textview><opacity><radius>","1","1","","",""
"4867016","1","4867083","","2011-02-01 19:22:55","6","2858","<p>I have the following fields</p><pre>1> WorkName - Varchar2> TimeStap </pre><p>I wanted to create a Table with the above fields.</p><ol><li><p>What will be the TimeStamp datatype </p></li><li><p>How can I insert timestamp values to the table.</p></li><li><p>What will the timestamp value while inserting data or how to fetch the timestamp.</p></li></ol><p>I have worked on SQLite but don't have any experience on adding TimeStamp as a field to the table &amp; adding values to that. </p><p>What kind of <code>CREATE</code> &amp; <code>INSERT</code> statements should I use?</p>","443141","","23199","","2011-02-01 19:26:25","2011-02-01 19:29:52","Insert TimeStamp in SQLite for Android","<android><sqlite>","1","1","2","",""
"4867106","1","5059055","","2011-02-01 19:33:02","3","5216","<p>I am using resolveActivityInfo to determine if my app was set as a home launcher:</p><pre><code>    PackageManager pm = getPackageManager();    Intent intent = new Intent(Intent.ACTION_MAIN, null);    intent.addCategory(Intent.CATEGORY_HOME);       userHomePackage = intent.resolveActivityInfo(pm, 0).packageName;    userHomeActivityClass = intent.resolveActivityInfo(pm, 0).name;     currentHomeLauncherName = intent.resolveActivityInfo(pm, 0).loadLabel(pm).toString();</code></pre><p>it works great on emulator and three android devices I have on hands.</p><p>Recently I started getting error reports from my users and error log shows that resolveActivityInfo is failing. This happens only on a few phones running on android 2.1 update 1 as I can see. I've received already many positive comments on my app and a few negative because of this issue.</p><p>Any advice what could be wrong? </p><pre><code>java.lang.NullPointerException    at android.os.Parcel.readException(Parcel.java:1224)    at android.os.Parcel.readException(Parcel.java:1206)    at android.content.pm.IPackageManager$Stub$Proxy.resolveIntent(IPackageManager.java:1418)    at android.app.ApplicationContext$ApplicationPackageManager.resolveActivity(ApplicationContext.java:2046)    at android.content.Intent.resolveActivityInfo(Intent.java:3790)    at com.myapp.myappname.Launcher.setAsHomeApplicationBeforeFroyo(Launcher.java:336)</code></pre><p>OR</p><pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp.myappname/com.myapp.myappname.Launcher}: java.lang.NullPointerException    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2497)    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2513)    at android.app.ActivityThread.access$2200(ActivityThread.java:119)    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1864)    at android.os.Handler.dispatchMessage(Handler.java:99)    at android.os.Looper.loop(Looper.java:123)    at android.app.ActivityThread.main(ActivityThread.java:4370)    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:862)    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)    at dalvik.system.NativeStart.main(Native Method)Caused by: java.lang.NullPointerException    at android.os.Parcel.readException(Parcel.java:1224)    at android.os.Parcel.readException(Parcel.java:1206)    at android.content.pm.IPackageManager$Stub$Proxy.resolveIntent(IPackageManager.java:1418)    at android.app.ApplicationContext$ApplicationPackageManager.resolveActivity(ApplicationContext.java:2046)    at android.content.Intent.resolveActivityInfo(Intent.java:3790)    at com.myapp.myappname.Launcher.showHomeChooserDialog(Launcher.java:141)    at com.myapp.myappname.Launcher.showNextActivity(Launcher.java:122)    at com.myapp.myappname.Launcher.onCreate(Launcher.java:59)    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2460)    ... 11 morejava.lang.NullPointerException    at android.os.Parcel.readException(Parcel.java:1224)    at android.os.Parcel.readException(Parcel.java:1206)    at android.content.pm.IPackageManager$Stub$Proxy.resolveIntent(IPackageManager.java:1418)    at android.app.ApplicationContext$ApplicationPackageManager.resolveActivity(ApplicationContext.java:2046)    at android.content.Intent.resolveActivityInfo(Intent.java:3790)    at com.myapp.myappname.Launcher.showHomeChooserDialog(Launcher.java:141)</code></pre>","473725","","473725","","2011-02-01 20:43:17","2011-02-20 18:32:07","issue with resolving activity for an intent - resolveActivityInfo()","<android><activity><android-intent><resolve>","2","2","1","",""
"4867128","1","4878604","","2011-02-01 19:34:52","0","1050","<p>I'm fairly new to Android programming, although not programming in other languages (if that makes sense).</p><p>I've got a string array like this:</p><pre><code>static final String[] fruit = new String[] {""carrot"", ""banana"", ""apple""};</code></pre><p>I want to display this in a list view, that is easily scrolled through using fast scroll and is in alphabetical order. I have found a few partial solutions on stack overflow, but I can't get them to work with a String[] (they want arrays of objects) and I also want to be able to have an image of the fruit before the text (like in the android contacts list, there is an image of the person, then their name).</p><p>Many thanks,Todd</p>","567390","","","","","2011-02-02 19:30:59","Android list view: how to use fast scrolling and alphabetical ordering","<java><android><listview>","2","1","","",""
"4867285","1","4867356","","2011-02-01 19:52:23","1","301","<p>Hy!</p><p>I just added a new Class, a new Activitity in the Manifest and add the startActivityforResult in the Main Class (start Class). Suddenly the apps starts with the wrong Activity</p><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=""android.skiptvad""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".Main""                  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="".Login""/&gt;        &lt;activity android:name="".NewAccount""/&gt;        &lt;activity android:name="".Channellist""/&gt;        &lt;activity android:name="".MainScreen""/&gt;    &lt;/application&gt;    &lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;    &lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;/manifest&gt; </code></pre><p>Main Class:</p><pre><code>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);       startActivityForResult(new Intent(Main.this, Login.class), 1);       startActivityForResult(new Intent(Main.this, Channellist.class), 1);       startActivityForResult(new Intent(Main.this, MainScreen.class), 1);       //finish();    }}</code></pre><p>The app starts with the main screen instead of the login.</p><p>Please help</p>","547995","","","","","2011-02-01 19:58:49","App starts with the wrong page suddenly","<android>","2","0","","",""
"4867286","1","6302994","","2011-02-01 19:52:28","10","3971","<p>I need to set/change the phone number of the emulator for debugging purposes... Any help would be appreciated...</p><p>Thanks :)</p>","592202","","","","","2013-04-23 17:30:45","Change phone number in emulator - Android development","<android><android-emulator>","3","0","2","",""
"4867317","1","4867363","","2011-02-01 19:55:18","3","3090","<p>My toast doesn't show up until after the file has completed downloading (I commented the download function). Any ideas why?</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ImageView main_image_view = (ImageView)this.findViewById(R.id.main_image_view);    TextView text_view = (TextView)this.findViewById(R.id.main_text_view);    Context context = getApplicationContext();    CharSequence text = ""File Not Found. Downloading... Please be patient, it's a large file!"";    int duration = Toast.LENGTH_SHORT;    Toast toast = Toast.makeText(context, text, duration);    toast.show();    // This function fetches a file from a URL.    brain = get_frame_fl(file_name, mActive_slice);    brain_slice = Bitmap.createBitmap(brain_pixels, frame_width, frame_height, Bitmap.Config.ARGB_8888);    // display    main_image_view.setImageBitmap(brain_slice);}</code></pre>","387064","","","","","2011-02-01 20:00:02","Why doesn't my Toast show up?","<java><android><toast>","1","0","0","",""
"4867334","1","","","2011-02-01 19:56:44","12","2407","<p>Which edition of Java is being used in Android J2ME or Java SE?</p>","598991","","244296","","2011-02-02 19:55:27","2011-02-02 19:55:27","Which edition of Java is being used in Android J2ME or Java SE?","<android>","3","0","2","",""
"4867337","1","","","2011-02-01 19:56:53","11","895","<p>My application displays a <code>Toast</code> when a certain action happens. If two of these actions happen in close proximity, however, I would like to forgo displaying the first <code>Toast</code>, instead displaying only the second one. I thought <code>Toast.cancel()</code> would do the trick, but what it does is simply hide the first toast; the second one only displays after the first one would have finished displaying anyway.</p><p>Example code:</p><pre><code>Toast toast1 = Toast.makeText(parentActivity, ""Test1"", Toast.LENGTH_SHORT);Toast toast2 = Toast.makeText(parentActivity, ""Test2"", Toast.LENGTH_SHORT);toast1.show();toast2.show();toast1.cancel();</code></pre><p>The second <code>Toast</code> shows up only after waiting a short while (the length of the short duration). This in fact happens even if I call <code>toast2.cancel()</code>.</p>","226008","","230513","","2011-07-13 14:58:59","2013-09-03 16:18:38","Cancel a toast on Android before it appears","<android><toast>","2","0","1","",""
"4867338","1","7320604","","2011-02-01 19:57:00","55","23115","<p>My application shows some notifications, and depending on user preferences it might use a custom layout in a notification. It works well, but there is a small problem -- <strong>text colors</strong>. Stock Android and almost all manufacturer skins use black text against a light background for notification text, but Samsung doesn't: their notification pulldown has a dark background and the text in the default notification layout is white.</p><p>So this causes a problem: the notifications that don't use any fancy layouts show up fine, but the one that uses a custom layout is hard to read because the text is black instead of the default white. Even the <a href=""http://developer.android.com/guide/topics/ui/notifiers/notifications.html#CustomNotification"" rel=""nofollow"">official documentation</a> just sets a <code>#000</code> color for a <code>TextView</code>, so I couldn't find any pointers there.</p><p>A user was kind enough to take a screenshot of the problem:</p><p><img src=""http://i.stack.imgur.com/znPWN.jpg"" alt=""Screenshot"" /></p><p>So <strong>how do I use the default notification text color from the device</strong> in my layouts? I'd rather not start dynamically altering the text color based on phone model, since that requires a lot of updating and people with custom ROM's might still get the problem, depending on the skin they're using.</p>","235960","","1503078","","2013-11-17 22:33:14","2013-11-17 22:33:14","Custom notification layouts and text colors","<android><notifications><android-notifications>","7","2","43","",""
"4867379","1","8896049","","2011-02-01 20:01:26","44","48733","<p>While testing my apps, I use emulators and my own phone to see if everything is working ok.  My apps are also writing data to shared preferences and a text file.</p><p>I can pull the data from my emulators through the <code>DDMS</code> in eclipse so I can read the data files on my computer, but when I try to open those folders through the <code>DDMS</code> on my phone, nothing happends.  I click the data folder and nothing happends.</p><p>My phone is rooted.  Is there any way I could pull the files from my phone?  I know that Android keeps these folders private, but there must be a way.  The emulator is just <em>way</em> too slow.</p>","239932","","239932","","2014-03-24 15:14:33","2014-03-24 15:14:33","Android eclipse DDMS - Can't access data/data/ on phone to pull files","<android><eclipse><data>","11","2","32","",""
"4867425","1","5350806","","2011-02-01 20:07:21","2","799","<p>I have a problem with AdView. When I start activity with this view and it looks like something goes in eternal loop and I see a lot of log appearence:</p><pre><code>02-01 21:57:34.437: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:34.512: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:34.512: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:34.587: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:34.587: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:34.657: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:34.657: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:34.727: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:34.727: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:34.797: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:34.802: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:34.872: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:34.887: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:35.002: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:35.092: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:35.092: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:35.172: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:35.172: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:35.267: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:35.267: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.02-01 21:57:35.527: WARN/AdMobSDK(29740): Ignoring requestFreshAd() because we are requesting an ad right now already.</code></pre><p>Many many many times</p><p>Here is may layout for this one:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""                xmlns:sac=""http://schemas.android.com/apk/res/com.myapp""                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=""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"" /&gt;    &lt;Button android:layout_width=""wrap_content"" android:id=""@+id/bFlashLight""            android:lines=""1"" android:ellipsize=""end"" android:textSize=""18sp""            android:layout_height=""wrap_content"" android:padding=""10dp""            android:textColor=""#000"" android:drawablePadding=""10dp""            android:gravity=""center"" android:layout_alignBottom=""@id/mapview""            android:text=""@string/open_flashlight"" /&gt;    &lt;ZoomControls android:id=""@+id/zoomcontrols""                  android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                  android:layout_toRightOf=""@id/bFlashLight"" android:layout_alignBottom=""@id/mapview"" /&gt;    &lt;com.admob.android.ads.AdView android:id=""@+id/ad""                                  android:layout_width=""fill_parent"" android:layout_height=""wrap_content""                                  sac:backgroundColor=""#000000"" sac:primaryTextColor=""#FFFFFF""                                  sac:secondaryTextColor=""#CCCCCC"" android:layout_alignParentTop=""true"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Is there a way to disable auto invoke of requestFreshAd() method?</p>","390323","","390323","","2011-02-01 21:22:26","2011-03-18 10:40:36","Android + AdMob problem","<android><admob>","2","2","2","",""
"4867472","1","4867604","","2011-02-01 20:12:28","1","2153","<p>I just want to restore the saved preferences, but an error occurs.</p><p>Login Class:</p><pre><code>SharedPreferences.Editor editor = settings.edit();                        editor.putString(""session_id"", session);                        editor.commit();</code></pre><p>List Class:</p><pre><code>editor.putInt(""channel_id"", map.get(lv2.getItemAtPosition(arg2).toString()));editor.commit();</code></pre><p>Main Class:</p><pre><code>public class MainScreen extends Activity{    @Override    protected void onCreate(Bundle savedInstanceState) {        // TODO Auto-generated method stub        super.onCreate(savedInstanceState);        TextView tv = (TextView) findViewById(R.id.mainscreen);        final SharedPreferences settings = getSharedPreferences(""pref"", 0);        String tmp= settings.getString(""session_id"", ""Error"") + ""ID: "" +String.valueOf(settings.getInt(""channel_id"", -1));        tv.setText(tmp);        setContentView(R.layout.mainscreen);    }}</code></pre><p>LogCat:</p><pre><code>02-01 21:06:56.621: ERROR/ApplicationContext(25035): Couldn't rename file /dbdata/databases/android.skiptvad/shared_prefs/pref.xml to backup file /dbdata/databases/android.skiptvad/shared_prefs/pref.xml.bak02-01 21:06:56.727: ERROR/AndroidRuntime(25035): FATAL EXCEPTION: main02-01 21:06:56.727: ERROR/AndroidRuntime(25035): java.lang.RuntimeException: Unable to start activity ComponentInfo{android.skiptvad/android.skiptvad.MainScreen}: java.lang.NullPointerException02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at android.os.Handler.dispatchMessage(Handler.java:99)02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at android.os.Looper.loop(Looper.java:123)02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at java.lang.reflect.Method.invokeNative(Native Method)02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at java.lang.reflect.Method.invoke(Method.java:521)02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)02-01 21:06:56.727: ERROR/AndroidRuntime(25035):     at dalvik.system.NativeStart.main(Native Method)02-01 21:06:56.727: ERROR/AndroidRuntime(25035): Caused by: java.lang.NullPointerException</code></pre>","547995","","845334","","2013-09-09 03:15:27","2013-09-09 03:15:27","Cannot rename file in Shared Preferences","<android>","2","2","","",""
"4867506","1","4867742","","2011-02-01 20:17:01","1","1232","<p>I have a basic page set up online on my server which processes Post Data from like a html form. The page returns xml data if the post requirements are met (correct username etc.) else, a 0.</p><p>It works perfectly in a browser. </p><p>I am using httppost in android to post to this page, however, my try catch block is going into IOexception. First off, I don't know how to actually view what is the problem since I don't know where stacktrace prints to. </p><p>The web page code just gets post data <code>$password = md5($_POST['password']);$user = $_POST[""username""];</code> simple enough.</p><p>Is there anything I am supposed to be doing server side maybe?</p>","599026","","599026","","2011-02-01 20:41:55","2012-03-23 01:33:42","Android IOException in HTTPPost","<java><android><http-post>","2","3","","",""
"4867551","1","","","2011-02-01 20:22:35","0","2059","<p>I'm developing an ordering feature to put on branded mobile apps for restaurants. Here are my goals... </p><ul><li><p>Orders:  Go straight into the restaurant's POS system    Option to Save ""favorite"" orders</p></li><li><p>Orderer Alert:  Automatic message alerting orderer that all is well</p></li><li><p>Restaurant Alert:  Notifies restaurant that an app order has been placed</p></li><li><p>Payment: In app payment. Completed transaction or customer signs when he gets there.     I'd like to store the CC info on the app if possible so that only the users password gives access to the info.  TabbedOut is doing something similar.  </p></li></ul><p>How audacious are these goals?  There isn't a lot of Mobile app-Restaurant POS integration going on. Is it legal, without becoming a ""licensing partner""?  </p><p>If you're feel like you are the best person to help me accomplish these things, leave some contact info and I will get back to you. </p><p>Thanks for the help.  If you have any rec's, let me know. </p><p>Eric  </p>","599032","","213269","","2011-02-01 20:26:25","2014-02-11 18:27:06","Restaurant POS integration and Payment from a Mobile App","<iphone><android><ordering><point-of-sale>","3","4","2","2014-02-15 11:10:47",""
"4867582","1","","","2011-02-01 20:25:33","1","1108","<p>I've implemented a class that implements Serializable object.</p><pre><code>public class SaveMe implements Serializable {    private static final long serialVersionUID = 1L;    private String someValue1;    private String someValue2;} </code></pre><p>But whenever I try to use it in a Bundle, I get this exception:</p><pre><code> Parcelable encounteredClassNotFoundException reading a Serializable object     at android.os.Parcel.readSerializable(Parcel.java:1951)     at android.os.Parcel.readValue(Parcel.java:1822)     at android.os.Parcel.readMapInternal(Parcel.java:2008)     at android.os.Bundle.unparcel(Bundle.java:208)     at android.os.Bundle.getString(Bundle.java:1034)</code></pre><p>What am I doing wrong?</p><p><strong>Edit</strong></p><p>Hm... Similar issue when using Parcelable:</p><pre><code>Class not found when unmarshalling</code></pre>","99024","","99024","","2011-02-01 21:08:31","2013-12-09 04:49:58","Parcelable encounteredClassNotFoundException reading a Serializable object","<java><android><serializable><parcelable>","1","3","1","",""
"4867732","1","","","2011-02-01 20:41:27","1","306","<p>Traceview shows that updatePhysics() is being called every 10ms or so and it takes about 8ms to run. The methods that I call inside updatePhysics are only running once every 5 or 6 times updatePhysics() runs, however. Is this simply a bug of Traceview, or what is going on? My game is stuttering a fair amount, so I am trying to figure out what is causing it.</p><p>Traceview is generally showing that a lot of my methods go several hundred milliseconds without being called once, even though there appears to be no reason they shouldnt be called. Ideas?</p><p>Run Method:</p><pre><code>        while (mRun)         {            Thread.currentThread().setPriority(Thread.MAX_PRIORITY);            Canvas c = null;            try             {                c = mSurfaceHolder.lockCanvas(null);//null                {                    time2 = System.nanoTime()/100000; // Get current time                    float delta = (time2 - time1)/1000f;                    if (mMode == STATE_RUNNING) updatePhysics(delta);                    else updateMenus();                    doDraw(c);                    time1 = time2;                }            } 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>Update Physics:</p><pre><code>    private void updatePhysics(float delta)    {        updateScore(delta);        updateDifficulty();    }</code></pre><p>EDIT: As you can see here, updateDifficulty is often not called for several hundred ms EVEN THOUGH updatePhysics is being called regularly... It makes no sense. <a href=""http://i.stack.imgur.com/BU6Fv.png"" rel=""nofollow"">Screenshot of traceview</a></p>","549859","","549859","","2011-02-01 21:10:43","2011-05-19 22:56:33","Traceview shows some methods arent being called for 200ms or more","<java><android>","1","7","","",""
"4867734","1","4867767","","2011-02-01 20:41:53","1","181","<p>Can I add data 2 from different databases into each row of a ListView in Android?</p><p>I have a vendor app and I want to add data from one standard items list table and one daily table to the list view.</p>","599044","","","","","2011-02-01 20:53:59","Adding from 2 databases to a listView row","<android><sqlite><listview>","2","0","","",""
"4867823","1","4867854","","2011-02-01 20:53:32","1","722","<p>I'm thinking about writing a development tool that will support development for Android.</p><p>I realize that people running Windows, Mac OS, and Linux all develop for Android, but what are the statistics?  </p><p>Personally I run Windows, and I'd prefer to write it in C# with WPF, but WPF isn't exactly cross platform.  I'm really only doing Java to target Android.</p><p>If it's cross platform, does Java make the most sense, or can it be .NET+GTK# or something like that?</p><p>EDIT: I have no intention of replacing the code editor/compiler/etc.  It was more along the line of a graphics editor.  Something that I don't think is supplied by any current tools.</p>","25182","","25182","","2011-02-01 22:19:30","2011-02-02 07:12:07","What is the most popular host OS for developing for Android?","<java><android><wpf><gtk#>","4","5","1","",""
"4867938","1","","","2011-02-01 21:06:00","2","1822","<p>I have a <code>LinearLayout</code> with a number of <code>TextView</code> followed by a <code>ListView</code> at the bottom - see code below.</p><p>The problem is the TextView/CheckBox's take around 75% of the screen - ListView then has a scroll inside it at the bottom, not massively usable - how do I disable the ListView scroll and enable the whole LinearLayout Scroll. Please provide some example code.</p><pre><code>&lt;LinearLayout android:orientation=""vertical""    android:layout_margin=""5dip""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;RelativeLayout android:layout_width=""fill_parent""        android:layout_margin=""5dip""        android:layout_height=""wrap_content""        android:background=""#CCCCCC""&gt;        &lt;TextView android:id=""@+id/_text_title""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""@string/text1""            android:layout_marginTop=""14dip""            android:textColor=""#FFFFFF""            android:gravity=""center_horizontal""            android:textSize=""17dip""            android:textStyle=""bold"" /&gt;           &lt;CheckBox ..../&gt;           &lt;CheckBox ..../&gt;           &lt;TextView android:id=""@+id/_text_title"" ..../&gt;           &lt;CheckBox ..../&gt;           &lt;CheckBox ..../&gt;       &lt;ListView .../&gt;&lt;/LinearLayout&gt;</code></pre>","599080","","418183","","2011-02-01 21:16:25","2012-12-04 09:09:38","Android ListView and Scroll problem","<android><listview><scroll>","3","2","","",""
"4867971","1","4868289","","2011-02-01 21:09:10","9","11267","<p>I'm trying to develop an Android application but when I try to connect to logcat I get the following error:</p><blockquote>  <p>Unable to open log device '/dev/log/main': No such file or directory</p></blockquote><p>I already installed a new SDK, rebooted my phone... nothing seems to solve the problem. Anyone has any solution?</p><p>Samsung Galaxy S (Darky's v9.1)</p><p>Apple OSX</p><p>ADB 1.0.26</p>","320281","","418183","","2011-02-01 21:11:34","2013-08-05 07:16:36","/dev/log/main not found","<android><debugging><logcat>","4","8","2","",""
"4868294","1","","","2011-02-01 21:44:39","1","1030","<p>I'm developing an Android app targeting Android 2.3 (API9).</p><p>I want to resize the height of a simple <code>EditText</code> but when I set <code>android:layout_height=""10pt""</code> the border of the <code>EditText</code> becomes dislocated.</p><p>The problem is shown here</p><p><img src=""http://i.stack.imgur.com/zX8U1.png"" alt=""enter image description here""></p><p>I tried layout_height, height, textsize.. pt, px, sp... but the same problem.</p><p>I haven't tried the application on real device yet.</p>","599126","","418183","","2011-02-01 21:51:53","2011-02-16 04:49:43","Problem with borders when resizing the height of EditText","<android><edittext>","2","0","","",""
"4868596","1","","","2011-02-01 22:15:46","1","627","<p>I'm planning a simulation that calls for multiple communicating android virtual devices; is there a simple way to get two or more Android Virtual Devices to talk to each other? Thanks.</p>","599165","","491044","","2011-03-11 07:55:03","2012-12-01 08:36:17","Is there a simple communication/message passing interface between two or more Android Devices?","<android><android-emulator>","3","0","","",""
"4868694","1","4869311","","2011-02-01 22:29:21","1","1595","<p>I'm a complete beginner to Java and Android development and had a question about preferences.</p><p>A tutorial asked me to use preferences to read and save the time in which the onCreate method is called. </p><p>I've sat on this problem for at least two days but have come up with nothing. Can anyone give me an example on how to code such an action?</p><pre><code>public static final String PREFS_NAME = ""Time_Pref"";public class QuizSplashActivity extends QuizActivity {@Override   public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.splash);    SharedPreferences = getSharedPreferences (""Time_Pref"", ""MODE_PRIVATE); }</code></pre><p>But that's where I seem to get lost. I'm not even sure if I'm heading in the right direction. </p>","599170","","50776","","2013-10-15 14:14:40","2013-10-15 14:14:40","Using getSharedPreferences to get time","<android><preferences>","2","1","","",""
"4868770","1","4970762","","2011-02-01 22:39:22","9","3441","<p>I am working on a twitter based app and am trying to incorporate Android's built-in Account support for Twitter. The following code works to popup the confirmation dialog for my app to access twitter but I am unsure of what to pass in as the authenticationType. Any help would be appreciated. I've googled all over the place and can't seem to find the correct answer. It goes in place of ""oauth"" below.</p><pre><code>AccountManager am = AccountManager.get(this);Account[] accts = am.getAccountsByType(TWITTER_ACCOUNT_TYPE);if(accts.length &gt; 0) {    Account acct = accts[0];    am.getAuthToken(acct, ""oauth""/*what goes here*/, null, this, new AccountManagerCallback&lt;Bundle&gt;() {    @Override    public void run(AccountManagerFuture&lt;Bundle&gt; arg0) {        try {                     Bundle b = arg0.getResult();                       Log.e(""TrendDroid"", ""THIS AUTHTOKEN: "" + b.getString(AccountManager.KEY_AUTHTOKEN));                  } catch (Exception e) {                       Log.e(""TrendDroid"", ""EXCEPTION@AUTHTOKEN"");                  }      }}, null);}</code></pre>","297762","","","","","2011-06-10 00:19:56","Twitter Authentication through Android's AccountManager classes","<android><twitter><twitter-oauth><accountmanager>","2","2","6","",""
"4868789","1","4868850","","2011-02-01 22:40:44","1","1085","<p>I'm trying to open up an xml file to parse it, but I am getting stopped trying to open the file. My code is: </p><pre><code>        try {            return new FileInputStream(location);        } catch (FileNotFoundException e) {            // TODO Auto-generated catch block            e.printStackTrace();            return null;        }   </code></pre><p>where location is a String passed into the function. Upon running my code, I get:</p><p>java.io.FileNotFoundException: /C:/Users/Seth/AndroidWorkspace/UCoupon/res/xml/information.xml (No such file or directory)</p><p>I gave the full file path, and I havn't mispelled anything. What am I doing wrong?</p>","544007","","","","","2011-02-01 22:48:46","fileinputstream throwing filenotfoundexception?","<android><filenotfoundexception><fileinputstream>","3","0","","",""
"4868998","1","4869066","","2011-02-01 23:04:55","0","1379","<p>Is it possible in the Android framework to duplicate what is displayed on the main display (UI)?</p><p>I have a situation where I need to demonstrate my app to many people, and it would be easier to do if I can duplicate the screen contents to an external monitor/TV. I am not married to the idea of using the <a href=""http://en.wikipedia.org/wiki/HDMI"" rel=""nofollow"">HDMI</a> port, I would be happy doing this through Wi-Fi or Bluetooth or <a href=""http://en.wikipedia.org/wiki/USB"" rel=""nofollow"">USB</a> if need be. What I am looking for is to see if I can do something similar to what Windows does by default when a second monitor is connected.</p><p>I have been through the developer's documentation and haven't been able to find anything that would allow me to do this, but it would not be the first time I've missed something. Specifically I need to do this with an <a href=""https://en.wikipedia.org/wiki/HTC_Evo_4G"" rel=""nofollow"">HTC Evo</a>.</p>","549510","","63550","","2014-04-04 16:50:03","2014-04-04 16:50:03","Redirecting/duplicating the UI to an external output","<android>","1","0","1","",""
"4869097","1","4872050","","2011-02-01 23:17:23","2","538","<p>I am working on a native CouchdDB app with android. Now just this week CouchOne released libcouch, described as ""Library files needed to interact with CouchDB on Android"":<a href=""https://github.com/couchone/libcouch-android/tree/master/src/com/couchone/libcouch"" rel=""nofollow"" title=""couchone.libcouch@github"">couchone_libcouch@Github</a></p><p>It is a basic app that installs CouchDB if the CouchDB service (that comes with CouchDB if it was installed previously) can't be bound to.</p><p>To be more precise, as I understand it: libcouch estimates CouchDb's presence on the device by trying to bind to a IPC Service from CouchDB and through that service wants communicate with CouchDB.</p><p>Please see the method ""attemptLaunch()"" at CouchAppLauncher.classfor reviewing this:</p><p>public void attemptLaunch() {</p><pre><code>    Log.i(TAG,""1.) called attemptLaunch"");Intent intent = new Intent(ICouchService.class.getName());    Log.i(TAG,""1.a) setup Intent"");    Boolean canStart = bindService(intent, couchServiceConn,            Context.BIND_AUTO_CREATE);    Log.i(TAG,""1.b bound service. canStart: "" + Boolean.toString(canStart));    if (!canStart) {        setContentView(R.layout.install_couchdb);        TextView label = (TextView) findViewById(R.id.install_couchdb_text);        Button btn = (Button) this.findViewById(R.id.install_couchdb_btn);        String text = getString(R.string.app_name)                + "" requires Apache CouchDB to be installed."";        label.setText(text);        // Launching the market will fail on emulators        btn.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                launchMarket();                finish();            }        });    }}</code></pre><p>The question(s) I have about this are: libcouch never is able to ""find"" a previously installed CouchDB. It always attempts to install CouchDBfrom the market. This is because it never actually is able to bind to the CouchDBService.As I understand the purpose auf AIDL generated service interfaces, the actual service that intends to offer it's IPC to other applications should make use of AIDL. In this case the AIDL has been moved to the application that is trying to bind to the remote service, which is libcouch in this case.</p><p>Reviewing the commits the AIDL files have just been moved out of that repository to libcouch. </p><p>For complete linkage, here's the link to the Android CouchDB sources:github.com/couchone/libcouch-android</p><p>Now, I could be completely wrong in my findings, it could also be lincouch's Manifest that s missing something, but I am really looking forward to get some answers!</p>","508709","","508709","","2011-02-01 23:22:34","2011-02-15 21:06:16","Android Couchdb - libcouch and IPC Aidl Services","<android><service><couchdb><ipc><aidl>","2","0","1","",""
"4869113","1","","","2011-02-01 23:19:15","0","579","<p>I'm making a simple progress bar. I have a full progress bar png on top of an empty progressbar png:</p><pre><code>&lt;RelativeLayout  android:layout_width=""fill_parent""  android:layout_height=""wrap_content"" &gt;  &lt;ImageView    android:layout_width=""fill_parent""    android:layout_height=""20dip""    android:background=""@drawable/empty.9.png""    /&gt;  &lt;ImageView    android:layout_width=""50dip"" // some computed percentage width.    android:layout_height=""20dip""    android:background=""@drawable/full.9.png""    /&gt;</code></pre><p></p><p>It almost works - the idea was to set the ""full"" imageview's width to whatever percentage I need, since it's sitting on top of the empty one in the relative layout. </p><p>For some reason, the imageview is wrapping the graphic around on itself. Might be because it's a 9 png stretchable? The effect looks like the ImageView is drawing the first 50dip of the png, then moves back to its 0,0 coordinate, and draws the last 50dip of the png. Very strange! The png under it is fine, stretches as expected.</p><p>I basically just want to show N pixels worth of the full.9.png by setting the ImageView's width to a variable amount.</p><p>Thanks</p>","291701","","","","","2011-02-02 01:43:14","Wrapping effect with 9 png, trying to make simple progress bar","<android>","1","2","","",""
"4869238","1","4888033","","2011-02-01 23:35:57","8","10470","<p>So, I've been struggling with this problem for some time, and haven't had any luck tapping the wisdom of the internets and related SO posts on the subject.</p><p>I am writing an Android app that uses the ubiquitous Accelerometer, but I seem to be getting an incredible amount of ""noise"" even while at rest, and can't seem to figure out how to deal with it as my readings need to be relatively accurate.  I thought that maybe my phone (HTC Incredible) was dysfunctional, but the sensor seems to work well with other games and apps I've played.</p><p>I've tried to use various ""filters"" but I can't seem to wrap my mind around them.  I understand that gravity must be dealt within some way, and maybe that's where I am going wrong.  Currently I have tried this, adapted from a <a href=""http://stackoverflow.com/questions/1638864/filtering-accelerometer-data-noise"">SO answer</a>, which refers to an example from the iPhone SDK:</p><pre><code>                accel[0] = event.values[0] * kFilteringFactor + accel[0] * (1.0f - kFilteringFactor);                accel[1] = event.values[1] * kFilteringFactor + accel[1] * (1.0f - kFilteringFactor);                double x = event.values[0] - accel[0];                double y = event.values[1] - accel[1];</code></pre><p>The poster says to ""play with"" the kFilteringFactor value (kFilteringFactor = 0.1f in the example) until satisfied.  Unfortunately I still seem to get a lot of noise, and all this seems to do is make the readings come in as tiny decimals, which doesn't help me all that much, and it appears to just make the sensor less sensitive.  The math centers of my brain are also atrophied from years of neglect, so I don't completely understand how this filter is working. </p><p>Can someone explain to me in some detail how to go about getting a <em>useful</em> reading from the accelerometer? A succinct tutorial would be an incredible help, as I haven't found a really good one (at least aimed at my level of knowledge).  I get frustrated because I feel like all of this should be more apparent to me.  Any help or direction would be greatly appreciated, and of course I can provide more samples from my code if needed.</p><p>I hope I'm not asking to be spoon-fed too much; I wouldn't be asking unless I've been trying to figure it our for a while. It also looks like there is some interest from other SO members.</p>","471791","","471791","","2011-02-02 17:39:18","2011-02-03 15:24:56","How to Calibrate Android Accelerometer & Reduce Noise, Eliminate Gravity","<android><filter><accelerometer><noise><calibration>","2","2","4","",""
"4869276","1","","","2011-02-01 23:40:02","0","3899","<p>I have a custom view that extends View.  It displays drawn shapes, and allows the user to add to those drawings via drawing touch events to the View via onDraw.</p><p>I've enabled the ScaleGestureDetector so that the user can zoom in on a particular section and draw, but as I am using single-touch to draw, they cannot use their finger to pan around the zoomed in View.</p><p>I've tried to enable scrollbars for the View such that when they are zoomed in, the scrollbars are displayed and can be used by the user to pan... but I simply can't get the scrollbars to be displayed.</p><p>Essentially, what I am doing is to call the View's <code>awakenScrollBars()</code> method in my ScaleListener's <code>onScale()</code> method when the user is zoomed in, which triggers <code>invalidate()</code>.  I enabled the scrollbars via both the XML, and programatically in <code>onCreate()</code>, but I can't trigger the scrollbars to be visible.  Here is my 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:layout_width=""match_parent""    android:layout_height=""match_parent""&gt;    &lt;com.package.name.Canvas    android:id=""@+id/canvas""    android:layout_width=""match_parent""        android:layout_height=""match_parent""        android:focusable=""true""        android:scrollbars=""horizontal|vertical"" /&gt;&lt;/FrameLayout&gt;</code></pre><p>And here is my onCreate():</p><pre><code>// set scrollbarssetHorizontalScrollBarEnabled(true);setVerticalScrollBarEnabled(true);</code></pre><p>In onDraw, I can verify that the scrollbars are enabled via <code>isHorizontalScrollBarEnabled()</code> and <code>isVerticalScrollBarEnabled()</code>, and <code>awakenScrollBars()</code> in <code>onScale()</code> returns true, but the scroll bars are just not visible.</p><p>Any suggestions on how to proceed?  Containing the custom View in a ScrollView layout doesn't seem to be an option, as that only supports vertical scrolling.</p><p>Thanks,</p><p>Paul</p>","357801","","","","","2013-06-03 09:11:12","Android: Enable Scrollbars on Canvas-Based View","<android><canvas><scroll>","3","0","5","",""
"4869392","1","6446790","","2011-02-02 00:00:30","4","1145","<p>I have a (array) list</p><pre><code>CarSomethingŠibicaCavaoCavao</code></pre><p>Is there a way to ""force"" <b>AutoCompleteTextView</b> so if user type in letter ""c"" it would show</p><pre><code>CarCavaoCavao</code></pre><p>so it would show <b>standard letter and international letter</b> (C and C/C, S and Š, Z and Ž, D and Ð).</p>","455268","","","","","2014-02-24 17:11:43","Diacritics/international characters in AutoCompleteTextView","<android><autocompletetextview>","4","0","2","",""
"4869423","1","4869590","","2011-02-02 00:06:03","1","2382","<p>I'm going through the tutorials for android and something about intent/activity interaction is confusing me. In Javascript whenever there is an ajax call we define how the results should be handled along with the ajax call and we can use different callbacks for different ajax calls throughout the application lifecycle. In android starting an activity with an intent and handling the passed back results are decoupled, at least that's how it's done in the tutorial and there is only a single point of entry for how the results are handled so it's hard to perform on the fly handling of results without messing with the main entry point. I can easily imagine some complex logic that could make the switching inside the main entry point into a horrible mess. Is this a fundamental android architectural thing or is there another way to do things with actual callbacks instead of switch statements in a single entry point?</p>","165198","","165198","","2011-02-02 00:16:40","2013-05-27 07:34:39","android intents and callbacks","<android><callback><android-intent>","3","16","","",""
"4869588","1","4869660","","2011-02-02 00:33:42","3","299","<p>I'm writing an Android application. As far as I know, most SD cards in devices have ~4Mb/s write speed. In the worst case, my application needs to create and write ~0.5Mb to a new file about 5 times a second. Generally, IO is very fast when doing this but, after creating and writing to several files in a short period of time, I experience a sudden long wait time of ~2 seconds.</p><p>Here are some stats from my application (note that only one IO operation is ever running at a time):</p><pre><code>E  = Time IO operation beganS  = Number of Mbs writtenWT = Time taken to write to fileE      S        WT     14.546 ~0.41 MB 0.02s15.061 ~0.40 MB 0.019s15.600 ~0.42 MB 0.073s16.054 ~0.41 MB 0.02s16.538 ~0.36 MB 0.019s17.007 ~0.33 MB 0.018s17.475 ~0.32 MB 0.017s18.030 ~0.38 MB 0.07s19.991 ~0.38 MB 1.542s &lt;--20.124 ~0.34 MB 0.018s20.233 ~0.25 MB 0.015s20.390 ~0.38 MB 0.021s20.624 ~0.36 MB 0.08s20.858 ~0.37 MB 0.018s21.304 ~0.32 MB 0.018s21.796 ~0.33 MB 0.017s22.257 ~0.35 MB 0.02s22.780 ~0.37 MB 0.07s24.366 ~0.27 MB 1.178s &lt;--24.522 ~0.40 MB 0.021s24.648 ~0.34 MB 0.019s24.866 ~0.38 MB 0.018s25.319 ~0.29 MB 0.07s25.850 ~0.45 MB 0.021s26.288 ~0.39 MB 0.018s26.796 ~0.43 MB 0.035s27.249 ~0.33 MB 0.069s27.671 ~0.41 MB 0.018s30.054 ~0.44 MB 1.874s &lt;--</code></pre><p>Notice that most of the IO operations finish in &lt;0.05s but, after about 8 write operations where ~4Mb of data has been written in total, the next IO operation takes ~1.5s. Why is this happening? This pattern happens fairly consistently.</p><p>My files are being written with the following code (I'm not flushing or syncing):</p><pre><code>  RandomAccessFile fos = new RandomAccessFile(filename, ""rw"");  FileChannel outChannel = fos.getChannel();  byteBuffer.rewind();  outChannel.write(byteBuffer);  fos.close();</code></pre><p>I'm no expert in file IO but I know the fast IO operation times indicate the data hasn't actually been written to disk yet and the big pauses are probably buffers being flushed. How do I avoid the pauses? It seems as if my IO operations are small and infrequent enough that I should be able to avoid this pausing.</p><p>For some context: I'm using the command pattern with mementos to implement undo/redo in a context where there are many destructive operations the user can perform. I cannot store the mementos in memory because I don't have enough memory so I write the mementos to disk instead. This works fantastic except for the above pausing problem as it means the UI is forced to wait for the IO to finish and 1.5s of lag is too much to hide from the user. I know there are other was to implement undo/redo but every approach has flaws.</p>","580100","","","","","2011-02-02 00:45:48","Random long IO pauses when writing data periodically","<java><android><mobile><io>","1","0","1","",""
"4869644","1","4869700","","2011-02-02 00:43:25","0","653","<p>I'm making an app that gets most of it's information from an XML file. I have been using an RSS-like XML, but now I've found an XML with much more information that I want to use. I already have the XML reader working, but when I put the XML into my code, it returns with ""NO DATA"", which is what I told it to do if it can't get any data from the XML. I've tried to find ways to make the app only read the part of the XML, but I haven't found a way that works yet.</p><p>This is the XML I am trying to read. <a href=""http://www.supercross.com/mobileapps/supercross.xml"" rel=""nofollow"">http://www.supercross.com/mobileapps/supercross.xml</a>(You might have to view source to see the XML)</p>","446875","","","","","2011-02-02 02:31:39","Make Android XML reader only read part of the XML file","<java><android><xml>","2","1","","",""
"4869667","1","4869691","","2011-02-02 00:46:29","0","643","<p>someone please tell me how can I update the TextView that is on app Widget, before default update period time is come.?.?.?.(30,om, or 1h... I set on 30mins but It updates on 1h)</p><p>So I have an activity which decides what is the final text on the widget, and it may be changed by user in the runtime, so after user changes something I should be able to show the final changes on widget (immediately),but I can't. how can I achieve this? </p><p>many thanks guys.</p>","536853","","","","","2011-02-02 00:50:49","Android: change app widget's text on runtime before update time!","<android><android-widget><widget>","1","0","","",""
"4869753","1","6226089","","2011-02-02 01:02:06","0","267","<p>I've got a homescreen widget that I've developed. It works, it just seems unresponsive. The only clue I've got as to why it's unresponsive at this point is that it prints the following in LogCat every time I click one of the two buttons:</p><p>ActivityManager   | Launch activity, postpone broadcast intents</p><p>I've done my google diligence, but haven't come up with a solution at this point. I have a lurking feeling that my activity is being killed as soon as it advances the data on the widget, and it has to be re-instantiated again before it can answer the intent. I am NOT calling the long-running background service every time, I'm just parsing the next String in a String[] and updating the RemoteViews with its data. </p><p>Is there something I'm doing wrong here? </p><p>Is there something I should be doing differently? </p><p>Am I lost in the wasteland of android widgets?</p><p>Any help would be appreciated, Thanks!</p>","599307","","","","","2011-06-03 10:44:44","ActivityManager keeps logging message ""Launch Activity, postpone broadcast intents"" for Android Widget with buttons","<java><android><widget><broadcast><android-intent>","1","1","","",""
"4869831","1","4869916","","2011-02-02 01:16:31","3","1314","<p>I'm trying to figure out how to use Android's resource system efficiently, both to provide the highest resolution resources and to keep the .apk size low.</p><p>My resource folders:</p><pre><code>drawable-normal-mdpidrawable-normal-hdpidrawable-large-mdpi</code></pre><p>Now the way I'm using the resources (a game) the normal-hdpi and large-mdpi are exactly the same. I don't want to include both in my final .apk because its going to inflate the size unnecessarily.  Is there a way to get around this? I tried to use a symbolic link (linux) but the android tools follow the links and copy the resources. </p>","413575","","444705","","2013-05-14 15:53:59","2013-05-14 15:53:59","Using an Android resources efficiently","<android><resources>","2","0","","",""
"4869891","1","","","2011-02-02 01:27:08","2","521","<p>Using Android's Bluetooth Chat sample app as my guide <a href=""http://developer.android.com/resources/samples/BluetoothChat/index.html"" rel=""nofollow"">http://developer.android.com/resources/samples/BluetoothChat/index.html</a>, I've tried to create my own bluetooth function for an app I am working on.</p><p>Last night I tested it with two Android phones and had some issues, but there were no force closes. It simply didn't connect my devices when I asked it to. I went in and added a few Log lines to make sure the program was following the proper course. When I reinstalled and launched the app on my phone today, I got a force close error when attempting to turn on Bluetooth, a problem I did not have at all last night. The only code I changed was the addition of 2-3 log commands. I checked logcat and got the following:</p><p><img src=""http://i.stack.imgur.com/oeB7W.png"" alt=""http://img708.imageshack.us/img708/143/logcatmysternpe.png""></p><p>As you can see, the problem is caused by an NPE @ line 185. Here is my code for the BluetoothService class, I will repost the specific area of issue below it.</p><pre><code>package com.tagapp.android;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.util.UUID;import android.bluetooth.BluetoothAdapter;import android.bluetooth.BluetoothDevice;import android.bluetooth.BluetoothServerSocket;import android.bluetooth.BluetoothSocket;import android.content.Context;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.util.Log;public class BluetoothService {    private static final String TAG = ""BluetoothService"";    private static final boolean D = true;    private static final String NAME = ""BluetoothTag"";    private static final UUID MY_UUID =         UUID.fromString(""93845760-234e-11e0-ac64-0800200c9a66"");    private final BluetoothAdapter mAdapter;    private final Handler mHandler;    private AcceptThread mAcceptThread;    private ConnectThread mConnectThread;    private ConnectedThread mConnectedThread;    private int mState;    public static final int STATE_NONE = 0;    public static final int STATE_LISTEN = 1;    public static final int STATE_CONNECTING = 2;    public static final int STATE_CONNECTED = 3;    public BluetoothService(Context context, Handler handler) {        mAdapter = BluetoothAdapter.getDefaultAdapter();        mState = STATE_NONE;        mHandler = handler;    }    private synchronized void setState(int state) {        if (D) Log.d(TAG, ""setState() "" + mState + "" -&gt; "" + state);        mState = state;        mHandler.obtainMessage(BluetoothTransfer.MESSAGE_STATE_CHANGE, state, -1).sendToTarget();    }    public synchronized int getState() {        return mState;    }    public synchronized void start() {        if (D) Log.d(TAG, ""start"");        if(mConnectThread != null) {            mConnectThread.cancel();            mConnectThread = null;        }        if(mConnectedThread != null) {            mConnectedThread.cancel();            mConnectedThread = null;        }        if(mAcceptThread == null) {            mAcceptThread = new AcceptThread();            mAcceptThread.start();        }        setState(STATE_LISTEN);    }    public synchronized void connect(BluetoothDevice device) {        if (D) Log.d(TAG, ""connect to: "" + device);        if(mState == STATE_CONNECTING) {            if(mConnectThread != null) {                mConnectThread.cancel();                mConnectThread = null;            }        }        if(mConnectedThread != null) {            mConnectedThread.cancel();            mConnectedThread = null;        }        mConnectThread = new ConnectThread(device);        mConnectThread.start();        setState(STATE_CONNECTING);    }    public synchronized void connected(BluetoothSocket socket, BluetoothDevice device) {        if (D) Log.d(TAG, ""connected"");        if(mConnectThread != null) {            mConnectThread.cancel();            mConnectThread = null;        }        if(mConnectedThread != null) {            mConnectedThread.cancel();            mConnectedThread = null;        }        if(mAcceptThread != null) {            mAcceptThread.cancel();            mAcceptThread = null;        }        mConnectedThread = new ConnectedThread(socket);        mConnectedThread.start();        Message msg = mHandler.obtainMessage(BluetoothTransfer.MESSAGE_DEVICE_NAME);        Bundle bundle = new Bundle();        bundle.putString(BluetoothTransfer.DEVICE_NAME, device.getName());        msg.setData(bundle);        mHandler.sendMessage(msg);        setState(STATE_CONNECTED);    }    public synchronized void stop() {        if (D) Log.d(TAG, ""stop"");        if(mConnectThread != null) {            mConnectThread.cancel();            mConnectThread = null;        }        if(mConnectedThread != null) {            mConnectedThread.cancel();            mConnectedThread = null;        }        if(mAcceptThread != null) {            mAcceptThread.cancel();            mAcceptThread = null;        }        setState(STATE_NONE);    }    public void write(byte[] out) {        ConnectedThread ct;        synchronized(this) {            if(mState != STATE_CONNECTED) return;            ct = mConnectedThread;        }        ct.write(out);    }    private void connectionFailed() {        setState(STATE_LISTEN);        Message msg = mHandler.obtainMessage(BluetoothTransfer.MESSAGE_TOAST);        Bundle bundle = new Bundle();        bundle.putString(BluetoothTransfer.TOAST, ""Unable to connect device"");        msg.setData(bundle);        mHandler.sendMessage(msg);    }    private void connectionLost() {        setState(STATE_LISTEN);        Message msg = mHandler.obtainMessage(BluetoothTransfer.MESSAGE_TOAST);        Bundle bundle = new Bundle();        bundle.putString(BluetoothTransfer.TOAST, ""Device connection was lost"");        msg.setData(bundle);        mHandler.sendMessage(msg);    }    private class AcceptThread extends Thread {        private final BluetoothServerSocket mmServerSocket;        public AcceptThread() {            BluetoothServerSocket tmp = null;            try {                tmp = mAdapter.listenUsingRfcommWithServiceRecord(NAME, MY_UUID);            }            catch (IOException e) {                Log.e(TAG, ""listen() failed"", e);            }            mmServerSocket = tmp;        }        public void run() {            if (D) Log.d(TAG, ""BEGIN mAcceptThread"" + this);            setName(""AcceptThread"");            BluetoothSocket socket = null;            while (mState != STATE_CONNECTED) {                try {                    socket = mmServerSocket.accept();                }                catch (IOException e) {                    Log.e(TAG, ""accept() failed"", e);                    break;                }                if(socket != null) {                    synchronized (BluetoothService.this) {                        switch(mState) {                        case STATE_LISTEN :                        case STATE_CONNECTING :                            connected(socket, socket.getRemoteDevice());                            break;                        case STATE_NONE :                        case STATE_CONNECTED :                            try {                                socket.close();                            }                            catch (IOException e) {                                Log.e(TAG, ""Could not close unwanted socket"", e);                            }                            break;                        }                    }                }            }            if (D) Log.i(TAG, ""END mAcceptThread"");        }        public void cancel() {            if (D) Log.d(TAG, ""cancel "" + this);            try {                mmServerSocket.close();            }            catch (IOException e) {                Log.e(TAG, ""close() of server failed"", e);            }        }    }    private class ConnectThread extends Thread {        private final BluetoothSocket mmSocket;        private final BluetoothDevice mmDevice;        public ConnectThread(BluetoothDevice device) {            mmDevice = device;            BluetoothSocket tmp = null;            try {                tmp = device.createRfcommSocketToServiceRecord(MY_UUID);            }            catch (IOException e) {                Log.e(TAG, ""create() failed"", e);            }            mmSocket = tmp;        }        public void run() {            Log.i(TAG, ""BEGIN mConnectThread"");            setName(""ConnectThread"");            mAdapter.cancelDiscovery();            try {                mmSocket.connect();            }            catch (IOException e) {                connectionFailed();                try {                    mmSocket.close();                }                catch (IOException e2) {                    Log.e(TAG, ""unable to close() socket during connection failure"", e2);                }            BluetoothService.this.start();            return;            }            synchronized (BluetoothService.this) {                mConnectThread = null;            }            connected(mmSocket, mmDevice);        }        public void cancel() {            try {                mmSocket.close();            }            catch (IOException e) {                Log.e(TAG, ""close() of connect socket failed"", e);            }        }    }    private class ConnectedThread extends Thread {        private final BluetoothSocket mmSocket;        private final InputStream mmInStream;        private final OutputStream mmOutStream;        public ConnectedThread(BluetoothSocket socket) {            Log.d(TAG, ""create ConnectedThread"");            mmSocket = socket;            InputStream tmpIn = null;            OutputStream tmpOut = null;            try {                tmpIn = socket.getInputStream();                tmpOut = socket.getOutputStream();            }            catch (IOException e) {                Log.e(TAG, ""tempt sockets not created"", e);            }            mmInStream = tmpIn;            mmOutStream = tmpOut;        }        public void run() {            Log.i(TAG, ""BEGIN mConnectedThread"");            byte[] buffer = new byte[1024];            int bytes;            while (true) {                try {                    bytes = mmInStream.read(buffer);                    mHandler.obtainMessage(BluetoothTransfer.CONTACT_RECEIVE, bytes, -1, buffer).sendToTarget();                }                catch (IOException e) {                    Log.e(TAG, ""disconnected"", e);                    connectionLost();                    break;                }            }        }        public void write(byte[] buffer) {            try {                mmOutStream.write(buffer);                mHandler.obtainMessage(BluetoothTransfer.CONTACT_SEND, -1, -1, buffer).sendToTarget();            }            catch (IOException e) {                Log.e(TAG, ""exception during write"", e);            }        }        public void cancel() {            try {                mmSocket.close();            }            catch (IOException e) {                Log.e(TAG, ""close() of connect socket failed"", e);            }        }    }}</code></pre><p>The lines which are causing the NPE (the AcceptThread):</p><pre><code>private class AcceptThread extends Thread {    private final BluetoothServerSocket mmServerSocket;    public AcceptThread() {        BluetoothServerSocket tmp = null;        try {            tmp = mAdapter.listenUsingRfcommWithServiceRecord(NAME, MY_UUID);        }        catch (IOException e) {            Log.e(TAG, ""listen() failed"", e);        }        mmServerSocket = tmp;    }    public void run() {        if (D) Log.d(TAG, ""BEGIN mAcceptThread"" + this);        setName(""AcceptThread"");        BluetoothSocket socket = null;        while (mState != STATE_CONNECTED) {            try {                socket = mmServerSocket.accept();//THIS LINE CAUSES NPE            }            catch (IOException e) {                Log.e(TAG, ""accept() failed"", e);                break;            }</code></pre><p>The object socket should by initialized @ null, but it is supposed to try socket = mmServerSocket.accept();</p><p>This is directly from Google's sample app provided on the Android dev website. I have two concerns: 1, why isn't this working, and 2, why did it work just fine just hours ago?</p><p>Thanks for your help.</p>","588758","","116938","","2011-02-02 02:51:31","2012-09-06 08:13:31","Getting a strange NPE in one of my Bluetooth classes, it didn't happen before","<android><bluetooth>","1","5","1","",""
"4870025","1","4923439","","2011-02-02 01:47:50","3","3145","<p>There are plenty of samples out there, especially for Twitter. This one seems to be one of the most complete so I've been hacking on it:</p><p><a href=""https://github.com/brione/Brion-Learns-OAuth"" rel=""nofollow"">https://github.com/brione/Brion-Learns-OAuth</a></p><p>However, all of the samples are basically proof of concept code. They all have rough edges like leaving a split task stack when you launch through the browser. I've got the app I'm playing with working mostly the way I want it to by declaring it singleTask and forcing the browser to call back into the original task instead of starting up a new activity:</p><pre><code>&lt;activity android:name="".MainActivity""              android:label=""@string/app_name""              android:launchMode=""singleTask""&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>However I'm wondering if there are better ways to handle this, like popping up a modal WebView to take the user through the auth process?</p><p>I'm assuming that for Twitter in particular the ""right"" thing to do is probably to swap to xauth.  But I still would like to know, generally speaking, is there a best-practice production quality OAuth implementation for Android out there?</p>","506507","","","","","2013-07-04 10:53:47","Is there a production quality OAuth sample for Android?","<android><twitter><oauth>","2","1","1","",""
"4870069","1","5366540","","2011-02-02 01:57:34","3","2672","<p>I am trying to learn android so i am making some apps to play around with to get use to it. I am having a problem with one i am doing now, I am trying to make a sms notification app but it always force closes in the emulator. here is my code</p><pre><code>import android.app.Notification;import android.app.NotificationManager;import android.app.PendingIntent;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.telephony.SmsMessage;public class Sms extends BroadcastReceiver {    static final String ACTION = ""android.provider.Telephony.SMS_RECEIVED"";    @Override    public void onReceive(Context arg0, Intent arg1) {           NotificationManager mNotificationManager = (NotificationManager) arg0.getSystemService(Context.NOTIFICATION_SERVICE);            if (arg1.getAction().equals(ACTION)) {                StringBuilder sb = new StringBuilder();                String from = new String();                String body = new String();                Bundle bundle = arg1.getExtras();                if (bundle != null) {                    Object[] pdus = (Object[]) bundle.get(""pdus"");                    for (Object pdu : pdus){                    SmsMessage messages = SmsMessage.createFromPdu((byte[]) pdu);                    sb.append(messages.getDisplayOriginatingAddress());                    from = messages.getDisplayOriginatingAddress();                    sb.append(messages.getDisplayMessageBody());                    body= messages.getDisplayMessageBody();                    //Log.i(LOG_TAG, ""[SMSApp] onReceiveIntent: "" + sb);                    //abortBroadcast();                    }// end for                }//end if                int icon = R.drawable.icon;                CharSequence tickerText = from + "": "" + body;                long when = System.currentTimeMillis();                Notification notification = new Notification(icon, tickerText, when);                CharSequence contentTitle = ""New SMS Message"";                CharSequence contentText = sb.toString();                Intent notificationIntent = new Intent();                PendingIntent contentIntent = PendingIntent.getActivity(arg0, 0, notificationIntent, 0);                notification.setLatestEventInfo(arg0, contentTitle, contentText, contentIntent);                notification.vibrate = new long[] { 100, 250, 100, 500};                notification.flags |= Notification.FLAG_AUTO_CANCEL;                mNotificationManager.notify(1, notification);            }//end if    }}</code></pre><p>and here is my manifest.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.example.froyo""      android:versionCode=""1""      android:versionName=""1.0""&gt;&lt;uses-sdk android:minSdkVersion=""8"" /&gt;    &lt;uses-permission android:name=""android.permission.RECEIVE_SMS"" /&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".FroyoTest""                  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;receiver android:name="".Sms""&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;        &lt;uses-permission android:name=""android.permission.RECEIVE_SMS"" /&gt;    &lt;uses-permission android:name=""android.permission.READ_SMS"" /&gt;    &lt;uses-permission android:name=""android.permission.WRITE_SMS"" /&gt;    &lt;uses-permission android:name=""android.permission.SEND_SMS"" /&gt;&lt;/manifest&gt;</code></pre><p>I dont understand what is wrong as it force closes every time</p><p>here is the logcat errors </p><pre><code>02-02 11:35:46.896: ERROR/System(66): Failure starting core service02-02 11:35:46.896: ERROR/System(66): java.lang.SecurityException02-02 11:35:46.896: ERROR/System(66):     at android.os.BinderProxy.transact(Native Method)02-02 11:35:46.896: ERROR/System(66):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)02-02 11:35:46.896: ERROR/System(66):     at android.os.ServiceManager.addService(ServiceManager.java:72)02-02 11:35:46.896: ERROR/System(66):     at com.android.server.ServerThread.run(SystemServer.java:184)02-02 11:36:09.847: ERROR/ActivityManager(66): ANR in com.android.settings02-02 11:36:09.847: ERROR/ActivityManager(66): Reason: Broadcast of Intent {           act=android.intent.action.CLOSE_SYSTEM_DIALOGS     cmp=com.android.settings/.widget.SettingsAppWidgetProvider (has extras) }02-02 11:36:09.847: ERROR/ActivityManager(66): Load: 2.95 / 0.74 / 0.2402-02 11:36:09.847: ERROR/ActivityManager(66): CPU usage from 7048ms to 569ms ago:02-02 11:36:09.847: ERROR/ActivityManager(66):   app_process: 52% = 39% user + 13% kernel / faults: 2461 minor02-02 11:36:09.847: ERROR/ActivityManager(66):   system_server: 46% = 28% user + 17% kernel / faults: 704 minor 3 major02-02 11:36:09.847: ERROR/ActivityManager(66):   ronsoft.openwnn: 40% = 25% user + 15% kernel / faults: 3986 minor 6 major02-02 11:36:09.847: ERROR/ActivityManager(66):   ndroid.launcher: 26% = 14% user + 11% kernel / faults: 3701 minor 3 major02-02 11:36:09.847: ERROR/ActivityManager(66):   m.android.phone: 25% = 13% user + 12% kernel / faults: 3322 minor 7 major02-02 11:36:09.847: ERROR/ActivityManager(66):   ndroid.settings: 19% = 9% user + 10% kernel / faults: 3007 minor 7 major02-02 11:36:09.847: ERROR/ActivityManager(66):   bootanimation: 10% = 5% user + 4% kernel02-02 11:36:09.847: ERROR/ActivityManager(66):   sh: 1% = 0% user + 0% kernel / faults: 118 minor02-02 11:36:09.847: ERROR/ActivityManager(66):   qemud: 0% = 0% user + 0% kernel02-02 11:36:09.847: ERROR/ActivityManager(66): TOTAL: 100% = 65% user + 34% kernel02-02 11:36:32.439: ERROR/HierarchicalStateMachine(66): TetherMaster - unhandledMessage: msg.what=302-02 11:37:48.610: ERROR/AndroidRuntime(278): FATAL EXCEPTION: main02-02 11:37:48.610: ERROR/AndroidRuntime(278): java.lang.RuntimeException: Unable to start receiver com.example.froyo.Sms: java.lang.SecurityException: Requires VIBRATE permission02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2821)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at android.app.ActivityThread.access$3200(ActivityThread.java:125)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2083)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at android.os.Handler.dispatchMessage(Handler.java:99)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at android.os.Looper.loop(Looper.java:123)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at java.lang.reflect.Method.invokeNative(Native Method)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at java.lang.reflect.Method.invoke(Method.java:521)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at dalvik.system.NativeStart.main(Native Method)02-02 11:37:48.610: ERROR/AndroidRuntime(278): Caused by: java.lang.SecurityException: Requires VIBRATE permission02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at android.os.Parcel.readException(Parcel.java:1247)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at android.os.Parcel.readException(Parcel.java:1235)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at android.app.INotificationManager$Stub$Proxy.enqueueNotificationWithTag(INotificationManager.java:274)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at android.app.NotificationManager.notify(NotificationManager.java:110)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at android.app.NotificationManager.notify(NotificationManager.java:90)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at com.example.froyo.Sms.onReceive(Sms.java:51)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2810)02-02 11:37:48.610: ERROR/AndroidRuntime(278):     ... 10 more02-02 11:37:54.500: ERROR/ContactsProvider(172): Cannot determine the default account for contacts compatibility02-02 11:37:54.500: ERROR/ContactsProvider(172): android.accounts.AuthenticatorException: bind failure02-02 11:37:54.500: ERROR/ContactsProvider(172):     at android.accounts.AccountManager.convertErrorToException(AccountManager.java:1433)02-02 11:37:54.500: ERROR/ContactsProvider(172):     at android.accounts.AccountManager.access$400(AccountManager.java:134)02-02 11:37:54.500: ERROR/ContactsProvider(172):     at android.accounts.AccountManager$BaseFutureTask$Response.onError(AccountManager.java:1338)02-02 11:37:54.500: ERROR/ContactsProvider(172):     at android.accounts.IAccountManagerResponse$Stub.onTransact(IAccountManagerResponse.java:69)02-02 11:37:54.500: ERROR/ContactsProvider(172):     at android.os.Binder.execTransact(Binder.java:288)02-02 11:37:54.500: ERROR/ContactsProvider(172):     at dalvik.system.NativeStart.run(Native Method)</code></pre>","599346","","599346","","2011-02-02 17:49:28","2012-05-01 00:47:38","Android sms notification problem","<android>","1","5","","",""
"4870078","1","4870110","","2011-02-02 01:58:40","0","92","<p>I have a set of commands that I want my app to run when it's restarted, regardless of what activity it's on. I know I need to put an <code>onRestart()</code> into every one. </p><p>Since it's the same set of commands regardless of what activity it's on, is there a way I could have them all refer to a single function for that?  It seems like that would be better then having to copy paste the commands into each <code>onRestart()</code> handler. It will be a lot less work if I need to change the set of commands too.</p>","569335","","2001600","","2013-08-23 17:26:38","2013-08-23 17:26:38","Is there a way to make a function that's available to all Activities?","<android><function><activity><global><restart>","3","0","","",""
"4870234","1","4870363","","2011-02-02 02:33:48","1","260","<p>I'm working on my first Android app, and wondering what call I can make to show this ""contact pane"": </p><p><img src=""http://i.stack.imgur.com/hVtXN.png"" alt=""Contact Pane""></p><p>I am of course, referring to the little pane with the contact's photo, name, and the action icons underneath. </p><p>As a related question... what is the official name for this little popup window?</p>","80209","","","","","2011-02-04 04:32:10","How to show the Android ""contact pane""?","<android><contacts><android-ui><android-contacts>","2","0","","",""
"4870257","1","4918191","","2011-02-02 02:38:13","1","1231","<p>I have an app that allows the user to scale in for a closer view of a custom View using the ScaleGestureDetector.</p><p>What I would like to do is show the user a thumbnail of the larger screen when they are zoomed in.  I'd like to show the thumbnail anchored to the bottom left corner of the visible area of the View, such that as the user scales in, the thumbnail stays visible.  </p><p>My problem is that while I am able to determine when I should be showing the thumbnail in my View's onDraw() method, I can't figure out how to anchor the shape I wish to draw (a translucent Rect) in the visible corner.  No problem drawing it to the canvas using absolute coordinates, but as soon as I scale in, it stays in the absolute corner.</p><p>I do track the current scaling factor as well as the scaling center (x,y), so I could likely do some calculations relating to the known window size, and these values to determine the corner, but just wondering if there are any routines or better ways to handle this.</p><p>Thanks for any info,</p><p>Paul</p>","357801","","357801","","2011-02-02 02:43:45","2011-02-07 04:59:51","Android: Determine Coordinates of Viewable Area when Scaling","<android><canvas><scaling><rect>","1","0","2","",""
"4870373","1","4871191","","2011-02-02 03:01:10","1","488","<p>I'm making a Live Wallpaper and attempting to add some user preferences. If I have this:</p><pre><code>public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {    drawType = prefs.getString(""drawtype"", ""0"");}</code></pre><p>I get a ClassCastException upon running the app on a completely unrelated line:</p><pre><code>Line front = (Line) polyList.get(polyList.size()-1);</code></pre><p>If I comment out the line beginning with ""drawType ="" I get no exceptions and the app works fine (albeit without the user settings doing anything).</p><p>Can anybody explain this at all, it doesn't seem to make any sense. If you need more parts of my code I'm happy to provide them. Thanks.</p><p>EDIT: Not sure how to get a stack trace, so at the risk of being unhelpful, here is my logcat:</p><pre><code>02-01 21:45:26.934: ERROR/AndroidRuntime(4264): FATAL EXCEPTION: main02-01 21:45:26.934: ERROR/AndroidRuntime(4264): java.lang.ClassCastException: com.nickavv.linear.Line02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at com.nickavv.linear.Wallpaper.draw(Wallpaper.java:127)02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at com.nickavv.linear.Wallpaper$WallEngine.drawFrame(Wallpaper.java:95)02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at com.nickavv.linear.Wallbaser$AnimationEngine.onSurfaceChanged(Wallbaser.java:45)02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at android.service.wallpaper.WallpaperService$Engine.updateSurface(WallpaperService.java:558)02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at android.service.wallpaper.WallpaperService$Engine.attach(WallpaperService.java:606)02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:817)02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:61)02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at android.os.Handler.dispatchMessage(Handler.java:99)02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at android.os.Looper.loop(Looper.java:123)02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at java.lang.reflect.Method.invokeNative(Native Method)02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at java.lang.reflect.Method.invoke(Method.java:521)02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-01 21:45:26.934: ERROR/AndroidRuntime(4264):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","468498","","468498","","2011-02-02 03:55:03","2011-02-02 05:47:45","Android ClassCastException when using Preferences.getString","<android><preferences><classcastexception>","2","3","","",""
"4870420","1","4870492","","2011-02-02 03:09:42","5","1167","<p>I'm working in Android where memory is limited and there is no swap file like feature. I've read that people have implemented swap file like functionality using memory mapped files in their apps but I don't understand how this would work. Does anyone know?</p><p>I think the general idea is that, if my program wanted to use an int array that was the size of say 20Mb, I could create the data for this array in a 20Mb file and then use the memory mapped file feature to transparently bring into memory the parts of the file I current need to read and write to. The crucial element is that, although I have 20Mb of space to read/write to, only a small fraction of this is ever in memory at a time (Android apps are limited to ~24Mb of memory).</p><p>I'd prefer to work in Java for this but a C solution would also work.</p><p>Edit: This memory mapped file trick is mentioned here but I don't understand how it would work <a href=""http://grammerjack.blogspot.com/2009/10/gles-quake-port-of-quake-to-android.html"" rel=""nofollow"">http://grammerjack.blogspot.com/2009/10/gles-quake-port-of-quake-to-android.html</a></p>","580100","","580100","","2011-02-02 03:21:58","2011-02-02 04:01:26","Using a memory mapped file as a swap file?","<java><android><c><jni><android-ndk>","1","2","2","",""
"4870519","1","4876238","","2011-02-02 03:29:51","3","594","<p>I've recently found out there is no hard limit to how much memory you can allocate in C/NDK on Android. This is in contrast to Java where the limit is ~24Mb. I'm working on a few apps that could greatly benefit from using about ~50Mb total. Is this far too much memory to use? Does anyone have any experience with developing apps that go above the Java limit and what impact this has across devices?</p><p>Obviously, I don't want to kill all background apps by consuming too much memory and I know the Android devs suggest not using too much memory but limiting all apps to ~24Mb is very limiting to certain kinds of apps. I've seen a few Android games recently that say they use ~256Mb.</p><p>I'm planning to use about 50Mb total for my app. Does this sound reasonable in terms of stability across devices that have a limit of 24Mb?</p>","580100","","580100","","2011-02-02 15:09:17","2011-02-02 15:24:34","Using too much memory in C/NDK?","<java><android><c><mobile><android-ndk>","1","0","","",""
"4870532","1","4870613","","2011-02-02 03:33:40","5","75","<p>There are over 60 devices for Android. </p><p>What are all of the images sizes that you need for images on Android to make things look really good? From tablets to the smaller phones.</p><p>I know with Apple hardware this is very easy to figure out, but I am wondering about Android image sizes.</p>","53740","","","","","2011-02-02 03:52:38","What are all of the images sizes that you need for images on Android to make things look really good?","<android>","1","0","2","",""
"4870603","1","","","2011-02-02 03:50:40","0","5009","<p>I have looked and tried a lot of different things but no matter what I end up doing the screen is always blank and I'm sure it's something really dumb I'm doing and I'm hoping someone will catch it.</p><p>I'm trying to alternate background colors but before I even get to that I need to get it so that even one background color will display properly.</p><p>First, my xml layout works fine and when I got to the layout view it displays the color just as I want it to. When I go to setContentView() in the activity that calls the xml it is never displayed and I only get a blank screen. </p><p>Second, since this initial issue described above I have tried several fixes and have numbered them accordingly. As I did a fix I usually only bothered to comment it out instead of deleting it after it didn't work. After certain lines there is a number, so if three lines have 1's behind them then those were the three lines used in attempt #1. </p><p>Third, while trying these fixes I added a colors xml file while I'll display as well.</p><p>Finally, I'll show my main activity first, xml file second, and colors file last. As you can see my ultimate goal would be to change the background dynamically but I can't even to get it to work normally right now. And FYI my splash screen works fine. But that's an image.</p><p>Thanks for you help.</p><pre><code>public class Blink extends Activity {    long startTime= System.currentTimeMillis();    long now=0;//the current time in millispublic void OnCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    //TextView backgroundColor=new TextView(this);2,3,4,5,6    //backgroundColor.setBackgroundColor(0xFFFF0000);5    //backgroundColor.setBackgroundResource(R.color.royalBlue);2,3,4    //backgroundColor.setVisibility(0);//make visible 3    setContentView(R.layout.blank);1    //setContentView(backgroundColor);4,5,6    //backgroundColor.setBackgroundColor(Color.argb(255, 255, 255, 255));6            //setContentView(R.layout.blink_blue);    //blink from royal blue to blank            /*while(true){        startTime= System.currentTimeMillis();        do{            now=System.currentTimeMillis();            setContentView(R.layout.blink_blue);        }while((-(startTime-now))&gt;1000);        do{            now=System.currentTimeMillis();            setContentView(R.layout.blank);        }while((-(startTime-now))&gt;1000);    }*/}</code></pre><p><strong>This begins the xml file</strong>  </p><pre><code>//it is formatted properly but for some reason stack overflow doesn't like it so I'm only posting relevant lines. //This is a Linear layoutandroid:id=""@+id/blinkBlue""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background=""@color/royalBlue""</code></pre><p><strong>This begins the colors file</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;color name=""royalBlue""&gt;#4169e1&lt;/color&gt;//Yes I have tried #FF4169e1 instead    &lt;color name=""plainBlue""&gt;#ff000000&lt;/color&gt;     &lt;color name=""darkBlue""&gt;#ff000000&lt;/color&gt;    &lt;color name=""black""&gt;#00000000&lt;/color&gt;    &lt;!-- I also know that the blues here aren't those colors... I'll change that when I fix this thing. --&gt;&lt;/resources&gt;</code></pre>","599417","","15168","","2013-09-08 19:07:28","2014-04-13 14:13:35","How do I set the background to a solid color? When I use setContentView the screen is blank","<android><screen>","2","0","","",""
"4870667","1","4870714","","2011-02-02 04:03:46","54","59636","<p>I'm having trouble offloading tasks from the main Activities OnCreate method onto another class to do the heavy lifting.</p><p>When I try to call getSystemService from the non-Activity class an exception is thrown.</p><p>Any help would be greatly appreciated :)</p><p>lmt.java:</p><pre><code>package com.atClass.lmt;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;import android.location.Location;public class lmt extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        fyl lfyl = new fyl();        Location location = lfyl.getLocation();        String latLongString = lfyl.updateWithNewLocation(location);        TextView myLocationText = (TextView)findViewById(R.id.myLocationText);        myLocationText.setText(""Your current position is:\n"" + latLongString);    }}</code></pre><p>fyl.java</p><pre><code>package com.atClass.lmt;import android.app.Activity;import android.os.Bundle;import android.location.Location;import android.location.LocationManager;import android.os.Bundle;import android.widget.TextView;import android.content.Context;public class fyl {    public Location getLocation(){        LocationManager locationManager;        String context = Context.LOCATION_SERVICE;        locationManager = (LocationManager)getSystemService(context);        String provider = LocationManager.GPS_PROVIDER;        Location location = locationManager.getLastKnownLocation(provider);        return location;    }    public String updateWithNewLocation(Location location) {        String latLongString;        if (location != null){            double lat = location.getLatitude();            double lng = location.getLongitude();            latLongString = ""Lat:"" + lat + ""\nLong:"" + lng;        }else{            latLongString = ""No Location"";        }        return latLongString;    }}</code></pre>","568508","","11296","","2011-02-02 04:06:42","2012-03-19 04:47:01","How can I use getSystemService in a non-activity class (LocationManager)?","<android>","3","2","11","",""
"4870678","1","4870760","","2011-02-02 04:05:21","0","5465","<p>I'm sure there's a better way to do this but I'm rather new to programming altogether so I apologize in advance for my noobiness.</p><p>Here's my problem:</p><p>I have an ArrayList filled with the name parameters of my strings in strings.xml, what I'm attempting to do is fill a TextView with .setText() utilizing a resource ID that is dynamically created from a part of my array. For example...</p><pre><code>ArrayList&lt;String&gt; options = new ArrayList&lt;String&gt;();options.add(""bacon"");options.add(""ham"");//R.id.option1 is in my layout and R.string.bacon is in my strings.xmlTextView option1 = (TextView)findViewById(R.id.option1);option1.setText(R.string.(options.get(0)));</code></pre><p>This isn't my complete code obviously. It's just a example faced by the same problem.</p><p>Any ideas?</p><p>Thanks in advance!</p>","599429","","","","","2011-02-02 04:26:06","Android: Set a resource string ID from an ArrayList?","<java><android><string><resources>","2","0","","",""
"4870694","1","5323155","","2011-02-02 04:10:19","0","700","<p>I have a set of images. I am displaying it on the screen as a grid.So based upon selecting each image i want to do actions.That I have done. But one more requirement is that when we move our hand through these images then also I have to perform the same actions. That is, I will have to track on which image I have touched right now and perform the actions. How will I implement it? Does anyone have any idea? Please respond..</p>","504162","","","","","2011-03-16 09:20:51","scrolling within grid view","<android>","3","2","","",""
"4870818","1","","","2011-02-02 04:35:26","1","1276","<p>Hi i am displaying some lines on canvas.Now i want to apply horizontal scrollview for those lines.Please give me some (code) suggestions.Thanks in advance</p>","479027","","","","","2011-02-02 07:31:15","apply the horizontal scrollview for canvas","<android>","1","0","","",""
"4870823","1","8583701","","2011-02-02 04:36:53","1","657","<p>I am an Android Newbie trying to use my VB experience (8yrs ago) and design a UI. I am trying to create a checkers board which in VB would be a form on which I add multiple resizable panel widgets contiguously as needed in multiple rows. Since these are panels I can either add a small image (coin) on it (with the panel as background) or even add another small panel with a color that I can make visible and invisible to represent the coins. I know describing a VB UI is bad but VB is meant to make form designs easy and it really does and that is the only language I can think in for UI.</p><p>I notice that android SDK does not nearly have enough widgets for me to use. The best I could think of is using a TableLayout with multiple rows. The thing I don't get is what do I use to represent a square? Is there something analogous to a VB panel widget? I don't want to use an image because I want the board to be auto adjust to the screen dimensions.</p><p>Could some one help me with some hints?</p><p>ThanksPav</p>","220201","","","","","2011-12-21 00:22:54","Drawing a board (checkers) for an Android App","<android><user-interface>","1","0","","",""
"4870828","1","4870966","","2011-02-02 04:39:33","0","2692","<p>i have published android app but not appearing in android market.i m using android 2.2 and i have tried in samsung galaxy that is not showing my application so just give me some idea to fix this problem.</p><p>this is my manifest.xml file:</p><p>                                                                                                                                                                          </p><pre><code>    &lt;activity android:name="".Full""    android:screenOrientation=""landscape""           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.SAMPLE_CODE"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".Short""           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.SAMPLE_CODE"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;/application&gt;</code></pre><p> </p><p>Please help me..</p>","591790","","","","","2011-02-02 08:22:08","android market is not showing my published application","<android>","2","2","","",""
"4870877","1","","","2011-02-02 04:50:08","0","2144","<p>I created one login form with html5 application.</p><p>Then how can i add this same application into andriod .</p><p>doubt: How can i configure this application into our local application server like apache tomcat and  how can i use it in andriod.</p><p>please help me on this .</p>","355997","","","","","2011-02-02 04:54:14","how can we embedded locally created html5 web application into android ","<android>","1","1","","",""
"4870878","1","","","2011-02-02 04:50:17","2","647","<p>I'm using the the Android SDK sample to get an image from the camera. The code below is the only logic I added to the code. Essentially I'm taking the picture converting it to a bitmap and displaying it. Unfortunately this results on a real phone as a distorted image (on the emulator it is just fine)</p><p>Any help will be appreciated</p><p></p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    switch(keyCode){        case KeyEvent.KEYCODE_CAMERA:            mCamera.takePicture(null, null,new PictureCallback(){                @Override                public void onPictureTaken(byte[] data, Camera camera) {                    showPicture(data);                }            });            break;    }    return super.onKeyDown(keyCode, event);}void showPicture(byte[] data) {    if (data != null) {        Bitmap picture = BitmapFactory                .decodeByteArray(data, 0, data.length);        ImageView view = new ImageView(this);        view.setImageBitmap(picture);        this.setContentView(view);    }}</code></pre><p></p>","213493","","","","","2012-03-21 15:39:32","Taking picture result in a distorted image","<android>","1","0","","",""
"4870937","1","4871012","","2011-02-02 05:00:46","4","8022","<p>I'm working on the Tabs example from Google Android Developers site (http://developer.android.com/resources/tutorials/views/hello-tabwidget.html) but I'm stuck in step 2.</p><p>At the very end of step 2 says ""Duplicate this for each of the three activities, and add the corresponding  tags to the Android Manifest file""</p><p>What exactly do I have to add to the AndroidManifest.xml?</p><p>Thanks</p>","485397","","","","","2011-02-02 09:27:53","Android manifest.xml","<android><tabs><android-manifest><tabview>","4","0","2","",""
"4870957","1","4872963","","2011-02-02 05:03:48","1","653","<p>I am trying to add some preferences abilities into my application. I want the application to be able to load default values that are set in an XML file and then be able to change those values later. I ran across Preferences and have been trying to implement in my code. I worked out the code below and when trying to run the code between the <strong>""//STARTING HERE""</strong> and <strong>""//ENDING HERE""</strong> comments in my <strong>SmartApp</strong> class it does not launch my gui (the screen is blank and does not appear to be doing anything) and gives the following logcat messages. When i run with that area commented out, the application runs like normal. Can someone please take a look at what i have and see what i might be doing wrong or have suggestions for what i might need to fix this issue? If you have any questions or need more information, please let me know. <strong>Thanks in advance</strong>, if i find the solution i will post it here.   </p><hr><pre><code>//The log cat messages02-01 22:49:19.653: INFO/ActivityManager(59): Displayed activity com.android.launcher/com.android.launcher2.Launcher: 43150 ms (total 43150 ms)02-01 22:49:24.513: WARN/ActivityManager(59): Launch timeout has expired, giving up wake lock!02-01 22:49:25.560: WARN/ActivityManager(59): Activity idle timeout for HistoryRecord{43f017d0 cpe495.smartapp/.SmartApp}02-01 22:49:29.393: DEBUG/KeyguardViewMediator(59): pokeWakelock(5000)02-01 22:49:29.613: DEBUG/KeyguardViewMediator(59): pokeWakelock(5000)02-01 22:49:29.862: INFO/ARMAssembler(59): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x337450:0x33755c] in 1480914 ns02-01 22:49:29.952: INFO/ARMAssembler(59): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x337560:0x337728] in 1085613 ns02-01 22:53:59.112: DEBUG/SntpClient(59): request time failed: java.net.SocketException: Address family not supported by protocol    </code></pre><hr><pre><code>//The Array Values&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;&lt;string-array name=""heartRateBaseArray""&gt;&lt;item&gt;10 bpm&lt;/item&gt;&lt;item&gt;20 bpm&lt;/item&gt;&lt;item&gt;30 bpm&lt;/item&gt;&lt;item&gt;40 bpm&lt;/item&gt;&lt;item&gt;50 bpm&lt;/item&gt;&lt;item&gt;60 bpm&lt;/item&gt;&lt;item&gt;70 bpm&lt;/item&gt;&lt;item&gt;80 bpm&lt;/item&gt;&lt;item&gt;90 bpm&lt;/item&gt;&lt;item&gt;100 bpm&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name=""heartRateBaseValues""&gt;&lt;item&gt;10&lt;/item&gt;&lt;item&gt;20&lt;/item&gt;&lt;item&gt;30&lt;/item&gt;&lt;item&gt;40&lt;/item&gt;&lt;item&gt;50&lt;/item&gt;&lt;item&gt;60&lt;/item&gt;&lt;item&gt;70&lt;/item&gt;&lt;item&gt;80&lt;/item&gt;&lt;item&gt;90&lt;/item&gt;&lt;item&gt;100&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name=""sI1Array""&gt;&lt;item&gt;0&lt;/item&gt;&lt;item&gt;5&lt;/item&gt;&lt;item&gt;10&lt;/item&gt;&lt;item&gt;15&lt;/item&gt;&lt;item&gt;20&lt;/item&gt;&lt;item&gt;25&lt;/item&gt;&lt;item&gt;30&lt;/item&gt;&lt;item&gt;35&lt;/item&gt;&lt;item&gt;40&lt;/item&gt;&lt;item&gt;45&lt;/item&gt;&lt;item&gt;50&lt;/item&gt;&lt;item&gt;55&lt;/item&gt;&lt;item&gt;60&lt;/item&gt;&lt;item&gt;65&lt;/item&gt;&lt;item&gt;70&lt;/item&gt;&lt;item&gt;75&lt;/item&gt;&lt;item&gt;80&lt;/item&gt;&lt;item&gt;85&lt;/item&gt;&lt;item&gt;90&lt;/item&gt;&lt;item&gt;95&lt;/item&gt;&lt;item&gt;100&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name=""sI1Values""&gt;&lt;item&gt;0&lt;/item&gt;&lt;item&gt;5&lt;/item&gt;&lt;item&gt;10&lt;/item&gt;&lt;item&gt;15&lt;/item&gt;&lt;item&gt;20&lt;/item&gt;&lt;item&gt;25&lt;/item&gt;&lt;item&gt;30&lt;/item&gt;&lt;item&gt;35&lt;/item&gt;&lt;item&gt;40&lt;/item&gt;&lt;item&gt;45&lt;/item&gt;&lt;item&gt;50&lt;/item&gt;&lt;item&gt;55&lt;/item&gt;&lt;item&gt;60&lt;/item&gt;&lt;item&gt;65&lt;/item&gt;&lt;item&gt;70&lt;/item&gt;&lt;item&gt;75&lt;/item&gt;&lt;item&gt;80&lt;/item&gt;&lt;item&gt;85&lt;/item&gt;&lt;item&gt;90&lt;/item&gt;&lt;item&gt;95&lt;/item&gt;&lt;item&gt;100&lt;/item&gt;&lt;/string-array&gt;&lt;/resources&gt;  </code></pre><hr><pre><code>//The settings.xml file&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen  xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;PreferenceCategory android:title=""Profile Settings""&gt;&lt;EditTextPreference android:title=""First Name"" android:key=""firstNameKey"" android:selectable=""false""&gt;&lt;/EditTextPreference&gt;&lt;EditTextPreference android:title=""Last Name"" android:key=""lastNameKey"" android:selectable=""false""&gt;&lt;/EditTextPreference&gt;&lt;EditTextPreference android:title=""User Name"" android:key=""userNameKey"" android:selectable=""false""&gt;&lt;/EditTextPreference&gt;&lt;EditTextPreference android:title=""Birth Date"" android:key=""birthDateKey"" android:selectable=""false""&gt;&lt;/EditTextPreference&gt;&lt;/PreferenceCategory&gt;&lt;PreferenceCategory android:title=""Configuration Settings""&gt;&lt;ListPreference android:title=""Medium Stress Index Threshold"" android:entryValues=""@array/sI1Values"" android:entries=""@array/sI1Array"" android:key=""sI1Key""&gt;&lt;/ListPreference&gt;&lt;ListPreference android:title=""High Stress Index Threshold"" android:entryValues=""@array/sI1Values"" android:entries=""@array/sI1Array"" android:key=""sI2Key""&gt;&lt;/ListPreference&gt;&lt;EditTextPreference android:title=""Weight 1"" android:key=""weight1Key""&gt;&lt;/EditTextPreference&gt;&lt;EditTextPreference android:title=""Weight 2"" android:key=""weight2Key""&gt;&lt;/EditTextPreference&gt;&lt;EditTextPreference android:title=""Weight 3"" android:key=""weight3Key""&gt;&lt;/EditTextPreference&gt;&lt;ListPreference android:entryValues=""@array/heartRateBaseValues"" android:entries=""@array/heartRateBaseArray"" android:defaultValue=""60"" android:key=""heartRateBaseKey"" android:title=""Heart Rate Base""&gt;&lt;/ListPreference&gt;&lt;EditTextPreference android:title=""Heart Rate Variability Minimum"" android:key=""hRVMinKey""&gt;&lt;/EditTextPreference&gt;&lt;EditTextPreference android:title=""Heart Rate Variability Maximum"" android:key=""hRVMaxKey""&gt;&lt;/EditTextPreference&gt;&lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;   </code></pre><hr><pre><code>//The preferences classpackage cpe495.smartapp;import android.os.Bundle;import android.preference.PreferenceActivity;public class Preferences extends PreferenceActivity {    public void onCreate(Bundle savedInstanceState) {        addPreferencesFromResource(R.xml.settings);    }}   </code></pre><hr><pre><code>//The Main Classpublic class SmartApp extends Activity implements OnSharedPreferenceChangeListener {    TextView smartConnectionStatus;    TextView testOutputView;    Thread cThread;    private ConnectDevice cD = new ConnectDevice();    private DataRobot dR = new DataRobot();    private DataBuilder dB = new DataBuilder();    private DataSender dS = new DataSender();    public SmartApp() {        /* Constructor */        cD.addDataReceivedListener(new DataReceivedListener() {            @Override            public void dataReceivedReceived(DataReceivedEvent event) {                // TODO Auto-generated method stub                dR.analyzeData(event.getData());            }        });        dR.addDataAnalyzedListener(new DataAnalyzedListener() {            @Override            public void dataAnalyzedReceived(DataAnalyzedEvent event) {                // TODO Auto-generated method stub                dB.submitData(event.getData());            }        });        dB.addDataBuilderListener(new DataBuilderListener() {            @Override            public void dataBuilderReceived(DataBuilderEvent event) {                // TODO Auto-generated method stub                dS.sendData(event.getData());            }        });    }    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.intro);        //STARTING HERE        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);        prefs.registerOnSharedPreferenceChangeListener(this);        //set remembered preferences        dR.sethRB(Integer.parseInt((prefs.getString(""heartRateBaseKey"", null))));        dR.sethRVMax(Integer.parseInt((prefs.getString(""hRVMaxKey"", null))));        dR.sethRVMin(Integer.parseInt((prefs.getString(""hRVMinKey"", null))));        dR.setsI1(Integer.parseInt((prefs.getString(""sI1Key"", null))));        dR.setsI2(Integer.parseInt((prefs.getString(""sI2Key"", null))));        dR.setW1(Integer.parseInt((prefs.getString(""weight1Key"", null))));        dR.setW2(Integer.parseInt((prefs.getString(""weight2Key"", null))));        dR.setW3(Integer.parseInt((prefs.getString(""weight3Key"", null))));        //ENDING HERE                    smartConnectionStatus = (TextView) findViewById(R.id.smartConnectionStatus);        testOutputView = (TextView) findViewById(R.id.testingOutput);        final Button firstTimeButton = (Button) findViewById(R.id.firstTimeButton);        firstTimeButton.setOnClickListener(        new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                Intent userCreationIntent = new Intent(v.getContext(), UserCreation.class);                startActivityForResult(userCreationIntent, 0);            }        });        final Button connectDeviceButton = (Button) findViewById(R.id.connectDeviceButton);        connectDeviceButton.setOnClickListener(        new View.OnClickListener() {                @Override            public void onClick(View v) {                // TODO Auto-generated method stub                //Intent connectDeviceIntent = new Intent(v.getContext(), ConnectDevice.class);                //startActivityForResult(connectDeviceIntent, 0);                cThread = new Thread(cD);                cThread.start();            }        });        final Button disconnectDeviceButton = (Button) findViewById(R.id.disconnectDeviceButton);        disconnectDeviceButton.setOnClickListener(        new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                cD.setConnected(false);            }        });    }    @Override    public void onSharedPreferenceChanged(SharedPreferences prefs,            String key) {        // TODO Auto-generated method stub        if(key.equals(""heartRateBaseKey"")) {            dR.sethRB(Integer.parseInt((prefs.getString(""heartRateBaseKey"", null))));        }        else if(key.equals(""hRVMaxKey"")) {            dR.sethRVMax(Integer.parseInt((prefs.getString(""hRVMaxKey"", null))));        }        else if(key.equals(""hRVMinKey"")) {            dR.sethRVMin(Integer.parseInt((prefs.getString(""hRVMinKey"", null))));        }        else if(key.equals(""sI1Key"")) {            dR.setsI1(Integer.parseInt((prefs.getString(""sI1Key"", null))));        }        else if(key.equals(""sI2Key"")) {            dR.setsI2(Integer.parseInt((prefs.getString(""sI2Key"", null))));        }        else if(key.equals(""weight1Key"")) {            dR.setW1(Integer.parseInt((prefs.getString(""weight1Key"", null))));        }        else if(key.equals(""weight2Key"")) {            dR.setW2(Integer.parseInt((prefs.getString(""weight2Key"", null))));        }        else if(key.equals(""weight3Key"")) {            dR.setW3(Integer.parseInt((prefs.getString(""weight3Key"", null))));        }    }}</code></pre>","427763","","","","","2011-02-02 09:57:40","android preferences causing error","<java><android><preferences><android-preferences><preferenceactivity>","1","0","1","",""
"4871072","1","7406747","","2011-02-02 05:26:41","0","358","<p>Would it be possible to create a TextView in Android that can scroll many lines of text, but will not draw the first or last line of text unless it can be drawn in it's height completely? I realize that it might look strange when scrolling, but I don't want to see the cut-off tops or bottoms of characters.</p><p>The suggested solution may involve modifying the android platform.</p>","215266","","215266","","2011-09-13 00:47:12","2011-09-19 09:54:08","TextView without partially drawn lines","<android><android-widget><textview>","3","2","","",""
"4871149","1","","","2011-02-02 05:40:01","4","6848","<p>I have written code in android which stores data in ""3gpp"" formate, but i required ""wav"" formate. I refered some forms and android developers site it says android has does not has ""wav"" formate. Please provide the suitable program to over come this problem.</p>","599504","","237838","","2012-09-07 05:55:52","2013-01-11 11:55:25","how to record voice in wav formt using android","<android>","2","0","3","",""
"4871152","1","4871397","","2011-02-02 05:40:22","12","13174","<p>For setting the Single Line in <code>EditText</code> we use <code>android:singleLine=""true""</code> but I want to set the single line for the Hint Text, it is large and I want to show it in  a one line like:</p><blockquote>  <p><a href=""http://google.myopenid.stackoverflow.com"">http://google.myopenid.stackoverflow.com</a></p></blockquote><p>I am using the following code:  </p><pre><code>&lt;EditText android:id=""@+id/editText1""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:hint=""@string/defaultUrl""    android:singleLine=""true"" /&gt;</code></pre><p>Note: <code>defaultUrl</code> is dynamic and very long URL.</p>","256612","","648313","","2012-02-26 18:51:30","2012-02-26 18:51:30","Android: EditText hint in single line","<android><edittext><hint>","2","3","","",""
"4871156","1","","","2011-02-02 05:41:14","3","267","<p>I'd love to be able to understand when a SPECIFIC item in the SMS or Call Log is changed.  It's pretty easy to get notified when something changes in the appropriate content provider, but getting to the specific record is totally inefficient as one needs to maintain a total mirror image of the store and then figure out the diff.  This is not only lame.  What use is a notifcation for ""oh something has changed in this table of 800 items, but we'll leave it to you to figure out not just the item, but the actual attribute/attributes for that item that have changed.""</p><p>Perhaps someone smarter than me can tell me how to get notifed when a SPECIFIC call log, sms or contact record has changed.  I'd love to know when the contact provider gets an update for a display_name.  Or when a contact has been marked as a 'favorite'.</p><p>I'd like to know how to detect/get notifide when the contacts provider gets an update for a display_name or some other attribute such as 'favorite'.  My service is interested in these changes as it will do something in response to these kinds of changes.</p>","599506","","314166","","2012-10-02 14:44:57","2012-10-02 14:44:57","ContentObservers are useless","<android><notifications><contacts><android-contentprovider><calllog>","1","1","1","",""
"4871196","1","","","2011-02-02 05:48:47","1","1928","<p>Hey guys I'm using alarm manager to run my application at specific point of time. I want to run my application on every weekdays ( Mon-fri ) so could you please tell me how to do this.</p>","478535","","18061","","2012-10-13 12:19:57","2012-10-13 12:19:57","How to set alarms using alarm manager running every weekdays","<android><android-alarms>","2","0","","",""
"4871204","1","","","2011-02-02 05:49:40","1","907","<p>I need to execute a binary from source code of an android application. This binary must be run for a few seconds and I have to capture the standard output during this time. Then I have to kill both processes. The problem is that the binary attempts to access /dev/block/vold/179:1 (sdcard) to read the device and am getting the message ""permission denied"" or sometimes other error messages. I've no clear what I have to do to run for 30 seconds and how to solve the ""permission denied."" I think the problem is not ""su"" process execution, because the application asks me for root privileges (I put the ""process.runtime.getRuntime (). Exec ("" su "");)</p><p>Please, help me! I've a big headache!!</p><p>Thanks.</p>","598011","","","","","2011-02-02 05:52:13","Run binary application from android source - problem permission denied","<android><permissions><binary><run><denied>","1","0","","",""
"4871288","1","4871478","","2011-02-02 06:05:58","1","825","<p>From last 2 weeks I am searching for an answer but not getting a bit of success.My scenario is, I am using Eclipse for developing Android apps. I want to display route directions (Driving, Walking, Bicycling) between two dynamically entered addresses on Google Maps... I want to make use of Google Maps JavaScript API V3 Services, because of all its  awesome functionalities...<a href=""http://code.google.com/apis/maps/documentation/javascript/services.html#Directions"" rel=""nofollow"">http://code.google.com/apis/maps/documentation/javascript/services.html#Directions</a></p><p>I was suggested by some developers on Stack Overflow and they gave this link <a href=""http://code.google.com/intl/en/apis/maps/articles/android_v3.html#why"" rel=""nofollow"">http://code.google.com/intl/en/apis/maps/articles/android_v3.html#why</a> But this site has code that uses some JavaScripts in the code, if this site is having the correct stuff, where am I supposed to write JavaScript in my eclipse android app because AFAIK code written in eclipse uses only Java framework.. If that site is not a good bet give me some other links that demonstrates with examples...</p>","505580","","505580","","2011-02-02 06:13:48","2011-02-02 06:38:46","Where to write JavaScript in my android Program","<javascript><android><map>","2","0","","",""
"4871297","1","","","2011-02-02 06:08:44","0","1163","<p>It is possible to get the events within a time range but is it possible to get the event info when user clicks any part in certain events.</p><p>For example if Event contains a URI which is linkified is it possible for application to know the source event which was clicked?</p>","119031","","","","","2011-02-02 06:28:19","How to get calendar event info in Android when specific event is clicked?","<java><android><events><calendar><onclick>","1","0","","",""
"4871355","1","4871472","","2011-02-02 06:20:31","1","6519","<p>I have list of images added in a <code>LinearLayout</code>  </p><pre><code>+------------+|  Image 1   |+------------+|  Image 2   |+------------+|  Image 3   |+------------+</code></pre><p>I want every 2nd image to get Displayed above 1st and 3rd Image.<br>For that I have set Bottom Margin of <code>Image 1</code> to <code>-10</code> pixels so <code>Image 2</code> overrides <code>Image 1</code> and it works, but this same logic does not work for  <code>Image 3</code>, <code>Image 2</code> does not override  <code>Image 3</code>s Top portion, as i have given <code>-10</code> top margin for the <code>Image 3</code>.</p><p>I have also tried <code>bring_to_front</code> for <code>Image 2</code> but it does not work.<br>How Should i get it working.  </p><p>Thanks,<br>PP.</p>","314247","","","","","2011-02-02 06:37:52","How to bring ImageView in front of other ImageViews (android)","<android>","2","2","","",""
"4871431","1","4871483","","2011-02-02 06:31:20","1","333","<p>I want a view much like menubar at the bottom of the screen.I want to keep it in all the activity i have.</p><p>Is there any way to keep this view in all the activity without copy &amp; pasting it to all the activity?</p><p>If you know about it let me know ASAP.</p><hr><p>Shaiful</p>","595543","","","","","2011-02-02 06:40:59","Use a fixed view to all my Activity","<android><view><activity>","2","0","3","",""
"4871509","1","4871723","","2011-02-02 06:44:19","4","914","<p>I find myself using the Application class a lot to persist user data. These are application wide resources, though I cheat by storing an integer or two sometimes. Are there any drawbacks of doing this? I could not find any documentation which puts a limit on the amount of data that can be stored here.</p>","48066","","","","","2011-02-02 07:18:22","Using Application class for storing persistent data in Android","<android>","1","0","1","",""
"4871516","1","","","2011-02-02 06:45:02","1","872","<p>i am using adb command for install .APk file in android phone successfully. Now i want to start application at the installation time i mean when .apk file is install in phone then run .Apk File run automatically. Please guide me..Thank in advance...</p>","594746","","","","","2012-02-21 02:27:22","Android Application Auto Start","<android>","2","0","","",""
"4871616","1","4872674","","2011-02-02 07:02:33","0","2121","<p>i have create login page with 2 EditText and checkbox and login button.if i set checkbox to Enabled i want to save data so next time user doesn't need to fill that fields..<br>i have uses this code but no luck..</p><p>public class LoginPage extends Activity {</p><pre><code>EditText d_ID;EditText password;CheckBox cb;ImageButton ib;public static final String PREFS_NAME = ""MyPrefsFile"";public String PREFS_USER;public String PREFS__PASS;String username;String upass;</code></pre><p>SharedPreferences pref</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    requestWindowFeature(Window.FEATURE_NO_TITLE);    super.onCreate(savedInstanceState);    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);    setContentView(R.layout.loginpage);    d_ID = (EditText) findViewById(R.id.dulzuID);    password = (EditText) findViewById(R.id.dulzuPASS);    cb = (CheckBox) findViewById(R.id.remember);    ib = (ImageButton) findViewById(R.id.login);        pref = getSharedPreferences(PREFS_NAME, MODE_PRIVATE);        username = pref.getString(PREFS_USER, null);        upass = pref.getString(PREFS__PASS, null);        d_ID.setText(username);        password.setText(upass);    ib.setOnClickListener(new OnClickListener() {        public void onClick(View view) {            startActivity(new Intent(LoginPage.this, Features.class));        }    });    cb.setOnCheckedChangeListener(new OnCheckedChangeListener() {        public void onCheckedChanged(CompoundButton cb1, boolean bln) {                PREFS_USER = d_ID.getText().toString();//get user name from EditText                PREFS__PASS = password.getText().toString();//get user Password from EditText                getSharedPreferences(PREFS_NAME, MODE_PRIVATE).edit().putString(PREFS_USER, username).putString(PREFS__PASS, upass).commit();        }    });}</code></pre><p>}</p><p>Any help??</p><p>Thanks...</p>","472882","","472882","","2011-02-02 07:32:45","2011-02-02 09:29:05","Android:problem in remember me functionality of login Activity","<android><activity>","5","0","1","",""
"4871686","1","","","2011-02-02 07:13:23","1","5127","<p>I have an android application that consists of main layout of FrameLayout which has two views set in RelativeLayout. (see layout XML files below).The problem is with second view (view2) screen orientation (the view turn to black and app is frozen).</p><p>I have tried with no success to use the option android:orientation=""horizontal""in the layout-land resource.</p><p>Please advise.</p><p>Thank you.Oakist</p><h2>main.xml</h2><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/container""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;include android:id=""@+id/notelist"" layout=""@layout/view1"" /&gt;&lt;include android:id=""@+id/notelist"" layout=""@layout/view2"" /&gt;&lt;/FrameLayout&gt;</code></pre><h2>view1.xml</h2><pre><code>&lt;RelativeLayout android:id=""@+id/Layout01""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ImageViewandroid:layout_centerHorizontal=""true""android:layout_centerVertical=""true""android:layout_width=""wrap_content""android:id=""@+id/image01""android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;&lt;/RelativeLayout&gt;</code></pre><h2>view2.xml</h2><pre><code>&lt;RelativeLayout android:id=""@+id/Layout02""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ImageViewandroid:layout_centerHorizontal=""true""android:layout_centerVertical=""true""android:layout_width=""wrap_content""android:id=""@+id/image02""android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;&lt;/RelativeLayout&gt;</code></pre>","573736","","","","","2012-06-18 06:26:17","Android: screen orientation with FrameLayout & relativeLayout","<android><orientation><relativelayout><framelayout>","2","0","","",""
"4871695","1","","","2011-02-02 07:14:42","2","681","<p>I am creating <strong>Rubber Band</strong> effect in my <code>ListView</code>. </p><p>So for that i created the class which extends <code>AdapterView&lt;Adapter&gt;</code>. When user ups the mouse i am setting the co-ordinate again so it is again re-positioning and there is similar effect but the problem is there is no motion effect. So can some one tell me how can i provide motion effect ?</p>","512973","","881286","","2013-08-18 02:03:29","2013-08-18 02:03:29","rubber band effect in android - with Motion","<android>","0","0","","",""
"4871750","1","4871841","","2011-02-02 07:22:59","0","658","<p>And it will look like a real button. When you press on the button, it has an ""umph"" effect.  </p><p>What CSS button is smooth when done inside a web view. Hopefully, so smooth that it looks and feels like a native button.</p>","179736","","","","","2011-02-02 07:35:02","What CSS buttons work really well in Web Views (iPhone/android)?","<javascript><jquery><iphone><android><css>","1","0","","",""
"4871814","1","","","2011-02-02 07:31:46","0","2365","<p>can you give me code of how we create navigation bar , tab bar in android .</p>","552027","","473070","","2011-02-02 07:37:23","2012-06-22 12:21:21","How can i create navigation bar,tab bar in android sdk","<android>","2","2","","2012-08-18 04:50:04",""
"4871834","1","4872033","","2011-02-02 07:34:21","0","673","<p>I'm trying to dynamically add some ProgressBar views to an inflated layout from an xml file. I continue to get ClassCastExceptions when running the following code:</p><pre><code>     // === This is the part I'm having trouble with ===     ProgressBar v = (ProgressBar) mLayoutInflater.inflate(R.layout.dayprogressbar, ll);     ProgressBar p = (ProgressBar) mLayoutInflater.inflate(R.layout.dayprogressbar, ll);</code></pre><p>The code below is how it works without the casts and runs without error, but I need to work with the views as a progress bar. Is there any way I can do this without getting a ClassCastException</p><pre><code>    /**     * Pulls the layout from R.layout.listview and creates a single list     * entry and returns it as a view to be put into the listview     */     public View getView(int position, View convertView, ViewGroup parent) {        // the view to be returned        View itemLayoutView = convertView;        // if the view doesn't exist, create the layout from the inflator        if (itemLayoutView == null) {            LayoutInflater mLayoutInflater = (LayoutInflater) getContext()                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);            // use listview.xml            itemLayoutView = mLayoutInflater.inflate(R.layout.listview,                    null);            LinearLayout ll = (LinearLayout) itemLayoutView.findViewById(R.id.List_Main_LinearLayout_ProgressBars);            // === This is the part I'm having trouble with ===            View v = mLayoutInflater.inflate(R.layout.dayprogressbar, ll);            View p = mLayoutInflater.inflate(R.layout.dayprogressbar, ll);        }</code></pre><p>Here is R.layout.dayprogressbar.xml that I'm inflating: </p><pre><code>&lt;ProgressBar    xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:progress=""50""    android:indeterminateOnly=""false""    android:progressDrawable=""@android:drawable/progress_horizontal""    android:indeterminateDrawable=""@android:drawable/progress_indeterminate_horizontal""    android:minHeight=""1dip""    android:maxHeight=""1dip""    android:max=""100""    android:paddingLeft=""1dp""    android:layout_weight=""2""/&gt;</code></pre>","396897","","","","","2011-02-02 08:04:24","Retrieve dyamically inflated layouts to work with","<android><layout><android-linearlayout>","1","2","","",""
"4871986","1","4872036","","2011-02-02 07:57:29","2","3801","<p>HiI have a listview which bind data using setAdapter ,but when i try to bind it shows Null point exception </p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);      try {          listView1 = (ListView) findViewById(R.id.ListView);        Thread t = new Thread() {            public void run() {                listItems=getList();                pHandler.post(mUpdateResults);            }            };        t.start();      } catch (Exception e) {        progress.dismiss();    }}final Handler pHandler = new Handler();// Create runnable for postingfinal Runnable mUpdateResults = new Runnable() {    public void run() {        updateTabData();    }};private void updateTabData() {    try {        this.post_Adapter = new PostAdapter(this, R.layout.outkrys,                listItems);        Toast.makeText(OutKrys.this, ""Inside updateTab after post_adapter intial ""+this.post_Adapter.items.size(), Toast.LENGTH_LONG).show();    listView1.setAdapter(new PostAdapter(this, R.layout.outkrys,listItems));                                                progress.dismiss();    } catch (Exception e) {        Toast.makeText(OutKrys.this, ""Inside updateTabData ""+e, Toast.LENGTH_LONG).show();        progress.dismiss();    }}</code></pre><p>in this this.post_Adapter.items.size() show count but ,i cant use listView1.setAdapter(new PostAdapter(this, R.layout.outkrys,listItems));please Help ...Regards Augustine</p>","593523","","133802","","2011-02-02 07:59:31","2011-02-02 08:58:38","Android :ListView.setAdapter shows null exception","<android>","2","0","1","",""
"4871999","1","6693980","","2011-02-02 08:00:28","3","1063","<p>My problem is the lowest volume in in-call mode still loud.<br>So I try this code</p><pre><code>AudioManager audio = (AudioManager)getSystemService(Context.AUDIO_SERVICE);audio.setStreamVolume(audio.STREAM_VOICE_CALL, -1, 0);</code></pre><p>But not effect, In-call volume is set to 0 and still loud.<br>Have any idea ?  </p><p>Thank you.</p>","466693","","","","","2011-07-14 13:33:59","How to reduce in-call volume (lower than 0) in android?","<android><audio>","1","1","","",""
"4872107","1","4872714","","2011-02-02 08:15:26","0","414","<p>How to get Samsung Galaxy Tab size on run time? If I use </p><pre><code>Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();int width = display.getWidth(); </code></pre><p>It gives 320*480 size. But its not the tab size.Is there any other way to get the tab size in runtime?.</p><p>Thanks,Yuvaraj.K</p>","598487","","473070","","2011-02-02 08:19:07","2012-01-07 09:06:45","Samsung Galaxy Tab size on run time","<android>","1","2","1","",""
"4872152","1","","","2011-02-02 08:21:16","1","857","<p>hai,     i have custom listview in that page should have the horizontal scrolling text. But the horizontal text is not scrolling. so please help me anyone.</p><p>i used following xml code.</p><pre><code>    &lt;TextView      android:id=""@+id/text""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:text=""""    android:layout_x=""2px""    android:layout_y=""690px""    android:background=""@drawable/bg_1""    android:textColor=""#cc0000""    android:scrollHorizontally=""true""    android:singleLine=""true""     android:focusable=""true""    android:focusableInTouchMode=""true""    android:marqueeRepeatLimit=""marquee_forever""        android:ellipsize=""marquee""       /&gt;</code></pre><p>Thank you in advance. </p>","552978","","102937","","2011-02-04 06:56:54","2011-02-04 06:56:54","can listview supports horizontal scrolling text","<android><listview><scrolling>","2","1","","",""
"4872159","1","","","2011-02-02 08:22:08","1","485","<p>I need a little help again :) I have this code again and I get an error in each line with the (R.id.ed_....) the error tells me that each ed_... cannot be resolved or is not a field. What did i do wrong?</p><pre><code>if (myCursor != null) {                if (myCursor != null) {                     EditText eName = (EditText)findViewById(R.id.ed_Name);                    eName.setText(myCursor.getString(ColumnName));                    EditText eComment = (EditText)findViewById(R.id.ed_Comment);                    eComment.setText(myCursor.getString(ColumnComment));                    EditText eCustomer_Project = (EditText)findViewById(R.id.ed_CustomerProject);                    eCustomer_Project.setText(myCursor.getString(ColumnCustomer_Project));                    EditText eBooking_Details = (EditText)findViewById(R.id.ed_BookingDetails);                    eBooking_Details.setText(myCursor.getInt(ColumnBooking_Details));                    EditText eEditable = (EditText)findViewById(R.id.ed_Editable);                    eEditable.setText(myCursor.getString(ColumnEditable));                }</code></pre>","582674","","","","","2011-10-09 08:03:50","ed_... cannot be resolved or is not a field","<android><unresolved><ed>","0","2","","2012-08-17 01:25:21",""
"4872164","1","","","2011-02-02 08:22:33","3","7545","<p>Here is My Code Snippet which perform a Search operation based on the text entered in a EditText Box, Please have a look on it...</p><pre><code>ed.addTextChangedListener(new TextWatcher() {        public void afterTextChanged(Editable s) {        }        public void beforeTextChanged(CharSequence s, int start, int count,        int after) {        }        public void onTextChanged(CharSequence s, int start, int before,        int count) {        b4.setVisibility(b4.VISIBLE);           textlength=ed.getText().length();        arr_sort.clear();        for(int i=0;i&lt;lv_arr.length;i++)        {            if(textlength&lt;=lv_arr[i].length())            {            boolean b=ed.getText().toString().equalsIgnoreCase((String) lv_arr[i].subSequence(0, textlength));            if(b)                {                    arr_sort.add(lv_arr[i]);                    //Log.i(""In If:"",arr_sort.toString());                }            }        }        lv1.setAdapter(new ArrayAdapter&lt;String&gt;(BasicsActivity.this,R.layout.rowlayout2 ,R.id.label, arr_sort));        //Log.i(""Step6-"",""ok"");        }        });</code></pre><p>Now the Problem is when I write anything on the EditText View while Running it shows a RunTime FATALException with some NullPointerException..Please suggest me some some way out of here..The Excpetions are as follows..</p><pre><code>02-02 13:29:48.577: ERROR/AndroidRuntime(541): FATAL EXCEPTION: main02-02 13:29:48.577: ERROR/AndroidRuntime(541): java.lang.NullPointerException02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at com.android.desitranslation.BasicsActivity$1.onTextChanged(BasicsActivity.java:65)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.widget.TextView.sendOnTextChanged(TextView.java:6295)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.widget.TextView.handleTextChanged(TextView.java:6336)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:6485)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.text.SpannableStringBuilder.sendTextChange(SpannableStringBuilder.java:889)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:352)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:269)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:432)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:409)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:28)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.text.method.QwertyKeyListener.onKeyDown(QwertyKeyListener.java:195)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.text.method.TextKeyListener.onKeyDown(TextKeyListener.java:132)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.widget.TextView.doKeyDown(TextView.java:4433)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.widget.TextView.onKeyDown(TextView.java:4267)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.view.KeyEvent.dispatch(KeyEvent.java:1256)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.view.View.dispatchKeyEvent(View.java:3855)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1687)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1120)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.app.Activity.dispatchKeyEvent(Activity.java:2073)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1663)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2560)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2535)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1867)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.os.Handler.dispatchMessage(Handler.java:99)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.os.Looper.loop(Looper.java:123)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at android.app.ActivityThread.main(ActivityThread.java:3647)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at java.lang.reflect.Method.invokeNative(Native Method)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at java.lang.reflect.Method.invoke(Method.java:507)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)02-02 13:29:48.577: ERROR/AndroidRuntime(541):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","589503","","21234","","2011-02-02 08:25:59","2013-03-21 23:36:09","How to solve FATAL EXCEPTION with Java.lang.NullPointerException?","<android><android-edittext>","1","9","","",""
"4872167","1","","","2011-02-02 08:23:09","2","628","<p>I'm having weird issues calling <code>getSelectedItem()</code> in my <code>onDraw()</code> function in my extended <code>Gallery</code> class. For some reason it gives me an <code>Integer</code> back when i'm expecting my own object. When i debug and look in the adapter it shows that it's filled with my objects. Any idea why it isn't returning what i expect?</p><p><strong>Edit :</strong> It looks like it's returning the index. </p><p><strong>Edit :</strong> Go figure, bad code on my part. In my adapter i did the following:</p><pre><code>@Overridepublic Object getItem(int position) {    return position;}</code></pre>","571088","","571088","","2011-02-02 08:34:45","2011-02-02 08:34:45","Problems with getSelectedItem() in extended gallery","<android><gallery><adapter><ondraw>","0","0","","",""
"4872169","1","4872606","","2011-02-02 08:23:20","1","263","<p>I am developing an Android game application.I have implemented the all the basic functionality.Designed all the screens.Now the main problem i am struck is I have to select 25 images randomly from 40 images.And display all the 25 images in the application.Can anyone guide me,,,, Thanks in advance</p><p>RegardsTushar Sahni</p>","475349","","","","","2011-02-02 09:20:43","selecting randomly images from 40 images and displaying them in game application in android","<android>","2","0","1","",""
"4872220","1","4872679","","2011-02-02 08:31:23","3","1166","<p>This is my code</p><pre><code>package com.marakana;import java.io.File;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import android.app.Activity;import android.content.Intent;import android.hardware.Camera;import android.hardware.Camera.PictureCallback;import android.hardware.Camera.ShutterCallback;import android.net.Uri;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.FrameLayout;import android.widget.Toast;public class CameraActivity extends Activity {  private static final String TAG = ""CameraDemo"";  Preview preview; // &lt;1&gt;  Button buttonClick; // &lt;2&gt;  myglobal m=new myglobal();  String aa;  /** Called when the activity is first created. */  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    preview = new Preview(this); // &lt;3&gt;    ((FrameLayout) findViewById(R.id.preview)).addView(preview); // &lt;4&gt;    buttonClick = (Button) findViewById(R.id.buttonClick);    buttonClick.setOnClickListener(new OnClickListener() {      public void onClick(View v) { // &lt;5&gt;        preview.camera.takePicture(shutterCallback, rawCallback, jpegCallback);      }    });    Log.d(TAG, ""onCreate'd"");  }  // Called when shutter is opened  ShutterCallback shutterCallback = new ShutterCallback() { // &lt;6&gt;    public void onShutter() {      Log.d(TAG, ""onShutter'd"");    }  };  // Handles data for raw picture  PictureCallback rawCallback = new PictureCallback() { // &lt;7&gt;    public void onPictureTaken(byte[] data, Camera camera) {      Log.d(TAG, ""onPictureTaken - raw"");    }  };  // Handles data for jpeg picture  PictureCallback jpegCallback = new PictureCallback() { // &lt;8&gt;    public void onPictureTaken(byte[] data, Camera camera) {      FileOutputStream outStream = null;      try {        // Write to SD Card          outStream = new FileOutputStream(String.format(""/sdcard/DCIM/%d.jpg"",            System.currentTimeMillis()));          m.setAa(aa);         Toast.makeText(getBaseContext(),aa,1000).show();        outStream.write(data);        outStream.close();        Log.d(TAG, ""onPictureTaken - wrote bytes: "" + data.length);        Intent i=new Intent();        i.setClassName(""com.marakana"", ""com.marakana.image"");        startActivity(i);      } catch (FileNotFoundException e) { // &lt;10&gt;        e.printStackTrace();      } catch (IOException e) {        e.printStackTrace();      } finally {      }      Log.d(TAG, ""onPictureTaken - jpeg"");    }  };}</code></pre>","584493","","473070","","2011-02-02 08:38:24","2011-02-02 09:29:35","image captured by camera should be forwarded to next screen in android","<android><camera>","2","2","","",""
"4872238","1","4872263","","2011-02-02 08:33:17","7","6473","<p>Is there a way to iterate through all the views in your Activity? Something like:</p><p><code><pre>Iterator it = getViewIterator();...</code></pre></p><p>Does this exist at all? I couldn't find any scent of it anywhere...</p><p>Thanks!swine</p>","418957","","","","","2014-02-19 06:42:02","Enumerate/Iterate all Views in Activity?","<android>","4","4","","",""
"4872329","1","","","2011-02-02 08:43:55","2","5009","<p>I am developing an application based on the zxing library using intent and I would like the user to be able to decode a barcode image that is stored on the sd card.</p><p>Since i am beginner in android,please tell me in detail about</p><ol><li>How to integrate ZXing with the application</li><li>How to get a image file from sd card onto the application</li><li>Finally how to decode the barcode image file and store the decoded result.</li></ol><p>Thanking you.</p>","599684","","","","","2012-08-21 04:24:00","How to decode a barcode image using ZXing library in android","<android>","1","0","","",""
"4872433","1","","","2011-02-02 08:59:47","3","1627","<p>I Want to gain a little experience in developing Android apps in the upcoming semester where I'll have a workshop course in developing for Android.So, is there a site as SourceForge for Android?</p><p>Thank you.</p>","352660","","","","","2011-02-02 10:50:01","is there a site as SourceForge for Android?","<android><sourceforge>","2","3","2","",""
"4872508","1","","","2011-02-02 09:08:44","0","48","<p>hii every buddy,</p><p>i am parsing a xml file am loading parsed data to a textview,in the xml i hav data likeYes,No,DontKnow  i need to load each data to seperate text view, i.e 'Yes' should be loaded to a textview,&amp;'No' should be loaded to other textview &amp; Dontknow should be loaded to another,can any one tell me how can i do thanx in advance</p>","571256","","","","","2011-02-02 09:12:27","loading data which are seperated by comma(,) to seperate textviews in android","<android><xml><textview>","0","0","0","",""
"4872583","1","5025547","","2011-02-02 09:18:53","2","7989","<pre><code>02-02 14:31:34.048: WARN/SQLiteCompiledSql(359): Releasing statement in a finalizer. Please ensure that you explicitly call close() on your cursor: SELECT * FROM 02-02 14:31:34.048: WARN/SQLiteCompiledSql(359): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here02-02 14:31:34.129: ERROR/Database(359): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here02-02 14:31:34.129: ERROR/Database(359):     at </code></pre><p>How to avoid this exception ?? Pls help</p><p>My code is given below : </p><pre><code> **DataSQLHelper .class**public class DataSQLHelper extends SQLiteOpenHelper {private static final String DATABASE_NAME = ""test.db"";private static final int DATABASE_VERSION = 1;   public DataSQLHelper (Context context) {super(context, DATABASE_NAME, null, DATABASE_VERSION);}@Overridepublic void onCreate(SQLiteDatabase db) {    String sql = ""create table "" + TABLE + ""( "" + BaseColumns._ID    + "" integer primary key autoincrement, "" + ID + "" text, ""    + PASSWORD + "" text, "" + ACTIVE + "" text, "" + STATUS    + "" text);"";    db.execSQL(sql);}@Overridepublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {if (oldVersion &gt;= newVersion)    return;String sql = null;if (oldVersion == 1)    sql = ""alter table "" + TABLE + "" add note text;"";if (oldVersion == 2)    sql = """";if (sql != null)    db.execSQL(sql);}        @Override    public synchronized void close() {                   super.close();    }}    ***Test_Java .java***     public class Test_Java extends Activity {  DataSQLHelper helData;SQLiteDatabase db;Cursor cursor;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);    setContentView(R.layout.main);    try {              helData= new DataSQLHelper(this);     cursor = getData();    startManagingCursor(cursor);    setContentView(R.layout.view);} catch (Exception ex) {    }    } // onCreate Endsprivate Cursor getData() {try {     db = helData.getReadableDatabase();     cursor = db.query(DataSQLHelper.TABLE, null, null,        null, null, null, null);    startManagingCursor(cursor);    return cursor;} catch (Exception ex) {    System.out.println(""Exception Occured : "" + ex.toString());    return null;}}@Overrideprotected void onDestroy() {   System.out.println(""onDestroy"");    super.onDestroy();    if (db!=null){                   db.close();                }    if (cursor!=null){                    cursor.close();    }    if ( helData!=null){        helData.close();    }}}</code></pre>","563442","","180538","","2011-02-02 13:39:00","2011-02-17 05:55:13","How to avoid db not close and cursor exception","<android><database><cursor>","2","0","2","",""
"4872593","1","4873760","","2011-02-02 09:19:29","0","105","<p>I have been using Traceview to improve some of my Android program. The problem is that I want to monitor some program that I've downloaded from Android Market.I've checked Android developer main page but it seems that you have to add these lines in order to get traceview traces:</p><p>Debug.startMethodTracing(""calc"");</p><p>Debug.stopMethodTracing();  </p><p>For example I'd like to monitor any game downloaded from Android market and see how many resources consume and which functions is calling to set a training data for a normal behavior pattern in IDS. I'm not sure if this is possible with ADB tool.</p><p>Any suggestion?</p>","574044","","","","","2011-02-02 11:15:46","Traceview for Android Market applications","<android><security>","1","0","","",""
"4872702","1","6742772","","2011-02-02 09:32:00","3","3027","<p>I'm working on a text-to-speech implementation of a flashcard program. Text in different languages should be read out. In order to do this properly the user has to select the language of the text to read (will be stored and used later without question).</p><p>Is there any possibility of getting the available tts-languages on an android system? If not, is there a possibility of getting all availably locales on the system?</p><p>thanks for your advice!</p><p>nob</p><p>edit: I guess, I got it: getAvailableLocales(), and tts.isLocaleAvailable(locale)</p>","564256","","168868","","2012-01-01 21:31:01","2013-12-29 18:38:31","get available locales for tts","<android><locale><text-to-speech>","2","0","3","",""
"4872792","1","4872907","","2011-02-02 09:40:29","0","1620","<p>I am having trouble finding a list of Android phones and their current supported Android versions so I could figure out the broadest target audience for my app.</p><p>Thanks in advance!</p>","116595","","","","","2011-02-02 09:52:34","Android phones, updates and supported SDK versions","<android><list><version><phone><target>","1","1","1","",""
"4872856","1","4872908","","2011-02-02 09:46:29","1","1852","<p>i try to transfer data from one activity to another but i can't achieve it.. can any one assit me.. kindly assit with example... thanks in advance..</p>","569553","","","","","2013-06-25 20:13:32","data transfer from one activity to another activity on button click event","<android>","3","0","1","",""
"4872881","1","","","2011-02-02 09:48:52","0","950","<p>Can anyone please tell me how to fetch call log details from android emulator?where does this type of data reside on phone?waiting for answers. :)thanks.</p>","599773","","599773","","2011-02-02 10:03:28","2011-02-07 12:00:00","How to fetch call log details from an android emulator?","<android><android-emulator>","2","2","","",""
"4872920","1","4872966","","2011-02-02 09:53:57","1","800","<p>We have HttpConnection Connector.open(URL) in J2ME how can we replace this class when using it in android?</p>","510617","","","","","2011-02-02 09:58:05","How can we replace HttpConnection Connector.open(URL) using in J2ME into android","<android>","1","1","","",""
"4872986","1","","","2011-02-02 10:00:52","3","2288","<p>I'm trying to make an app that records video and saves it to sdcard and when it runs again it overwrites the previous video.</p><p>The problem is, when I specify the Intent extra EXTRA_OUTPUT, the camera records the video to the location, but crashes on retake and play clicks.</p><p>The code I use is as follows:</p><pre><code>_path = Environment.getExternalStorageDirectory() + ""/examplevideo.3gp"";File file = new File(_path);Uri outputFileUri = Uri.fromFile(file);Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE );intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);            startActivityForResult(intent, 0);</code></pre><p>When I stop recording, the logcat says</p><pre><code>VERBOSE/videocamera(6602): Setting current video filename: null</code></pre><p>which is strange and seems to be a problem.</p><p>When I press play, I get an error, but the app keeps running(recorded video doesnt play)</p><pre><code>ERROR/videocamera(6602): Couldn't view video file:///mnt/sdcard/examplevideo.3gpERROR/videocamera(6602): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=file:///mnt/sdcard/examplevideo.3gp }ERROR/videocamera(6602):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)ERROR/videocamera(6602):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)ERROR/videocamera(6602):     at android.app.Activity.startActivityForResult(Activity.java:2817)ERROR/videocamera(6602):     at android.app.Activity.startActivity(Activity.java:2923)..</code></pre><p>When I press retake, the app crashes completely with an error:</p><pre><code>ERROR/AndroidRuntime(6602): FATAL EXCEPTION: mainERROR/AndroidRuntime(6602): java.lang.IllegalArgumentException: Unknown URL file:///mnt/sdcard/examplevideo.3gpERROR/AndroidRuntime(6602):     at android.content.ContentResolver.delete(ContentResolver.java:671)ERROR/AndroidRuntime(6602):     at com.android.camera.VideoCamera.deleteCurrentVideo(VideoCamera.java:1010)ERROR/AndroidRuntime(6602):     at com.android.camera.VideoCamera.discardCurrentVideoAndInitRecorder(VideoCamera.java:476)ERROR/AndroidRuntime(6602):     at com.android.camera.VideoCamera.onClick(VideoCamera.java:420)ERROR/AndroidRuntime(6602):     at android.view.View.performClick(View.java:2408)...</code></pre><p>The strange thing is, that this video is saved to the given location and I can play it from my sdcard, Its just that the camera activity doesnt recognize it.</p><p>Some help or ideas would be much appreciated!</p>","599743","","403455","","2012-09-06 01:19:41","2012-09-06 01:19:41","Android Intent MediaStore.ACTION_VIDEO_CAPTURE with EXTRA_OUTPUT crashes on play, retake","<java><android>","1","0","","",""
"4873076","1","","","2011-02-02 10:09:34","2","4562","<p>In my current android application, I would like to get the geocordinates based on an entered city name, street name or zip code. How can I accomplish this?</p><p>Best Regards</p>","598238","","","","","2012-08-27 08:49:19","get latitude and longitude from city name","<android><google-maps>","3","0","2","",""
"4873081","1","","","2011-02-02 10:09:55","0","207","<p>the problem is that once a widget of my application is uninstalled, it lkeaves a black message box on the home screen saying unable to load widget, i was wonderring if we could clean the system display our self, is it possbile to add some code/ call to instruct the android frame work to do that, the widget is being consumed by a remote service may be once service is finished/closed we can call some syetem calls, any code for helping out the home reloading will help, Thanks</p>","392574","","","","","2011-02-02 12:23:56","Remote service clean up, launcher screen refresh required","<android>","1","2","","",""
"4873124","1","","","2011-02-02 10:13:27","12","10176","<p>Dear all,I'm trying to perform native code debug on my HTC Desire for my Android project.The project is made of a thin layer of JNI wrapper and the main chunk in C++, compiled using ndk-build. The debuggable flag is set, I'm running 2.2 on an HTC Desire and I'm working with Ubuntu on my PC.</p><p>So a plain ndk-gdb --start returns a:</p><pre><code>ERROR: Could not setup network redirection to gdbserver?   Maybe using --port=&lt;port&gt; to use a different TCP port might help?</code></pre><p>This is weird. I checked on the internet and found that it's the wrong message error caused by a flaw in ndk-gdb. If I run ndk-gdb -- start --verbose I obtain this messed up error:</p><pre><code>Android NDK installation path: /home/marco/dev/android-ndkUsing specific adb command: /home/marco/dev/android-sdk//platform-tools/adbADB version found: Android Debug Bridge version 1.0.26Using final ADB command: '/home/marco/dev/android-sdk//platform-tools/adb'Using auto-detected project path: .Found package name: com.marco83.siegeABIs targetted by application: armeabiDevice API Level: 8Device CPU ABIs: armeabi-v7a armeabiCompatible device ABI: armeabiFound debuggable flag: trueFound device gdbserver: /data/data/com.marco83.siege/lib/gdbserverUsing gdb setup init: /home/marco/dev/siege_game/trunk/SiegeGameNative/libs/armeabi/gdb.setupUsing toolchain prefix: /home/marco/dev/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-Using app out directory: /home/marco/dev/siege_game/trunk/SiegeGameNative/obj/local/armeabiFound data directory: 'run-as: Package 'com.marco83.siege' has corrupt installation'Found first launchable activity: .MainLaunching activity: com.marco83.siege/.Main## COMMAND: /home/marco/dev/android-sdk//platform-tools/adb shell am start -n com.marco83.siege/.MainStarting: Intent { cmp=com.marco83.siege/.Main }Warning: Activity not started, its current task has been brought to the front## COMMAND: /home/marco/dev/android-sdk//platform-tools/adb shell sleep 2Found running PID: 844Launched gdbserver succesfully.Setup network redirection## COMMAND: /home/marco/dev/android-sdk//platform-tools/adb forward tcp:5039 localfilesystem:run-as: Package 'com.marco83.siege' has corrupt installation/debug-socket## COMMAND: /home/marco/dev/android-sdk//platform-tools/adb shell run-as com.marco83.siege lib/gdbserver +debug-socket --attach 844Android Debug Bridge version 1.0.26 -d                            - directs command to the only connected USB device                                 returns an error if more than one USB device is present. -e                            - directs command to the only running emulator.                                 returns an error if more than one emulator is running. -s &lt;serial number&gt;            - directs command to the USB device or emulator with                                 the given serial number. Overrides ANDROID_SERIAL                                 environment variable. -p &lt;product name or path&gt;     - simple product name like 'sooner', or                                 a relative/absolute path to a product                                 out directory like 'out/target/product/sooner'.                                 If -p is not specified, the ANDROID_PRODUCT_OUT                                 environment variable is used, which must                                 be an absolute path. devices                       - list all connected devices connect &lt;host&gt;[:&lt;port&gt;]       - connect to a device via TCP/IP                                 Port 5555 is used by default if no port number is specified. disconnect [&lt;host&gt;[:&lt;port&gt;]]  - disconnect from a TCP/IP device.                                 Port 5555 is used by default if no port number is specified.                                 Using this ocmmand with no additional arguments                                 will disconnect from all connected TCP/IP devices.device commands:  adb push &lt;local&gt; &lt;remote&gt;    - copy file/dir to device  adb pull &lt;remote&gt; [&lt;local&gt;]  - copy file/dir from device  adb sync [ &lt;directory&gt; ]     - copy host-&gt;device only if changed                                 (-l means list but don't copy)                                 (see 'adb help all')  adb shell                    - run remote shell interactively  adb shell &lt;command&gt;          - run remote shell command  adb emu &lt;command&gt;            - run emulator console command  adb logcat [ &lt;filter-spec&gt; ] - View device log  adb forward &lt;local&gt; &lt;remote&gt; - forward socket connections                                 forward specs are one of:                                    tcp:&lt;port&gt;                                   localabstract:&lt;unix domain socket name&gt;                                   localreserved:&lt;unix domain socket name&gt;                                   localfilesystem:&lt;unix domain socket name&gt;                                   dev:&lt;character device name&gt;                                   jdwp:&lt;process pid&gt; (remote only)  adb jdwp                     - list PIDs of processes hosting a JDWP transport  adb install [-l] [-r] [-s] &lt;file&gt; - push this package file to the device and install it                                 ('-l' means forward-lock the app)                                 ('-r' means reinstall the app, keeping its data)                                 ('-s' means install on SD card instead of internal storage)  adb uninstall [-k] &lt;package&gt; - remove this app package from the device                                 ('-k' means keep the data and cache directories)  adb bugreport                - return all information from the device                                 that should be included in a bug report.  adb help                     - show this help message  adb version                  - show version numDATAOPTS: (no option)                   - don't touch the data partition  -w                           - wipe the data partition  -d                           - flash the data partitionscripting:  adb wait-for-device          - block until device is online  adb start-server             - ensure that there is a server running  adb kill-server              - kill the server if it is running  adb get-state                - prints: offline | bootloader | device  adb get-serialno             - prints: &lt;serial-number&gt;  adb status-window            - continuously print device status for a specified device  adb remount                  - remounts the /system partition on the device read-write  adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program  adb reboot-bootloader        - reboots the device into the bootloader  adb root                     - restarts the adbd daemon with root permissions  adb usb                      - restarts the adbd daemon listening on USB  adb tcpip &lt;port&gt;             - restarts the adbd daemon listening on TCP on the specified portnetworking:  adb ppp &lt;tty&gt; [parameters]   - Run PPP over USB. Note: you should not automatically start a PPP connection. &lt;tty&gt; refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1 [parameters] - Eg. defaultroute debug dump local notty usepeerdnsadb sync notes: adb sync [ &lt;directory&gt; ]  &lt;localdir&gt; can be interpreted in several ways:  - If &lt;directory&gt; is not specified, both /system and /data partitions will be updated.  - If it is ""system"" or ""data"", only the corresponding partition    is updated.environmental variables:  ADB_TRACE                    - Print debug information. A comma separated list of the following values                                 1 or all, adb, sockets, packets, rwx, usb, sync, sysdeps, transport, jdwp  ANDROID_SERIAL               - The serial number to connect to. -s takes priority over this if given.  ANDROID_LOG_TAGS             - When used with the logcat option, only these debug tags are printed.ERROR: Could not setup network redirection to gdbserver?       Maybe using --port=&lt;port&gt; to use a different TCP port might help?marco@pacer:~/dev/siege_game/trunk/SiegeGameNative$ run-as: Package 'com.marco83.siege' has corrupt installation</code></pre><p>which, as you can see and as reported here: <a href=""http://vilimpoc.org/blog/2010/09/23/hello-gdbserver-a-debuggable-jni-example-for-android/"">http://vilimpoc.org/blog/2010/09/23/hello-gdbserver-a-debuggable-jni-example-for-android/</a> is caused by a mix of different simultaneous outputs; the real error should be </p><pre><code>Package 'xxxxx' has corrupt installation</code></pre><p>Further investigation in this error pointed me to: <a href=""http://osdir.com/ml/android-ndk/2010-08/msg00263.html"">http://osdir.com/ml/android-ndk/2010-08/msg00263.html</a></p><p>where the same error is reported, and they say it's not possible to debug natively on Desire. The problem is with <code>run-as</code> not being able to access the /data folder.</p><p>Any solution other than rooting/flashing the phone? Why does the <code>run-as</code> access /data?I was thinking of a naive solution where I copy the package (objs, libs, ...) into an easier accessible location (like on the SDcard) and tell the debugger to access that location instead - is it feasible?</p><p>ThanksMarco</p><p><strong>EDIT: Update:</strong> I rooted the phone using unrevoked3. Even if I set <code>chmod 0777 data</code> (which is probably EXTREMELY dangerous), I get the same error. As reported in the second link in the post, run-as is checking if /data is accessible. How can I access run-as source code? Is it possible to recompile it and upload a modified version that works around this check? (since I can set /data to be readable by everyone anyway)</p>","412927","","149841","","2011-08-17 08:19:33","2014-03-22 06:01:24","Android Native debug (ndk-gdb) on HTC Desire: run-as flaw?","<android><debugging><gdb><native><htc>","5","0","3","",""
"4873159","1","4873370","","2011-02-02 10:16:01","0","443","<p>I search a way to make a apk who can change default icons of my first apk. Like ADW Launcher for example.</p><p>How can I do this ? Maybe a way to take drawables of another apk ?</p><p>Thanks for your help.</p>","541867","","","","","2011-02-02 10:36:39","How create an apk with icons replacement for another apk","<java><android><icons><apk>","1","0","","",""
"4873185","1","4873269","","2011-02-02 10:18:44","1","1493","<p>I am trying to transfer data from one page to another but some problem is coming below is the code. I am trying to transfer value of variable using bundle from first activity to second but something is wrong please tell me whats going wrong.</p><p>below is first activity:-</p><pre><code>public class login extends Activity {/** Called when the activity is first created. */Context mCtx;final static int START =0;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mCtx = this;    Button btn = (Button)findViewById(R.id.btn);    btn.setOnClickListener(new OnClickListener(){    //  @Override    public void onClick(View v)    {        String fromLat = new String();        String fromLong = new String();        String toLat = new String();        String toLong = new String();        fromLat = ((EditText)findViewById(R.id.FromLatitude)).getText().toString();         fromLong = ((EditText)findViewById(R.id.FromLongitude)).getText().toString();         toLat = ((EditText)findViewById(R.id.ToLatitude)).getText().toString();         toLong = ((EditText)findViewById(R.id.ToLongitude)).getText().toString();         Intent intent = new Intent(mCtx, MapRouteActivity.class);         /*Sending some arguments*/         Bundle bundle = new Bundle(4);          bundle.putString(""fromLat"",fromLat );          bundle.putString(""fromLong"",fromLong );          bundle.putString(""toLat"",toLat );          bundle.putString(""toLong"",toLong );          intent.putExtras(bundle);        /*Start Activity*/        mCtx.startActivity(intent);        /*Start ActivityForResult*/        ((Activity)mCtx).startActivityForResult(intent, 2);    }});}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    // TODO Auto-generated method stub    super.onActivityResult(requestCode, resultCode, data);    if(requestCode == START)    {        Toast.makeText(mCtx, Integer.toString(resultCode), Toast.LENGTH_SHORT).show();    }}@Overridepublic void onDestroy(){    super.onDestroy();    finish();}}</code></pre><p>Below is the Second activity :-</p><pre><code>public class MapRouteActivity extends MapActivity {    LinearLayout linearLayout;    MapView mapView;    private Road mRoad;    @Override    public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.routeplanning);            mapView = (MapView) findViewById(R.id.mapview);            mapView.setBuiltInZoomControls(true);            Bundle extras = this.getIntent().getExtras();            String fLat=extras.getString(""fromLat"");            String fLong=extras.getString(""fromLong"");            String tLat=extras.getString(""toLat"");            String tLong=extras.getString(""toLong"");            final double fromLat=Double.parseDouble(fLat);            final double fromLon=Double.parseDouble(fLong);            final double toLat=Double.parseDouble(tLat);            final double toLon=Double.parseDouble(tLong);             new Thread() {                    @Override                    public void run() {                          //double fromLat = 28.6353, fromLon = 77.2250, toLat = 30.7313, toLon = 76.7754;                            /***url contains the path to fetch the kml file from the internet*/                            String url = RoadProvider                                            .getUrl(fromLat, fromLon, toLat, toLon);                            InputStream is = getConnection(url);                            mRoad = RoadProvider.getRoute(is);                            mHandler.sendEmptyMessage(0);                    }            }.start();    }    Handler mHandler = new Handler() {            public void handleMessage(android.os.Message msg) {                    TextView textView = (TextView) findViewById(R.id.description);                    textView.setText(mRoad.mName + "" "" + mRoad.mDescription);                    MapOverlay mapOverlay = new MapOverlay(mRoad, mapView);                    List&lt;Overlay&gt; listOfOverlays = mapView.getOverlays();                    listOfOverlays.clear();                    listOfOverlays.add(mapOverlay);                    mapView.invalidate();            };    };    private InputStream getConnection(String url) {            InputStream is = null;            try {                    //Opens a connection to the remote database(bidirectional)                    URLConnection conn = new URL(url).openConnection();                    is = conn.getInputStream();            } catch (MalformedURLException e) {                    e.printStackTrace();            } catch (IOException e) {                    e.printStackTrace();            }            return is;    }    @Override    protected boolean isRouteDisplayed() {            return false;    }}class MapOverlay extends com.google.android.maps.Overlay {    Road mRoad;    ArrayList&lt;GeoPoint&gt; mPoints;    public MapOverlay(Road road, MapView mv) {            mRoad = road;            if (road.mRoute.length &gt; 0) {                    mPoints = new ArrayList&lt;GeoPoint&gt;();                    for (int i = 0; i &lt; road.mRoute.length; i++) {                            mPoints.add(new GeoPoint((int) (road.mRoute[i][1] * 1000000),                                            (int) (road.mRoute[i][0] * 1000000)));                    }                    int moveToLat = (mPoints.get(0).getLatitudeE6() + (mPoints.get(                                    mPoints.size() - 1).getLatitudeE6() - mPoints.get(0)                                    .getLatitudeE6()) / 2);                    int moveToLong = (mPoints.get(0).getLongitudeE6() + (mPoints.get(                                    mPoints.size() - 1).getLongitudeE6() - mPoints.get(0)                                    .getLongitudeE6()) / 2);                    GeoPoint moveTo = new GeoPoint(moveToLat, moveToLong);                    MapController mapController = mv.getController();                    mapController.animateTo(moveTo);                    mapController.setZoom(9);            }    }    @Override    public boolean draw(Canvas canvas, MapView mv, boolean shadow, long when) {            super.draw(canvas, mv, shadow);            drawPath(mv, canvas);            return true;    }    public void drawPath(MapView mv, Canvas canvas) {            int x1 = -1, y1 = -1, x2 = -1, y2 = -1;            Paint paint = new Paint();            paint.setColor(Color.GREEN);            paint.setStyle(Paint.Style.STROKE);            paint.setStrokeWidth(3);            for (int i = 0; i &lt; mPoints.size(); i++) {                    Point point = new Point();                    mv.getProjection().toPixels(mPoints.get(i), point);                    x2 = point.x;                    y2 = point.y;                    if (i &gt; 0) {                            canvas.drawLine(x1, y1, x2, y2, paint);                    }                    x1 = x2;                    y1 = y2;            }    }}</code></pre><p>On pressing the button the application is force closed.</p><p>Below is the LogCat data on force closing the application</p><pre><code>02-02 15:32:31.837: ERROR/AndroidRuntime(199): Uncaught handler: thread main exiting due to uncaught exception02-02 15:32:31.857: ERROR/AndroidRuntime(199): java.lang.NullPointerException02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at route.planning.login$1.onClick(login.java:49)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at android.view.View.performClick(View.java:2344)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at android.view.View.onTouchEvent(View.java:4133)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at android.widget.TextView.onTouchEvent(TextView.java:6504)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at android.view.View.dispatchTouchEvent(View.java:3672)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1712)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1202)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at android.app.Activity.dispatchTouchEvent(Activity.java:1987)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1696)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1658)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at android.os.Handler.dispatchMessage(Handler.java:99)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at android.os.Looper.loop(Looper.java:123)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at android.app.ActivityThread.main(ActivityThread.java:4203)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at java.lang.reflect.Method.invokeNative(Native Method)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at java.lang.reflect.Method.invoke(Method.java:521)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)02-02 15:32:31.857: ERROR/AndroidRuntime(199):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","569938","","1468708","","2013-09-02 13:08:20","2013-09-02 13:08:20","How to transfer input taken at one activity to another activity?","<android>","1","0","","",""
"4873196","1","","","2011-02-02 10:19:22","3","10794","<p>I am quite new to Android development. Can someone let me know the relevant APIs to dynamically update a <code>TextView</code> (or entire screen )?</p><p>For example: I have a search application and I need to show the results as they are found rather than waiting for all results and then show.</p>","584361","","1016716","","2012-06-02 10:30:02","2012-06-02 10:30:02","dynamically update TextView in Android","<android><textview>","3","1","","",""
"4873228","1","","","2011-02-02 10:22:31","0","1901","<p>I am trying to make a little application that simulates the dice. I want the picture of the dice side randomly change 6 times after clicking the button. It should randomly change 6 times with 0,3 second delay after every random change. The problem is that it changes always only one time not six times as wished. I guess it will be just some trivial mistake but I could not find the right answer anywhere on the web. Here is the code and I thank u all in advance: </p><pre><code>   import java.util.Random;import android.app.Activity;import android.os.*;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.ImageView;public class OneDice extends Activity{    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        setContentView(R.layout.onedicelayout);        final ImageView image = (ImageView) findViewById(R.id.OneDiceRollImage);        final int[] arrayOfDices = {                R.drawable.icon,                R.drawable.icon2,                R.drawable.icon3,        };        final Random rand = new Random();        View.OnClickListener rollOneDiceListener = new View.OnClickListener() {            @Override            public void onClick(View v){                int j = 0;                for(int i = 0; i&lt;6; i++){                    try {                        j = rand.nextInt(3);                        image.setImageResource(arrayOfDices[j]);                        Thread.sleep(300);                    } catch (InterruptedException e) {                        e.printStackTrace();                    }                }            }        };        Button oneDiceRollButton = (Button) findViewById(R.id.OneDiceRollButton);        oneDiceRollButton.setOnClickListener(rollOneDiceListener);    }}</code></pre>","599816","","","","","2013-03-08 14:14:50","loop and delay problem","<android><loops><delay>","2","2","","",""
"4873263","1","","","2011-02-02 10:24:52","1","2928","<p>I'm currently working an application that should have the following behavior :In one of the activities, the user can select different items into a list. While doing that, he should be able to take a picture, save it, and return to the previous activity.</p><p>I'm having the following problem : when the user goes back to the activity after taking the picture, the progress (basically, the items selected) is lost. </p><p>I tried to use android:launchMode=""singleInstance"" (as well as singleTask) and android:alwaysRetainTaskState=""true"" on my activity to save its current state (and it works great when the user leave the application to do something else, then come back later to it). I tried to lunch the ACTION_IMAGE_CAPTURE intent with the FLAG_ACTIVITY_NEW_TASK to simulate the same behavior (somewhere in my mind i thought it should be the same thing as lunching the picture activity from the homescreen), but with no effect. I even tried to lunch the picture activity with startActivityforResult with the hope that somehow my activity wouldn't be lost, but with still no effect.</p><p>I know I could use the Bundle savedInstanceState to manually save and restore the state by overriding onPause, onResume, on Create (etc), but there is actually lots of data in custom components that are not easily serializable, so I'd like to avoid that. </p><p>Well I guess my question is how can I reproduce the same behavior as alwaysRetainTaskState manifest attribute? Or is there anyway to easily save the state of my activity? Or what am I doing wrong, missing the obvious?</p><p>Thanks a lot!</p>","483291","","","","","2011-02-02 12:22:18","Android - Save activity state when starting new activity","<android><activity><android-intent><state><task>","1","0","2","",""
"4873340","1","4874108","","2011-02-02 10:34:12","0","480","<p>I am doing Multimedia application using client server interaction, for that i uploaded some media files in apache tomcat server(My server is static). Now i want to display the media files whatever uploaded in sever to my android device (device is a client). I am confused how to get files from server to client. please guide me. give me some tutorials link. Note:i am using for multiple client.  </p>","599841","","","","","2011-02-02 11:49:52","How to get file from server","<android>","1","0","","",""
"4873395","1","","","2011-02-02 10:39:15","1","4262","<p>I am trying to embedded a webview in a framelayout. my launch.xml is as shown below.</p><pre><code>&lt;FrameLayout 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=""fill_parent""/&gt;   &lt;/FrameLayout&gt;</code></pre><p>I have implemented the <code>WebChromeClient</code> and <code>WidgetViewClient</code>. I have implemented the <code>onTouchEvent</code> and passing the touch events to the <code>WebView</code>. </p><p>The problem i am facing is am not able to scroll inside the webview. For example, the content is some 5 lines then am able to see only 3 lines and not able to scroll.</p><p>The touch events go to <code>Webview</code>, first <code>action_down</code> and then <code>action_move</code>, am not able to get what wrong am doing?? </p><p>I have this code also </p><pre><code>mWebView.setHorizontalScrollBarEnabled(true);mWebView.setVerticalScrollBarEnabled(true);</code></pre><p>Is there anything else i have to set?? </p><p>I have checked by replacing the FrameLayout with ScrThanks in advance.. </p>","599811","","467900","","2011-02-02 10:45:45","2013-06-06 04:25:37","Webview + scrolling issue + android","<android><scrolling><webview>","3","0","1","",""
"4873396","1","4874580","","2011-02-02 10:39:20","3","2914","<p>I have to set a SlidingDrawer on the right side and on click it should not expand over the half screen. I saw many tutos and i managed to set it more or less correctly but it's currently pushing everything in the layout to the left. Here is my xml:</p><pre><code>&lt;LinearLayout android:layout_height=""wrap_content""    android:id=""@+id/edition_content_linear"" android:layout_width=""fill_parent""    android:layout_weight=""1"" android:background=""@android:color/white""&gt;    &lt;LinearLayout android:layout_width=""fill_parent""        android:id=""@+id/static_menu_layout"" android:layout_height=""fill_parent""        android:layout_weight=""2"" android:visibility=""gone"" android:background=""@drawable/ipad_category_back""&gt;        &lt;ExpandableListView android:id=""@+id/static_expandable_list""            android:layout_height=""fill_parent"" android:layout_width=""fill_parent""            android:drawSelectorOnTop=""false"" android:groupIndicator=""@drawable/expandablelist_selector"" android:indicatorLeft=""210dp"" android:indicatorRight=""230dp""&gt;&lt;/ExpandableListView&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:id=""@+id/center_linear""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""        android:layout_weight=""1""&gt;        &lt;ImageView android:scaleType=""centerInside""            android:layout_height=""fill_parent"" android:layout_width=""fill_parent""            android:id=""@+id/cover_image_big""&gt;&lt;/ImageView&gt;        &lt;WebView android:id=""@+id/story_webview""            android:layout_height=""fill_parent"" android:layout_width=""fill_parent""            android:visibility=""gone""&gt;&lt;/WebView&gt;    &lt;/LinearLayout&gt;    &lt;SlidingDrawer android:id=""@+id/slider_drawer""    android:layout_width=""250dp"" android:layout_height=""500dp""    android:orientation=""horizontal"" android:layout_gravity=""center_vertical""    android:handle=""@+id/slider_handle"" android:content=""@+id/slider_expandable_list_container""&gt;    &lt;ImageView android:id=""@+id/slider_handle""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:src=""@drawable/menu_handler"" /&gt;    &lt;RelativeLayout android:id=""@+id/slider_expandable_list_container""        android:layout_height=""500dp"" android:layout_width=""250dp""&gt;        &lt;ExpandableListView android:id=""@+id/slider_expandable_list""            android:layout_height=""fill_parent"" android:layout_width=""fill_parent""            android:drawSelectorOnTop=""false"" android:indicatorLeft=""210dp"" android:layout_gravity=""center_vertical""            android:indicatorRight=""230dp"" android:groupIndicator=""@drawable/expandablelist_selector""&gt;&lt;/ExpandableListView&gt;    &lt;/RelativeLayout&gt;   &lt;/SlidingDrawer&gt;&lt;/LinearLayout&gt;</code></pre>","599826","","","","","2011-02-02 12:40:49","Android : is there a way to properly set a SlidingDrawer width and height to half screen?","<android><layout><slidingdrawer>","1","0","3","",""
"4873437","1","","","2011-02-02 10:43:18","1","416","<p>I'm parsing not so large XML files, about 200KB, in my application. Parser fails systematically when parsing some files.Symptoms:</p><ol><li>I use two types of XML parsers: <strong>SAX(XMLReader) and Pull(XMLPullParser)</strong>, both of them failat the same place in the file(3182th byte).</li><li>I use <code>InputStream</code> as the input source for parsers.</li><li>I trieed to wrap <code>FileInputStream</code> with <code>BufferedInputStream</code> and nothing changed.</li></ol><p>I don't know if the problem is in the <code>Parser</code> or in <code>InputStream</code>.</p><p>Please help to fix the problem or advise a workaround.</p>","599769","","457982","","2011-02-02 10:54:58","2011-02-02 11:59:35","Android XML parsing problem with both SAX and Pull parser","<android><xml><parsing>","0","2","","",""
"4873523","1","4873695","","2011-02-02 10:53:37","2","1696","<p>Hi allmy need is that buttons must show at bottom, so my code as</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""  android:padding=""12dip""&gt;  &lt;ListView      android:id=""@+id/list_multiselectable""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:layout_gravity=""center_vertical""&gt;  &lt;/ListView&gt;&lt;LinearLayout android:orientation=""horizontal""                android:background=""@android:drawable/bottom_bar""    android:paddingLeft=""4.0dip"" android:paddingTop=""5.0dip""    android:paddingRight=""4.0dip"" android:paddingBottom=""1.0dip""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""&gt;    my buttons code here&lt;/LinearLayout&gt;  &lt;/LinearLayout&gt; </code></pre><p>But when items in list are less (until scroll bar of list view is not enable), Buttons are visible, but when items in list are more, buttons are not visible, although I scrolled list item to last row, but at last buttons are not displaying. How can I solve it.</p><p>Thank you!</p>","550966","","550966","","2011-03-19 18:29:30","2011-10-18 15:08:36","Buttons not displaying in linear layout","<android><android-widget><android-layout>","3","0","0","",""
"4873546","1","","","2011-02-02 10:55:22","0","257","<p>I am looking for source to see if we can use SharedPreferences for Webviews in android. so far I have come across only CheckBoxes EditTexts Ringtones and stuff but nothing related to webviews, I want to use it to set preferences for 3 websites and display a particular site when user clicks that button.</p>","466590","","","","","2011-02-02 10:55:22","SharedPreferences for WEBVIEWS in android","<android><webview><preferences><sharedpreferences>","0","4","","",""
"4873556","1","","","2011-02-02 10:56:43","2","7716","<p>i have in xml a ScrollView which includes one TableLayout.My question is if it's possible to have a focusable row every time i click on it.Here is my xml code:</p><p></p><pre><code>    &lt;ScrollView         android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;        &lt;TableLayout             android:id=""@+id/table2""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" &gt;            &lt;TableRow&gt;                &lt;RelativeLayout                    android:id=""@+id/rowlayout""                    android:layout_width=""wrap_content""                    android:layout_height=""fill_parent""                    android:background=""@drawable/rowbackground2"" &gt;                        &lt;ImageView                            android:id=""@+id/icon""                            android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                            android:src=""@drawable/icon_code_contact""                             android:padding=""7dip""                            android:layout_alignParentLeft=""true"" /&gt;                        &lt;TextView                            android:id=""@+id/contacts""                            android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                            android:textStyle=""bold""                            android:text=""Contacts""                            android:textColor=""#000""                            android:textSize=""18dip""                            android:layout_toRightOf=""@id/icon""                            android:paddingTop=""10dip"" /&gt;                &lt;/RelativeLayout&gt;            &lt;/TableRow&gt;            &lt;TableRow&gt;                &lt;Button                    android:id=""@+id/contacts_button""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:background=""@drawable/contact_button"" /&gt;            &lt;/TableRow&gt;</code></pre><p>I have already tried the ""focusable=""true"""" and ""focusableInTouchMode=""true"""" but nothing happened..</p><p>thanks in advance</p>","579981","","","","","2012-06-18 20:29:43","focusable row inside table android","<android><tablerow><focusable>","3","0","3","",""
"4873559","1","","","2011-02-02 10:57:06","2","904","<p>Similar to GPS Status application in android I want to get the ""absolute strength of the magnetic field"" and ""theoretical strengh"". I ma able to get the theoretical strengh using GeomagneticField getFieldStrength() method .</p><p>But I am not sure hw to get the ""absolute strength of the magnetic field"" from sensors.</p><p>Please help.</p><p>Thanks</p>","511280","","","","","2011-05-23 17:31:28","absolute strength of the magnetic field : Anddroid","<android>","1","1","","",""
"4873564","1","8058218","","2011-02-02 10:57:23","3","684","<p>I have encountered strange issue. From Activity onStart() I request Bluetooth activation and 120s discoverability via intent:</p><pre><code>Intent activateBTIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);startActivityForResult(activateBTIntent, BT_ACTIVATE_INTENT);                                   </code></pre><p>I use it no matter if the Bluetooth is already activated or not. Android documentation says that Bluetooth will be activated if it was not, and that works fine. In both cases I get system Alert dialog</p><p><img src=""http://i.stack.imgur.com/9cDHZ.png"" alt=""enter image description here""></p><p>When I rotate the screen I observe flickering. Press on Yes/No removes one dialog, but there is still another one below. Performing screen rotation I can get a pile of Alert dialogs, and have to press Yes/No on each to get rid of them.</p><p>Described issue is present only if Bluetooth was not already started when intent was sent, otherwise it works correctly. Tried on different 2.2 phones, and issue is present on all. Looks to me like Android system issue.</p><p>Has anybody encountered it also, and maybe have some useful hint how to avoid this?</p><p>Thanks and regards.</p>","423823","","423823","","2011-04-18 07:23:24","2012-01-30 22:04:19","Bluetooth activation Alert dialog multiplication after screen rotation","<android>","3","0","1","",""
"4873579","1","4975643","","2011-02-02 10:58:45","2","983","<pre><code>var headerView = Ti.UI.createView({    backgroundColor:'#1D561C',    top:0,    height:40})var mainWindow = Ti.UI.createWindow({    backgroundColor:'#EAE6DB',    top:0,    x: 40,    height: 'auto',    height:Titanium.Platform.displayCaps.platformHeight,})var footerView = Ti.UI.createView({    backgroundColor:'#1D561C',    top:mainWindow.height - 40,    height:40})</code></pre><p>I have my header defined as 40 and footer as 40. Now how to i say to main window that you should start after 40 px... when i define it in <code>x:40</code> the footer does get disappear. </p>","548591","","","","","2011-02-12 01:12:42","Programatically setting my main window height in titanium","<android><titanium>","1","0","","",""
"4873590","1","4882471","","2011-02-02 10:59:50","1","673","<p>I've already searched how to do this but couldn't find any solution. Here it goes, I have edittext1 and edittext2, while the carat/cursor is positioned in edittext1 then I pressed ""Next/Enter"" key in soft keyboard, the carat/cursor must be positioned in edittext2. The snippet below received the event when I pressed the ""Next/Enter"" key but didn't move the carat/cursor in edittext2. </p><pre><code>    edittext1.setOnKeyListener(new View.OnKeyListener()     {               @Override        public boolean onKey(View v, int keyCode, KeyEvent event)         {            if(event.getKeyCode() == KeyEvent.KEYCODE_ENTER)            {                Editable e = edittext2.getText();                Selection.setSelection(e,e.length());            }            return false;        }    });</code></pre><p>Any inputs will be highly appreciated. Thanks.</p>","504470","","","","","2011-02-03 09:56:57","Set carat/cursor from edittext1 to edittext2","<android><android-edittext>","2","0","","",""
"4873662","1","","","2011-02-02 11:06:13","8","1871","<p>I have a Android project for which I want a class diagram. What is the best way to do this? I have installed the MoDisco, GEF, UML2 Extender. Are these sufficient? What is the simplest way to generate a UML from the classes with activities I already have?</p>","455479","","","","","2012-12-14 11:15:41","Generate class diagram Eclipse with Android SDK","<android><eclipse><uml-modeling><eclipse-3.6>","1","1","2","",""
"4873699","1","4874445","","2011-02-02 11:09:56","0","136","<p>I'm a noob Android developer. I learned of the basic UI controls and different types of views that I can utilize.</p><p>Now my problem is, I need to show list of items using the ListView that is being shown full screen. when I click on an item it should load a TextView full screen. when I click the back button it should go back to ListView again..</p><p>Can someone point me where I can learn such stuff?? any support or even external link is greatly appreciated. </p><p>Thanks in advance.</p>","348301","","","","","2011-02-02 12:27:11","Trigger Textview when clicked on ListView","<java><android><android-widget>","2","0","1","",""
"4873743","1","4956194","","2011-02-02 11:14:11","0","860","<p>I have an application that displays contacts from the contact book. This isnt hard:</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW, Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, """"+contactId));startActivity(intent);</code></pre><p>However, I would like my apps banner to still be showing on the top of the screen. Is there any way to show this new activity as part of my own layout, so I can have my banner and some buttons, and then show the contact in a FrameLayout at the bottom?</p><p>Cheers,</p>","249871","","","","","2011-02-10 10:58:14","Show another activity in a layout in Android?","<android><activity>","2","0","","",""
"4873814","1","4875040","","2011-02-02 11:20:07","0","859","<p>I have an image in the screen and I have used <code>onTouchListener</code> on the image so that the user can rotate and scale the image by finger touch. After completion of image modification by finger touch, the user have to proceed by a button click. After the button click, I want to take a screen-shot programetically so that I can save the modified image as Bitmap. How can I take the current screen-shot? Is OpenGL is the solution for this? If it is, how can I get the GL10 object <code>OnClickListener</code>.</p>","525004","","44729","","2011-02-02 14:26:50","2011-02-02 14:26:50","Android Screenshot problem","<android><opengl-es><screenshot>","1","1","1","",""
"4873827","1","","","2011-02-02 11:21:47","5","3360","<p>I'm developing an app that uses </p><blockquote>  <p>android.hardware.Camera.parameters.getSupportedPictureSizes()</p></blockquote><p>This is only available from SDK version 8 and I would like to be compatible with SDK 4, so I've done this:</p><blockquote>  <p>if(Build.VERSION.SDK_INT >=8){...}</p></blockquote><p>But on the emulator, it seams that it tries to check the reference to this function, and it fails:</p><blockquote>  <p>02-02 11:20:10.930: ERROR/dalvikvm(1841): Could not find method android.hardware.Camera$Parameters.getSupportedPictureSizes, referenced from method com.test.demo.CameraCustom.takeAPicture</p></blockquote><p>Any idea about how to solve this backward compatibility issue?</p><p>I've tried to use inkocation with this piece of code inside surfaceChanged. Obviously, the code works directly without invokation:</p><pre><code>try{    windowmanager_defaultdisplay_Rotation = getWindowManager().getDefaultDisplay().getClass().getMethod(""getRotation"");    Log.v(MainMenu.TAG, ""getRotation exist"");}catch(Exception e){    Log.v(MainMenu.TAG, ""getRotation dont exist"");}try{    windowmanager_defaultdisplay_Rotation.invoke(null, null);    Log.v(MainMenu.TAG, ""getRotation invoking ok, rotation "");}catch(Exception e){    Log.v(MainMenu.TAG, ""exception invoking getRotation ""+e.toString());}</code></pre><p>I get ""getRotation exist"" but then ""exception invoking getRotation java.lang.NullPointerException.</p><p>Any idea?</p>","245638","","245638","","2011-02-05 16:27:25","2011-06-26 03:58:56","Android backward code compatibility","<android><backwards-compatibility>","2","0","2","",""
"4873868","1","4874684","","2011-02-02 11:25:40","0","409","<p>So here's my rather open-ended question. I've spent the last 7 hours creating numerous different ""concepts"" for a simple CYOA game engine. (Create Your Own Adventure) I have no problem with displaying/updating graphics, the UI, playing audio, etc. but it's the seemingly simplest of things that's really frustrating me, the core engine itself.</p><p>Here's the idea...</p><p>There are 4 TextViews: prompt, option1, option2 and option3. When the game begins the user is met with a prompt and 3 options. They then click on an option and all 4 text views update based on what they chose. If the user chooses say...""Buy a hotdog."" from the ""What would you like to buy?"" prompt, the next screen would say something like ""Choose a condiment!"" with 3 different condiments, etc.</p><p>I've tried ArrayLists, Bundles, HashMaps, etc. but nothing seems to work without some seriously convoluted code. I am at a complete stand still (and my wits end) and have no idea how to create an optimized mechanism for this in Java/Android. </p><p>Any ideas?</p>","599429","","","","","2011-02-02 12:52:27","Android: Create Your Own Adventure Engine Basics","<android><game-engine>","1","0","1","",""
"4873900","1","4874707","","2011-02-02 11:29:16","3","2399","<p>When I rund my application I can choose which view to show in my viewFlipper by running:</p><pre><code>viewFlipper.setDisplayedChild(1);</code></pre><p>in onCreate, I can switch the view in my onClick()</p><pre><code>viewFlipper.setDisplayedChild(0);</code></pre><p>When I want to switch child from my code (not in my main app) i get the following problem!</p><pre><code>02-02 12:17:08.620: ERROR/AndroidRuntime(1005): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</code></pre><p>Any help is appreciated.</p>","280240","","","","","2011-02-02 12:54:59","Switch view with a ViewFlipper","<android><viewflipper>","1","0","2","",""
"4873930","1","4874139","","2011-02-02 11:32:00","2","4821","<p>I am trying to use the <code>CountDownTimer</code> in Android to get a <code>TextView</code> to count down from 100 to zero. I would like this to happen as quickly as possible while remaining visible.</p><p>At the moment if the CountDownTimer tick interval is any less than 500ms (I think it was that, might've been a bit lower) then the updates just don't happen.</p><p>I have only tried this on the emulator.</p><p>Am I going about this in the right way? If I am, is this apparent slowness a limitation of the emulator or just something that I will have to live with? If this is not the right way, can someone recommend a different approach?</p>","68283","","","","","2011-02-02 12:01:54","Updating Android TextView regularly to show countdown","<android><android-widget>","2","0","3","",""
"4873978","1","","","2011-02-02 11:36:37","2","1368","<p>I am developing a utility class in Android 2.2 exposing various methods to Application.Application can import my jar file(utility class) to invoke methods defined in utility class. Can somebody tell me how to pass/return data to application class from my utility class. Note: utility class and application class is kept under different packages.</p>","566772","","201387","","2011-02-02 11:47:31","2011-02-02 11:47:31","Passing data from one class to another class","<java><android><packages>","2","4","","",""
"4873995","1","","","2011-02-02 11:37:41","1","297","<p>I'm using a SoundPool to load .wav files from resources, and then play them back.  Sometimes, when I start the app, a sound will repeat itself every time it's played--and sometimes it won't.  It acts like sometimes the .wav file is loaded double:  if you tell it to loop zero times, it plays twice, if you tell it to loop nine times it plays twenty times, etc.</p><p>But it does not happen every time I start the program.  It either happens for the whole execution, or not at all (so I think it's a problem with loading the files).  Some .wav files are more prone to this than others; one of my files does this 95% of the time, while a different one only does it about 20% of the time.</p><p>I'm doing this on a Samsung Epic, API level 7.</p><p>Code to load the sound:</p><pre><code>soundPool = new SoundPool(3, AudioManager.STREAM_MUSIC, 0);soundRicochet = soundPool.load(this, R.raw.ricochet, 0);</code></pre><p>Code to play the sound:</p><pre><code>soundPool.play(soundRicochet, 1.0f, 1.0f, 0, 0, 1.0f);</code></pre><p>How can I fix this behavior?</p>","599917","","","","","2011-02-02 11:37:41","My .wav files sometimes loop more than they should","<android><audio>","0","1","","",""
"4874095","1","6086264","","2011-02-02 11:47:51","11","1179","<p>I am working on an app that will show reverse view from camera. For example, if current view from camera is like: <img src=""http://i.stack.imgur.com/hylaW.jpg"" alt=""enter image description here"">, </p><p>the app should reverse view like: <img src=""http://i.stack.imgur.com/fR5O4.jpg"" alt=""enter image description here""></p><p>so user will see constantly reverse view from camera through this app.</p><p>I am not very sure how to achieve this. Any help or idea would be highly appreciated. Thanks!</p>","7604","","7604","","2011-05-13 10:11:50","2011-05-22 05:38:04","How to slice & reverse camera view?","<java><android><android-layout>","2","0","3","",""
"4874146","1","4875217","","2011-02-02 11:54:09","8","2445","<p>I am thinking about how to ideally implement a <strong>cache layer</strong> in my Android app.</p><p>Currently I have generic Activities which display data coming from a remote server. The data is represented by a DTO <em>TemplateInstance</em>. Each <em>TemplateInstance</em> has a Map with <em>Components</em> in it and each of the components can have child components. The components themselves can be Text (String), Image (ByteArray) or Time (or whatever by sub-classing Component).</p><p>Currently my app loads a TemplateInstance from the server each time an Activity is started.</p><p>I would now like to implement a <strong>cache layer</strong> in the app, so that </p><ol><li><strong>the time to display data is reduced to a minimum,</strong></li><li><strong>the data is refreshed when it is changed on the server.</strong></li></ol><p>My strategy for this looks like this:</p><ul><li>The started Activity loads the TemplateInstance from a local storage by an ID (if exists)</li><li>A UpdateService checks in the background if the TemplateInstance has changed on the server (using a version field in the database)</li><li>If the server version is greater than the local one or there is no local TemplateInstance then retrieve the data from the server, update the local store and update the view</li></ul><p>I implemented this already successfully with <strong>db4o</strong>. There are just two problems with this solution:</p><ul><li>db4o is under GPL (I cannot use it)</li><li>db4o is really slow when I load TemplateInstances which have many images (4 seconds for a query)</li></ul><p>Now I am looking for the best replacement for db4o. My ideas about that are until now:</p><ul><li>SQLite is not suitable because of the structure of the data</li><li>I don´t need database functionality - retrieving objects by ID would be enough</li><li>Holding the objects in memory would be significantly faster</li><li>The memory state should be saved to disk when application exits, so the objects can be reinstantiated at startup</li></ul><p>What do you think is the best solution for this?</p><p>My research on this brought me to <strong>EHCache</strong> and <strong>JCS</strong>, which I have never used. Do you think they are appropriate, also in respect of resources on an Android phone? Or do you have other suggestions?</p>","153721","","","","","2011-02-07 16:56:00","Caching strategy for Android app","<android><caching>","2","0","4","",""
"4874266","1","","","2011-02-02 12:05:36","10","1418","<p>I want to implement the same nature type of control on text selection on a Activity with various text fields. Any ideas of implementing the behavior shown in Picture</p><p><img src=""http://i.stack.imgur.com/oXZP3.png"" alt=""enter image description here""></p>","392574","","12855","","2011-02-02 12:43:25","2011-02-02 12:47:26","What Text Selection Control is this?","<android><textselection>","1","0","4","",""
"4874284","1","","","2011-02-02 12:08:13","1","3585","<p>The requirement is as follows:</p><p>i>I have added four tasks T1 , T2 , T3 , T4 &amp; storing the tasks in SQLite with details.</p><p>ii>I need to display the tasks both in list view &amp; cover view.</p><p>I have already implemented the same for list view &amp; have provided the functionality to delete the tasks.</p><p>I need to implement the Cover view display of the tasks &amp; also provide the option of editing the task name &amp; delete the task.If I am deleting the task , how can I rearrange the Cover view display items?</p><p>Kindly provide me any link/sample code so that I get the logic for implementing the Cover View.</p><p>Thanks in advance.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2013-03-09 14:28:28","Coverflow sample code","<android>","1","0","1","",""
"4874311","1","6541643","","2011-02-02 12:11:37","4","3192","<p>I am making an Android application and I want to encrypt a String before sending it to a DataBase, and encrytpion is correct. The problem happens when decrypting the String because I get a BadPaddingException and I have no idea where the problem is. Here is the code:</p><pre><code>public final static String HEX = ""36A52C8FB7DF9A3F"";public static String encrypt(String seed, String cleartext) throws Exception {    byte[] rawKey = getRawKey(seed.getBytes());    byte[] result = encrypt(rawKey, cleartext.getBytes());    return toHex(result);}public static String decrypt(String seed, String encrypted) throws Exception {    byte[] rawKey = getRawKey(seed.getBytes());    byte[] enc = toByte(encrypted);    byte[] result = decrypt(rawKey, enc);    return new String(result);}public static String toHex(String txt) {    return toHex(txt.getBytes());}public static String fromHex(String hex) {    return new String(toByte(hex));}public static byte[] toByte(String hexString) {    int len = hexString.length()/2;    byte[] result = new byte[len];    for (int i = 0; i &lt; len; i++)        result[i] = Integer.valueOf(hexString.substring(2*i, 2*i+2), 16).byteValue();    return result;}public static String toHex(byte[] buf) {    if (buf == null)        return """";    StringBuffer result = new StringBuffer(2*buf.length);    for (int i = 0; i &lt; buf.length; i++) {        appendHex(result, buf[i]);    }    return result.toString();}private static byte[] getRawKey(byte[] seed) throws Exception {    KeyGenerator kgen = KeyGenerator.getInstance(""AES"");    SecureRandom sr = SecureRandom.getInstance(""SHA1PRNG"");    sr.setSeed(seed);    kgen.init(128, sr); // 192 and 256 bits may not be available    SecretKey skey = kgen.generateKey();    byte[] raw = skey.getEncoded();    return raw;}private static byte[] encrypt(byte[] raw, byte[] clear) throws Exception {    SecretKeySpec skeySpec = new SecretKeySpec(raw, ""AES"");    Cipher cipher = Cipher.getInstance(""AES"");    cipher.init(Cipher.ENCRYPT_MODE, skeySpec);    byte[] encrypted = cipher.doFinal(clear);    return encrypted;}private static byte[] decrypt(byte[] raw, byte[] encrypted) throws Exception {    SecretKeySpec skeySpec = new SecretKeySpec(raw, ""AES"");    Cipher cipher = Cipher.getInstance(""AES"");    cipher.init(Cipher.DECRYPT_MODE, skeySpec);    byte[] decrypted = cipher.doFinal(encrypted);    return decrypted;}private static void appendHex(StringBuffer sb, byte b) {    sb.append(HEX.charAt((b&gt;&gt;4)&amp;0x0f)).append(HEX.charAt(b&amp;0x0f));}</code></pre><p>I encrypt and decrypt with this code:</p><pre><code>String encrypted = encrypt(HEX, ""some text"");String decrypted = decrypt(HEX, encrypted);</code></pre><p>Can anyone help me please?</p><p>Thank you very much!!</p><p><strong>EDIT:</strong> Problem is not solved, but I have a bit more information. First of all, I encrypt in a Java project, and I decrypt in an Android project. I have tried to decrypt in the same Java project, and there is no problem, but if I try to decrypt in Android, it doesn't work. The problem is in method ""getRawKey"" (look at the kgen.generateKey() comment):</p><p><strong>JAVA:</strong></p><pre><code>private static byte[] getRawKey(byte[] seed) throws Exception {    KeyGenerator kgen = KeyGenerator.getInstance(""AES"");    SecureRandom sr = SecureRandom.getInstance(""SHA1PRNG"");    sr.setSeed(seed); //Seed: [51, 54, 65, 53, 50, 67, 56, 70, 66, 55, 68, 70, 57, 65, 51, 70]    kgen.init(128, sr); // 192 and 256 bits may not be available    SecretKey skey = kgen.generateKey(); //skey.key = [-97, -52, 45, -95, -64, -58, 16, -20, 124, -50, -104, 58, 23, -75, 88, 94]    byte[] raw = skey.getEncoded();    return raw;}</code></pre><p><strong>ANDROID:</strong></p><pre><code>private static byte[] getRawKey(byte[] seed) throws Exception {    KeyGenerator kgen = KeyGenerator.getInstance(""AES"");    SecureRandom sr = SecureRandom.getInstance(""SHA1PRNG"");    sr.setSeed(seed); //Seed: [51, 54, 65, 53, 50, 67, 56, 70, 66, 55, 68, 70, 57, 65, 51, 70]    kgen.init(128, sr); // 192 and 256 bits may not be available    SecretKey skey = kgen.generateKey(); //skey.key = [-114, 32, 16, -52, -81, 125, -88, 88, -76, 20, -117, -11, 33, -61, 32, -91]    byte[] raw = skey.getEncoded();    return raw;}</code></pre><p>I am not a crypt expert, but how can be possible that with the same seed, I get a different key??</p>","248183","","78022","","2011-05-26 16:00:28","2013-07-08 22:18:41","BadPaddingException in Android encrypt","<android><exception><encryption>","4","3","1","",""
"4874392","1","","","2011-02-02 12:20:13","2","174","<p>When are the startElement characters StopElement methods called in the DefaultHelper class of in android?</p><p>The package name of the class isorg.xml.sax.helpers.DefaultHandler</p>","590849","","127880","","2013-02-17 06:49:25","2013-02-17 06:49:25","Confusion in DefaultHelper class in android","<android><xml-parsing>","3","0","","",""
"4874770","1","4875314","","2011-02-02 13:02:40","2","322","<p>I'm new at android developing and wanted to make a little tool.</p><p>I would need to give my tool a path, like C://my/path</p><p>Then my app goes to that path and does something like copying some file on the phone, checking its mime type, its size, some other attributes.</p><p>Is this possible?</p><p>I don't want a Windows Explorer-like app or something like that. I just need to do some simple file manipulations.</p>","587680","","52626","","2011-03-27 21:05:34","2011-03-27 21:05:34","Accessing files on pc from android","<android>","1","1","0","",""
"4874803","1","4874841","","2011-02-02 13:06:22","1","161","<p>I tried to uninstall and re install the SDK and ADT and now when I'm trying to create a new project with the ADT on Build Target it notifies ""No target available"".</p><p>What to do?</p>","564230","","28169","","2011-02-02 13:07:07","2011-02-02 13:10:51","Problems with new Android project","<android>","1","0","","",""
"4874856","1","4875047","","2011-02-02 13:12:49","0","169","<p>I have an XML file stored in the res/xml that I am trying to write to. I know how to read it using XmlResourceParser, but I have not been able to find a way to write to that file locally. </p><p>Thanks Venkat</p>","317510","","","","","2011-02-02 13:33:29","Modifying local file inside Android","<android>","1","0","","",""
"4874865","1","","","2011-02-02 13:13:45","0","528","<p>I am using a ALertDialog to show some results.i first  display the results in alertdialog and scroll down then press ok.When showing the next result the scrollbar is in the same position where it was left when  previously shown. How can i bring the scroll bar position to the top of the dialog so that the user can read the new results starting from the top?PLz reply</p>","600028","","","","","2011-02-09 14:00:35","Android AlertDialog SCrollbar position","<android><scrollbar><alertdialog>","1","0","","",""
"4874877","1","4874930","","2011-02-02 13:15:18","1","807","<p>im new to android development i want to change the title backcolor of alerdialogue box in android which is by default is black ,kindly tell how to change this any help in this regards is greatly appreciated thanks in advance.</p>","575218","","","","","2011-02-02 13:34:37","how to change the AlertDialogue box title back color in Android?","<android>","2","0","","",""
"4874896","1","5129736","","2011-02-02 13:17:43","1","524","<p>By default, Android has the decoders to display the following images formats: jpg, png, bmp, and gif.  If I want to develop an application which can display other image formats (like tiff, psd, pcx, mat, mng) which library (using c or c++ or java) should I use to achieve this?</p>","205929","","44729","","2011-02-02 14:33:59","2012-01-31 11:44:13","How to display unsupported(formats) images in Android application?","<java><c++><android><image>","1","0","1","",""
"4874952","1","","","2011-02-02 13:23:37","0","1612","<p>hi i have a custom listview , each contain a bulk text ,i given the text in scroll view ,my problem am not able to scroll items in listview , when i press the text actually listview is scrolling, but in some case it work fine</p>","487219","","491044","","2011-03-11 14:17:21","2012-05-22 21:12:50","android scrollview in listview","<android><listview><scrollview>","2","2","1","",""
"4874998","1","","","2011-02-02 13:29:09","0","826","<p>I'm developing an Android 2.2 application that uses OpenGL ES 2.0. All OpenGL ES stuff is implmented with C++.</p><p>I got this error when I try to load a texture:</p><pre><code>02-02 13:03:03.210: ERROR/dalvikvm-heap(4117): 1728000-byte external allocation too large for this process.02-02 13:03:03.210: ERROR/dalvikvm(4117): Out of memory: Heap Size=6471KB, Allocated=3881KB, Bitmap Size=17023KB02-02 13:03:03.210: ERROR/GraphicsJNI(4117): VM won't let us allocate 1728000 bytes</code></pre><p>What I should check to fix this 'Out of Memory' problem?</p><p>Thanks.</p>","68571","","","","","2011-03-05 14:03:21","Android Out of Memory with OpenGL ES 2.0","<android><out-of-memory><opengl-es-2.0>","1","1","","",""
"4875114","1","","","2011-02-02 13:40:56","6","10742","<p>I want to save an image from a URL to the SD card (for future use) and then load that image from the SD card to use it as a drawable overlay for Google maps.</p><p>Here is the save section of the function:</p><pre><code>//SAVE TO FILEString filepath = Environment.getExternalStorageDirectory().getAbsolutePath(); String extraPath = ""/Map-""+RowNumber+""-""+ColNumber+"".png"";filepath += extraPath;FileOutputStream fos = null;fos = new FileOutputStream(filepath); bmImg.compress(CompressFormat.PNG, 75, fos);//LOAD IMAGE FROM FILEDrawable d = Drawable.createFromPath(filepath);return d;</code></pre><p>The image is saved to the sd card succuessfully but fails when getting to the <code>createFromPath()</code> line. I don't understand why it would save ok to that destination but not load from it....</p>","595743","","580556","","2011-02-02 13:46:16","2014-02-21 11:28:23","Android - Save image from URL onto SD card","<java><android><maps><emulator>","6","3","5","",""
"4875221","1","4875538","","2011-02-02 13:51:48","1","256","<p>Hey,So I'm trying to develop an App that will take the users ID and Password and then log onto a site in the background and tranfer the users contacts from the phone to the site. I'm doing this for my final year project in college. I'm new to this and have been completely lost since developing the GUI. Is there a particular library I should look at or a name for what I am trying to do that I could look for tutorials on? Any help would be greatly appreciated. Thanks.  </p>","519064","","21234","","2011-02-02 13:57:04","2011-02-02 14:24:57","Developing an Android App that interfaces with a website- Help!","<android>","2","0","2","",""
"4875231","1","4875324","","2011-02-02 13:52:41","0","760","<p>hello i am trying to get a better grasp of the views of android<br>i am getting an error when i try to run the program<br>the program will run but it will not show anything<br>here is HelloListView.java  </p><pre><code>package com.HelloListView;import android.R.string;import android.app.ListActivity;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.AdapterView.OnItemClickListener;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.Toast;public class HelloListView extends ListActivity {    private string[] coun;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setListAdapter (new ArrayAdapter &lt;string&gt;(this, R.layout.list_item,coun));        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(), null, Toast.LENGTH_SHORT).show();            }        });        @SuppressWarnings(""unused"")        final String[] coun = new String[] {            ""Afghanistan"", ""Albania"", ""Algeria"", ""American Samoa"", ""Andorra"",            ""Angola"", ""Anguilla"", ""Antarctica"", ""Antigua and Barbuda"", ""Argentina"",            ""Armenia"", ""Aruba"", ""Australia"", ""Austria"", ""Azerbaijan"",            ""Bahrain"", ""Bangladesh"", ""Barbados"", ""Belarus"", ""Belgium"",            ""Belize"", ""Benin"", ""Bermuda"", ""Bhutan"", ""Bolivia"",            ""Bosnia and Herzegovina"", ""Botswana"", ""Bouvet Island"", ""Brazil"", ""British Indian Ocean Territory"",            ""British Virgin Islands"", ""Brunei"", ""Bulgaria"", ""Burkina Faso"", ""Burundi"",            ""Cote d'Ivoire"", ""Cambodia"", ""Cameroon"", ""Canada"", ""Cape Verde"",            ""Cayman Islands"", ""Central African Republic"", ""Chad"", ""Chile"", ""China"",            ""Christmas Island"", ""Cocos (Keeling) Islands"", ""Colombia"", ""Comoros"", ""Congo"",            ""Cook Islands"", ""Costa Rica"", ""Croatia"", ""Cuba"", ""Cyprus"", ""Czech Republic"",            ""Democratic Republic of the Congo"", ""Denmark"", ""Djibouti"", ""Dominica"", ""Dominican Republic"",            ""East Timor"", ""Ecuador"", ""Egypt"", ""El Salvador"", ""Equatorial Guinea"", ""Eritrea"",            ""Estonia"", ""Ethiopia"", ""Faeroe Islands"", ""Falkland Islands"", ""Fiji"", ""Finland"",            ""Former Yugoslav Republic of Macedonia"", ""France"", ""French Guiana"", ""French Polynesia"",            ""French Southern Territories"", ""Gabon"", ""Georgia"", ""Germany"", ""Ghana"", ""Gibraltar"",            ""Greece"", ""Greenland"", ""Grenada"", ""Guadeloupe"", ""Guam"", ""Guatemala"", ""Guinea"", ""Guinea-Bissau"",            ""Guyana"", ""Haiti"", ""Heard Island and McDonald Islands"", ""Honduras"", ""Hong Kong"", ""Hungary"",            ""Iceland"", ""India"", ""Indonesia"", ""Iran"", ""Iraq"", ""Ireland"", ""Israel"", ""Italy"", ""Jamaica"",            ""Japan"", ""Jordan"", ""Kazakhstan"", ""Kenya"", ""Kiribati"", ""Kuwait"", ""Kyrgyzstan"", ""Laos"",            ""Latvia"", ""Lebanon"", ""Lesotho"", ""Liberia"", ""Libya"", ""Liechtenstein"", ""Lithuania"", ""Luxembourg"",            ""Macau"", ""Madagascar"", ""Malawi"", ""Malaysia"", ""Maldives"", ""Mali"", ""Malta"", ""Marshall Islands"",            ""Martinique"", ""Mauritania"", ""Mauritius"", ""Mayotte"", ""Mexico"", ""Micronesia"", ""Moldova"",            ""Monaco"", ""Mongolia"", ""Montserrat"", ""Morocco"", ""Mozambique"", ""Myanmar"", ""Namibia"",            ""Nauru"", ""Nepal"", ""Netherlands"", ""Netherlands Antilles"", ""New Caledonia"", ""New Zealand"",            ""Nicaragua"", ""Niger"", ""Nigeria"", ""Niue"", ""Norfolk Island"", ""North Korea"", ""Northern Marianas"",            ""Norway"", ""Oman"", ""Pakistan"", ""Palau"", ""Panama"", ""Papua New Guinea"", ""Paraguay"", ""Peru"",            ""Philippines"", ""Pitcairn Islands"", ""Poland"", ""Portugal"", ""Puerto Rico"", ""Qatar"",            ""Reunion"", ""Romania"", ""Russia"", ""Rwanda"", ""Sqo Tome and Principe"", ""Saint Helena"",            ""Saint Kitts and Nevis"", ""Saint Lucia"", ""Saint Pierre and Miquelon"",            ""Saint Vincent and the Grenadines"", ""Samoa"", ""San Marino"", ""Saudi Arabia"", ""Senegal"",            ""Seychelles"", ""Sierra Leone"", ""Singapore"", ""Slovakia"", ""Slovenia"", ""Solomon Islands"",            ""Somalia"", ""South Africa"", ""South Georgia and the South Sandwich Islands"", ""South Korea"",            ""Spain"", ""Sri Lanka"", ""Sudan"", ""Suriname"", ""Svalbard and Jan Mayen"", ""Swaziland"", ""Sweden"",            ""Switzerland"", ""Syria"", ""Taiwan"", ""Tajikistan"", ""Tanzania"", ""Thailand"", ""The Bahamas"",            ""The Gambia"", ""Togo"", ""Tokelau"", ""Tonga"", ""Trinidad and Tobago"", ""Tunisia"", ""Turkey"",            ""Turkmenistan"", ""Turks and Caicos Islands"", ""Tuvalu"", ""Virgin Islands"", ""Uganda"",            ""Ukraine"", ""United Arab Emirates"", ""United Kingdom"",            ""United States"", ""United States Minor Outlying Islands"", ""Uruguay"", ""Uzbekistan"",            ""Vanuatu"", ""Vatican City"", ""Venezuela"", ""Vietnam"", ""Wallis and Futuna"", ""Western Sahara"",            ""Yemen"", ""Yugoslavia"", ""Zambia"", ""Zimbabwe""          };    }}  </code></pre><p>here is the list_view.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:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:padding=""10dp"" android:textSize=""16sp""&gt;&lt;/TextView&gt;</code></pre><p>thanks for your help let me know if i need to post anything else<br>thanks,<br>CS  </p><p>this is my new HelloListView.java  </p><p>public class HelloListView extends ListActivity {    private string[] coun;</p><pre><code>public class HelloListView extends ListActivity{    private string[] coun = new String[] {            ""Afghanistan"", ""Albania"", ""Algeria"", ""American Samoa"", ""Andorra"",            ""Angola"", ""Anguilla"", ""Antarctica"", ""Antigua and Barbuda"", ""Argentina"",            ""Armenia"", ""Aruba"", ""Australia"", ""Austria"", ""Azerbaijan"",            ""Bahrain"", ""Bangladesh"", ""Barbados"", ""Belarus"", ""Belgium"",            ""Belize"", ""Benin"", ""Bermuda"", ""Bhutan"", ""Bolivia"",            ""Bosnia and Herzegovina"", ""Botswana"", ""Bouvet Island"", ""Brazil"", ""British Indian Ocean Territory"",            ""British Virgin Islands"", ""Brunei"", ""Bulgaria"", ""Burkina Faso"", ""Burundi"",            ""Cote d'Ivoire"", ""Cambodia"", ""Cameroon"", ""Canada"", ""Cape Verde"",            ""Cayman Islands"", ""Central African Republic"", ""Chad"", ""Chile"", ""China"",            ""Christmas Island"", ""Cocos (Keeling) Islands"", ""Colombia"", ""Comoros"", ""Congo"",            ""Cook Islands"", ""Costa Rica"", ""Croatia"", ""Cuba"", ""Cyprus"", ""Czech Republic"",            ""Democratic Republic of the Congo"", ""Denmark"", ""Djibouti"", ""Dominica"", ""Dominican Republic"",            ""East Timor"", ""Ecuador"", ""Egypt"", ""El Salvador"", ""Equatorial Guinea"", ""Eritrea"",            ""Estonia"", ""Ethiopia"", ""Faeroe Islands"", ""Falkland Islands"", ""Fiji"", ""Finland"",            ""Former Yugoslav Republic of Macedonia"", ""France"", ""French Guiana"", ""French Polynesia"",            ""French Southern Territories"", ""Gabon"", ""Georgia"", ""Germany"", ""Ghana"", ""Gibraltar"",            ""Greece"", ""Greenland"", ""Grenada"", ""Guadeloupe"", ""Guam"", ""Guatemala"", ""Guinea"", ""Guinea-Bissau"",            ""Guyana"", ""Haiti"", ""Heard Island and McDonald Islands"", ""Honduras"", ""Hong Kong"", ""Hungary"",            ""Iceland"", ""India"", ""Indonesia"", ""Iran"", ""Iraq"", ""Ireland"", ""Israel"", ""Italy"", ""Jamaica"",            ""Japan"", ""Jordan"", ""Kazakhstan"", ""Kenya"", ""Kiribati"", ""Kuwait"", ""Kyrgyzstan"", ""Laos"",            ""Latvia"", ""Lebanon"", ""Lesotho"", ""Liberia"", ""Libya"", ""Liechtenstein"", ""Lithuania"", ""Luxembourg"",            ""Macau"", ""Madagascar"", ""Malawi"", ""Malaysia"", ""Maldives"", ""Mali"", ""Malta"", ""Marshall Islands"",            ""Martinique"", ""Mauritania"", ""Mauritius"", ""Mayotte"", ""Mexico"", ""Micronesia"", ""Moldova"",            ""Monaco"", ""Mongolia"", ""Montserrat"", ""Morocco"", ""Mozambique"", ""Myanmar"", ""Namibia"",            ""Nauru"", ""Nepal"", ""Netherlands"", ""Netherlands Antilles"", ""New Caledonia"", ""New Zealand"",            ""Nicaragua"", ""Niger"", ""Nigeria"", ""Niue"", ""Norfolk Island"", ""North Korea"", ""Northern Marianas"",            ""Norway"", ""Oman"", ""Pakistan"", ""Palau"", ""Panama"", ""Papua New Guinea"", ""Paraguay"", ""Peru"",            ""Philippines"", ""Pitcairn Islands"", ""Poland"", ""Portugal"", ""Puerto Rico"", ""Qatar"",            ""Reunion"", ""Romania"", ""Russia"", ""Rwanda"", ""Sqo Tome and Principe"", ""Saint Helena"",            ""Saint Kitts and Nevis"", ""Saint Lucia"", ""Saint Pierre and Miquelon"",            ""Saint Vincent and the Grenadines"", ""Samoa"", ""San Marino"", ""Saudi Arabia"", ""Senegal"",            ""Seychelles"", ""Sierra Leone"", ""Singapore"", ""Slovakia"", ""Slovenia"", ""Solomon Islands"",            ""Somalia"", ""South Africa"", ""South Georgia and the South Sandwich Islands"", ""South Korea"",            ""Spain"", ""Sri Lanka"", ""Sudan"", ""Suriname"", ""Svalbard and Jan Mayen"", ""Swaziland"", ""Sweden"",            ""Switzerland"", ""Syria"", ""Taiwan"", ""Tajikistan"", ""Tanzania"", ""Thailand"", ""The Bahamas"",            ""The Gambia"", ""Togo"", ""Tokelau"", ""Tonga"", ""Trinidad and Tobago"", ""Tunisia"", ""Turkey"",            ""Turkmenistan"", ""Turks and Caicos Islands"", ""Tuvalu"", ""Virgin Islands"", ""Uganda"",            ""Ukraine"", ""United Arab Emirates"", ""United Kingdom"",            ""United States"", ""United States Minor Outlying Islands"", ""Uruguay"", ""Uzbekistan"",            ""Vanuatu"", ""Vatican City"", ""Venezuela"", ""Vietnam"", ""Wallis and Futuna"", ""Western Sahara"",            ""Yemen"", ""Yugoslavia"", ""Zambia"", ""Zimbabwe""          };    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setListAdapter (new ArrayAdapter &lt;string&gt;(this, R.layout.list_item,coun));        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(), null, Toast.LENGTH_SHORT).show();            }        });    }}</code></pre>","595137","","595137","","2011-02-02 15:41:55","2011-02-06 02:27:15","Problems running HelloListView in the android emulator","<java><android><android-emulator>","4","0","","",""
"4875252","1","4880459","","2011-02-02 13:55:26","2","3343","<p>I'm developing an application in android 2.2.</p><p>When change the device orientation (by rotate the device) an black screen is painted in the bounds of my Activity (there is no even the Activity title), it takes some seconds (7-15 seconds) and then the activity is finally painted.</p><p>I have tested it emulator and two different devices and the behavior is the same.</p><p>In LogCat I have the next output:</p><pre><code>02-02 09:18:06.044: WARN/WindowManager(1300): MyActivity freeze timeout expired.02-02 09:18:06.044: WARN/WindowManager(1300): Force clearing freeze: AppWindowToken{4515af88 token=HistoryRecord{44f52458 com.project.package/.MyActivity}}02-02 09:18:08.054: WARN/WindowManager(1300): Window freeze timeout expired.02-02 09:18:08.054: WARN/SurfaceFlinger(1300): timeout expired mFreezeDisplay=1, mFreezeCount=002-02 09:18:08.054: WARN/WindowManager(1300): Force clearing orientation change: Window{45178a00 com.project.package/com.project.package.Activity paused=false}</code></pre><p>I don't know why is it happening.Thanks for the comments, suggestion, answers.</p>","593894","","473070","","2011-02-02 14:14:33","2011-02-02 22:07:02","Black screen when device orientation changed","<android>","1","2","3","",""
"4875271","1","","","2011-02-02 13:57:27","1","208","<p>So, the thing is that i've downloaded a couple of photos and stored them in the <code>data/data/project/username</code> directory on the phone and I want to display them (without having to download them again first) every time the user with username is using my application. </p><p>So've created a linkedlist with the paths on the phone where these photos are stored and every time a new photo is downloaded I add it to this linked list. Every time the activity is created/stopped i deserialize/serilize the list containning these links. </p><p>The serilialization part seems to be working ok, since I checked and the deserialized list seems to contain proper links to the the photos on the phone, but nonetheless when I start this activity nothing appears on the screen (before that I was downloading the photos every time the user logs in and they were displayed properly and everything was fine) and there's no error bumping in logcat or whatsoever. I first thought I had some typo when adding the photo urls to the list, but i checked and everything seems fine. Any ideas? (think)</p>","588264","","473070","","2011-02-02 14:21:46","2011-02-03 10:07:13","Strange problem when trying to reload images in android","<android><image><list><caching><serialization>","1","5","1","",""
"4875312","1","","","2011-02-02 06:07:23","1","816","<p>I have to edit a project using some C++ stuff (commons-codec-1.4) to read a SVG file. If I comment out the SVG reference it works fine but I have to run with it. It originally compiled with NDK. I downloaded NDK but don't know how to attach with this project.</p><p><em>build.log file in jni folder says</em></p><blockquote>  <p>Android NDK: WARNING: Unsupported source file extensions in /cygdrive/c/work/Android/Source/yprintit-android/jni/Android.mk for module svgandroid<br>  Android NDK:   libpng/png.h libpng/pngconf.h libpng/pngpriv.h libsvg/svg.h libsvg/svgint.h libsvg/svg_ascii.h libsvg/svg_version.h libsvg/svg_hash.h libsvg-android/svg-android.h libsvg-android/svg-android-internal.h<br>  Compile thumb  : svgandroid &lt;= /cygdrive/c/work/Android/Source/yprintit-android/jni/datauri/base64.c  SharedLibrary  : libsvgandroid.so  Install        : libsvgandroid.so => /cygdrive/c/work/Android/Source/yprintit-android/libs/armeabi</p></blockquote>","446350","gauravstomar","21960","","2011-02-02 16:03:24","2013-11-21 08:29:00","How to use NDK?","<android>","1","1","1","",""
"4875337","1","4875338","","2011-02-02 03:58:28","0","634","<p>I have an a web app using PhoneGap, and I'd like the app to only work in a portrait mode. Where is the bit of documentation I'm looking for?</p>","51567","aussiegeek","21234","","2011-02-02 14:34:43","2011-02-02 14:34:43","Disable Rotation","<android><website><auto-rotation>","1","0","","",""
"4875340","1","","","2011-02-02 14:04:17","2","83","<p>How to make the emulator run with a different sim serial number / phone number, etc...</p><p>Any help will be appreciated...</p><p>Thanks :)</p>","592202","","","","","2011-02-02 14:08:34","Android emulation","<android><android-emulator>","1","0","","",""
"4875415","1","4876484","","2011-02-02 14:12:51","16","14049","<p>I would like to detect how fast is the device on with my Android application is running?</p><p>Is there any API to do it on Android? Or do I have to benchmark it by myself?</p><p>If the device has got slow CPU I would like to turn off some CPU time consuming operations like animations or limit maximum number of simultaneous HTTP request.</p>","361832","","361832","","2011-02-02 21:34:15","2011-02-12 20:55:12","How to detect android cpu speed?","<android><performance><detect><cpu-speed>","3","0","6","",""
"4875544","1","","","2011-02-02 14:25:30","2","1410","<p>I am using Google Maps in my application. Part of the specification is to be able to view the map offline. </p><p>I have a set of custom map tile images spanning across an area of the UK, how do I got about displaying those tiles over the google map view?</p>","595743","","","","","2011-02-25 16:41:03","Android - Use map tiles offline","<java><android><maps><tiles>","2","2","1","",""
"4875632","1","","","2011-02-02 14:32:26","2","81","<p>I would like to get the currencies information from :http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml to my android programme and update constantly</p>","600133","","","","","2011-02-02 16:02:33","What should I do If I want to get the currencies rates from a web service to my android programme?","<android><programming-languages>","2","0","","",""
"4875635","1","","","2011-02-02 14:32:29","2","341","<p>I'm doing a final project for my university, and I'm getting a strange error.In Eclipse it says everything is ok, but when I run the program when trying to access this function in the database adapter the program crashes:</p><pre><code>public Cursor getAllProjectsCursor() {    return db.query(DATABASE_TABLE,                    new String[] {                            KEY_ID,                            KEY_PROJ_NAME,                            KEY_BEG_DATE                    },                     null,                     null,                     null,                     null,                     null);}</code></pre><p>but if instead I just put like this, the program runs normally:</p><pre><code>public Cursor getAllProjectsCursor() {    return db.query(DATABASE_TABLE,                    new String[] {                            KEY_ID,                            KEY_PROJ_NAME                    },                     null,                     null,                     null,                     null,                     null);}</code></pre><p>I want to pass all column values, and I think all the building is good. It's the same for all columns.</p><p>Can you help me?</p><hr><p>In debug it says that:</p><pre><code>INFO/Database(677): sqlite returned: error code = 1, msg = no such column: beg_date</code></pre><p>In my code I have:</p><pre><code>public class PMDBAdapter {    private static final String DATABASE_NAME = ""PocketManager.db"";        private static final String DATABASE_TABLE = ""Projects"";            private static final int DATABASE_VERSION = 1;            private SQLiteDatabase db;            public static final String KEY_ID = ""_id"";            public static final String KEY_PROJ_NAME = ""proj_name"";            public static final int PROJ_NAME_COLUMN = 2;            public static final String KEY_AREA = ""proj_area"";            public static final int AREA_COLUMN = 3;            public static final String KEY_BEG_DATE = ""beg_date"";            public static final int BEG_DATE_COLUMN = 4;            public static final String KEY_END_DATE = ""end_date"";            public static final int END_DATE_COLUMN = 5;            public static final String KEY_PERC = ""perc"";            public static final int PERC_COLUMN = 6;            private final Context context;            private ProjDBOpenHelper dbHelper;</code></pre><p>and:</p><pre><code>    private static final String DATABASE_CREATE = ""create table "" +    DATABASE_TABLE + "" ("" + KEY_ID + "" integer primary key autoincrement, ""            + KEY_PROJ_NAME + "" text not null, ""           + KEY_AREA + ""text not null, ""            + KEY_BEG_DATE + ""long, ""           + KEY_END_DATE + ""long, ""           + KEY_PERC + "" integer);"";</code></pre>","600134","","13531","","2011-07-25 22:04:49","2012-12-11 10:31:55","Public Cursor getAll error Android","<android>","1","3","1","",""
"4875638","1","4876008","","2011-02-02 14:32:34","3","538","<p>I have bunch of images from dozen or so sources and I am downloading them in background thread. Most of images are downloaded without problems but there are 2 sources that are causing problems. All images from them fail to load.</p><p>I am using following code to download (and store) images:</p><pre><code>File f=new File(cacheDir, urlHash);Bitmap bitmap=null;InputStream is=new URL(url).openStream();OutputStream os = new FileOutputStream(f);Utils.CopyStream(is, os);os.close();bitmap = BitmapFactory.decodeStream(new FileInputStream(f), null, null);</code></pre><p>Utils.CopyStream : </p><pre><code>public static void CopyStream(InputStream is, OutputStream os){    int counter = 0;    final int buffer_size=1024;    try    {        byte[] bytes=new byte[buffer_size];        for(;;)        {          int count=is.read(bytes, 0, buffer_size);          if(count==-1) {              Log.d(""tag"", counter + "" bytes copied"");              break;          }          os.write(bytes, 0, count);          counter += count;        }    }    catch(Exception ex) {        ex.printStackTrace();    }}</code></pre><p>when I try to download this image <a href=""http://www.zapakatel.cz/static/deal/7193-1057b.jpg"" rel=""nofollow"">http://www.zapakatel.cz/static/deal/7193-1057b.jpg</a> than it fails. BitmapFactory.decodeStream returns NULL. All I could find out about this that could cause a problem is that is.bytesRemaining is missing few thousands bytes: 162721 vs 179845 according to downloaded file size. When I manually download image from that url and upload it somewhere else, than everything works just fine. </p><p>Any idea what could cause problems? Is it possible that server hosting this image cuts me out before download is finished? This image load fine on any PC and even in my iphone app (I know that this is completely different platform and that it probably isn't important, I just find it weird)</p>","124649","","512958","","2011-02-02 14:55:00","2011-02-02 15:06:00","InputStream.bytesRemaining is less than should be","<java><android>","1","2","","",""
"4875643","1","4875731","","2011-02-02 14:32:53","1","673","<p>i am having the set of times in database and i want to compare with current time in computer .how it be done pls help me!!</p>","555910","","","","","2011-02-02 14:40:36","how to compare time values in android","<android><sqlite><cursor><datetimepicker>","1","0","","",""
"4875673","1","4876048","","2011-02-02 14:35:27","1","1131","<p>i draw 4 lines (canvas.drawLine) in order to draw a rectangle. Is there any possibility to fill the area of the rectangle? (I know that android have a rectDraw. Mine is only curiosity)</p><p>thanks in advance.</p><hr><p>ok.. I ve also a path created a path segment. Following the code.. Please can u explain how fill the internal area?</p><pre><code>    `Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);                 paint.setStrokeWidth(2);     paint.setColor(android.graphics.Color.RED);     paint.setStyle(Paint.Style.FILL_AND_STROKE);     paint.setAntiAlias(true);     path.reset();     path.setFillType(Path.FillType.INVERSE_EVEN_ODD);           path.moveTo(mPin[0].getX() + 10, mPin[0].getY() + 10);     path.lineTo(mPin[1].getX() + 10, mPin[1].getY() + 10);     path.moveTo(mPin[1].getX() + 10, mPin[1].getY() + 10);     path.lineTo(mPin[3].getX() + 10, mPin[3].getY() + 10);     path.moveTo(mPin[3].getX() + 10, mPin[3].getY() + 10);     path.lineTo(mPin[2].getX() + 10, mPin[2].getY() + 10);     path.moveTo(mPin[2].getX() + 10, mPin[2].getY() + 10);     path.lineTo(mPin[0].getX() + 10, mPin[0].getY() + 10);     paint.setShader(new LinearGradient(0, 0, 0, getHeight(), Color.BLACK, Color.WHITE, Shader.TileMode.MIRROR));     c.drawPath(path, paint);`</code></pre>","501696","","59303","","2013-04-28 11:24:13","2013-04-28 11:24:13","onDraw fill shape create with canvas.drawLine","<android><paint><ondraw>","1","0","1","",""
"4875885","1","","","2011-02-02 14:54:57","3","400","<p>I have an app that displays some data graphically.  It creates two Views to draw graphics in and adds them to my layout.   Each view shows the data differently way but each View implements <em>onSizeChanged()</em> the same:</p><pre><code>        protected void onSizeChanged(int curw, int curh, int oldw, int oldh) {        if (bitmap2 != null) {            bitmap2.recycle();        }        canvas2= new Canvas();        bitmap2 = Bitmap.createBitmap(curw, curh, Bitmap.Config.ARGB_8888);        canvas2.setBitmap(bitmap2);    }</code></pre><p>The views are invoked thusly:</p><pre><code>      LinearLayout myLayout = (LinearLayout)findViewById(R.id.revlay);      GraphView1 graphView1 = new GraphView1(this, theEventArrayList);      myLayout.addView(graphView1);        GraphView2 graphView2 = new GraphView2(this, theEventArrayList);      myLayout.addView(graphView2);  </code></pre><p>Always the <strong>first</strong> <em>onSizeChanged()</em> that gets called gets a height of 652 and a width of 480; the <strong>second</strong> one gets a height of 0, which causes <em>createBitmap()</em> to fail.  If I reversed the order of the above invocation then graphView1 would fail that way.   I'd like each bitmap to have about half the area.</p><p>Thanks in advance for explaining what's going on!</p>","424690","","","","","2012-03-24 21:25:07","second onSizeChanged gets height of zero","<android><graphics>","1","0","","",""
"4875893","1","4875954","","2011-02-02 14:55:31","0","1774","<p>I try to do some calendar. I do it as <strong>GridView</strong> with custom adapter.How in adapter combine 2 <strong>TextView</strong>(date and text) and icons (red circle) ?</p><p><a href=""http://i.stack.imgur.com/5lt9t.png"" rel=""nofollow"">(screen for example)</a></p>","273106","","297762","","2011-02-02 15:02:06","2011-02-02 15:02:06","Custom adapter in GridView","<android><gridview><android-layout><listadapter>","1","1","","",""
"4875933","1","4876129","","2011-02-02 14:59:39","0","579","<p>I'm beginner in Java Android developing. I'm using Eclipse SDK 3.6.1 version. I'm trying to this: first class is watching a two RadioButtons status from second class. I'm trying to set RadioButton status when they are not clicked.</p><p>First class:</p><pre><code>public void onClick(View view) {            switch (view.getId()) {    case R.id.Button01:                 if (toolsas.rb1.isChecked()) { //do something</code></pre><p>Second class with RadioButtons:</p><pre><code>public void onClick(View view) {        switch (view.getId()) {        case R.id.RadioButton01:            rb1=(RadioButton)findViewById(R.id.RadioButton01);            rb2=(RadioButton)findViewById(R.id.RadioButton02);            if (rb1.isChecked()) {                rb2.setChecked(false);                rb1.setChecked(true);</code></pre><p>When I click a RadioButton rb1 and change him status to checked the first class is working, bet how to set status when I don't click RadioButton rb1? If I firstable click Button01 the program is stopped. First class have few buttons, when I push the Button01 I can call a second class and change some optionsSorry for the bad english</p>","572853","","","","","2011-12-23 23:30:53","How to set a variable from different class when the activity is first time loaded?","<android><class><variables><button><checked>","1","0","","",""
"4875963","1","4876162","","2011-02-02 15:02:23","0","2694","<p>While looking through the built in Android themes/styles I noticed references to textColorPrimary, textColorSecondary etc. I would like to implement this in to my own theme but cannot find any way of setting a textview (or any view) to ""primary"" or ""secondary"" etc. </p><p>Am I overlooking something or is it not possible to be done?</p>","597521","","","","","2011-02-02 15:18:19","Setting text as ""primary"" in Android","<android><coding-style><themes><textview>","2","0","","",""
"4876011","1","","","2011-02-02 15:06:15","3","1720","<p>Hey all , first post on Stack so be patient.</p><p>I am trying to close the IME after user presses enter in EditText.</p><p>I've tried using <code>android:imeOptions=""actionDone""/""actionNext""</code> in the layout.xml</p><p>I've set up setOnEditorActionListener on said EditText and am looking for code to signal IME it's done.</p><p>tnx.</p>","600164","","4958","","2011-02-02 16:45:16","2011-02-17 12:21:38","Closing IME onEditorAction","<android>","1","0","1","",""
"4876083","1","4876156","","2011-02-02 15:11:47","5","7828","<p>I have a ListView with set CHOICE_MODE_MULTIPLE. I also have additional header to manage(un)selecting all the items. The question is : is it correct way to do that? Well it works, however I'm not sure thats proper way. As you see below there is an checkAllCheckBoxesobject which I pass to header onClickListener() method. What do you think? Would be grateful for any responses.</p><pre><code>private OnClickListener checkAllCheckboxes = new OnClickListener(){    public void onClick(View v) {        ListView lv = getListView();        int size = getListAdapter().getCount();        if(lv.isItemChecked(0)){            for(int i = 0; i&lt;=size; i++){                lv.setItemChecked(i, false);            }        } else {            for(int i = 0; i&lt;=size; i++){                lv.setItemChecked(i, true);            }        }    }};</code></pre>","577604","","297762","","2011-02-02 15:19:35","2011-02-02 15:38:55","Correct way to check all checkboxes in ListView?","<android><android-listview>","2","1","2","",""
"4876113","1","4876277","","2011-02-02 15:14:25","0","1735","<p>I have written an app for the android. I want to make this add free, so I have decided to put admob adds in it so that I can still makes some money. I have two problems, in test mode, the add is verry faded and is barly noticable. this is the smaller of my two problems though. I keep heering about how to test it, but how do I know that when I publish the app to the android market, that atuall apps will apear? I am a begginer to moblie adds and admob so if someone could tell me what I should be dooing, that would be much apreashiate (including setting up the admob account for my app, I already have an ccout, but there is something I need to do for each specific app, and i'm not sure if I am doing it correctly)here is the xml code for the layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;!-- !this is the exclusive write of Rothschild Programming LLC--&gt;&lt;FrameLayoutxmlns:android=""http://schemas.android.com/apk/res/android""   android:layout_height=""fill_parent""   android:layout_width=""fill_parent""&gt;    &lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_height=""50dip""    android:layout_gravity=""top""    android:layout_width=""fill_parent""    android:background=""@color/puzzle_foreground""&gt; &lt;com.admob.android.ads.AdView    xmlns:myapp=""http://schemas.android.com/apk/res/com.rothschild.android.gemagria""    android:id=""@+id/ad3""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    myapp:backgroundColor=""@color/puzzle_foreground""    myapp:primaryTextColor=""@color/puzzle_foreground""    myapp:secondaryTextColor=""@color/puzzle_foreground""    /&gt;    &lt;/LinearLayout&gt;&lt;LinearLayout   xmlns:android=""http://schemas.android.com/apk/res/android""   android:background=""@color/dust_tan""   android:layout_height=""fill_parent""   android:layout_width=""fill_parent""   android:paddingTop=""30dip""   android:paddingLeft=""30dip""   android:paddingRight=""30dip""   android:orientation=""horizontal""&gt;   &lt;ScrollView 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=""vertical""      android:layout_height=""wrap_content""      android:layout_width=""fill_parent""      android:layout_gravity=""center""       xmlns:app=""http://schemas.android.com/apk/res/com.rothschild.android.gemagria""&gt;      &lt;FrameLayout       android:layout_height=""wrap_content""      android:layout_width=""fill_parent""      android:layout_gravity=""center""       &gt;      &lt;ImageView        android:background=""@drawable/icon""        android:layout_height=""wrap_content""         android:layout_width=""wrap_content""         android:layout_gravity=""center""/&gt;        &lt;/FrameLayout&gt;      &lt;TextView         android:text=""@string/app_name""         android:layout_height=""wrap_content""         android:layout_width=""wrap_content""         android:layout_gravity=""center""         android:layout_marginBottom=""25dip""         android:textColor=""@color/puzzle_foreground""         android:textSize=""24.5sp"" /&gt;      &lt;Button         android:id=""@+id/start_button""         android:layout_width=""fill_parent""         android:layout_height=""50dip""         android:text=""Start"" /&gt;      &lt;Button         android:id=""@+id/help_button""         android:layout_width=""fill_parent""         android:layout_height=""50dip""         android:text=""Help"" /&gt;      &lt;Button         android:id=""@+id/settings_button""         android:layout_width=""fill_parent""         android:layout_height=""50dip""         android:text=""Settings"" /&gt;      &lt;Button         android:id=""@+id/exit_button""         android:layout_width=""fill_parent""         android:layout_height=""50dip""         android:text=""Exit"" /&gt;   &lt;/LinearLayout&gt;   &lt;/ScrollView&gt;&lt;/LinearLayout&gt;&lt;/FrameLayout&gt;</code></pre>","599402","","626273","","2012-06-14 10:28:27","2012-06-14 10:28:27","How do I get admob adds to work on an android app","<android><admob>","1","0","1","",""
"4876128","1","4876208","","2011-02-02 15:15:57","1","877","<p>I have a listactivity which contains a listview. i want to show another layout which contains a button at top and a webview at bottom on this listview and that layout always to be shown. I tried this but this is not what i want to do :</p><pre><code>ListView lv =getListView();LayoutInflater inflater = getLayoutInflater();ViewGroup header = (ViewGroup)inflater.inflate(R.layout.mylayer, lv, false);lv.addHeaderView(header, null, false);</code></pre><p>This shows my layout but when i scroll my listview, needless to say that when i scroll my listview down it is no more to be shown like it is part of my other listview items.</p>","590757","","","","","2012-05-10 14:28:25","How to show another layout in listactivity","<android><listview><layout><listactivity>","1","0","","",""
"4876233","1","4876343","","2011-02-02 15:23:51","0","512","<p>I am working in android application.I have one doubt ""How long it takes to start an </p><p>Activity?""</p>","533787","","","","","2011-12-22 03:34:22","How long it takes to start an Activity?","<android>","3","0","","2011-02-02 16:38:40",""
"4876261","1","","","2011-02-02 15:25:48","0","942","<p>I'm new to Android development and find the Google Checkout sales reporting lacking.</p><p>Is there a tool like the AppViz for iPhone App Store available for getting reports for the Android Market sales?</p>","44091","","","","","2011-02-02 15:30:19","Are there any app sales reporting tools available for the Android Market?","<android><google-play>","1","1","","2011-02-02 18:06:21",""
"4876311","1","","","2011-02-02 15:30:16","3","909","<p>I have an application which exhibits two different behaviors, possible related toAndroid 2.2 vs. Android 2.1 update 1.</p><p>The application uses the proximity sensor to determine when the phone is ""near""the ear.  If a ""near"" condition is detected, I get the applications window andset the LayoutParams to FLAG_NOT_TOUCHABLE and FLAG_FULLSCREEN.  In general, thishas the desired effect of preventing accidental screen touches by the ear fromcausing any unwanted action.  However...</p><p>With my Android V2.2 phones:  If I am in the process of sliding open the StatusBar at the time the proximity sensor detects a ""near"" condition, the Status Barimmediately closes and all is good.</p><p>With my Android V2.1 phones:  If I have the Status Bar partially open, detect a""near"" condition, and then simultaneously (more or less) revert to a ""far"" condition while releasing the Status Bar, the Status Bar is left in a partiallyopened state.  Meanwhile, part of my application remains visible, but nottouchable.  I can simulate this at will with 2.1 phones, but can not do soat all with 2.2 phones.</p><p>My questions:</p><p>1)  Does anyone know why this behavior is different, and if it is indeed related    to different Android versions?</p><p>2)  Is there a way that an application (such as mine!) can detect if the Status    Bar is opened, or in the process of sliding open, and tell it to close?</p><p>Thanks for any help you can offer.</p>","600222","","","","","2011-02-02 15:30:16","Is there a way to tell the Android Status Bar panel to close?","<android><statusbar>","0","1","","",""
"4876335","1","4906119","","2011-02-02 15:31:43","0","946","<p>I'm using the ContactPicker for my app. I'm using this <a href=""http://www.higherpass.com/Android/Tutorials/Working-With-Android-Contacts/1/"" rel=""nofollow"">this</a> tutorial to build my onActivityResult method. I can't get the content revolver to build; </p><pre><code>Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);</code></pre><p>Doesn't work, the app crashes and I can't tell what kind ox exception it's throwing, if any. What am I doing wrong?</p><p>Code:</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) {      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()) {              // Do something with phones              }               pCur.close();        }              }              }      }</code></pre>","595425","","244296","","2011-02-05 14:25:27","2011-02-05 14:25:27","Contact Picker Result","<android><activity><android-intent><contactscontract>","1","5","","",""
"4876487","1","","","2011-02-02 15:42:49","2","508","<p>I am working on an application that needs to record audio streams from online radio, either live (that broadcasts to everybody) or on demand (like last.fm and pandora), is there any tool that can help me do so, or an opensource code that does so,please if any body knows how this can be done help.</p><p>Thanks</p>","600237","","","","","2011-07-01 06:24:37","Android save Live Streaming Recording","<java><android><audio-streaming>","0","0","1","",""
"4876516","1","4876563","","2011-02-02 15:44:57","0","227","<p>Hey everyone ;) I have a new question again :D I can open my app now and insert the data into the fields, but as soon as i click the save-menu-item it aborts ... i posted the piece of code at the end of which i think where the error lies. Hope you can help me ;)</p><pre><code>//KFZ-Daten updaten (UPDATE)                        if(getIntent().hasExtra(""id"") == true)                {                    long l = getIntent().getExtras().getLong(""id"");                    myDB.execSQL(""UPDATE ""+wechsel.MY_DB_TABLE+"" SET ""+                            ""name = '""+KfzName.getText().toString()+""', ""+                        ""model = '""+KfzModel.getText().toString()+""', ""+                        ""bemerkungen ='""+KfzBemerkungen.getText().toString()+""', ""+                        ""kraftstoffart ='""+i+""', ""+                        ""tankinhalt = '""+KfzTankinhalt.getText().toString()+""' ""+                        ""WHERE _id = ""+l+"";"");                 }//Neues KFZ in Datenbank speichern (INSERT)                             else                {                                       myDB.execSQL(""INSERT INTO ""+wechsel.MY_DB_TABLE+""name,""+                                                                        ""model,""+                                                                        ""bemerkungen,""+                                                                        ""kraftstoffart,""+                                                                        ""tankinhalt) ""                            +""VALUES ('""+KfzName.getText().toString()+""',""+                            ""'""+KfzModel.getText().toString()+""',""+                            ""'""+KfzBemerkungen.getText().toString()+""',""+                            ""'""+i+""',""+""'""+                                               KfzTankinhalt.getText().toString()+""');"");                }                finish();                return true;                }            else            {                Toast toast = Toast.makeText(this, ""Bitte geben Sie einen Namen für das Fahrzeug ein!"",                                                                    Toast.LENGTH_SHORT);                toast.show();            }        }        return false;    }}</code></pre>","582674","","","","","2011-02-02 15:48:13","Saving data into my Database not possible...App ends","<android><sql><save>","1","5","","",""
"4876580","1","4884812","","2011-02-02 15:49:32","0","328","<p>I'm working on a simple modelling program concept for Android, and I've come into a bit of a problem.</p><p>Basically, I keep Vertex and Polygon info in Java Vectors (I need this info for manipulating them, not drawing them).</p><p>For drawing I'm using VBO's.</p><p>Each polygon currently has a list of vertices that it is made of. That means that when the indice array is populated, I need to find out what index each vertex has, and those indexes can change if vertices are created or deleted.</p><p>I quickly coded this using the indexOf(Vertex v) method of the Java Vector, but obviously this is very slow and I'm wondering what is the best way of managing this so that it doesn't take too much processing?</p><p>Thank you in advance.</p>","600246","","","","","2011-02-03 10:14:09","Storing OpenGL ES Polygon and Vertex info","<java><android><opengl-es><3d>","1","0","","",""
"4876661","1","4876682","","2011-02-02 15:55:43","1","219","<p>Does anybody know if I can update arrays.xml from the code?</p>","577841","","","","","2011-02-02 15:57:14","Android: update arrays.xml from code","<android><xml><arrays>","1","0","","",""
"4876777","1","","","2011-02-02 16:06:12","0","388","<p>I created an application with phonegap that reads an RSS feed anddisplays also a to do list -- data is stored in a database on thephone...</p><p>It is for API 7+ and works fine on my emulator, but as soon as I makemy android 2.1 the emulator, I it crashes within seconds. I looked atthe log files, but cannot really figure out why it is crashing.</p><p>Here is part of the log:</p><pre><code>02-02 09:48:41.950 I/ActivityManager(   81): Starting activity: Intent{ act=android.intent.action.MAINcat=[android.intent.category.LAUNCHER] flg=0x10200000cmp=com.missnowmrs.blog/.AppStart }02-02 09:48:42.100 I/ActivityManager(   81): Start proccom.missnowmrs.blog for activity com.missnowmrs.blog/.AppStart:pid=10844 uid=10076 gids={1006, 3003, 1015}02-02 09:48:42.270 I/foo     (   81): ********************** resuming:113301554402-02 09:48:42.550 I/System.out(10844): loadUrl(file:///android_asset/www/index.html)02-02 09:48:42.550 I/System.out(10844): url=file:///android_asset/www/index.html baseUrl=file:///android_asset/www02-02 09:48:43.100 I/ActivityManager(   81): Displayed activitycom.missnowmrs.blog/.AppStart: 1009 ms (total 1009 ms)02-02 09:48:44.840 I/DEBUG   (10858): *** *** *** *** *** *** *** ****** *** *** *** *** *** *** ***02-02 09:48:44.840 I/DEBUG   (10858): Build fingerprint: 'motorola/motus_att_us/motus/motus:2.1-update1/ERD79/3.0.1390:user/ota-rel-keys,release-keys'02-02 09:48:44.840 I/DEBUG   (10858): pid: 10844, tid: 10857  &gt;&gt;&gt;com.missnowmrs.blog &lt;&lt;&lt;02-02 09:48:44.840 I/DEBUG   (10858): signal 11 (SIGSEGV), fault addr00000014</code></pre><p>Any idea why it crashes? Did I not initialize the app correctly? Isthis a memory issue?</p><p>Here is some javascript  that happens onLoad()</p><pre><code>// Wait for PhoneGap to load //function onLoad() {        document.addEventListener(""deviceready"", onDeviceReady, false);}function onDeviceReady() {        sqlObject.webdb.open();        sqlObject.webdb.createToDoTable();        sqlObject.webdb.createSetupTable();        // check if data needs to be created        sqlObject.webdb.checkSetup();}</code></pre><p>Thanks for any help!</p><p>Patrick </p><p><strong>EDIT:</strong></p><p>Here is the complete log, I am not sure what you are looking for...</p><pre><code>    02-02 11:33:29.830 I/DEBUG   (11477): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***02-02 11:33:29.830 I/DEBUG   (11477): Build fingerprint: 'motorola/motus_att_us/motus/motus:2.1-update1/ERD79/3.0.1390:user/ota-rel-keys,release-keys'02-02 11:33:29.830 I/DEBUG   (11477): pid: 11462, tid: 11476  &gt;&gt;&gt; com.missnowmrs.blog &lt;&lt;&lt;02-02 11:33:29.830 I/DEBUG   (11477): signal 11 (SIGSEGV), fault addr 0000001402-02 11:33:29.830 I/DEBUG   (11477):  r0 45bb6e10  r1 00000014  r2 45bb6e2c  r3 45bb6e2c02-02 11:33:29.830 I/DEBUG   (11477):  r4 00000030  r5 00439cc0  r6 45bb6e10  r7 0000000002-02 11:33:29.830 I/DEBUG   (11477):  r8 00100000  r9 aa045a99  10 45ab7000  fp 00439f6002-02 11:33:29.830 I/DEBUG   (11477):  ip 80000000  sp 45bb6db8  lr aa198f2f  pc aa0cefb2  cpsr 0000003002-02 11:33:29.980 I/DEBUG   (11477):          #00  pc 000cefb2  /system/lib/libwebcore.so02-02 11:33:29.980 I/DEBUG   (11477):          #01  pc 00198f2a  /system/lib/libwebcore.so02-02 11:33:29.990 I/DEBUG   (11477):          #02  pc 0019848a  /system/lib/libwebcore.so02-02 11:33:29.990 I/DEBUG   (11477):          #03  pc 00199be8  /system/lib/libwebcore.so02-02 11:33:29.990 I/DEBUG   (11477):          #04  pc 00199c7c  /system/lib/libwebcore.so02-02 11:33:29.990 I/DEBUG   (11477):          #05  pc 00199670  /system/lib/libwebcore.so02-02 11:33:30.000 I/DEBUG   (11477):          #06  pc 00194a2a  /system/lib/libwebcore.so02-02 11:33:30.000 I/DEBUG   (11477):          #07  pc 00194e98  /system/lib/libwebcore.so02-02 11:33:30.000 I/DEBUG   (11477):          #08  pc 00195908  /system/lib/libwebcore.so02-02 11:33:30.000 I/DEBUG   (11477):          #09  pc 00195996  /system/lib/libwebcore.so02-02 11:33:30.000 I/DEBUG   (11477):          #10  pc 001f92c8  /system/lib/libwebcore.so02-02 11:33:30.010 I/DEBUG   (11477):          #11  pc 00045aba  /system/lib/libwebcore.so02-02 11:33:30.010 I/DEBUG   (11477):          #12  pc 000102d0  /system/lib/libc.so02-02 11:33:30.010 I/DEBUG   (11477):          #13  pc 0000fd90  /system/lib/libc.so02-02 11:33:30.010 I/DEBUG   (11477):02-02 11:33:30.010 I/DEBUG   (11477): code around pc:02-02 11:33:30.010 I/DEBUG   (11477): aa0cefa0 60296811 e7e76010 b091b5f0 92071c0602-02 11:33:30.010 I/DEBUG   (11477): aa0cefb0 680b930a 2b001c0c 684bd10e 2b00214002-02 11:33:30.010 I/DEBUG   (11477): aa0cefc0 68e7d007 00780059 006a19c5 da00428a02-02 11:33:30.010 I/DEBUG   (11477):02-02 11:33:30.010 I/DEBUG   (11477): code around lr:02-02 11:33:30.020 I/DEBUG   (11477): aa198f1c 1c04b084 1c1a1c01 31144668 f736343002-02 11:33:30.020 I/DEBUG   (11477): aa198f2c 2300f83d 7023b004 46c0bd10 b089b5f002-02 11:33:30.020 I/DEBUG   (11477): aa198f3c 1c066813 93041c0d d0022b00 3201681a02-02 11:33:30.020 I/DEBUG   (11477):02-02 11:33:30.020 I/DEBUG   (11477): stack:02-02 11:33:30.020 I/DEBUG   (11477):     45bb6d78  0043b428  [heap]02-02 11:33:30.020 I/DEBUG   (11477):     45bb6d7c  c0000000 02-02 11:33:30.020 I/DEBUG   (11477):     45bb6d80  00100000  [heap]02-02 11:33:30.020 I/DEBUG   (11477):     45bb6d84  aa045a99  /system/lib/libwebcore.so02-02 11:33:30.020 I/DEBUG   (11477):     45bb6d88  00000000 02-02 11:33:30.020 I/DEBUG   (11477):     45bb6d8c  afe0f658  /system/lib/libc.so02-02 11:33:30.020 I/DEBUG   (11477):     45bb6d90  00000003 02-02 11:33:30.020 I/DEBUG   (11477):     45bb6d94  afe3c9fc 02-02 11:33:30.020 I/DEBUG   (11477):     45bb6d98  0043b458  [heap]02-02 11:33:30.020 I/DEBUG   (11477):     45bb6d9c  c0000000 02-02 11:33:30.020 I/DEBUG   (11477):     45bb6da0  00100000  [heap]02-02 11:33:30.020 I/DEBUG   (11477):     45bb6da4  aa045a99  /system/lib/libwebcore.so02-02 11:33:30.020 I/DEBUG   (11477):     45bb6da8  45ab7000 02-02 11:33:30.020 I/DEBUG   (11477):     45bb6dac  afe0bde5  /system/lib/libc.so02-02 11:33:30.020 I/DEBUG   (11477):     45bb6db0  df002777 02-02 11:33:30.020 I/DEBUG   (11477):     45bb6db4  e3a070ad 02-02 11:33:30.020 I/DEBUG   (11477): #00 45bb6db8  00100000  [heap]02-02 11:33:30.020 I/DEBUG   (11477):     45bb6dbc  aa045a99  /system/lib/libwebcore.so02-02 11:33:30.020 I/DEBUG   (11477):     45bb6dc0  00000008 02-02 11:33:30.020 I/DEBUG   (11477):     45bb6dc4  0043b458  [heap]02-02 11:33:30.020 I/DEBUG   (11477):     45bb6dc8  00439d58  [heap]02-02 11:33:30.020 I/DEBUG   (11477):     45bb6dcc  00100000  [heap]02-02 11:33:30.020 I/DEBUG   (11477):     45bb6dd0  aa045a99  /system/lib/libwebcore.so02-02 11:33:30.020 I/DEBUG   (11477):     45bb6dd4  45bb6e2c 02-02 11:33:30.020 I/DEBUG   (11477):     45bb6dd8  00439f60  [heap]02-02 11:33:30.020 I/DEBUG   (11477):     45bb6ddc  0043b458  [heap]02-02 11:33:30.020 I/DEBUG   (11477):     45bb6de0  45bb6e2c 02-02 11:33:30.020 I/DEBUG   (11477):     45bb6de4  aa130bdb  /system/lib/libwebcore.so02-02 11:33:30.020 I/DEBUG   (11477):     45bb6de8  00000001 02-02 11:33:30.020 I/DEBUG   (11477):     45bb6dec  00439d38  [heap]02-02 11:33:30.020 I/DEBUG   (11477):     45bb6df0  45bb6e14 02-02 11:33:30.020 I/DEBUG   (11477):     45bb6df4  0043b438  [heap]02-02 11:33:30.020 I/DEBUG   (11477):     45bb6df8  00000000 02-02 11:33:30.030 I/DEBUG   (11477):     45bb6dfc  00000030 02-02 11:33:30.030 I/DEBUG   (11477):     45bb6e00  00439cc0  [heap]02-02 11:33:30.030 I/DEBUG   (11477):     45bb6e04  00000000 02-02 11:33:30.030 I/DEBUG   (11477):     45bb6e08  00000000 02-02 11:33:30.030 I/DEBUG   (11477):     45bb6e0c  aa198f2f  /system/lib/libwebcore.so02-02 11:33:30.030 I/DEBUG   (11477): #01 45bb6e10  45bb6e30 02-02 11:33:30.030 I/DEBUG   (11477):     45bb6e14  0043b438  [heap]02-02 11:33:30.030 I/DEBUG   (11477):     45bb6e18  45bb6e2c 02-02 11:33:30.030 I/DEBUG   (11477):     45bb6e1c  aa192673  /system/lib/libwebcore.so02-02 11:33:30.030 I/DEBUG   (11477):     45bb6e20  45bb6e2c 02-02 11:33:30.030 I/DEBUG   (11477):     45bb6e24  aa19848f  /system/lib/libwebcore.so02-02 11:33:32.510 I/WindowManager(   81): WIN DEATH: Window{43d8b088 com.missnowmrs.blog/com.missnowmrs.blog.AppStart paused=false}02-02 11:33:32.520 I/ActivityManager(   81): Process com.missnowmrs.blog (pid 11462) has died.02-02 11:33:32.560 I/UsageStats(   81): Unexpected resume of com.motorola.blur.home while already resumed in com.missnowmrs.blog02-02 11:33:32.560 I/foo     (   81): ********************** resuming: 113606196802-02 11:33:32.580 W/InputManagerService(   81): Got RemoteException sending setActive(false) notification to pid 11462 uid 1007602-02 11:33:32.590 I/DEBUG   (11477): debuggerd committing suicide to free the zombie!02-02 11:33:36.040 I/ActivityManager(   81): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.rhythm.hexise.uninst/.Uninstaller bnds=[83,138][157,217] }02-02 11:33:36.110 I/foo     (   81): ********************** resuming: 113868545602-02 11:33:38.770 I/ActivityManager(   81): Starting activity: Intent { act=android.intent.action.DELETE dat=package:com.missnowmrs.blog cmp=com.android.packageinstaller/.UninstallerActivity }02-02 11:33:38.900 I/foo     (   81): ********************** resuming: 113628864802-02 11:33:39.040 W/InputManagerService(   81): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@43b14448 (uid=10061 pid=10903)02-02 11:33:39.250 I/ActivityManager(   81): Displayed activity com.android.packageinstaller/.UninstallerActivity: 361 ms (total 361 ms)02-02 11:33:40.010 I/ActivityManager(   81): Starting activity: Intent { act=android.intent.action.VIEW cmp=com.android.packageinstaller/.UninstallAppProgress (has extras) }02-02 11:33:40.070 I/foo     (   81): ********************** resuming: 113474160802-02 11:33:40.140 I/PackageManager(   81): Removing non-system package:com.missnowmrs.blog02-02 11:33:40.450 I/ActivityManager(   81): Displayed activity com.android.packageinstaller/.UninstallAppProgress: 385 ms (total 385 ms)02-02 11:33:44.290 W/ResourceType(   81): Resources don't contain package for resource number 0x7f05000202-02 11:33:44.290 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02000002-02 11:33:44.430 W/ResourceType(   81): Resources don't contain package for resource number 0x7f04000102-02 11:33:44.430 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02000202-02 11:33:44.610 W/ResourceType(   81): Resources don't contain package for resource number 0x7f05000002-02 11:33:44.610 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02000502-02 11:33:44.610 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02000402-02 11:33:45.000 W/ResourceType(   81): Resources don't contain package for resource number 0x7f0d000002-02 11:33:45.000 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02014202-02 11:33:45.000 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02014302-02 11:33:45.630 I/UninstallAppProgress(10914): Finished uninstalling pkg: com.missnowmrs.blog02-02 11:33:45.710 I/foo     (   81): ********************** resuming: 113868545602-02 11:33:46.280 W/ResourceType(   81): Resources don't contain package for resource number 0x7f08001e02-02 11:33:46.280 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02007a02-02 11:33:46.280 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02007b02-02 11:33:48.430 W/ResourceType(   81): Resources don't contain package for resource number 0x7f0a027a02-02 11:33:48.430 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02027c02-02 11:33:48.430 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02027c02-02 11:33:48.600 W/ResourceType(   81): Resources don't contain package for resource number 0x7f07000102-02 11:33:49.780 W/Searchables(   81): did not find component in searchables: ComponentInfo{com.yellowpages.android.ypmobile/com.yellowpages.android.ypmobile.YPSearchReceiver}02-02 11:33:50.230 I/CheckinService(   81): Checkin triggered: Intent { act=android.server.checkin.CHECKIN (has extras) }, market only = true02-02 11:33:50.570 I/CheckinService(   81): Sending checkin request (5080 bytes)...02-02 11:33:51.270 E/EONS    (  145): EF_PNN: No short Name02-02 11:33:52.290 E/AndroidRuntime(11483): ERROR: thread attach failed02-02 11:34:01.340 I/CheckinService(   81): From server: Intent { act=android.server.checkin.FOTA_CANCEL }02-02 11:34:01.750 W/CheckinService(   81): Checkin interval too long: 59689902-02 11:34:02.500 I/PackageManager(   81): /data/app/vmdl42333.tmp changed; unpacking02-02 11:34:04.300 E/AndroidRuntime(11492): ERROR: thread attach failed02-02 11:34:05.380 W/ResourceType(   81): Resources don't contain package for resource number 0x7f05000202-02 11:34:05.380 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02000002-02 11:34:05.430 W/ResourceType(   81): Resources don't contain package for resource number 0x7f04000102-02 11:34:05.430 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02000202-02 11:34:05.530 W/ResourceType(   81): Resources don't contain package for resource number 0x7f05000002-02 11:34:05.530 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02000502-02 11:34:05.530 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02000402-02 11:34:05.560 W/ResourceType(   81): Resources don't contain package for resource number 0x7f0d000002-02 11:34:05.560 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02014202-02 11:34:05.560 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02014302-02 11:34:05.640 W/ResourceType(   81): Resources don't contain package for resource number 0x7f08001e02-02 11:34:05.640 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02007a02-02 11:34:05.640 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02007b02-02 11:34:06.050 E/EONS    (  145): EF_PNN: No short Name02-02 11:34:06.140 W/ResourceType(   81): Resources don't contain package for resource number 0x7f0a027a02-02 11:34:06.140 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02027c02-02 11:34:06.140 W/ResourceType(   81): Resources don't contain package for resource number 0x7f02027c02-02 11:34:06.640 W/ResourceType(   81): Resources don't contain package for resource number 0x7f07000102-02 11:34:07.240 I/ActivityManager(   81): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.missnowmrs.blog/.AppStart }02-02 11:34:07.440 E/AndroidRuntime(11503): ERROR: thread attach failed02-02 11:34:07.460 I/ActivityManager(   81): Start proc com.missnowmrs.blog for activity com.missnowmrs.blog/.AppStart: pid=11513 uid=10076 gids={1006, 3003, 1015}02-02 11:34:07.980 I/foo     (   81): ********************** resuming: 113301554402-02 11:34:08.100 W/Searchables(   81): did not find component in searchables: ComponentInfo{com.yellowpages.android.ypmobile/com.yellowpages.android.ypmobile.YPSearchReceiver}02-02 11:34:08.320 I/System.out(11513): loadUrl(file:///android_asset/www/index.html)02-02 11:34:08.320 I/System.out(11513): url=file:///android_asset/www/index.html baseUrl=file:///android_asset/www02-02 11:34:08.550 I/CheckinService(   81): Checkin triggered: Intent { act=android.server.checkin.CHECKIN (has extras) }, market only = true02-02 11:34:08.600 I/CheckinService(   81): Sending checkin request (5080 bytes)...02-02 11:34:09.500 W/InputManagerService(   81): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@43b14448 (uid=10061 pid=10903)02-02 11:34:09.550 I/ActivityManager(   81): Displayed activity com.missnowmrs.blog/.AppStart: 2126 ms (total 2126 ms)02-02 11:34:12.920 I/CheckinService(   81): From server: Intent { act=android.server.checkin.FOTA_CANCEL }02-02 11:34:13.160 W/CheckinService(   81): Checkin interval too long: 59689902-02 11:34:14.700 I/DEBUG   (11531): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***02-02 11:34:14.700 I/DEBUG   (11531): Build fingerprint: 'motorola/motus_att_us/motus/motus:2.1-update1/ERD79/3.0.1390:user/ota-rel-keys,release-keys'02-02 11:34:14.700 I/DEBUG   (11531): pid: 11513, tid: 11530  &gt;&gt;&gt; com.missnowmrs.blog &lt;&lt;&lt;02-02 11:34:14.700 I/DEBUG   (11531): signal 11 (SIGSEGV), fault addr 00000014</code></pre>","139691","","139691","","2011-02-02 16:39:38","2011-02-02 16:39:38","mobile app works on simulator but crashes on phone after a couple of seconds","<javascript><android><mobile-website><phonegap>","0","10","","",""
"4876798","1","","","2011-02-02 16:08:23","1","290","<p>I'm wondering if anyone has any experience developing Android apps using MacVIM? I've been reading up on the subject and so far it seems that MacVIM together with <a href=""http://eclim.org/"" rel=""nofollow"">Eclim</a> might be a good mix. Please share your experience.</p>","465009","","","","","2011-02-02 16:08:23","Using MacVIM for Android development","<android><osx><macvim><eclim>","0","0","1","2011-06-12 21:37:31",""
"4876862","1","","","2011-02-02 16:13:43","0","116","<p>I wanted to make an app that you can select a country and it comes up with information about the country. I don't know that much about Java i'm hoping that this will help me learn more about java.<br>I would like this to be an android app<br>please help me<br>thanks<br>CS  </p><p>edit: I am new to java so can you help me out and give me pointers on how to do this please.</p><p>Example: Lets say we have a listview that has the United States, Germany, and the UK<br>I already have the list view set up. How would i go about making a second view that would let me select the us and give basic information about it?</p>","595137","","595137","","2011-02-04 15:05:57","2011-02-06 02:12:34","I have got my HelloListView app working from android.com what is the best way to add information","<java><android><new-operator>","2","2","","",""
"4876972","1","4876999","","2011-02-02 16:23:50","0","788","<p>I'm trying to implement a UI with a scrollable component that has a certain resistance to starting the scroll - ie. that you have to drag it a certain number of pixels before the scroll starts. Is this supported in Android, and if not is it something that can be added? The idea is to allow a scrolling component to snap to certain positions and resist being moved from them accidentally.</p>","39368","","","","","2011-02-02 16:26:00","Adding resistance/inertia/dead zone to scrolling in Android","<android><scroll><inertia>","1","0","","",""
"4877042","1","","","2011-02-02 16:29:20","0","1087","<p>I have recently started developing a game in android, never used it before and was wondering if there is a simple way of getting a set of images loaded into the application. As my current implementation involves basically</p><p>Creating an int[] array,<br>Storing the values of each drawable into this array, <strong>(now this has to be hand coded, so if I add any more images it has to be added programmitically)</strong></p><p>Then itterating through each item in the array and calling BitmapFactory to get the resource.(Unfortunately I don't have the code with me as it is at home and I am at work, but that is the jist)</p><p>So 2 questions, is there a way of getting the drawables without having to put in each item manually to the int[] - ie looking for perhaps a file name prefix and then only loading the resource with the prefix?</p><p>Which leads me to my second question because I more than just these images in my drawable resource directory, is there a way to add extra organisation (folders) to manage the files better. As currently I have loads of images within the drawable file and how would I reference these sub folders/images.</p>","600282","","244296","","2011-02-02 16:36:34","2011-02-02 17:39:36","Android: Loading multiple images","<android><resources><bitmap>","2","0","","",""
"4877112","1","4877385","","2011-02-02 16:37:43","3","2703","<p>I am Having Nested Tab Activity.</p><p>TabMain (TabHost) with that i have ChildTab (another TabHost) and other 2 Activities.</p><p>I can able to show Progress Dialog in that other 2 activity.</p><p>But with in ChildTab TabActivity I add 5 Activities </p><p>in that i can able to Show progressDialog.</p><p>I am getting the following error.</p><p>ERROR/AndroidRuntime(339): Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@43d304f0 is not valid; is your activity running?</p>","510491","","","","","2012-04-09 05:19:55","Problem Showing ProgressDialog within Nested Tab Activity","<android><android-tabhost><progressdialog>","4","2","3","",""
"4877133","1","4877282","","2011-02-02 16:39:25","3","3226","<p>possible to use javascript (like PhoneGap, but not PhoneGap) to capture a photo? I realize that this post: <a href=""http://www.google.com/url?sa=D&amp;q=http://stackoverflow.com/questions/2953865/javascript-camera-api-android-froyo"" rel=""nofollow"">http://www.google.com/url?sa=D&amp;q=http://stackoverflow.com/questions/2953865/javascript-camera-api-android-froyo</a> states that it is coming - but what about iPhone?</p>","510395","","","","","2012-05-08 01:15:01","Using javascript to capture photo from iPhone / Android Camera","<javascript><iphone><android><html5><phonegap>","1","1","","",""
"4877137","1","11706119","","2011-02-02 16:40:18","1","221","<p>I am developing some location-based apps on android and using google maps, currently struggling for how can I obtain an object instance for the TrackballGestureDetector class which is part of the google maps API?</p><p>Appreciating any help in that regard;Hass.</p>","582689","","582689","","2012-03-26 11:32:40","2013-07-20 19:41:28","TrackballGestureDetector instantiation","<java><android>","1","0","","",""
"4877153","1","","","2011-02-02 16:41:28","8","6777","<p>Is it possible to make an application-wide setting for the font-size to be used by all views displaying text? I would like to provide a Preference to the user which should allow scaling all text in the app.</p><p>Android explicitly allows using the <a href=""http://developer.android.com/guide/topics/resources/more-resources.html#Dimension"">""sp"" dimension unit</a> for scalable text, however there is no actual way to set the ""user's font size preference"" in a global way.</p><p>Iterating through all views on Activity instantiation is not really an option ;-)</p>","539443","","","","","2012-09-25 22:24:37","Android: application-wide font-size preference","<android><preferences><font-size>","3","2","6","",""
"4877244","1","4877527","","2011-02-02 16:48:50","2","1780","<p>Greetings,</p><p>I have the following service running in the background:</p><p><a href=""https://gist.github.com/807968"" rel=""nofollow"">https://gist.github.com/807968</a></p><p>When I close the application, the user is asked if they'd like to continue to upload their GPS coordinates in the background. When 'Yes' is clicked, the service works just fine. When 'No' is clicked, the app shuts down as expected, but it still uploads the GPS coordinates in the background! I can even see the little GPS icon in the status bar of my Android phone. I expect to see a ""Stopped"" Toast, but it never appears...</p><p>Anyone got any ideas?</p><p>Many thanks in advance,</p>","395974","","","","","2012-05-16 11:40:13","Android: Background Service won't stop","<android><service><background>","1","1","","",""
"4877251","1","","","2011-02-02 16:49:29","0","793","<p>I have another question also, one I haven't yet got round to having a bash at coding yet so feel free to complain and tell me to try it first. But I just wanted to know if there is a way of storing data such as references to images </p><p>i.e I would have a customer object with a name, age etc and then an image which is contained within the drawable class. So when starting up the Activity (after the first time) I could obtain the name/age primitive types easy enough off of the data store but then when it comes to the image if I store it's id how would I then use that as a reference for the bitmap loader. To obviously avoid retaining two images (the one supplied with the app and if I had to store one to keep the association with the customer object). </p><p>Thanks, </p><p>Somin</p>","600282","","218589","","2011-02-02 16:51:01","2011-02-02 16:54:57","Android: Saving persistent data","<android><data><resources><persistent>","1","3","","",""
"4877303","1","4877403","","2011-02-02 16:53:53","1","681","<p>I'm encrypting data on Android with a CipherOutputStream through a BufferedOutputStream to a FileOutputStream(someFile, true). I use the ""AES/CBC/NoPadding"" for the cipher settings. Currently constant IV and key. I decrypt the data on the Mac. Encoding and decoding works well in this setting. </p><p>But when i reopen the encrypted file and append encrypted data I get garbaged data at the beginning of the appended data section. Could this be a problem of some sort of minimum block size for encrypting data?</p>","281535","","","","","2011-02-02 17:03:22","CipherOutputStream and FileOutputStream(someFile, true) results in garbage when appending data","<java><android><filestream><aes><cryptography>","2","0","1","",""
"4877305","1","","","2011-02-02 16:54:17","0","2128","<p>I have been going through several threads on here and didn't come across an answer to the issue I am running into.</p><p>My setup:I have a Mac pc that I am using as a virtual serial port to communicate with my android Nexus S phone. Running the bluetooth chat app on the phone and using it as a client to talk to the virt comm I set up. </p><p>Initially I tried the bluetooth chat app with 2 android phones to confirm it works, which it does. I can send texts back and forth.</p><p>My Use case:I have a device that reads RFid tags and sends the data to an android phone to collect the info.</p><p>I am using my PC to represent my device for now. </p><p>++++++++++++++++++Ok to the problem,</p><p>I try to connect to the pc from my phone and initially I get a ""connecting...."" status bar update and after 15secs or so I get a toast message saying ""I am connected to the pc"" but immediately after I get ""device lost connection"" toast. Then the status bar goes to ""not connected""</p><p>When I step through with the debugger, it seems to fail at the following portion of the bluetooth chat app. Specifically this line (<code>bytes = mmInStream.read(buffer);</code>)</p><pre><code>    public void run() {        Log.i(TAG, ""BEGIN mConnectedThread"");        byte[] buffer = new byte[1024];        int bytes;        // Keep listening to the InputStream while connected        while (true) {            try {                // Read from the InputStream                bytes = mmInStream.read(buffer);                // Send the obtained bytes to the UI Activity                mHandler.obtainMessage(BluetoothChat.MESSAGE_READ, bytes, -1, buffer)                        .sendToTarget();            } catch (IOException e) {                Log.e(TAG, ""disconnected"", e);                connectionLost();                break;            }        }    }</code></pre><p>When I look in logcat, the i/o exception is ""<code>software caused connection abort</code>""for the read() on inputstream.</p><p>Questions:Does this have to do with my virtual port not setup right? I have the terminal up and waiting to receive input on /dev/tty.Nexus....using the screen command @ 9600 baud</p><p>Otherwise, I thought maybe the socket which the inputstream connects to is unavailable somehow. I printed that to log and it seems like it was not NULL. Every time I step through though it dies at the <strong>ConnectThread</strong> not in the <strong>ConnectedThread</strong>.</p><p>The following portion of code: specifically this line (<code>mmSocket.connect();</code>)</p><pre><code>        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);            }            // Start the service over to restart listening mode            BluetoothChatService.this.start();            return;        }        // Reset the ConnectThread because we're done        synchronized (BluetoothChatService.this) {            mConnectThread = null;        }        // Start the connected thread        connected(mmSocket, mmDevice);    }</code></pre><p>I wonder if the socket variable is losing scope due to multi-threading and the socket is being passed around?</p><p>Thanks</p>","593278","","512958","","2011-02-02 22:01:39","2011-02-28 14:39:06","android bluetooth chat app (device loses connection immediately)","<java><android><bluetooth>","1","0","","",""
"4877311","1","4918252","","2011-02-02 16:55:13","2","1795","<p>I had developed a game intending to publish it as a paid application using the Android LVL with the default <code>ServerManagedPolicy</code> licensing policy. Now, the powers that be have decided that we have to publish it as a free app. For some reason I do not want to remove/disable the license checks. My question is: how does the licensing service handle free apps? Will checks always fail or always pass? Is there any way I can make the license service accept any installation of my free app as licensed? </p><p>I found the following on free apps in the official documentation, but, it doesn't help me much. </p><p><code>Only paid applications published through Market can use the service.[...] Licensing is currently for paid apps only, since free apps are considered licensed for all users.</code></p><p>I would have assumed that checks will fail, but, I remember reading somewhere that for free apps the licensing server will return a very large validity timestamp (long.MAX) ensuring that the license is always valid for free apps. Unfortunately, I have lost the link to that source.</p><p>Note: The problem is not as crazy as it sounds. It's just that I am not able to explain my use case further without giving away some proprietary information. </p>","341008","","","","","2012-06-21 13:10:30","LVL behavior on client side license validity check for free apps","<android><google-play><android-lvl>","3","0","0","",""
"4877366","1","","","2011-02-02 16:59:43","0","70","<p>I am experimenting with locations and listviews. I am getting location results back and I am trying to create a listview of my locations results using the following code:</p><p>ListView locationList           =   (ListView)findViewById(R.id.ListView01);            String[] items = new String[]{};</p><pre><code>        try {            Geocoder geocoder       =   new Geocoder(this, Locale.getDefault());            List&lt;Address&gt; addresses =   geocoder.getFromLocation(LATITUDE, LONGITUDE, 5);            address_textview.setText( """"+addresses );            Address[] addresses_array       =   new Address[addresses.size()];            addresses.toArray(addresses_array);            for( int i = 0; i &lt; addresses_array.length; i++ ){                items[i]    =   addresses_array[i].getPostalCode();            }        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        ArrayAdapter&lt;String&gt; adapter    =   new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, items);        locationList.setAdapter(adapter);</code></pre><p>My problem is, when I try to write into my items array ( items[i]   =   addresses_array[i].getPostalCode(); )  in the forloop, my application crashes.</p><p>Can anyone please help. I am stuck at this point.</p>","504612","","","","","2011-02-02 17:08:42","Location Listing problem","<android>","1","1","","",""
"4877574","1","4877710","","2011-02-02 17:17:55","2","574","<p>I've read so many posts and still can't find or understand how to handle a result set that can have either 1 result, or an array of results.  (From yahoo Search)</p><p>I can parse the results perfectly fine IF multiple results were received, but when there is only 1 search result I get the JSONException: blahblahbalh is not a JSONArray.</p><pre><code>JSONArray results = resultObject.getJSONArray(""Result"");</code></pre><p>Works fine when there are multiple results, but how can I FORCE the built-in JSON parser to accept it as a result when there is only 1 result returned from the Yahoo Query?</p><p>This single result fails to parse to JSON Array:</p><pre><code>{  ""ResultSet"": {    ""totalResultsAvailable"": ""108"",    ""totalResultsReturned"": ""1"",    ""firstResultPosition"": ""1"",    ""ResultSetMapUrl"": ""http:\/\/maps.yahoo.com\/broadband\/?q1=Virginia+Beach%2C+VA+23454-4608tt=mexicantp=1"",    ""Result"": {      ""id"": ""12811175"",    }  }}</code></pre><p>But this parses to JSONArray just fine:</p><pre><code>    {  ""ResultSet"": {    ""totalResultsAvailable"": ""108"",    ""totalResultsReturned"": ""2"",    ""firstResultPosition"": ""1"",    ""ResultSetMapUrl"": ""http:\/\/maps.yahoo.com\/broadband\/?q1=Virginia+Beach%2C+VA+23454-4608tt=mexicantp=1"",    ""Result"": [      {        ""id"": ""12811175"",      },      {        ""id"": ""12814560"",      }    ]  }}</code></pre><p>Sorry if I'm babbling, but it's driving me crazy that I just can't figure out how to get a JSONArray with length of 1, out of the first result example.</p><p>Thanks much!</p>","600346","","142162","","2011-02-02 17:24:22","2011-02-02 17:31:26","Help parsing Yahoo search results with JSON Not a JsonArray exception","<java><android><json><json-decode>","2","0","","",""
"4877694","1","4886871","","2011-02-02 17:30:16","11","18677","<p>In my Android App I have a Activity which show images which have following size <code>244 x 330</code>.I want to show those images in full device width.</p><p>My layout file looks like this:</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;LinearLayout       android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      android:orientation=""vertical""&gt;            &lt;ImageView android:id=""@+id/news_image""                 android:layout_height=""fill_parent""                 android:layout_width=""fill_parent""                android:layout_marginLeft=""18dip""                android:layout_marginRight=""18dip""                android:background=""#aaaaaa"" /&gt;    &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>I tried to set the ScaleType of the ImageView but there is no ScalingType which scales the ImageView proportional.How can I scale the image proportionally to fit the whole screen in landscape mode AND portrait mode?</p><p>Basically what I want is something like ScaleType.CENTER_CORP but which also sets the proportional height for the image so I can see all of it and not just a part of the image. </p><p><strong>Edit cause I know I'm confusing you with my ""weird"" questing.</strong> </p><p>I want to show it to you with a image.This is what I get at the moment with my layout. I want to fill the whole grey area by scaling the image as big as needed. How can I accomplish that?</p><p><img src=""http://i.stack.imgur.com/5vhMM.png"" /></p><p>When I set the <code>ScaleType</code> to <code>CENTER_CROP</code> I get this </p><p><img src=""http://i.stack.imgur.com/jMS4f.png"" /></p><p>but this is not what I want cause you are not seeing the whole image just a part from the center.</p><p>And this is what I want it to be:</p><p><img src=""http://i.stack.imgur.com/52Mt1.png"" /></p><p>I hope this helps you to understand what I'm trying to accomplish.Anyone knows how to do that?</p><p><strong>Edit 2:</strong></p><p>It might look weird and little confusing that I'm trying to display a image which is bigger in the height than the screen size but since I'm using a <code>ScrollView</code> in my example layout this should be ok and the user could scroll if he want to see the not displayed area.</p><p>Hope this helps to understand what I'm trying to do.</p>","138584","","138584","","2011-02-03 08:23:30","2014-02-24 09:21:44","Scaling ImageView to device width","<android><layout><imageview>","7","0","7","",""
"4877706","1","4877802","","2011-02-02 17:31:03","1","802","<p>I wanted to ask how does Bar code recognition apps works (like Goggles)?Where do they get the bar code information? </p>","533562","","","","","2011-02-02 18:53:10","Bar code recognition in apps","<iphone><android><barcode><barcode-scanner>","2","0","","",""
"4877734","1","4877905","","2011-02-02 17:33:18","1","2014","<p>I'm fairly new to eclipse and android development, and I'm having what must be a pretty simple error to fix. I've done some development on my laptop and never encountered these errors. (I currently only have access to public computers, and have eclipse and the SDK installed on a USB drive.)</p><p>The first strange thing I noticed when editing the main layout was that there is no properties window to allow easy editing of various layouts and objects. (There was on my old computer) I have not been able to figure out how to get this window to appear.</p><p>So after adding one textView and modifying its properties by hand, I receive the following two errors when I attempt to run the program. (No code has even been added yet, just one textView)</p><p><a href=""http://i.stack.imgur.com/9VGT0.png"" rel=""nofollow"">http://i.stack.imgur.com/9VGT0.png</a> <em>(Link to screenshot of error, only have 6 rep)</em></p><p>All I've done is change the textView to have center gravity, fill_parent layout width, and a textSize of 22sp. I've tried googling the errors to figure out what I'm doing wrong but have been unsuccessful. Anybody encounter this before? Also, if anybody knows how to make the properties window appear it would be a great help.</p><p>Thanks in advance</p>","551892","","","","","2011-02-02 19:06:21","XML Problems with Eclipse / Android SDK","<android><xml><eclipse>","4","2","","",""
"4877759","1","5383015","","2011-02-02 17:35:20","2","639","<p>Ok well I have been fighting with this for a while now and have soundboard apps that I havn't ran into this problem in.  I am developing a widget that allows for a sound to be played when a button is pressed on the widget.</p><p>I am assuming I am just not using the setOnPreparedListener properly but basically what is happening is that some of my sounds play correctly and more likely than not the sounds will cut off the last part noticeable by word or sound effect missing.  Below is my code please let me know if you have any idea what's wrong with the code or post a working revision.  </p><p>Thanx in advance.</p><pre><code>    public int onStartCommand(Intent intent, int flags, int startId) {            /** Get our place holder for quotes &amp; sounds. */            int s = UpdateService.getQuoteNumber();            /** Check if a sound is playing if so... stop and reset it. */            if (mp != null &amp;&amp; mp.isPlaying()){mp.stop();mp.reset();}            /** Create a new mediaplayer and set looping. */            mp = MediaPlayer.create(this, SoundsClicked.randomSound[s]);            mp.setLooping(false);            /** Try to prepare the sound/mediaplayer, if not report error &amp; type. */            try {mp.prepare();}                 catch (IllegalStateException e) {e.printStackTrace();Log.e(Integer.toString(s), ""IllegalStateException"");}                 catch (IOException e) {e.printStackTrace();Log.e(Integer.toString(s), ""IOException"");}                          /** Check if the sound is prepared, if so play it. */            mp.setOnPreparedListener(new OnPreparedListener() {                public void onPrepared(MediaPlayer mp) {                    mp.start();                    while (mp.isPlaying()) {};                }            });            return flags;}</code></pre><p>This is called from a service (obviously from the onStartCommand) but figured I would throw that out there for those not familiar with some of the methods.</p>","591253","","","","","2011-03-21 20:07:13","Sounds stopping too soon in MediaPlayer :: Android","<android><android-widget><media-player><listener><sounds>","1","0","1","",""
"4877768","1","","","2011-02-02 17:35:51","-2","738","<p>I'm having trouble with settting some text to EditText every time a dialog is loaded.</p><p>The problem is whenever the dialog window appears there should be some specific text in the editText that can be edited. It can't be made static (defined in XML), so where should I put the code like <code>wrapper.setText(""some phone number etc"");</code>?</p><p>Here is the code:</p><pre><code>private void edit(final long id) {    if (id&gt;0)    {        LayoutInflater inflator = LayoutInflater.from(this);        View dialogView = inflator.inflate(R.layout.editonly, null);        final editDialogContentGetter wrapper = new editDialogContentGetter(dialogView);        new AlertDialog.Builder(this).setTitle(R.string.edit).        setView(dialogView).setPositiveButton(R.string.edit,new DialogInterface.OnClickListener(){            @Override            public void onClick(DialogInterface dialog, int which) {                basicallyEdit(wrapper);            }}).setNegativeButton(R.string.cancel,new DialogInterface.OnClickListener(){                @Override                public void onClick(DialogInterface dialog, int which) {                    Toast.makeText(AllPhones2.this,R.string.nochange,Toast.LENGTH_SHORT).show();                }}).show();    }}protected void basicallyEdit(editDialogContentGetter wrapper) {        // some code here to process information  recieved by the dialog}class editDialogContentGetter{    //class for dialog    EditText editphoneBox = null;    View base2 = null;    public  editDialogContentGetter(View base2) {        // TODO Auto-generated constructor stub        this.base2 = base2;    }    public EditText getEditBoxField()    {        if(editphoneBox==null)    {        editphoneBox =(EditText) base2.findViewById(R.id.editphone);    }        return editphoneBox;    }    public String getEditBoxText()             {                return getEditBoxField().getText().toString();             } }</code></pre>","572941","","105971","","2012-01-14 18:08:18","2012-01-14 18:08:18","how to change text in AlertDialog before onClick event","<android><alertdialog>","1","0","","",""
"4877880","1","","","2011-02-02 17:44:44","1","4595","<p>How to play .aac audio format in android.</p><p>I tried using ffmpeg convert audio format and play in android-ndk. But im not able to implement.</p><p>Please let me know any ideas or any ref link to follow</p>","341443","","244296","","2011-02-02 17:47:10","2014-03-28 05:37:01","How to play .aac format audio file in android","<android><jni><android-ndk>","1","0","","",""
"4878057","1","4879993","","2011-02-02 18:02:13","0","293","<p>If I build a Android and Blackberry app with Flash/AIR, do i get access to the file system and database for both platforms? </p><p>My app will need to save downloaded images.</p>","346443","","346443","","2011-02-02 18:12:23","2011-02-02 22:12:25","Flash CS5 Android and Blackberry Development","<android><flash><blackberry><air>","1","0","1","",""
"4878159","1","","","2011-02-02 18:11:18","34","42204","<p>hey people,I have one activity which is the main activity used throughout the app and it has a number of variables.  I have 2 other activities which I would like to be able to use the data from the first activity.Now I know I can do something like this:</p><pre><code>GlobalState gs = (GlobalState) getApplication();String s = gs.getTestMe();</code></pre><p>However I want to share alot of variables and some might be rather large so I don't want to be creating copies of them like above.  Therefore is there a way to directly get and change the variables without using get and set methods as I remember reading an article on the google dev site saying this is not recommended for performance on android.</p><p>So if anyone has any ideas or knows a better way I would appreciate it.  Thanks.</p>","597334","","","","","2013-12-02 23:01:37","Android - What's the best way to share data between activities?","<java><android><sharing>","9","1","26","",""
"4878172","1","4880268","","2011-02-02 18:12:37","0","150","<p>Okay guys, I am developing an app on Android that uses the Google API to display a map on the screen. I have simple overlays that will display the location of Contacts that the user decides to track. I already know how to use the Mapping and retrieve my own location, but I need to know the best way to get other Users locations. </p><p>With the release of Google Latitude's API, this functionality was supposed to be made easy. I cannot find any tutorials or anything on how to implement the API. </p><p>Please: If you know any Tutorials or anything of the sort to teach me this, please let me know. Also, if this is not the most efficient way to go about this let me know. </p><p>Any help would be much appreciated.</p><p>Thanks.</p><p>Specs: Eclipse Galileo, Android SDK, Android APIs and Google API</p>","600137","","881229","","2013-12-29 23:49:23","2013-12-29 23:49:23","How do I utilize Android Google Map Capabilities?","<android><google-maps><google-latitude>","1","0","","",""
"4878212","1","","","2011-02-02 18:16:42","1","2122","<p>How can i check from my android application whether there is a keyguard enabled right now? I mean normally when screen goes off Android enables the keyguard, so next time you wake up you have keyguard screen infront of you. So I just want to know from the application that if there is a key guard enabled or not.</p><p>I had a look on keyguardmanager.java but it does not have that API.</p>","600445","","1225413","","2013-01-25 04:00:55","2013-01-25 04:00:57","check if keyguard is enabled i.e. currently active from android application","<android><api>","1","0","","",""
"4878215","1","4878327","","2011-02-02 18:17:06","1","661","<p>This is probably the most annoying error I have ever encountered. When I go to inflate a custom view and pass it to and activity, I get this:</p><pre><code>02-02 10:34:08.080: ERROR/AndroidRuntime(839): java.lang.RuntimeException: Unable to start activity ComponentInfo{android.appion.ResourceManager.UI/android.appion.ResourceManager.UI.ARMHomescreen}: android.view.InflateException: Binary XML file line #62: Error inflating class android.appion.ResourceManager.NUI.ARMPublicService$WorkBench02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2787)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2803)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.app.ActivityThread.access$2300(ActivityThread.java:135)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.os.Handler.dispatchMessage(Handler.java:99)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.os.Looper.loop(Looper.java:144)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.app.ActivityThread.main(ActivityThread.java:4937)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at java.lang.reflect.Method.invokeNative(Native Method)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at java.lang.reflect.Method.invoke(Method.java:521)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at dalvik.system.NativeStart.main(Native Method)02-02 10:34:08.080: ERROR/AndroidRuntime(839): Caused by: android.view.InflateException: Binary XML file line #62: Error inflating class android.appion.ResourceManager.NUI.ARMPublicService$WorkBench02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.view.LayoutInflater.createView(LayoutInflater.java:503)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.app.Activity.setContentView(Activity.java:1654)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.appion.ResourceManager.UI.ARMHomescreen.onCreate(ARMHomescreen.java:141)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2751)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     ... 11 more02-02 10:34:08.080: ERROR/AndroidRuntime(839): Caused by: java.lang.NoSuchMethodException: WorkBench(Context,AttributeSet)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at java.lang.Class.getMatchingConstructor(Class.java:660)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at java.lang.Class.getConstructor(Class.java:477)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     at android.view.LayoutInflater.createView(LayoutInflater.java:475)02-02 10:34:08.080: ERROR/AndroidRuntime(839):     ... 23 more</code></pre><p>What I took away from this was ""Hey, I must have forgotten to add AttributeSet to my View, dummy"", this is not so! My constructor is perfect from what I can tell. Can anyone tell what I'm missing or if eclipse is screwing me rectally?</p><pre><code>public class WorkBench extends GridView {    private final String TAG = ""WorkBench"";    // The position in the WorkArea    public String TITLE;    private String[] DEVICE = new String[6];    private int mSelection;    public WorkBench(Context context) {super(context);}    public WorkBench(Context context, AttributeSet attrs) {        super(context, attrs);        setAdapter(new GridAdapter());    }    public WorkBench(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);    }... Rest of class definition</code></pre><p>Where I'm calling the WorkBench (WorkBench and this function are in a service, that's why I cast to Activity)</p><pre><code>public WorkBench createBench(Context context) {    return (WorkBench)((Activity)context).findViewById(R.id.workbench);}</code></pre><p>And the XML</p><pre><code>&lt;view               class=""android.appion.ResourceManager.NUI.ARMPublicService$WorkBench""    android:id=""@+id/workbench""    android:background=""@+drawable/woodtexture1""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:numColumns=""2"" /&gt;</code></pre><p>Any tips will be helpful, thanks~Aedon</p>","480691","","918472","","2012-02-13 13:20:00","2012-02-13 13:20:00","Inflater can't find constructor","<android><view><inflate>","1","0","","",""
"4878254","1","","","2011-02-02 18:20:45","2","1520","<p>I need to patch a file into the system.img file used by the Android emulator, specifically I want to add an ARM binary to the /system/bin directory.</p><p>I have this binary pre-compiled and it works in my emulator perfectly, but I can't simply remount system.img as rw and adb push it because the change is non-persistent across reboots. I tried this on a copy of system.img and passing it to the emulator with -system but that was non-persistent to sadly.</p><p>In the ideal world I want to modify the ""make sdk"" process so that the sdk build process automatically includes my binary when it produces system.img. Can this be done?</p><p>If this isn't possible, is there anyway of patching it into the image manually?</p><p>Thanks a lot.</p>","455584","","","","","2013-03-07 15:05:50","Patching a file into system.img for use with android emulator","<android><android-emulator>","2","0","","",""
"4878344","1","7472086","","2011-02-02 18:32:23","0","701","<p>i am trying to make a progressdialog inside a onclick, and it doesn't shows nothing</p><p>this is my code:</p><pre><code>enterButton.setOnClickListener(new OnClickListener() {            public void onClick(View v) {ProgressDialog pd = ProgressDialog.show(GPSLoc.this, GPSLoc.this.getResources().getString(R.string.app_name),                                     GPSLoc.this.getResources().getString(R.string.loading), true, false);  }}</code></pre><p>why it doesn't shows nothing? i am doing something wrong?</p>","479886","","","","","2011-09-19 13:55:33","Problems showing a ProgressDialog from a onClick method","<android><progressdialog>","2","1","","",""
"4878443","1","4878952","","2011-02-02 18:41:46","-1","792","<p>Hello i have a problem with this aplication.</p><pre><code>import java.util.ArrayList;import java.util.List;import android.app.Activity;import android.database.Cursor;import android.net.Uri;import android.os.Bundle;import android.telephony.SmsManager;import android.view.View;import android.widget.AdapterView;import android.widget.AdapterView.OnItemClickListener;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;public class Smsfive extends Activity {/** Called when the activity is first created.* @param messages */public void onCreate(Bundle savedInstanceState, ListView messages) {super.onCreate(savedInstanceState);setContentView(R.layout.main);ListView list = (ListView) findViewById(R.id.list);List&lt;String&gt; msgList = getSMS();for(int i = 0; i&lt;msgList.size(); i++) {System.out.println(msgList.get(i));}ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, R.id.list, msgList);  --&gt; there is error with list_item//ListView messages;messages.setAdapter(adapter);messages.setOnItemClickListener(new OnItemClickListener(){@Overridepublic void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,long arg3) {SmsManager m = SmsManager.getDefault();TextView view;String destinationNumber=(String) ((TextView) view).getText();m.sendTextMessage(destinationNumber, null, destinationNumber, null, null);}});}public List&lt;String&gt; getSMS() {List&lt;String&gt; messages = new ArrayList&lt;String&gt;();Uri uri = Uri.parse(""content://sms/inbox"");Cursor c = null;try{c = getApplicationContext().getContentResolver().query (uri, null, null ,null,null);}catch(Exception e){e.printStackTrace();}try{for (boolean hasData = c.moveToFirst(); hasData; hasData = c.moveToNext()) {final String address = c.getString(c.getColumnIndex(""address""));final String body = c.getString(c.getColumnIndexOrThrow(""body""));messages.add(""Number: "" + address + "". Message: "" + body);}}catch(Exception e){e.printStackTrace();}c.close();return messages;}}</code></pre><p>XML file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutandroid:id=""@+id/widget30""android:layout_width=""fill_parent""android:layout_height=""fill_parent""androidrientation=""vertical""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ListViewandroid:id=""@+id/list""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><p>Error:</p><blockquote>  <p>Description Resource Path Location  Type list_item cannot be resolved or  is not a field Smsfive.java  /Sms5/src/sms/five line 30 Java  Problem</p></blockquote><p>What can i do please? </p>","600468","","142162","","2011-02-02 18:42:58","2011-02-03 00:23:46","Sms aplication - List_item error","<java><android><xml>","4","3","0","",""
"4878470","1","4878954","","2011-02-02 18:44:00","4","1249","<p>i want to show a PD when my activity A starts another activity B. But in that onclick method, my A activity haves to do some work before start B, and B also haves to do some work because it haves to load a lot of data for the UI.</p><p>I need a PD that is viewed by the user in all the process of the loading data of changin from activity A to B.</p><p>¿how can do it?</p><p>i tryed storing a static ProgressDialog on MyApplication.java, and with these methods:</p><pre><code>public static void showProgressDialog(Context c) {    pd = ProgressDialog.show(c, c.getResources().getString(R.string.app_name),         c.getResources().getString(R.string.loading), true, false);    }public static void dismissProgressDialog(){    pd.dismiss();}</code></pre><p>but it doesn't works, it doesn't shows nothing, i dont know why</p><p>how to achieve this by a easy way? <strong>i know that i can do it with async task, but that is too hard for me</strong>, i can't understand the code examples i am finding on this web and google</p><p>code examples are welcome</p><p>thanks</p>","479886","","479886","","2011-02-02 18:52:38","2013-07-17 09:58:39","How to show a ProgressDialog while changing from a activity to another activity?","<android><progressdialog>","2","2","0","",""
"4878639","1","","","2011-02-02 19:00:55","1","707","<p>This is regarding google apps Device Management policy third party application which I got from android market in 2.2 . </p><p>I registered an account in Google Apps domain in order to use this account for enabling  device management policies. I need to know the process in which remote wipe out feature can be achieved using this application in an enterprise manner. I need to login as an administrator in this application and need to wipe out the user secured data in his device on his request.</p><p>Is there a way in which I can achieve this using this 3rd party application?</p><p>I will be waiting for reply  with the process in which this application can be used in Enterprise scenario.</p><p>Thanks in Advance.</p>","429501","","444277","","2012-08-07 05:12:10","2012-08-07 05:12:10","Device Management application in Android 2.2","<android><mdm><device-policy-manager>","2","0","5","",""
"4878718","1","","","2011-02-02 19:07:33","5","5032","<p>I am trying to implement an animation on key event. Same code is working fine on OnClickListener but OnKeyListener, nothing is happening. Even no error message on Logcat.</p><p>Please help me to solve this problem. Below is my code. Please tell me where I'm wrong.</p><pre><code>package com.example.SliderImage;import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.KeyEvent;import android.view.View;import android.view.View.OnKeyListener;import android.view.animation.AccelerateInterpolator;import android.view.animation.Animation;import android.view.animation.TranslateAnimation;import android.widget.Button;import android.widget.ViewFlipper;public class SliderImage extends Activity {    ViewFlipper flipper;    String value;    int i;     int menuArray[] = {R.id.gtmain, R.id.gtmini, R.id.gtmore};     protected void showPrevious() {            // TODO Auto-generated method stub        }        protected void setInAnimation(Animation inFromRightAnimation) {            // TODO Auto-generated method stub        }        protected void setOutAnimation(Animation outToLeftAnimation) {            // TODO Auto-generated method stub        }        protected void showNext() {            // TODO Auto-generated method stub        }        private Animation inFromRightAnimation() {            Animation inFromRight = new TranslateAnimation(            Animation.RELATIVE_TO_PARENT,  +1.0f, Animation.RELATIVE_TO_PARENT,  0.0f,            Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f            );            inFromRight.setDuration(500);            inFromRight.setInterpolator(new AccelerateInterpolator());            return inFromRight;            }        private Animation outToLeftAnimation() {            Animation outtoLeft = new TranslateAnimation(              Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,  -1.0f,              Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f            );            outtoLeft.setDuration(500);            outtoLeft.setInterpolator(new AccelerateInterpolator());            return outtoLeft;            }        private Animation inFromLeftAnimation() {            Animation inFromLeft = new TranslateAnimation(            Animation.RELATIVE_TO_PARENT,  -1.0f, Animation.RELATIVE_TO_PARENT,  0.0f,            Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f            );            inFromLeft.setDuration(500);            inFromLeft.setInterpolator(new AccelerateInterpolator());            return inFromLeft;            }        private Animation outToRightAnimation() {            Animation outtoRight = new TranslateAnimation(              Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,  +1.0f,              Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f            );            outtoRight.setDuration(500);            outtoRight.setInterpolator(new AccelerateInterpolator());            return outtoRight;            }    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.home);     flipper = (ViewFlipper) findViewById(R.id.flipper);     final  Button miniButton = (Button) findViewById(R.id.gtmini);     final Button mainButton = (Button) findViewById(R.id.gtmain);     final Button moreButton = (Button) findViewById(R.id.gtmore);     miniButton.setOnClickListener(new View.OnClickListener() {         public void onClick(View view) {             flipper.setInAnimation(inFromRightAnimation());             flipper.setOutAnimation(outToLeftAnimation());             flipper.showNext();               }     });     mainButton.setOnClickListener(new View.OnClickListener() {         public void onClick(View view) {             flipper.setInAnimation(inFromLeftAnimation());             flipper.setOutAnimation(outToRightAnimation());             //flipper.showPrevious();             flipper.showNext();          }     });     moreButton.setOnClickListener(new View.OnClickListener() {         public void onClick(View view) {             flipper.setInAnimation(inFromLeftAnimation());             flipper.setOutAnimation(outToRightAnimation());            // flipper.showPrevious();             flipper.showNext();         }     });     mainButton.setOnKeyListener(new OnKeyListener() {        public boolean onKey(View v, int keyCode, KeyEvent event) {            // TODO Auto-generated method stub            String a1=String.valueOf(keyCode);            Log.i(""listvalaaaaaaaaaa"",a1);            if (keyCode==66) {                //String value=mainButton.getText().toString();                if(value.equalsIgnoreCase(""GO TO MAIN""))                {                    //startActivity(new Intent(Start.this,MainEpg.class));                }                if(value.equalsIgnoreCase(""GO TO MINI""))                {                    //startActivity(new Intent(Start.this,MiniEpg.class));                }            }             if (keyCode==22) {                 Log.i(""insideright"",""ghkhkjhk"");                 flipper.setInAnimation(inFromRightAnimation());                 flipper.setOutAnimation(outToLeftAnimation());                 flipper.showNext();                   }                 int c = moreButton.getId();                 int b = mainButton.getId();                 int a = moreButton.getId();                 menuArray[0] = b;                 menuArray[1] = c;                 menuArray[2] = a;                 moreButton.setId(menuArray[i]);                 miniButton.setId(menuArray[++i]);                 mainButton.setId(menuArray[++i]);                 mainButton.requestFocus();                 i = 0;                //mainButton.requestFocus();                 mainButton.setSelected(true);                 flipper.setInAnimation(inFromRightAnimation());                 flipper.setOutAnimation(outToLeftAnimation());                 flipper.showNext();                   if (keyCode==21) {                 int a11 = moreButton.getId();                 int b1 = mainButton.getId();                 int c1 = moreButton.getId();                 menuArray[0] = c1;                 menuArray[1] = b1;                 menuArray[2] = a11;                 moreButton.setId(menuArray[i]);                 miniButton.setId(menuArray[++i]);                 mainButton.setId(menuArray[++i]);                 mainButton.requestFocus();                 i = 0;                //mainButton.requestFocus();                 mainButton.setSelected(true);                /* flipper.setInAnimation(inFromRightAnimation());                 flipper.setOutAnimation(outToLeftAnimation());                 flipper.showPrevious();*/             }            return true;            }        });    }}</code></pre>","285163","","938089","","2012-01-09 13:07:29","2014-03-29 09:43:08","OnKeyListener not working","<android>","2","0","0","",""
"4878723","1","","","2011-02-02 19:08:09","0","1078","<p>Here's the rub:  I have a layout that uses the include tag.  The layout is simple -> </p><pre><code>&lt;LinearLayout&gt;  &lt;TextView ...&gt;  &lt;LinearLayout&gt;     &lt;include ...&gt;  &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Now the included file is nothing more than:</p><pre><code>&lt;LinearLayout&gt;  &lt;TextView ... android:id=""@+id/inner_text""&gt;&lt;/LinearLayout&gt;</code></pre><p>Now, if I try to access the TextView inner_text in either the create or onStart call, it throws a NPE.  I have tried using LayoutInflater to infate the included xml file and then access inner_text but to no avail - it always fails.</p><p>So, the question is :  does LayoutInflater work with included xml files of the parent xml file?  What I would like to do is grab the contents of the included xml file - and set the whole thing to be either visible or not visible based on preferences.</p><p>Nothing seems to allow me to grab the TextView object.</p><p>Now, when I include the xml as just a nested element in the parent file (not using the include tag) - then it accesses that LinearLayout just fine - but that defeats my purpose of trying to make the layout of the view dynamic - that is, I can change the contents of the child included layout at will - and not have to do any changes to the parent layout.</p><p>Any help, pointers, suggestions -> greatly appreciated.</p>","600506","","244296","","2011-02-02 19:14:55","2011-02-08 13:13:21","Does LayoutInflater work with a layout xml file that uses includes?","<android><android-layout>","3","0","","",""
"4878732","1","4878835","","2011-02-02 19:08:55","2","1209","<p>I've got custom fonts loading in my application just fine, but since I can't see their position until I load up the application it's taking an exorbitant amount of time to get my display just right. </p><p>Is there any way to get the Graphical Layout tool in eclipse to display a custom font so I can position it there before running the application?</p>","183380","","","","","2012-01-25 11:20:30","Android: Show custom font in Graphical Layout tool","<android><eclipse>","2","0","","",""
"4878755","1","","","2011-02-02 19:10:56","0","917","<p>I have a problem with this application.</p><pre><code>public class Smsfive extends Activity {/** Called when the activity is first created.* @param messages */public void onCreate(Bundle savedInstanceState, ListView messages) {super.onCreate(savedInstanceState);setContentView(R.layout.main);ListView list = (ListView) findViewById(R.id.list);List&lt;String&gt; msgList = getSMS();for(int i = 0; i&lt;msgList.size(); i++) {System.out.println(msgList.get(i));}ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, R.id.list,msgList); --&gt; there is error (R.layout.list_item)//ListView messages;messages.setAdapter(adapter);messages.setOnItemClickListener(new OnItemClickListener(){@Overridepublic void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,long arg3) {SmsManager m = SmsManager.getDefault();TextView view;String destinationNumber=(String) ((TextView) view).getText();m.sendTextMessage(destinationNumber, null, destinationNumber, null, null);}});}public List&lt;String&gt; getSMS() {List&lt;String&gt; messages = new ArrayList&lt;String&gt;();Uri uri = Uri.parse(""content://sms/inbox"");Cursor c = null;try{c = getApplicationContext().getContentResolver().query (uri, null, null ,null,null);}catch(Exception e){e.printStackTrace();}try{for (boolean hasData = c.moveToFirst(); hasData; hasData = c.moveToNext()) {final String address = c.getString(c.getColumnIndex(""address""));final String body = c.getString(c.getColumnIndexOrThrow(""body""));messages.add(""Number: "" + address + "". Message: "" + body);}}catch(Exception e){e.printStackTrace();}c.close();return messages;}}</code></pre><p>XML file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutandroid:id=""@+id/widget30""android:layout_width=""fill_parent""android:layout_height=""fill_parent""androidrientation=""vertical""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ListViewandroid:id=""@+id/list""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><p>Error Description : </p><blockquote>  <p>Resource Path Location Type list_item  cannot be resolved or is not a field  Smsfive.java /Sms5/src/sms/five line  30 Java Problem</p></blockquote><p>What can I do please? </p>","600468","","457982","","2011-02-03 05:43:37","2011-02-03 05:43:37","Resource Path Location Type XXXXXXXX cannot be resolved or is not a field","<android><listview><sms>","0","0","0","",""
"4878903","1","4879088","","2011-02-02 19:26:47","2","4558","<p>Using the <a href=""http://developer.android.com/guide/topics/data/data-storage.html#filesExternal"" rel=""nofollow"">api logic</a> you can detect if the sd card is available for read or write, but it doesn't tell you why it is not writable.</p><p>I want to know if the user even has a sd card vs if it just mounted.</p><p>Is this possible?</p>","445348","","","","","2011-09-27 07:02:57","Is there a way to tell if the sdcard is mounted vs not installed at all?","<android><sd-card>","2","2","1","",""
"4878912","1","","","2011-02-02 19:28:01","0","507","<p>I want to have a normal class file in my android package that is not a component but will be used by an activity. Is this allowed? How do I add this in the manifest if required?</p><p>Right now it is not part of my manifest and I am getting an 'INSTALL_PARSE_FAILED_MANIFEST_MALFORMED' error in my Android project and don't know if it's because of this generic class file.</p><p>Thanks</p>","450364","","","","","2011-02-02 19:40:02","Generic class in Android package and manifest","<android><manifest>","2","1","","",""
"4878917","1","","","2011-02-02 19:28:31","1","101","<p>Can I setup a pc to act as a virtual serial port to mimic a device using SPP bluetooth profile that I need to talk to an android phone?</p><p>The device would not have no way receiving the UUID that it needs to be listening for to connect to my phone.I saw the ""reflection"" method being used to avoid UUID. Is this how to communicate with devices agnostic to android's communication process?</p>","593278","","","","","2013-04-29 12:20:41","device to android","<android><bluetooth>","1","0","0","",""
"4879040","1","","","2011-02-02 19:42:29","1","539","<p>I have a for loop as part of a background thread in my code.  Part way through execution of the code within the loop I want a wait period so I call thread.sleep.  I've discovered that if the phone display closes during the wait period the wait time becomes erratic.   According to the documentation sleep is not time reliable.  So I am wondering what to substitute.  As far as I can see if I create a post delayed sub thread I will loose the continuity within the for loop.  I hope I am wrong and have'nt understood the mechanics properly - any help appreciated.Ron   </p>","538847","","","","","2011-02-02 20:49:44","what to substitute for thread.sleep","<android>","3","0","","",""
"4879050","1","4884449","","2011-02-02 19:43:54","0","720","<p>Why?</p><p>Here is one of my apps for example:</p><p><a href=""http://market.android.com/details?id=com.citc.ud"" rel=""nofollow"">http://market.android.com/details?id=com.citc.ud</a></p>","396106","","","","","2011-02-03 09:41:06","Android icon background is black in new market","<android><icons>","2","0","","",""
"4879134","1","","","2011-02-02 19:51:13","1","2206","<p>I am having exactly the same problem as described <a href=""https://code.google.com/p/android/issues/detail?id=4175"" rel=""nofollow"">here</a>.</p><p>I am trying to use this Intent:<code>android.provider.ContactsContract.Intents.ATTACH_IMAGE</code></p><p><code>Starts an Activity that lets the user pick a contact to attach an image to.</code><br>Sounds suitable to me but unfortunately results in an <code>ActivityNotFoundException</code>.</p><p>Code:  </p><pre><code>import android.provider.ContactsContract;  ...  try {      Intent myIntent = new Intent();      myIntent.setAction(ContactsContract.Intents.ATTACH_IMAGE);      myIntent.setData(imageUri);      startActivity(myIntent);  } catch (ActivityNotFoundException anfe) {      Log.e(""ImageContact"",             ""Firing Intent to set image as contact failed."", anfe);      showToast(this, ""Firing Intent to set image as contact failed."");  }</code></pre><p>I cannot find any error in the code above. The <code>imageUri</code> is correct for following code is working perfectly:</p><p>Code:  </p><pre><code>try {      Intent myIntent = new Intent();      myIntent.setAction(Intent.ACTION_ATTACH_DATA);    myIntent.setData(imageUri);      startActivity(myIntent);  } catch (ActivityNotFoundException anfe) {      Log.e(""ImageContact"",             ""Firing Intent to set image as contact failed."", anfe);      showToast(this, ""Firing Intent to set image as contact failed."");  }</code></pre><p>As mentioned in the link this results in a another menu before getting to the contacts. That is acceptable but not perfect.</p>","600537","","418183","","2011-02-03 22:11:56","2011-02-03 22:11:56","Attach an image to a contact","<android><image><contact>","2","0","2","",""
"4879208","1","4983756","","2011-02-02 19:58:30","3","6768","<p>I want to create an android activity for setting up an SSH Session with a remote device (through Wifi) and executing some linux commands on the remote device.  Anyone got a quick, short example for connecting, authenticating and sending remote commands using <a href=""https://github.com/kruton/connectbot/tree/master/src/com/trilead/ssh2"" rel=""nofollow"">Trilead</a> libraries in Android ? Connectbot source (the only place to find the source for the unmaintained library) is quite vast and time consuming to go through if one is just trying to do a quick SSH Connection/ Command execution. I had found the sshJ library earlier, which had nicely documented examples and tips but unfortunately Android lacks some Java.Util classes required for sshJ.</p><p>I am looking for something in Trilead like (this is from the sshJ example I found earlier) :</p><pre><code>final SSHClient ssh = new SSHClient();ssh.loadKnownHosts();ssh.connect(""localhost"");try {    ssh.authPublickey(System.getProperty(""user.name""));    final Session session = ssh.startSession();    try {        final Command cmd = session.exec(""ping -c 1 google.com"");        System.out.print(cmd.getOutputAsString());        System.out.println(""\n** exit status: "" + cmd.getExitStatus());    } finally {        session.close();    }} finally {    ssh.disconnect();}</code></pre>","448191","","","","","2013-11-20 07:44:57","Android SSH Example Code","<android><ssh>","1","0","5","",""
"4879214","1","4879296","","2011-02-02 19:59:11","0","385","<p>I'm building a functional architecture.</p><p>With regard to the following android application framework diagram <a href=""http://developer.android.com/guide/basics/what-is-android.html"" rel=""nofollow"">here</a>, I'm wondering which software component at the android application framework layer would be responsible for providing the SQLite interface? I know that the android.database package gives the developer the necessary API to access the underlying SQLite database, but if we think of the ""application framework layer"", where is this provided? For example, the ""Notification Manager"" allows applications to display custom alerts. What component gives us database access? The reason I ask is for the purposes of documentation. Many thanks</p>","543220","","265167","","2011-12-17 20:21:27","2011-12-17 20:21:27","What thing is responsible for Android - SQLite access?","<android><sqlite>","1","0","","",""
"4879221","1","4879346","","2011-02-02 19:59:30","0","1172","<p>I have a very specific situation where i found that a single activity generating multiple views is the most correct approach:</p><ul><li>The main activity receives a code from the server (XML like) saying what it should build. That XML can contain links to other views that use similar code.</li></ul><p>To use this, i build only one activity that decodes the code sent from the server and builds the view...</p><p>When i pass from a screen from this activity to another screen of this activity, retrieving more server-code on press of a button, it's all ok. But... when pressing back, the last view has also been altered. </p><p>I understand this, the activity being used is probably the same.. how can i avoid being the same?</p>","327011","","","","","2012-08-31 07:04:23","Android: Single Activity & Multiple Views","<android>","2","0","","",""
"4879259","1","","","2011-02-02 20:03:13","0","191","<p>I have an application that is installed on numerous devices and recently I have gotten a couple of reports that the map tiles are grey within my app.  I asked the normal questions like whether they were connected to the internet.  They seem to be connected.  Also the google maps app works.  I have looked and found no mention of these types of problems.  Any recommendations as to how to debug this?  </p>","600575","","","","","2011-02-02 21:12:44","Intermittent problems with embedded Google map on Android App","<android><google-maps>","1","0","","",""
"4879301","1","","","2011-02-02 20:06:35","0","355","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4298458/android-live-wallpaper-touch-event-hierarchy"">Android Live Wallpaper Touch Event Hierarchy</a>  </p></blockquote><p>Greetings,</p><p>I am working on a live wallpaper that reacts to certain touch events. I can detect and handle the taps/swipes just fine, but whenever one of these touch actions is done on a widget or the app launcher the wallpaper still receives the event. This is very unwanted behavior. I do not want the wallpaper to receive touches on the widget or app launcher. </p><p>Does anyone know how to detect whether the wallpaper or widgets/app launcher is receiving touch events? I know I can set setTouchEventsEnabled(false) for wallpaper, but how can I tell when a random widget gains focus or the app launcher is open? I have tried looking for an intent filter for a broadcast receiver but having no luck. </p>","598025","","19750","","2011-03-31 15:40:27","2011-03-31 15:40:27","Android Handling Live Wallpaper Touches","<android><events><touch><live-wallpaper>","0","4","","2011-02-21 17:28:07",""
"4879308","1","4879334","","2011-02-02 20:07:54","0","3114","<p>I have a UI that has a handful of text entries that might be needed by the user.  The users selects the type of entry from a spinner.  when the selection is made I change the visibility of some edittext controls and change the label that goes with it.  </p><p>The problem is the space where the edittext was is now blank and the screen layout looks screwy.  </p><p>I put all of this in a table, hoping I could hide a row, but that didnt help either.</p><p>Any ideas short of make a new class for each one?</p>","528130","","","","","2011-02-02 20:11:30","android how to hide a edittext and reclaim the space","<android><edittext>","2","0","","",""
"4879338","1","4879389","","2011-02-02 20:10:58","0","585","<p>When a user flips their keyboard out or switches between portrait and landscape, the activity seemingly restarts. This is fine except I have my activity play music. When this occurs, there are then TWO music files playing, and pressing back only stops ONE of them! I've disabled switching between portrait and landscape for the activity, but sliding the keyboard out still causes the issue!</p>","1302338","","","","","2011-02-02 20:15:57","Android: Activity restarts on switch to landscape/keyboard flips out","<android><keyboard><activity><landscape><portrait>","1","0","","",""
"4879369","1","","","2011-02-02 20:13:14","0","383","<p>I have several activities that inherit from a base activity with a menu like below.</p><pre><code>@Overridepublic boolean onOptionsItemSelected(MenuItem item) {        Intent myIntent;        switch(item.getItemId()) {        case R.id.home:            myIntent = new Intent(this, HomeActivity.class);            startActivityForResult(myIntent, 0);            return true;        case R.id.map:            myIntent = new Intent(this, GoogleMapsActivity.class);            startActivityForResult(myIntent, 0);            return true;        case R.id.art:            myIntent = new Intent(this, ArtActivity.class);            startActivityForResult(myIntent, 0);            return true;        ...        default:            return super.onOptionsItemSelected(item);        }    }</code></pre><p>This works well, but selecting a menu item starts a new instance of that activity.  How can pause() and resume() be used in conjunction with setResult() to only have one or less instance of each activity at a given time?</p><p>In an effort to be more specific, when a user comes back to a previously visited activity, it should be in the same state as they left it (like tabs).</p>","591042","","","","","2011-02-02 20:44:44","Android -- Menu items that function as tabs","<android><menu><activity>","2","0","","",""
"4879416","1","4879574","","2011-02-02 20:18:39","7","11918","<p>I am facing problem while setting the backGround Image of LinearLayout from asset folder.</p><pre><code>String filePath=""file:///android_asset/images/test.png"";    Drawable d = Drawable.createFromPath(filePath);    frontTextView.setBackgroundDrawable(d);</code></pre><p>Can someone help me out.</p>","388088","","","","","2012-04-23 17:42:53","How to Set Background Image from asset folder in android?","<android>","3","3","3","",""
"4879435","1","","","2011-02-02 20:20:22","14","1164","<p>I trying to set the ""GPSTimeStamp"" into the exif tags of an jpg via android. The documentation is pretty scarce on this one:<br><a href=""http://developer.android.com/reference/android/media/ExifInterface.html#TAG_GPS_TIMESTAMP"" rel=""nofollow"">http://developer.android.com/reference/android/media/ExifInterface.html#TAG_GPS_TIMESTAMP</a>Type is String. Constant Value: ""GPSTimeStamp"".  But what is the exact format?</p><p>Looking here:<a href=""http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/GPS.html"" rel=""nofollow"">http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/GPS.html</a><br>GPSTimeStamp: rational64u[3]    (when writing, date is stripped off if present, and time is adjusted to UTC if it includes a timezone)</p><p>So I need a long value a 3 cell array? I not sure, what to put in. I have obtained a ""UTC time of this fix, in milliseconds since January 1, 1970."" via location.gettime().<br><a href=""http://developer.android.com/reference/android/location/Location.html#getTime%28%29"" rel=""nofollow"">http://developer.android.com/reference/android/location/Location.html#getTime%28%29</a><br>If I write the long value as a string into the Timestamp and check the exif tags via ""exif"" on Linux, I get the error ""denominator expected"". All experiments with hh:mm:ss, or other formats have failed. Being a bit lost here.</p>","600537","","1076451","","2012-07-13 22:18:14","2012-07-13 22:18:14","Android: Put GPSTimeStamp into jpg EXIF tags","<android><tags><exif><gps-time>","1","0","1","",""
"4879529","1","","","2011-02-02 20:30:06","0","575","<p>I'm going through a loop <code>canvas.drawBitmap</code>'ing png's with transparency, and the last png is transparent but all previous ones are not, even if I use the same graphic. All the other pngs have a white background.</p><p>I'm basically using the code from the SDK example <code>TicTacToe</code>.</p><p>In the for loop:</p><pre><code>for (int i = 0; i &lt; ROWS; i++){    Paint i_paint = new Paint(Paint.ANTI_ALIAS_FLAG);    Bitmap i_bmp = getResBitmap(i_res);    Rect i_rect = new Rect();    i_rect.set(i, 0, i+WIDTH, HEIGHT);    canvas.drawBitmap(i_bmp, null, i_rect, i_paint);}</code></pre><p>Any ideas?</p>","600607","","857361","","2011-09-27 08:58:19","2011-09-27 08:58:19","Transparent .png not transparent (after first one)","<android><canvas><drawbitmap>","0","2","","",""
"4879621","1","4879890","","2011-02-02 20:41:46","3","322","<p>I have a static 10K file with a word on each line. I need to create a String[] array with all the words. I have 2 options:</p><ol><li>I create a static <strong>final</strong> String[] words and hardcode by hand all the words in my code.</li><li>At start-up, load the file, parse it and create a static String[] words array with all the words.</li></ol><p>Now, my question is, after all this is done, is accesing a word from the array 1 (notice the <strong>final</strong> keyword) noticeably faster than a word from the array 2 (no final keyword because we load the words at runtime). Theoretically does it make a difference? And we're talking here about Android specifically, not Java. But I am interested in both cases.</p>","292263","","","","","2011-02-02 21:49:58","Performance accessing static final","<android><performance>","4","6","","",""
"4879713","1","4880643","","2011-02-02 20:52:45","6","3108","<p>Hi I'd like to play audio backwards in Android. How do I accomplish it? Any pointers will be appreciated. Thanks.</p>","421372","","","","","2011-02-04 05:41:50","Playing audio backwards","<android><audio><playback>","2","3","1","",""
"4879732","1","","","2011-02-02 20:55:11","0","155","<p>working on a db driven tabhost I am running into problem trying to move to Honycomb.</p><p>I have something like this:</p><pre><code>        Cursor c = db.getAll();    if ( c.moveToFirst() ) {               do {                 // Log tab name    Log.d(""(Honycomb)"", ""TabSpec : "" + c.getString(2));                 // Set new tabspec ID    TabSpec Tab = tabHost.newTabSpec( ""tid"" + c.getString(1) ) ;            if( c.getString(2).equals(""abc"")) {          Tab.setIndicator( c.getString(2), context.getResources().getDrawable(R.anim.icon1) ) ;            } else if( c.getString(2).equals(""bcd"")) {                Tab.setIndicator( c.getString(2), context.getResources().getDrawable(R.anim.icon2) ) ;            }            Intent intent = new Intent() ;            intent.putExtra( ""CATORDER"", c.getString(1) );            intent.setClass(context, Mytab.class) ;            Tab.setContent( intent ) ;            tabHost.addTab(Tab) ;        } while ( c.moveToNext() ) ;    } else {             Toast.makeText(context, ""There is nothing available."",              Toast.LENGTH_LONG).show();    }    tabHost.setOnTabChangedListener(OnTabChangeListener);    tabHost.getTabWidget().setCurrentTab(0);</code></pre><p>db.getAll() results in > 2 records comming back from db. In LOGCAT c.getString(2) is seen > 2 times - values as expected, however looking at tabHost on screen I do get all tabs shown BUT only first tab shown with the string (but) without any action posible and after some time return to start of app.</p><p>If I switch from Honycomb to 2.2 it shows everything expected?</p><p>Also MyTab is having log.d() and from this I only find display from this just the first time only, if running in 3.0 but multiple times (as expected) in 2.2. </p><p>Looks like something has changed (or I did something ok for 2.2 but not in 3.0) but so far I could not find what I did wrong. Any idea?</p><p>If I would have errors in my LOGCAT telling something I would post this also but they seem not to be there (again switching to 2.2 let this run ok and the c.getString(2) is not only shown > x times but also gives tabs correctly.</p><p>Regards,RvE</p>","596088","","","","","2011-03-12 05:03:52","TabHost problems moving to Honycomb","<android><android-tabhost><android-2.2-froyo><tabview>","1","1","","",""
"4879740","1","","","2011-02-02 20:55:53","1","143","<p>Now I have kind of asked about this before but haven't been clear enough. I know how to make a context menu that says ringtone or notfication. I just don't know how to make it actually save the soundfile to the phone as a ringtone or notfication. This is the code Im trying to do it with(though I am open to code suggestions):</p><pre><code>public class MyMain extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);Button btn = (Button) findViewById(R.id.Button01);registerForContextMenu(btn);}@Overridepublic void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {super.onCreateContextMenu(menu, v, menuInfo);menu.setHeaderTitle(“Context Menu”);menu.add(0, v.getId(), 0, “Action 1?);menu.add(0, v.getId(), 0, “Action 2?);}@Overridepublic boolean onContextItemSelected(MenuItem item) {if(item.getTitle()==”Action 1?){function1(item.getItemId());}else if(item.getTitle()==”Action 2?){function2(item.getItemId());}else {return false;}return true;}public void function1(int id){Toast.makeText(this, “function 1 called”, Toast.LENGTH_SHORT).show();}public void function2(int id){Toast.makeText(this, “function 2 called”, Toast.LENGTH_SHORT).show();}public boolean saveas(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 blockreturn false;}String path=”/sdcard/media/audio/ringtones/”;String filename=”money”+”.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 blockreturn false;} catch (IOException e) {// TODO Auto-generated catch blockreturn 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, “exampletitle”);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, true);values.put(MediaStore.Audio.Media.IS_ALARM, true);values.put(MediaStore.Audio.Media.IS_MUSIC, false);//Insert it into the databasethis.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values);return true;}</code></pre>","598925","","","","","2011-03-13 00:38:54","Android: Need help making it so sounds can be saved to sd card via Content menu","<android><sdk><contextmenu><javasound>","0","0","","",""
"4879762","1","","","2011-02-02 20:57:04","3","956","<p>Maybe this will help someone avoid some pain.</p><p>While doing some GUI work, I got the typical id cannot be resolved error (R.id hell I call it).<br>""No problem, I'll just check my xml files"", but I couldn't find any issue (no clue in console).</p><p>But I did notice further down the error list several goofy syntax errors in R.java such as...</p><p><em>Illegal modifier for the class array; only public, abstract &amp; final are permitted</em></p><p>So I figured something must be broke in the code that generates it.The beginning of my R.java file looked like this...</p><pre><code>public final class R {    public static final class  {        public static final int VertBar=0x7f0a0000;    }    public static final class array {        public static final int AnswerActionValues=0x7f060001;        public static final int AnswerActionsNames=0x7f060000;    }   </code></pre><p>Notice the missing class name in the first class?Well the clue was the VertBar constant.</p><p>This led me to my layout which had...</p><pre><code>&lt;Viewandroid:id=""@+/VertBar""android:layout_centerHorizontal=""true""android:layout_height=""fill_parent""android:layout_width=""20dp""android:background=""#FFFFFFFF""&gt;&lt;/View&gt;   </code></pre><p>Notice anything strange??</p><p>I somehow deleted the id portion of ""@+id/VertBar"" and just had ""@+/VertBar"" This causes the auto generator to create a class with no name! I guess @+ with no id means just add a constant in an unnamed class. </p><p>In short every R.id hell issue I've had so far has been do to the keyboard-chair interface (me).</p>","589662","","589662","","2011-02-02 21:18:52","2011-02-02 21:18:52","If you ever get strange syntax errors in your R.java file, then check for this issue","<android>","0","1","","2011-02-02 21:46:19",""
"4879767","1","4879805","","2011-02-02 20:57:15","3","1261","<p>I am attempting to work with the NDK to render an openGL image on Android. I've taken a basic graphics course and am familiar with open GL. I have looked at several examples, such as the San-Angeles project, but have no idea what is going on. I'm familiar with calls such as glBegin(GL_LINES);. I don't see anything like that anywhere in there. There seems to be a lot of code doing a lot of things which becomes a bit overwhelming. So, are there any resources I can take advantage of that show basic openGL rendering on Android. I'm talking drawing a rotating triangle type of tutorial. If not, are there any more complicated projects like San-Angeles that are commented?</p>","523412","","44729","","2011-02-02 22:05:25","2011-02-02 22:05:25","NDK and OpenGL basics on android","<android><opengl-es><android-ndk>","1","0","","",""
"4879792","1","","","2011-02-02 20:59:10","9","683","<p>I based my game off the lunarlander example and have been having stuttering issues since I first started making it. Nothing I have tried has gotten rid of them so I have gotten to the point where I have spent a few hours creating a stripped down version of the lunarlander example, and put a simple scrolling image in to show the stuttering. NOTE: it is not related to the garbage collector. If you think it is, just look at the log, the garbage collector runs no-where near as often as the stutter appears.</p><p>The image that scrolls down the screen stutters approximately every second for about 1/10th of a second on my phone (Motorola Milestone, 2.2). This kind of stuttering does not exactly completely destroy gameplay, but it is very distracting and frustrating. My game also involves a lot of fast scrolling and quick movements so it is generally more obvious there.</p><p>If any of you have the time could you take a quick look at this eclipse project and see if:</p><ol><li>It stutters for you on your phone (look closely as it scrolls, it has a small hitch every half second to second and a half)</li><li>If you can see any way to fix the stuttering</li></ol><p>I am hoping I simply have a retarded line of code that is causing this whole thing without me realising. I just can't believe that even after stripping out this much it still has the exact same amount of stutter as my full game with 1000 objects, especially since it runs at a solid 60fps on my phone.</p><p>EDIT: Have profiled my game on Traceview, it seems fine.</p><p>Source download link: <a href=""http://dl.dropbox.com/u/4972001/LunarLander.rar"" rel=""nofollow"">http://dl.dropbox.com/u/4972001/LunarLander.rar</a></p>","549859","","549859","","2011-02-02 21:20:43","2011-02-13 13:10:00","Weird stuttering issues that I cannot get rid of (full source included)","<java><android>","4","5","6","",""
"4879876","1","4891474","","2011-02-02 21:07:55","3","8721","<p>Forgive me if this is a newbie question, but...</p><p>When playing video, is it better to use VideoView/MediaPlayer, or is it better to use intent.ACTION_VIEW and let the user select his/her media player?</p><p>The videos that I need to play are very large mp4 files (20 meg - 50+ meg) which are not optimized for mobile.  I have buffering issues when using VideoView/MediaPlayer.  However, when I use intent.ACTION_VIEW, I can use something like RealPlayer, which does a better job of buffering (at least in my case).  Plus, RealPlayer and the other players I've tried handle orientation changes without restarting the video like VideoView/MediaPlayer do.  However, I don't know if this second approach is ""acceptable"" from a user-experience perspective.</p><p>Here's the code for my VideoView/MediaPlayer approach:</p><p>XML:</p><pre><code>&lt;VideoView android:id=""@+id/videoView""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" /&gt;</code></pre><p>Java:</p><pre><code>public class VideoViewActivity extends Activity {    @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);        Uri video = Uri.parse(""http://www.my.big.video.com/video.mp4"");        videoView.setMediaController(mediaController);        videoView.setVideoURI(video);        videoView.start();}</code></pre><p>And here's the code for my second approach:</p><p>Java:</p><pre><code>public class VideoViewActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        String videoUrl = ""http://www.my.big.video.com/video.mp4"";        Intent i = new Intent(Intent.ACTION_VIEW);          i.setData(Uri.parse(videoUrl));          startActivity(i); }</code></pre><p>Suggestions?</p>","359519","","23760","","2011-11-06 00:52:10","2011-11-06 00:52:10","Video - Use VideoView/MediaPlayer, or intent.action_view and user's choice?","<android><video><media-player><mp4><videoview>","1","0","1","",""
"4879930","1","","","2011-02-02 21:13:34","2","341","<p>I have an android application which main view consists of a tab-bar with three tabs in it.</p><p>When developing and running the application on the device through adb I get the following behavior:</p><ul><li>When clicking the phone button ""Home screen"" and relaunching the application it seems as the application continues where I was before pressing the button (remembers selected tab etc...) (apparently its still running in the background).</li></ul><p>However when I export and sign the application (using Eclipse) it suddenly always seem to start a new instance of the application when returning from home screen.</p><p>Why does it behave so different in those cases? And what do I need to do in my application in order to always have the ""running in background"" behavior.</p>","600655","","13792","","2011-02-02 21:20:57","2011-02-02 21:45:33","Android multitasking problem","<java><android>","2","0","","",""
"4880044","1","","","2011-02-02 21:26:10","0","313","<p>In my main layout XML I have:</p><pre><code>    &lt;LinearLayout android:id=""@+id/LinearLayout01"" android:orientation=""horizontal"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;LinearLayout android:orientation=""vertical"" android:gravity=""center_horizontal"" android:layout_width=""wrap_content"" android:layout_height=""match_parent"" android:id=""@+id/LinearLayout02""&gt;&lt;Chronometer android:text=""@+id/Chronometer01"" android:id=""@+id/Chronometer01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Chronometer&gt;&lt;Button android:text=""@string/hints"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:id=""@+id/Button01""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;&lt;com.touchpanel.Panel android:id=""@+id/SurfaceView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/com.touchpanel.Panel&gt;&lt;/LinearLayout&gt;</code></pre><p>In my Panel class, I spawn a thread to do the drawing for itself. My question is, can I access the Button in the other linear layout to change the text? (This would happen quite a bit, the text is dynamic)</p><p>I tried declaring the button in the activity using this layout, but I can't access it from the Panel class. I can write a function that takes the text as a parameter to put to the button, but if I call it from the Panel class it force closes. If I comment out the ""button1.setText(""Text"");"" line, it handles the function call fine.</p><p>Trying to declare the button in the Panel class, such as: </p><pre><code>private Button b1; //Declared at the beginning of the class//in constructor of Panel class:b1 = (Button)findViewById(R.id.Button01);b1.setText(""Hello"");</code></pre><p>It declares the button, and sets it fine. But when I try to use the line ""b1.setText"" it force closes. </p><p>Any suggestions?</p>","600671","","","","","2011-02-02 21:39:15","How do I set the text on a Button in Android, from a thread?","<android><button>","1","3","","",""
"4880130","1","4880340","","2011-02-02 21:37:04","1","685","<p>I'm adding in a TextView programatically to a linear layout.  I can see the background image but for some reason the text is never displayed.  Any ideas?  Here's the code:</p><pre><code>TextView pointsTV = new TextView(getApplicationContext());pointsTV.setText(""Test Should Show"");pointsTV.setGravity(Gravity.CENTER);pointsTV.setTextColor(android.R.color.white);pointsTV.setPadding(0, 20, 0, 20);pointsTV.setBackgroundResource(R.drawable.gamesummary_bottom);pointsTV.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT)); ll.addView(pointsTV);</code></pre>","542322","","512958","","2011-02-02 21:41:35","2011-02-02 22:09:24","Adding in a TextView programatically shows no text","<android>","1","0","1","",""
"4880144","1","","","2011-02-02 21:38:17","4","1891","<p>I have three EditText boxes in an activity, for two of which normal input methods (hard keys, default soft keyboard) are ok. But for one of the EditText boxes I want to send soft input only from a custom keyboard view. So in effect I want the default soft keyboard never to be shown for this EditText. I've tried adding onTouchListeners and onFocusChange listeners for the EditText with partial success like this:</p><pre><code>public boolean onTouch(View v, MotionEvent event) {    v.requestFocus();    imm.toggleSoftInput(0, 0);    return true;}public void onFocusChange(View v, boolean hasFocus) {    InputMethodManager imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);    if (imm.isActive(v)) {        imm.toggleSoftInput(0,0);    }}</code></pre><p>But I have not achieved a definitive solution because </p><p>1)the default soft keyboard always briefly flashes visible before the listener hides it</p><p>2)on some occasions, such as moving focus to the EditText with hard keyboard arrow keys sometimes sets the default soft keyboard visible</p><p>and so on.</p><p>So I would love to find a simple way to tell Android never to show the default soft keyboard for this specific EditText. I would not like to extend EditText and start to override stuff, since the EditText functionality is perfect for me - I just want the default soft keyboard not to be shown.</p><p>I've spent days now trying to figure this out. Some topics (including some here) found via google have half-way attempts at this problem, but so far I haven't found a single totally functional solution.</p><p>EDIT:</p><p>I'm really starting to get annoyed. I decided I could try not to use EditText but whatever other view that will get the job done. It turns out it is freakin hard to get rid of that soft keyboard. It even shows up when I use the hard keys to move focus from an EditText to a Button! Why on earth should the soft keyboard be shown on every freakin View that happens to have focus? Even when I explicitly say inputType=""none""? How do I turn that <strong>*</strong> soft keyboard OFF? Below is the xml for the Button - let's use that as an example:</p><pre><code>&lt;Button    android:id=""@+id/OkButton""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:inputType=""none""    android:paddingRight=""5mm""    android:paddingLeft=""5mm""    android:layout_below=""@id/Volume""    android:layout_alignParentLeft=""true""    android:text=""OK""/&gt;</code></pre><p>EDIT2:</p><p>I have how achieved a solution that seems to work. First I get a hold of the InputMethodManager:</p><pre><code>this.imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);</code></pre><p>and the I set OnClickListener, OnTouchListener and OnFocusChange listener all call the following method when I want the EditText to be focused and my custom KeyboardView visible, while hiding the default soft input:</p><pre><code>private boolean makeActive(View v) {    imm.hideSoftInputFromWindow(v.getWindowToken(), 0);    EditText e = (EditText) v;    int iType = e.getInputType();    e.setInputType(InputType.TYPE_NULL);    e.requestFocus();    showKb();    e.setInputType(iType);    return true;}</code></pre>","600416","","600416","","2011-02-06 16:52:23","2011-02-06 16:52:23","Android: how to permanently & completely NOT show default soft keyboard for an EditText?","<java><android>","1","7","3","",""
"4880202","1","4880355","","2011-02-02 21:43:07","0","2385","<p>I'm having a little trouble parsing a string of xml called responseText in android. The xml is fully valid and has the following structure:</p><pre><code>&lt;plan&gt;&lt;entry&gt;&lt;name&gt;john&lt;/name&gt;&lt;address&gt;uk&lt;/address&gt;&lt;/entry&gt;&lt;entry&gt;&lt;name&gt;joe&lt;/name&gt;&lt;address&gt;usa&lt;/address&gt;&lt;/entry&gt;&lt;/plan&gt;</code></pre><p>The code I am using to parse the String is as follows:</p><pre><code>    try {        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();        DocumentBuilder db = dbf.newDocumentBuilder();        InputSource is = new InputSource();        is.setCharacterStream(new StringReader(responseText));        Document doc = db.parse(is);        NodeList nodes = doc.getElementsByTagName(""entry"");        for (int i = 0; i &lt; nodes.getLength(); i++) {            Element element = (Element) nodes.item(i);            NodeList name = ((Document) element)                    .getElementsByTagName(""name"");            Element line = (Element) name.item(0);            Toast.makeText(Containers.this,                    getCharacterDataFromElement(line), Toast.LENGTH_SHORT)                    .show();            NodeList title = ((Document) element)                    .getElementsByTagName(""address"");            line = (Element) title.item(0);            Toast.makeText(Containers.this,                    getCharacterDataFromElement(line), Toast.LENGTH_SHORT)                    .show();        }    } catch (Exception e) {        e.printStackTrace();    }}public static String getCharacterDataFromElement(Element e) {    Node child = ((Node) e).getFirstChild();    if (child instanceof CharacterData) {        CharacterData cd = (CharacterData) child;        return cd.getData();    }    return ""?"";}</code></pre><p>I'm just using simple toasts to print the xml data to screen. However, i get an IOexception when I enter the for loop. Any idea what is wrong?</p>","599026","","523100","","2013-02-10 03:55:26","2013-02-10 03:55:26","Parsing string of xml android","<java><android><xml>","3","4","","",""
"4880298","1","","","2011-02-02 21:52:52","1","269","<p>I am trying to build Android 2.1 from source using the instructions given <a href=""http://wiki.cyanogenmod.com/index.php?title=Compile_CyanogenMod_for_Dream_%26_Sapphire"" rel=""nofollow"">here</a></p><p>However, when I run repo sync it exits with an error that says:</p><pre><code>error: revision eclair in Cyanogenmod/android external webkit not found.</code></pre><p>Does anyone have any idea about why this might occur? </p>","438383","","844882","","2012-03-18 01:40:53","2012-03-18 01:40:53","building android 2.1 (eclair) from source","<android><android-source>","1","0","","",""
"4880332","1","4880416","","2011-02-02 21:56:08","1","1836","<p>My application has multiple activities that use the same database in different ways.  Periodically, data is added to the database from outside my application.  So instead of duplicating the code to check the database in each activity, I'm trying to create a single class that can be used from any of the activities to check the database for new entries.  I am using a fileInputStream, and the openFileInput method to open a file that holds some preferences that go in to determining if the new database entries are of interest to the application.  Using the openFileInput method in each activity works as expected, but using it in my own class gives the error saying that the openFileInput() method is undefined. I've imported java.io.FileInputStream, but the error persists.</p>","600699","","","","","2011-02-02 22:31:39","Android: How can I use methods defined for Activities in my own classes?","<java><android>","2","0","0","",""
"4880363","1","4880474","","2011-02-02 21:58:04","2","1252","<p>I'm having problem with asynctasks and http requests.</p><p>The user can press two different buttons. Both buttons download information from a web server. I want the requests to be cancelable. Before each call a progressdialog is shown.</p><p>The http request is performed in an asynctask, and I have an OnDismiss listener on the progressdialog that cancels the asynctask if back is pressed.</p><p>It works 50/50.</p><p>If I do the http request, cancel the asynctask, then do a new request, it might work but it might also cause the http request to hang infinite.</p><p>This line is where it hangs:</p><p><code>response = httpclient.execute(urlConnection, context);</code></p><p>Is there any other way to do a call that is cancelable or is there anything I could do to avoid the hang?</p>","513932","","","","","2011-02-02 23:01:29","Cancelled AsyncTask hangs new HttpRequests","<android><httprequest><android-asynctask>","2","0","","",""
"4880379","1","4900144","","2011-02-02 21:59:18","1","4102","<p>Here is the code for playing a url with vedio view</p><pre><code>String urlVideo = ""http://www.youtube.com/cp/vjVQa1PpcFPLrLo9hkR90zKx_XHP5kMNaNb-_bE3v0s="";    VideoView video = (VideoView) findViewById(R.id.videoView1);    Log.d(""You"", urlVideo);    video.setVideoURI(Uri.parse(urlVideo));    MediaController mc = new MediaController(this);    video.setMediaController(mc);    video.requestFocus();    video.start();    mc.show();</code></pre><p>It throws error and can not start the video</p><p>Here is the logcat message</p><pre><code> ERROR/MediaPlayer(1765): error (1, -2147483648)</code></pre><p>ERROR/MediaPlayer(1765): Error (1,-2147483648)DEBUG/VideoView(1765): Error: 1,-2147483648</p><ol><li>The simulator and target OS is 2.2.</li><li>This is tested on simulator.</li></ol><p>Can this code run properly on device??Can you explain the error code and reason behind the error??</p><p><strong>Edit</strong> : Well thanks all for your suggesions. Actually my application needs to play a video in its own design and according to your suggesions and some other post I have seen on web it can be concluded that it can not be played on the way I desire and I have to open it in a web view. Thanks...</p>","246942","","246942","","2011-02-07 05:37:49","2013-04-28 15:39:50","Android Mediaplayer throws an error while playing a youtube video with video view","<android><youtube><videoview>","1","0","","",""
"4880413","1","4880744","","2011-02-02 22:02:31","15","17626","<p>I understand that the closed spinner is actually a <code>View</code>, I think.  But I am guessing it has a <code>TextView</code> there somewhere to show the text.  How do I get access to that <code>TextView</code> so I can change the textcolor? </p><p><strong>EDIT:  I need to change this programatically on the fly, not in the XML.</strong></p><pre><code>TextView v = (TextView) getView(mySpinner);v.setTextColor(.....</code></pre><p>This doesnt work... </p><p>Thank you!</p><pre><code>    array_typ=new String[5];    array_typ[0]=""Pressure"";    array_typ[1]=""Level"";    array_typ[2]=""Overage"";    array_typ[3]=""Under"";    array_typ[4]=""Taken"";    adaptertyp = new ArrayAdapter&lt;Object&gt;(this,R.layout.simple_spinner_item, array_typ);    typ.setAdapter(adaptertyp);</code></pre>","528130","","528130","","2011-02-03 13:40:31","2014-03-07 18:42:31","Text color of a closed spinner","<android><spinner><textcolor>","4","1","4","",""
"4880489","1","5009215","","2011-02-02 22:09:57","21","32515","<p>I am having a problem with one of my apps and I was wondering if anyone could give me any insight into what maybe causing it.</p><p>I am getting a <strong>ClassNotFoundException</strong>, the important line below is</p><pre><code>E/AndroidRuntime(21982): Caused by: java.lang.ClassNotFoundException: couk.doridori.goigo.customUI.GoBoardView in loader dalvik.system.PathClassLoader@446fc3d0</code></pre><p>Now this app has been out for over a year and 2 days ago I had two seperate users contact me regarding this issue, one on a HTC wildfire (2.1) and one a Samsung Galaxy S (?). Now I cannot recreate this problem on my devices (2.2 and 1.6) or an emulator (2.1) and cannot really work out why this class cannot be found by the classloader. I have spent a while googling to no avail, and hopes someone has some pointers! It only seems to be when an activity is loaded which when the contentView is set, it tries to inflate a custom View called <strong>GoBoardView</strong> which extends the View class, this is just doing some simple canvas drawing and is not using any third party libs or any other classes that would have a packagename clash or anything.</p><p>Please help! Just in case its a build issue I am updating all my SDK and ADT through eclipse as it was building against 1.6 and using the old ADT, but I have no idea if this will help just thought worth a try. Any advice would be great thanks! (see below for EDIT)</p><pre><code>E/AndroidRuntime(21982): java.lang.RuntimeException: Unable to start activity ComponentInfo{couk.doridori.goigoFull/couk.doridori.goigoFull.Board}: android.view.InflateException: Binary XML file line #14: Error inflating class couk.doridori.goigo.customUI.GoBoardViewE/AndroidRuntime(21982): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)E/AndroidRuntime(21982): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)E/AndroidRuntime(21982): at android.app.ActivityThread.access$2200(ActivityThread.java:126)E/AndroidRuntime(21982): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)E/AndroidRuntime(21982): at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(21982): at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(21982): at android.app.ActivityThread.main(ActivityThread.java:4603)E/AndroidRuntime(21982): at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(21982): at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(21982): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)E/AndroidRuntime(21982): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)E/AndroidRuntime(21982): at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(21982): Caused by: android.view.InflateException: Binary XML file line #14: Error inflating class couk.doridori.goigo.customUI.GoBoardViewE/AndroidRuntime(21982): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)E/AndroidRuntime(21982): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)E/AndroidRuntime(21982): at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)E/AndroidRuntime(21982): at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)E/AndroidRuntime(21982): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)E/AndroidRuntime(21982): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)E/AndroidRuntime(21982): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)E/AndroidRuntime(21982): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)E/AndroidRuntime(21982): at android.app.Activity.setContentView(Activity.java:1629)E/AndroidRuntime(21982): at couk.doridori.goigoFull.Board.onCreate(Board.java:31)E/AndroidRuntime(21982): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)E/AndroidRuntime(21982): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)E/AndroidRuntime(21982): ... 11 moreE/AndroidRuntime(21982): Caused by: java.lang.ClassNotFoundException: couk.doridori.goigo.customUI.GoBoardView in loader dalvik.system.PathClassLoader@446fc3d0E/AndroidRuntime(21982): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)E/AndroidRuntime(21982): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)E/AndroidRuntime(21982): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)E/AndroidRuntime(21982): at android.view.LayoutInflater.createView(LayoutInflater.java:466)E/AndroidRuntime(21982): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)E/AndroidRuntime(21982): ... 22 more</code></pre><p><strong>EDIT</strong></p><p>Ok, researching some of the links that users to have commented in reply to this question, it seems that the use of the wrong context for loading activities can cause this problem. I find this interesting becuase <strong>one</strong> of the <strong>two</strong> log reports i have been send has this exception preceeded by </p><pre><code>W/ActivityManager( 1222): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { flg=0x20000 cmp=couk.doridori.goigoFull/.Games }</code></pre><p>which is quite self explanatory - problem is i have no idea where this activity could be being started from where it uses a non activity context, so im a bit stumped, thinking it maye be some multitasking like quirk and its being brought back into the foreground of something . This can then apparently cause problems with the classLoader. If this was happening on a users phone i cant see why i cannot reproduce this (and most other users cannot either).</p><p>The other thing i found through the links which is interesting, is some people have encountered problems due to a ""incorrect apk installation', which can be resolved by a reinstall, which i have asked the users who have had the problem to try (which does not make a difference). Also it seems once the problem is encountered (which is on first use) it will be persistent.</p>","236743","","533552","","2012-07-28 21:50:11","2014-02-12 12:28:08","Android ClassNotFoundException","<java><android><classnotfoundexception>","9","1","2","",""
"4880516","1","4880623","","2011-02-02 22:13:15","0","635","<p>I have an object that contains a list of other objects.  Say it's as follows:</p><pre><code>class Keychain {    public List&lt;Object&gt; keys = new ArrayList&lt;Object&gt;();}class Key {    public String name;}</code></pre><p>I get an array of all the Fields available for the class (in this case Keychain) and check to see if any are an instance of a List.  If it is, I want to grab a copy of that list and manipulate the data.</p><pre><code>for(Field f : keychain.getFields()){    if(f.getType() == List.class){        List&lt;Object&gt; keys = f.getObject(new ArrayList&lt;Object&gt;);        // IllegalArgumentException thrown...    }}</code></pre><p>For what I'm doing I don't know what the exact class in the list will be, the only thing I do know is who it's parent class will be.</p>","480475","","","","","2011-02-02 22:39:23","Get a copy of a List using reflection","<java><android><reflection>","2","0","","",""
"4880520","1","","","2011-02-02 22:14:26","0","924","<p>I am trying to read yahoo weather rss and display them in my android application.</p><p>There is an img src=""url of the image"" tag in side the &lt; description>&lt; /description> tag of the rss. </p><p>But I do not know how to read that url. Can anybody plz help me in this regard?</p><p>Here is my code:</p><pre><code>public class RssReader {private final static String BOLD_OPEN = ""&lt;B&gt;"";private final static String BOLD_CLOSE = ""&lt;/B&gt;"";private final static String BREAK = ""&lt;BR&gt;"";private final static String ITALIC_OPEN = ""&lt;I&gt;"";private final static String ITALIC_CLOSE = ""&lt;/I&gt;"";private final static String SMALL_OPEN = ""&lt;SMALL&gt;"";private final static String SMALL_CLOSE = ""&lt;/SMALL&gt;"";public static List&lt;JSONObject&gt; getLatestRssFeed(){    String feed =""http://weather.yahooapis.com/forecastrss?w=554890&amp;u=c"";     RSSHandler rh = new RSSHandler();    List&lt;Article&gt; articles =  rh.getLatestArticles(feed);    Log.e(""RSS ERROR"", ""Number of articles "" + articles.size());    return fillData(articles);}private static List&lt;JSONObject&gt; fillData(List&lt;Article&gt; articles) {    List&lt;JSONObject&gt; items = new ArrayList&lt;JSONObject&gt;();    for (Article article : articles) {        JSONObject current = new JSONObject();        try {            buildJsonObject(article, current);        } catch (JSONException e) {            Log.e(""RSS ERROR"", ""Error creating JSON Object from RSS feed"");        }        items.add(current);    }    return items;}private static void buildJsonObject(Article article, JSONObject current) throws            JSONException {    String title = article.getTitle();    String description = article.getDescription();    String date = article.getPubDate();    StringBuffer sb = new StringBuffer();    sb.append(BOLD_OPEN).append(title).append(BOLD_CLOSE);    sb.append(BREAK);    sb.append(description);    sb.append(BREAK);    sb.append(SMALL_OPEN).append(ITALIC_OPEN).append(date).append(ITALIC_CLOSE).append(SMALL_CLOSE);    current.put(""text"", Html.fromHtml(sb.toString()));}}</code></pre><p>SO here the img tag is inside the Description tag. How can I read it?? any help??</p><p>Here is the RSSHandler:</p><pre><code>public class RSSHandler extends DefaultHandler {// Feed and Article objects to use for temporary storageprivate Article currentArticle = new Article();private List&lt;Article&gt; articleList = new ArrayList&lt;Article&gt;();// Number of articles added so farprivate int articlesAdded = 0;// Number of articles to downloadprivate static final int ARTICLES_LIMIT = 15;//Current characters being accumulatedStringBuffer chars = new StringBuffer();/*  * This method is called everytime a start element is found (an opening XML marker) * here we always reset the characters StringBuffer as we are only currently interested * in the the text values stored at leaf nodes *  * (non-Javadoc) * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) */public void startElement(String uri, String localName, String qName, Attributes atts) {    chars = new StringBuffer();}/*  * This method is called everytime an end element is found (a closing XML marker) * here we check what element is being closed, if it is a relevant leaf node that we are * checking, such as Title, then we get the characters we have accumulated in the StringBuffer * and set the current Article's title to the value *  * If this is closing the ""Item"", it means it is the end of the article, so we add that to the list * and then reset our Article object for the next one on the stream *  *  * (non-Javadoc) * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String, java.lang.String) */public void endElement(String uri, String localName, String qName) throws SAXException {    if (localName.equalsIgnoreCase(""title""))    {        Log.d(""LOGGING RSS XML"", ""Setting article title: "" + chars.toString());        currentArticle.setTitle(chars.toString());    }    else if (localName.equalsIgnoreCase(""description""))    {        Log.d(""LOGGING RSS XML"", ""Setting article description: "" + chars.toString());        currentArticle.setDescription(chars.toString());    }    else if (localName.equalsIgnoreCase(""pubDate""))    {        Log.d(""LOGGING RSS XML"", ""Setting article published date: "" + chars.toString());        currentArticle.setPubDate(chars.toString());    }    else if (localName.equalsIgnoreCase(""encoded""))    {        Log.d(""LOGGING RSS XML"", ""Setting article content: "" + chars.toString());        currentArticle.setEncodedContent(chars.toString());    }    else if (localName.equalsIgnoreCase(""item""))    {    }    else if (localName.equalsIgnoreCase(""link""))    {        try {            Log.d(""LOGGING RSS XML"", ""Setting article link url: "" + chars.toString());            currentArticle.setUrl(new URL(chars.toString()));        } catch (MalformedURLException e) {            Log.e(""RSA Error"", e.getMessage());        }    }    // Check if looking for article, and if article is complete    if (localName.equalsIgnoreCase(""item"")) {        articleList.add(currentArticle);        currentArticle = new Article();        // Lets check if we've hit our limit on number of articles        articlesAdded++;        if (articlesAdded &gt;= ARTICLES_LIMIT)        {            throw new SAXException();        }    }}/*  * This method is called when characters are found in between XML markers, however, there is no * guarante that this will be called at the end of the node, or that it will be called only once * , so we just accumulate these and then deal with them in endElement() to be sure we have all the * text *  * (non-Javadoc) * @see org.xml.sax.helpers.DefaultHandler#characters(char[], int, int) */public void characters(char ch[], int start, int length) {    chars.append(new String(ch, start, length));}/** * This is the entry point to the parser and creates the feed to be parsed *  * @param feedUrl * @return */public List&lt;Article&gt; getLatestArticles(String feedUrl) {    URL url = null;    try {        SAXParserFactory spf = SAXParserFactory.newInstance();        SAXParser sp = spf.newSAXParser();        XMLReader xr = sp.getXMLReader();        url = new URL(feedUrl);        xr.setContentHandler(this);        xr.parse(new InputSource(url.openStream()));    } catch (IOException e) {        Log.e(""RSS Handler IO"", e.getMessage() + "" &gt;&gt; "" + e.toString());    } catch (SAXException e) {        Log.e(""RSS Handler SAX"", e.toString());    } catch (ParserConfigurationException e) {        Log.e(""RSS Handler Parser Config"", e.toString());    }    return articleList;}</code></pre>","574308","","510491","","2011-03-19 05:00:50","2012-04-05 11:22:33","how to read the img tag inside the description tag of rss","<android><parsing><rss>","2","2","","",""
"4880583","1","4880953","","2011-02-02 22:21:12","1","2556","<p>I've got a singe object which has three fields: two strings and a <code>Drawable</code></p><pre><code>public class MyObject implements Serializable {    private static final long serialVersionUID = 1L;    public String name;    public String lastName;    public Drawable photo;    public MyObject() {    }    public MyObject(String name, String lastName, Drawable photo) {        this.name = name;        this.lastName = lastName;        this.photo = photo;    }}</code></pre><p>What I'm trying to do, is to save an <code>ArrayList</code> of these objects to a file, but i keep getting a <code>NotSerializableException</code></p><pre><code>02-02 23:06:10.825: WARN/System.err(13891): java.io.NotSerializableException: android.graphics.drawable.BitmapDrawable</code></pre><p>The code which I use to store the file:</p><pre><code>public static void saveArrayList(ArrayList&lt;MyObject&gt; arrayList, Context context) {    final File file = new File(context.getCacheDir(), FILE_NAME);    FileOutputStream outputStream = null;    ObjectOutputStream objectOutputStream = null;    try {        outputStream = new FileOutputStream(file);        objectOutputStream  = new ObjectOutputStream(outputStream);        objectOutputStream.writeObject(arrayList);    }    catch(Exception e) {        e.printStackTrace();    }    finally {        try {            if(objectOutputStream != null) {                objectOutputStream.close();            }            if(outputStream != null) {                outputStream.close();            }        }        catch (Exception e) {            e.printStackTrace();        }    }}</code></pre><p>Everything works fine when the drawable isn't initialized.Thanks in advance for any help.</p>","285680","","512958","","2011-02-02 22:40:39","2011-02-02 23:01:41","Problem serializing Drawable","<java><android><drawable><serializable>","2","0","","",""
"4880748","1","4881002","","2011-02-02 22:37:56","5","1583","<p>I've been ""Googling"" for a while now but I am coming up empty on any decent tutorials on how to ""prettify""my android app.</p><p>Currently, my android app is fully functional but all it is is a bunch of buttons,text on several views.</p><p>What options or techniques exist to make it look beautiful, other than changing the font type, size or colour. Also changing the background colour or image isn't exactly a job done.</p><p>I appreciate any guidance on this!</p><h2>Update</h2><p>I am not looking for a designer. I just want know how else is someone supposed to design beautiful android apps - surely its just not the XML? Is it just about making a great background and fitting everything around that?</p>","51649","","51649","","2011-02-02 22:49:06","2011-02-03 00:16:26","Prettifying my Android App?","<android><design>","5","3","3","",""
"4880774","1","","","2011-02-02 22:40:21","4","1788","<p>I've heard that Nextreaming has released a customizable video player SDK for both iOS and Android:<a href=""http://www.nextreaming.com/product/nexplayer.php"" rel=""nofollow"">http://www.nextreaming.com/product/nexplayer.php</a>Have you already tried to integrate it? If so, I'd be pleased to have some technical feedback, especially on its ability to bringing HTTP Live to Android.Thanks for you help!</p>","600744","","","","","2011-08-01 13:52:57","Looking for technical feedback on Nextreaming NexPlayer™","<android><http><ios><video><player>","1","0","","",""
"4880815","1","4880944","","2011-02-02 22:45:07","0","386","<p>I have an android app that has to load very large files on start up. any time it switches orientations, it has to destroy and recreate the activity, causing the large files to reload. this takes about 30 seconds, this is pretty inconvenient if I were to actually publish this. I am sure that I am doing something wrong here. I have heard of onSaveInstanceState() and onRestoreInstanceState(), but I have no idea how to use them. does any body know how I could use this to speed up the Orientation change?</p>","599402","","","","","2011-02-02 23:14:30","How do I switch orientations in android faster?","<android><activity><screen-orientation>","2","0","1","",""
"4880998","1","","","2011-02-02 23:06:12","1","665","<p>Is it possible to play video from URL in VideoView and simultaneously save it to file on sdcard?</p><p>I want to let user start watching the movie just after action and make movie available for offline viewing next time.</p>","270298","","","","","2011-02-03 00:31:28","Play video from web and save to file","<android><http><video>","1","0","1","",""
"4881096","1","4881258","","2011-02-02 23:18:28","1","2013","<p>I've making an app and I want to launch a new activity from a menu, but ever time I click the menu button, the app crashes. I've tried many ways and all of the have failed.</p><pre><code>public boolean onCreateOptionsMenu(Menu menu) {new MenuInflater(getApplication())        .inflate(R.menu.menu, menu);return(super.onPrepareOptionsMenu(menu));}@Overridepublic boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) {   case R.id.Menu1:              Toast.makeText(this, ""Coming soon"", Toast.LENGTH_SHORT).show();    break;   case R.id.Menu2:       Intent Intent = new Intent(this, About.class);       startActivity(Intent); }return(super.onOptionsItemSelected(item));}}</code></pre><p>Android Manifest</p><blockquote><pre><code>    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;  &lt;activity android:name="".AndroidRssReader""            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="".About"" android:label=""@string/app_label""&gt;&lt;/activity&gt;</code></pre></blockquote>","446875","","","","","2014-04-12 08:44:24","Launch an activity from a menu button?","<java><android><menu><activity>","8","5","1","",""
"4881351","1","5123132","","2011-02-02 23:55:05","2","419","<p>Android's MediaStore.Video.Thumbnails.getThumbnail allows you to get the first frame of a video as a thumbnail. Is it possible to obtain other thumbnails besides the first frame? (perhaps there is there a way to modify a file descriptor)</p>","584794","","","","","2011-02-25 21:58:38","retrieve an arbitrary frame from a video on android","<android><video>","2","0","","",""
"4881597","1","5828443","","2011-02-03 00:39:07","3","1388","<p>I want to overlay a view over my entire app, all activities included. Think of it as a HUD (Head Up Display) over my app. The app has multiple activities, including a tab activity and the HUD doesn't interact with the user in any way, it just displays information while letting the user interact with the app as she would normally.I want this HUD for debugging purposes so I (and others) can monitor app activity and state when the phone is not attached to a debugging machine (field testing).</p><p>How do I do add such a view?</p><p>I've tried using WindowManager.addView() like so:</p><pre><code>        WindowManager.LayoutParams lp = new WindowManager.LayoutParams(             LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT,             WindowManager.LayoutParams.TYPE_APPLICATION,             WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE                  | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,             PixelFormat.TRANSLUCENT);        windowManager.addView(hudView, lp);</code></pre><p>But the HUD doesn't seem to persist in the foreground when I launch new activities it simply disappears.</p>","210048","","210048","","2011-02-03 21:47:15","2011-04-29 05:57:24","Android appwide view overlay (HUD)","<android><view><overlay>","1","0","1","",""
"4881641","1","4881733","","2011-02-03 00:48:56","0","1018","<p>The Samsung Galaxy S includes the custom widget ""Buddies Now"". This widget implements a carousel that can be rotated with a a press-drag. Here's a description of the widget:<br><a href=""http://www.phonescoop.com/articles/article.php?a=389&amp;p=2830&amp;g=3054&amp;h=25816"" rel=""nofollow"">http://www.phonescoop.com/articles/article.php?a=389&amp;p=2830&amp;g=3054&amp;h=25816</a></p><p>This widget exhibits features not commonly seen in other widgets: animated images and interactivity beyond a simple click. Does this widget take advantage of Samsung's custom launcher (TwLauncher), or is it a standard widget? If it is a standard widget, what API does it use for the animation and interactivity?</p>","584065","","","","","2011-02-03 01:05:35","Can the ""Buddies Now"" widget be implemented with the standard Android launcher?","<android><android-widget>","1","0","","",""
"4881771","1","","","2011-02-03 01:12:18","0","345","<p>I'm having an interesting issue where my code runs fine on my phone, but when running on the emulator i get a crash as soon as the app tries to get a value from the database.</p><p>Here is the DB Helper function which is crashing it</p><pre><code>/** Used to retrieve our lowest stored val */public int GetLowestVal(){    // Get our databases results    Cursor result = null;    try {         // Get our databases results        result = super.getAll();    } catch( SQLException anyDbError ) {         // Errors? TODO    } finally {         // Finally TODO    }    // Setup initial lowest val    int lowestVal = 0;    // Move through results and compare them    while( result.moveToNext() ){        // Get our place from the DB        int index = Integer.parseInt(result.getString(1).trim());        // Last index should be lowest        if ( index == 10){            lowestVal = Integer.parseInt(result.getString(3).trim());        }       }    // Return our value    return lowestVal;}</code></pre><p>And the error it throws is:getWriteableDatabase() was called recursively.</p>","487059","","","","","2011-02-04 01:55:24","Android SQLite crash in emulator but not phone?","<android><sqlite><android-emulator><phone>","1","2","","",""
"4881773","1","","","2011-02-03 01:13:04","8","13307","<p>I've been trying everything I can think of to get my app to display full screen on the Galaxy Tab.</p><p>Basically, it works like the Lunar Lander example app that comes with the Android SDK.  What would you do to make that Lunar Lander app display in full screen on Large screen devices like the Galaxy Tab?</p><p>I'm not concerned about the quality of the graphics at this point, but just how an app created like this can fill the screen.  It was basically designed to work on a 320x480 MDPI screen with images in the drawable folder and it uses a SurfaceHolder and view to draw the individual bitmaps.</p><p>Any advice?</p><p>CLARIFICATION: Sorry, I don't mean full screen as in removing the notification and title bar, I mean that everything has a giant black border around it and it the graphics don't take up the whole screen.</p>","179518","","92837","","2011-10-31 11:27:26","2012-04-21 13:10:00","How to make my app full screen on Galaxy Tab","<android>","8","2","5","",""
"4881817","1","","","2011-02-03 01:23:25","3","19393","<p>I am trying to save a file out from within my app to the external storage of a device.  Specifically, I am trying to save a sound out.</p><p>I've followed every 'tutorial' on doing this, and none of it seemed particularly confusing to me, yet it just will not work for me.  No file is ever created on the SD card at all, much less actually transferring over the information.</p><p>I've assumed I am somehow not getting the correct path to the card, but no matter what I have tried it doesn't work.  I have tried entering just ""/sdcard/"", as well as using the getExternalStorageDirectory() method, among other random experiments.  </p><p>After spending over half the day on something that would seem so trivial I can't even think straight anymore, so I hope you will excuse some of the lack of detail I'm providing, but any suggestion would be helpful at this point.</p>","600899","","","","","2011-08-08 20:27:15","Android : Saving Files to SD Card","<android><file><save><sd-card><outputstream>","2","3","","",""
"4881819","1","","","2011-02-03 01:23:59","0","1023","<p>I'm trying to make a widget that would be 4x1.I set the provider as follow</p><pre><code>&lt;appwidget-provider xmlns:android=""http://schemas.android.com/apk/res/android""android:minWidth=""294dp""android:minHeight=""72dp""android:updatePeriodMillis=""0""android:initialLayout=""@layout/widgetlayout""&gt;&lt;/appwidget-provider&gt;</code></pre><p>and the widget layout is as follow</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""320dp"" android:layout_height=""100dp""android:background=""@drawable/widgetframe""&gt;&lt;Button android:id=""@+id/butscan""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Click Me"" /&gt;&lt;Button android:id=""@+id/butenable""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""On/Off""        android:paddingRight=""5dip""/&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:paddingLeft=""4dip""    android:includeFontPadding=""false""    android:id=""@+id/lblcurrent""    android:text=""Test""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Now when i try this on the emulator, i get only the middle of the layer shown on the home screen. The background image is the 4x1 portait image from the SDK (320x100).</p><p>What am i missing?</p>","170971","","","","","2012-03-07 22:50:44","Linear Layout too big for widget size","<android><android-widget><android-layout>","2","0","","",""
"4881915","1","","","2011-02-03 01:42:24","1","493","<p>I am completely new to android. What I wanna do is, from a given textbox, I want to get the number, encrypt it with a key stored in the android app (which increments each time  the user does the encryption) and then pass the ciphertext through sha1 and then print it back on the screen. Can anybody give me some basic help? </p>","600910","","","","","2011-02-03 02:02:10","encryption in android","<android>","1","2","","",""
"4881954","1","4882081","","2011-02-03 01:51:23","0","361","<p>Ok so I have an android app with an Activity (UI) and a Service (background polling).  The two are intricately connected using AIDL (including callbacks so it's duplex communication, IPC, whatever).</p><p>Any time the two talk I'm using that.</p><p>However I have also extended the Application class - so that the two can share common data objects.  So the Application holds a User object that the Service is always using, and the Activity can also access it when it's running.</p><p>The Application also has a WeakReference to the Activity (to avoid context leaks) because the User will sometimes trigger UI updates.</p><p>So it looks like </p><p><code>Activity (UI) ---&gt; Application &lt;--- Service</code></p><p>I can trigger UI events within the Service by doing</p><pre><code>_app = (FooApplication)this.getApplication();FooActivity uiRef = _app.getUIReference().get();if (uiRef != null) {   uiRef.updateSomeDisplay();}</code></pre><p>So I don't get it.  Why bother with complex AIDL calls when I just weak reference the UI, see if it exists, and call its methods.</p>","569246","","1288","","2013-07-06 14:05:44","2013-07-06 14:05:44","AIDL - What's the point?","<android><service><callback><aidl><android-application>","1","0","","",""
"4881955","1","4882172","","2011-02-03 01:51:27","0","84","<p>write now, I am working on an app that is based on an application written in java for the computer. in that program, I loaded several database files into it. those files were .properties files. I already have those files, and they were fast on a computer, but they are very slow on an android. is there a better file that I should be using that I can create by just converting the .properties files into them (I don't want to re-create the files because they took several days to create, and it was very hard to do, so I really don't want to do it again) I have heard that android generally use sqlite, but I don't know how to use that, so if that is the best option, could someone tell me how I would go about using it (by the way there are several different database files, not just one).</p>","599402","","189950","","2011-02-03 02:23:22","2011-02-03 02:41:23","What kind of file should I be using when loading a database file in android?","<android><database><sqlite><properties-file>","1","2","1","",""
"4881961","1","4881987","","2011-02-03 01:53:10","1","789","<p>Here is the problem that I am dealing with right now with my Android App. Program works fine on emulator without any error but errors out on real device running same OS.</p><ol><li><p>I have a App Widget Update Service that updates my Widget. This service checks whether the widget is on the screen otherwise does not go through the update process. Works fine on emulator.</p></li><li><p>Every time the widget has to be updated in the OnReceive method I capture the intent in a string variable check_intent which tells me if its ENABLED, DELETED or UPDATE intents.</p></li><li><p>I have a SQLite table tuuserid_widget_enabled which has only one field enabled. When the intent is enabled I toggle it to 1 and when deleted I toggle it to 0. Works fine.</p></li><li><p>When the intent is UPDATE I check if the enable field in the DB table is = 1 if true then I go ahead with the update. This is where I get the Cursor Index Out of Bounds error on the device but everything works as expected on the emulator.</p></li></ol><p>I would appreciate any help on this. Thanks in advance. Sorry if I did something wrong, I am just learning Android.</p><p>Here is the error - </p><pre><code>    02-02 18:58:03.007: ERROR/AndroidRuntime(4292): FATAL EXCEPTION: main02-02 18:58:03.007: ERROR/AndroidRuntime(4292): java.lang.RuntimeException: Unable to start service Test.TU.TUWidget$UpdateService@45d2b7d0 with Intent { cmp=Test.TU/.TUWidget$UpdateService }: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 002-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3282)02-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at android.app.ActivityThread.access$3600(ActivityThread.java:135)02-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2211)02-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at android.os.Handler.dispatchMessage(Handler.java:99)02-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at android.os.Looper.loop(Looper.java:144)02-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at android.app.ActivityThread.main(ActivityThread.java:4937)02-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at java.lang.reflect.Method.invokeNative(Native Method)02-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at java.lang.reflect.Method.invoke(Method.java:521)02-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at dalvik.system.NativeStart.main(Native Method)02-02 18:58:03.007: ERROR/AndroidRuntime(4292): Caused by: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 002-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at android.database.AbstractCursor.checkPosition(AbstractCursor.java:580)02-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:214)02-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java:84)02-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at Test.TU.TUWidget$UpdateService.onStart(TUWidget.java:209)02-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at android.app.Service.onStartCommand(Service.java:420)02-02 18:58:03.007: ERROR/AndroidRuntime(4292):     at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3267)02-02 18:58:03.007: ERROR/AndroidRuntime(4292):     ... 10 more</code></pre><p>Here are the code snippets.</p><pre><code>@Override    public void onReceive(Context context, Intent intent) {        check_intent = intent.getAction();        widgetUpdate.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);        AlarmManager alarms = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);        PendingIntent newPending = PendingIntent.getBroadcast(context, 0, widgetUpdate,PendingIntent.FLAG_UPDATE_CURRENT);        alarms.set(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime()+ PERIOD, newPending);        context.startService(new Intent(context, UpdateService.class));} public static class UpdateService extends Service {        @Override        public void onStart(Intent intent, int startId) {        if (check_intent.contains(""APPWIDGET_ENABLED"")){            TUDB tdb = new TUDB(getApplicationContext());            final SQLiteDatabase db = tdb.getReadableDatabase();            String update_sql = ""update tuuserid_widget_enabled set enabled = '1';"";            if(db.isOpen() &amp;&amp; !db.isReadOnly()){                db.execSQL(update_sql);                db.close();            }        }        else        **if (check_intent.contains(""APPWIDGET_UPDATE"")){            TUDB tdb1 = new TUDB(getBaseContext());            final SQLiteDatabase db1 = tdb1.getReadableDatabase();            String check_widget_enabled = ""select enabled from tuuserid_widget_enabled;"";            if(db1.isOpen() &amp;&amp; !db1.isReadOnly()){                Cursor cur = db1.rawQuery(check_widget_enabled, null);                 cur.moveToFirst();                widget_enabled = cur.getInt(0); //this is where it bombs                cur.close();                db1.close();            }**            if (widget_enabled == 1){                RemoteViews updateViews = buildUpdate(getApplicationContext());                          ComponentName thisWidget = new ComponentName(getApplicationContext(), TUWidget.class);                AppWidgetManager manager = AppWidgetManager.getInstance(getApplicationContext());                manager.updateAppWidget(thisWidget, updateViews);               }        }        else        if (check_intent.contains(""APPWIDGET_DELETED"")){            TUDB tdb = new TUDB(getBaseContext());            final SQLiteDatabase db = tdb.getReadableDatabase();            String update_sql = ""update tuuserid_widget_enabled set enabled = '0';"";            if(db.isOpen() &amp;&amp; !db.isReadOnly()){                db.execSQL(update_sql);                db.close();            }        }    }</code></pre>","447886","","","","","2011-02-03 03:56:56","IndexOutOfBoundsException error on Android device not on emulator","<java><android><android-emulator><android-widget>","1","0","","",""
"4882025","1","4882139","","2011-02-03 02:06:41","4","6644","<p>I'm currently trying to get a custom WebView that displays a ContextMenu when it is pressed for a longer time. As the default WebView class only displays a ContextMenu when a link is longPressed, I wrote my own class to override this behaviour:</p><pre><code>public class MyWebView extends WebView {    Context context;    GestureDetector gd;    public MyWebView(Context context, AttributeSet attributes) {        super(context, attributes);        this.context = context;        gd = new GestureDetector(context, sogl);    }    @Override    public boolean onTouchEvent(MotionEvent event) {        return gd.onTouchEvent(event);    }    GestureDetector.SimpleOnGestureListener sogl =                new GestureDetector.SimpleOnGestureListener() {        public boolean onDown(MotionEvent event) {            return true;        }        public void onLongPress(MotionEvent event) {            // The ContextMenu should probably be called here        }    };}</code></pre><p>This works without problems the longPress is detected and the onLongPress method is called, however I am at a loss when it comes to displaying the ContextMenu. I tried doing it the usual way in my Activity:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.layout);    MyWebView mwv = (MyWebView) findViewById(R.id.mwv);    registerForContextMenu(mwv);}@Overridepublic void onCreateContextMenu(ContextMenu menu, View v,                    ContextMenu.ContextMenuInfo menuInfo) {    super.onCreateContextMenu(menu, v, menuInfo);    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.context, menu);}</code></pre><p>However, when I longPress the MyWebView in the emulator, nothing happens. What do I have to call from onLongPress() to display the ContextMenu?</p>","487903","","","","","2013-04-08 17:36:18","Android: Opening a ContextMenu from onLongPress in custom WebView","<android><webview><contextmenu><gesturedetector>","4","0","1","",""
"4882065","1","","","2011-02-03 02:16:26","1","934","<p>i just stated develponog for android and i dont really know what is happening.when i open the SDK Manager.exe application everything opens fine exept for when i try to type into the command line section of it does not work. also i have looked everywhere to find out why i need to setup a path for the SDK. does this have to do with the SDK manager?i am running it on a netbook</p><p>thanks for the help</p>","600929","","","","","2012-05-23 11:32:59","Android SDK Manager.exe does not work","<java><android>","1","0","","",""
"4882068","1","","","2011-02-03 02:17:18","3","392","<p>Does any one know what tools, techniques, skills are most practical on the Android platform to diagnose / fix bugs during development?</p><p>My issues are that my phone model does not seem to be supported by the Android Debug Bridge.  When I crank up the emulator, it runs about 10 times slower than my phone which results in a very inefficient, tedious, painful dev process.  When the app crashes, all that is shown is that an exception was thrown, there is no stacktrace presented (which I know is the standard).</p><p>If anyone can suggest any best practices to use within the limitations of the android platform it would be much appreciated.  I feel like I'm developing at tortoise speed here.</p><p>Thanks.</p><p>Byron</p>","600925","","","","","2011-02-03 02:27:30","Android Development/Debugging Best Practices","<android>","1","1","","",""
"4882147","1","5078415","","2011-02-03 02:36:54","2","1779","<p>I have a broadcast receiver which listens for all outgoing calls. In another activity I <em>make</em> an outgoing call. In my BC I want to be able to determine which calls were created in the activity, so I use <code>putExtras()</code> to place a marker field when I'm making the call. Problem is, in the <code>onReceive()</code> of the BC I don't see the extra data field at all (returns null).</p><p>Here is the relevant Activity code:</p><pre><code>@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        appGlobal gState = (appGlobal)getApplicationContext();        dh = gState.getSqlDataHelper();        Bundle extras = getIntent().getExtras();         if(extras != null)        {            phoneNumber = extras.getString(""number"");        }        makePhoneCall();        finish();    }private void makePhoneCall()    {        if (phoneNumber.length() &lt; 1) {            return;        }        String url = ""tel:"" + phoneNumber;        Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(url));        intent.putExtra(""number"", ""bla"");        startActivity(intent);    }</code></pre><p>And here is the relevant BC code:</p><pre><code>public class CallMeNotServiceCallReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {        Bundle bundle = intent.getExtras();        if (intent.getStringExtra(""number"") != null)        { Log.w(""bla"", ""HAS KEY!!!""); }...</code></pre><p>Does this situation require a PendingIntent?</p>","129638","","","","","2011-02-22 12:59:12","Missing Extras in Intent when received from a BroadcastReceiver","<android><android-intent><broadcastreceiver><extras>","2","0","","",""
"4882167","1","","","2011-02-03 02:40:00","20","23909","<p>I am creating a widget that we will provide to developer end users and it consists of a JAR and a native library (*.SO) built using the NDK. The JAR has a JNI interface to the dynamic library.</p><p>It's very clear on how to include an external JAR in a project but not how to include a dependent dynamic library.</p><ol><li><p>How do I package up and build the .JAR and .SO? What are the best practices here? </p></li><li><p>I can create the JAR file using the JDK's jar command. Do I need to run dx.bat on the jar to convert to Dalvik bytecode?</p></li><li><p>I need to create a sample project showing the widget in action. How do I include this .JAR and .SO in a sample project that demonstrates how to use the widget? </p></li></ol>","600937","","214890","","2013-02-22 01:35:33","2013-10-31 04:00:19","Creating a product SDK: How do I add a native lib (.SO) and a jar with the SDK I am creating?","<android><jar><android-ndk>","4","0","6","",""
"4882226","1","4882275","","2011-02-03 02:55:07","1","356","<p>I am writing an android program that is a speedometer. the way it works wright now is it takes 2 GPS locations over time, and divides the distance by time to get speed. the problem with this is that it only refreshes when the gps moves, so when I stop moving it would stay at the last speed that I had. is there a better way of doing this?</p>","599402","","555242","","2011-02-03 03:04:32","2011-09-12 18:13:46","what would be a good way to calculate the current speed of an android?","<android><gps>","2","1","","",""
"4882257","1","4882450","","2011-02-03 03:00:58","1","2178","<p>Ok, everything was working fine, I had the ADT 0.9 installed under eclipse Galileo. But then I just tryied to install the Honeycomb preview SDK and for that I was prompted to install the ADT 9.0. </p><p>The problem is that somehow my tools folder was erased! and apparently it has now been renamed as platform-tools. But whenever I go to Preferences->Android and put the folder where my SDK is, eclipse keeps complaining about the missing tools directory.</p><p>What can I do?</p><p>UPDATE: The problem was a mix of bad ADT installation and an expired debug key. For more info about how dealing with the expired debug key just take a look at: <a href=""http://androidbook.blogspot.com/2009/11/tip-dealing-with-expired-debug.html"" rel=""nofollow"">http://androidbook.blogspot.com/2009/11/tip-dealing-with-expired-debug.html</a></p>","274434","","2642204","","2014-01-22 23:23:01","2014-01-22 23:23:01","ADT Can't find the tools directory","<android><debugging><adt>","1","1","","",""
"4882280","1","6077030","","2011-02-03 03:06:18","4","1980","<p>I have been coding a web scraping application on Android, using HtmlUnit.But, when I build the app, the build error occur ""Conversion to Dalvik format failed with error 1"".So, how do I build the android app using HtmlUnit? please...</p>","367308","","","","","2012-07-29 13:01:25","HtmlUnit on Android","<android>","2","0","4","",""
"4882292","1","4882454","","2011-02-03 03:09:11","0","652","<p>To de-clutter my code I've moved the registration of a new broadcastReceiver outside of the main activity.</p><p>I am finding that my application does cash when backing out of it when the onPause method is called and I have not yet unregistered the receiver.</p><p>Question: How can I unregister the receiver from the onPause method back in my main activity? See the last few lines of Lmt.java (main activity).</p><p>Any help is greatly appreciated :)</p><p>Proximity.java<code><pre>package com.atClass.lmt;</p><p>import android.app.Activity;import android.app.PendingIntent;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.location.LocationManager;import android.util.Log;</p><p>public class Proximity {    public static String PROXIMITY_ALERT = ""com.atClass.proximityalert"";    Context cContext;    Activity cActivity;</p><pre><code>public Proximity(Context iContext, Activity iActivity){    this.cContext = iContext;    this.cActivity = iActivity;}public void setProximityAlert() {    Log.d(Global.TAG,""--&gt;ProximityAlert set...\n"");    String locService = Context.LOCATION_SERVICE;    LocationManager locationManager;    locationManager = (LocationManager)cActivity.getSystemService(locService);    double lat = 39.522006;    double lng = -122.084095;    float radius = 500f; //meters    long expiration = -1; //never expire    Intent intent = new Intent(PROXIMITY_ALERT);    PendingIntent proximityIntent = PendingIntent.getBroadcast(cContext,-1,intent,0);    locationManager.addProximityAlert(lat, lng, radius, expiration, proximityIntent);    IntentFilter filter = new IntentFilter(PROXIMITY_ALERT);    cContext.registerReceiver(new ProximityIntentReceiver(),filter);}</code></pre><p>}</pre></code></p><p>Lmt.java (main activity):<code><pre>package com.atClass.lmt;</p><p>import android.app.Activity;import android.app.Notification;import android.app.NotificationManager;import android.os.Bundle;import android.widget.TextView;import android.graphics.Color;import android.location.Location;</p><p>public class Lmt extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);</p><pre><code>    Fyl lFyl = new Fyl(this,this);    Location location = lFyl.getLocation();    lFyl.getLocationString(location);    Gui lGui = new Gui(this);    lGui.updateGui();    Proximity lProximity = new Proximity(this,this);    lProximity.setProximityAlert();}public void onPause(Bundle savedInstanceState){    this.unregisterReceiver(??);}</code></pre><p>}</pre></code></p>","568508","","","","","2011-02-03 03:40:35","Unregister broadcastReceiver initiated in another class in my main Activity?","<android>","1","0","","",""
"4882338","1","","","2011-02-03 03:20:06","1","414","<p>I just use <strong>PowerManager.PARTIAL_WAKE_LOCK</strong> to let my app still run when users press the power button. My app need to use wifi sensor sometimes so I need to continually register Receiver for wifi sensor and startscan wifimanager, but I find that when system work for a period of time (about 1-2 hours), it seem register Receiver or startscan do not work successfully. Does anybody have some ideas what's the problem of it or does <strong>PowerManager.PARTIAL_WAKE_LOCK</strong> have timeout that cause it not work? If does, how to set it?</p><p>BTW, is DEIVCE_POWER permission useful to PowerManager or to my app? Can anybody tell me what is it used for?</p><p>Thanks a lot!!!</p>","582327","","","","","2011-02-03 03:20:06","Does PowerManager.PARTIAL_WAKE_LOCK have timeout?","<java><android>","0","0","","",""
"4882375","1","4882431","","2011-02-03 03:25:57","2","552","<p>I have download some example and put it under c:\android\WifiDemo. Now when I'm trying to create a new project I choose at the wizard ""create project from existing resouce"" the I choose the above folder and itt gives the following error: Invalid project description"". when I look at details it gives  C:\android2\WiFiDemo overlaps the location of another project: 'WiFiDemo'</p><p>What am I doing wrong?Thanks,Nahum</p>","564230","","","","","2011-02-03 03:35:17","Problems Creating new project","<android>","2","0","","",""
"4882531","1","4882665","","2011-02-03 03:53:32","1","413","<p>I am creating an app that is a speedometer, but right now, it looks very bland. what I want to do, is make it look like a speedometer in a modern car. one that would have the number, and then the needle pointing to the number as well. specifically what I am looking for is something that looks like this: <a href=""http://static.howstuffworks.com/gif/vehicle-pictures/2009/honda/fit/5802-062-speedometer-tachometer-480.jpg"" rel=""nofollow"">http://static.howstuffworks.com/gif/vehicle-pictures/2009/honda/fit/5802-062-speedometer-tachometer-480.jpg</a><br>how would I go about doing that i.e creating the speedometer and moving the needle.</p>","599402","","","","","2012-10-26 09:18:55","how would I create an animation in android, specifically one that looks like a speedometer?","<android><image><animation>","2","1","","",""
"4882566","1","","","2011-02-03 04:00:23","0","696","<p>i am implementing <code>getspeed</code> to get speed of the device while moving in phone.why <code>getSpeed()</code> always <code>return 0</code> on android ..?..i am using gps to get coordinates.</p><pre><code>if(location.hasSpeed() == true){    Toast.makeText(ProxAlertActivity.this, ""Speed:""+ location.getSpeed(), Toast.LENGTH_LONG).show();}</code></pre>","587012","","595204","","2011-02-03 04:09:33","2011-03-13 02:05:02","Android Getspeed using maps","<android>","1","0","1","",""
"4882647","1","","","2011-02-03 04:13:11","0","810","<p>I am creating a ViewFlipper that flips thru WebViews: I have no problems running the app if I place the WebViews within the main.xml.  Since I will be using a multiple count of Web views, I decided to break them up into separate XML files.  When I do this using the include android:id=""@+id/myWebView001"" layout=""@layout/pg001"" within the ViewFlipper of the main.xml, I get an force close when the app starts.  </p><p>Please look thru the following code and if you have any suggestions for this to work correctly, it will greatly appreciate it.  Thnx again!!</p><p>main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;ViewFlipper xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/ViewFlipper""         android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" &gt;        &lt;include android:id=""@+id/myWebView001""  layout=""@layout/pg001"" /&gt;    &lt;/ViewFlipper&gt;</code></pre><p>main.java:</p><pre><code>package com.aero.ac4313;import android.app.Activity;import android.os.Bundle; public class main extends Activity { @Override public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //set your content view, this will be your layout    setContentView(R.layout.main);   } }</code></pre><p>pg001.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout&gt;    &lt;WebView xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/myWebView001"" android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Pg001.java:</p><pre><code>package com.aero.ac4313;import android.app.Activity;import android.os.Bundle;import android.webkit.WebView;public class Pg001 extends Activity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //set your content view, this will be your layout    setContentView(R.layout.pg001);    WebView mWebView = null;    mWebView = (WebView) findViewById(R.id.myWebView001);    mWebView.getSettings().setJavaScriptEnabled(true);    mWebView.loadUrl(""file:///android_asset/pg001.html"");  }}</code></pre>","742030","","742030","","2011-02-03 04:55:35","2011-12-15 20:01:01","ViewFlipper w/ WebView includes","<java><android><layout><viewflipper>","1","2","","",""
"4882659","1","","","2011-02-03 04:16:24","1","332","<p>When uploading 480x800 or 480x854 png or jpgs to the Android Market Developer console, the images in the console appear poorly scaled and chopped off on the left side. Upon clicking the image you see the ""real"" thing.</p><p>Problem is what you see in the console is also what appears in the Android Market (till user actually clicks on the thumbnail) !!!! So users are seeing images that are chopped off on the left side.</p><p>There is some text next to the screenshot upload area in the dev console that reads: ""The thumbnails will appear to be cropped, but the actual images will be preserved."" But again, the problem is that customers are seeing the cropped image in the main Market listing for the app. If user then clicks on an image they see the uncropped image.</p><p>Please let me know if you have a way to get 480x800 or 480x854 images uploaded without them getting chopped.</p>","483163","","","","","2011-02-03 05:06:41","Android Developer Console screenshots being cropped. Anyone else having this issue? Advise?","<android><console><google-play><screenshots>","1","0","","",""
"4882696","1","4882750","","2011-02-03 05:05:27","1","262","<p>I have to put my Android application in a Galaxy tab. When I installed the app, the resolution of the UI of my application changed. But it's looking good in emulator and other Android 2.2 phones. But in Galaxy tab, the resolution is changed. Please help.</p>","548218","","1128737","","2012-01-13 08:57:00","2012-01-13 08:57:00","Changes to be done in Android application to put it in Galaxy tab","<android><android-layout>","2","0","0","",""
"4882697","1","4882761","","2011-02-03 05:06:02","1","1215","<p>I am doing multimedia application,now i am concentrating on to connect Apache web server. I already uploaded some media files in server.I want to access all media file from the server to android device(to client). can any one suggest me how to do this application.  I am new to android. Pls give some useful link to understand how to access data from server. Thanks in andvance. </p>","599841","","599841","","2011-02-03 05:24:34","2011-02-03 05:24:34","Accessing files from server","<android>","2","0","","",""
"4882709","1","","","2011-02-03 05:07:59","2","1211","<p>i want to learn android development and have started with something basic like switching windows, alertdialog and such.</p><p>next lesson i want to take is something that involves client/server database application. for starters, i will have to create a guest book website (please advice what i should use for server database and scripting language ie.. php/mysql, asp/msaccess). i have extensive knowledge with oracle database and oracle apex but not sure if this will be supported in android.</p><p>anyways, the android app that i want to develop will basically sync with the server database and download messages into the phone and displays them in a listview.</p><p>this should do for now.</p><p>please give me some tips on how to do this.</p><p>thanksads</p>","601015","","135152","","2011-07-05 17:49:57","2012-07-10 17:59:26","noob learning android development... need suggestions","<android>","3","0","1","",""
"4882776","1","","","2011-02-03 05:21:25","4","3447","<p>I am trying to make an application which have 4 tabs at the bottom of the screen.</p><p>All of them contain Activity (Intent).</p><p>And I want to navigate any of the Activity to another activity. But want to keep the TabWidget visible.</p><p>Let me know as quickly as possible if you know about it.</p><hr><p>Shaiful</p>","595543","","","","","2011-07-26 05:54:42","Start another Activity inside the FrameLayout of TabActivity","<android><activity><tabactivity>","3","1","2","",""
"4882778","1","4882948","","2011-02-03 05:22:10","1","1219","<p>Following is my xml  I want to set <code>button1</code> to left centrally vertical and <code>button2</code> to right centrally vertical but for me <code>android:layout_gravity=""center_vertical|right""</code> is not working what is the wrong?I know that i can achieve this by applying by using padding or margin but I won't know that why it is not working. <strong>How should I make it work?</strong> </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;HorizontalScrollView     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=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;Button                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""Button1""                android:layout_gravity=""center_vertical""                /&gt;        &lt;Button                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""Button2""                android:layout_gravity=""center_vertical|right""/&gt;         &lt;RelativeLayout            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;        &lt;/RelativeLayout&gt;    &lt;/FrameLayout&gt;  &lt;/HorizontalScrollView&gt;</code></pre>","484073","","484073","","2011-02-03 09:01:12","2011-10-24 21:41:46","Android layout_gravity problem?","<android><android-layout><gravity>","2","0","","",""
"4882794","1","4882893","","2011-02-03 05:24:26","0","330","<p>i am creating App. that contains Sign-Up form. i want to change language as per click(select) language from spinner. is it possible?</p><p>any help?</p><p>Thanks..</p>","472882","","","","","2011-02-03 05:43:17","Android:Change Language Accordinglly","<android><locale>","1","0","","",""
"4882797","1","4882817","","2011-02-03 05:24:50","1","110","<p>I've written a relatively simple app, and I've been testing it out on the various different API levels created through the SDK and AVD manager in Eclipse.  It works great in all API levels except for level 3.  I have a few spinners on the front page which work just fine, but my four buttons don't seem to be working.  I've tried adding a breakpoint in one of the 'onClick' methods that I specified in my xml layout file, but the breakpoint never seems to get reached.  I'm kind of at a loss here.  Does anyone have any idea what could be going on here?</p>","585419","","","","","2011-02-03 05:29:41","Button clicks in API level 3?","<android>","1","0","","",""
"4882845","1","4950937","","2011-02-03 05:34:11","6","357","<p>and if possible, how can I get this behavior for 'my' app?</p><p>For example, when a user navigates to the URL 'example.com/*' (any page starting with example.com), I'd want it so the 'complete this action with' menu shows up listing all of the browsers and this particular app?</p><p>I've done some reading of the Intent documentation, but it seems like you can only create them for phone data, not web URLs.</p><p>Edit: anyone? I've looked into this some more, but haven't had any luck. I'd like to set a bounty, but I don't have that option yet. If it isn't possible, I guess I'll just make a way to paste in a url.</p>","34910","","34910","","2011-02-06 07:46:16","2011-02-16 00:11:33","What makes Google Maps/Youtube able to display the 'Complete this action with' menu?","<android>","2","3","3","",""
"4882872","1","4883961","","2011-02-03 05:39:07","2","964","<p>Is it possible to provide application specific security to the files?. I want the file could only be accessed by the desired application and not by the others.</p>","516985","","","","","2012-07-17 22:10:44","Android file security","<android><security><file>","3","0","","",""
"4882885","1","","","2011-02-03 05:42:18","0","588","<p>i m making a android media player. in first step i have play all song from sdcard one by one and next prev pause functionality. i have done this.but when i test my application like continuously pressing next prev.. next prev.. button my application creased due to VM shutting down and get exception indexoutofbound.</p><p>Pls helm me out.</p><p>Thanks     </p>","562296","","","","","2011-02-03 05:58:02","VM shutting down on android media player","<android><media-player>","1","3","","",""
"4882899","1","4886543","","2011-02-03 05:43:43","2","1678","<p>I am in the process of designing a MATLAB-based algorithm. Is it possible to call that MATLAB source code from a Java application?</p><p>Has anyone come across such a issue?</p>","596364","","97160","","2011-09-25 22:23:08","2011-09-25 22:23:08","MATLAB-based Java program","<java><android><matlab><matlab-deployment>","2","1","","",""
"4882952","1","","","2011-02-03 05:52:58","-1","3234","<p>This is major problem I am getting while monkey testing my application on emulator.</p><blockquote>  <p>""activity home(in process  android.process.acore) is not  responding""</p></blockquote><p>I don't know what is happening behind.</p><p>Has anybody any solution?</p>","578346","","457982","","2011-02-03 06:02:57","2011-02-03 07:36:09","Activity Not Responding","<android>","2","7","","",""
"4883063","1","4883738","","2011-02-03 06:12:31","1","6365","<p>i am  developing social app this app integrate to facebook  my app related message post to facebook wall i am using facebook sdk  in facebook sdk </p><pre><code>mPostButton.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                String message = ""Post this to my wall"";                Bundle parameters = new Bundle();                        parameters.putString(""message"", message);                   mAsyncRunner.request(""me/feed"", parameters, ""POST"",  new SampleDialogListener());            }            });     mPostButton.setVisibility(mFacebook.isSessionValid() ?                View.VISIBLE :                View.INVISIBLE);    }   public class SampleDialogListener extends BaseDialogListener implements RequestListener {            public void onComplete(Bundle values) {                final String postId = values.getString(""post_id"");                if (postId != null) {                    Log.d(""Facebook-Example"", ""Dialog Success! post_id="" + postId);                    mAsyncRunner.request(postId, new WallPostRequestListener());                               } else {                    Log.d(""Facebook-Example"", ""No wall post made"");                }            } public class WallPostRequestListener extends BaseRequestListener {        public void onComplete(final String response, final Object state) {            Log.d(""Facebook-Example"", ""Got response: "" + response);            String message = ""&lt;empty&gt;"";            try {                JSONObject json = Util.parseJson(response);                message = json.getString(""message"");            } catch (JSONException e) {                Log.w(""Facebook-Example"", ""JSON Error in response"");            } catch (FacebookError e) {                Log.w(""Facebook-Example"", ""Facebook Error: "" + e.getMessage());            }            final String text = ""Your Wall Post: "" + message;            Example.this.runOnUiThread(new Runnable() {                public void run() {                    mText.setText(text);                }            });        }</code></pre><p>i am using this code is not working to post message my intension is userlogin facebook my string  is open just publish wall post </p>","254790","","881229","","2014-02-18 18:06:48","2014-02-18 18:06:48","How to post message on facebook wall using Facebook android SDK integrate android app","<android><facebook><facebook-wall>","2","0","2","",""
"4883079","1","","","2011-02-03 06:15:02","10","9332","<p>sendBroadcast() - Should it be called inside Activity?I am trying to call sendBroadcast() from my method of utility-class which doesn't extend Activity. I am getting compilation error as below</p><blockquote>  <p>The method sendBroadcast(Intent) is  undefined for the type MyWrapperClass  MyWrapperClass.java</p></blockquote><p>Here is the code snippet:</p><pre><code>abstract class MyWrapperClass {    public static void sendData()         {             Intent intent = new Intent (""com.proj.utility.mgr"",null);             intent.putExtra(""example"",""Broadcasting "");             sendBroadcast(intent);         }    }</code></pre><p>Is there any concept behind using sendBroadcast call inside my class. There is no issue in using sendBroadcast() inside Activity. Can someone here help me to resolve it? Or Any other suggestions are invited to return data from utility class to application asynchronously.Thanks in advance.</p>","566772","","931721","","2013-04-27 18:55:57","2013-04-27 18:55:57","Usage of sendBroadcast()","<java><android><class><android-intent>","2","1","3","",""
"4883113","1","4883269","","2011-02-03 06:35:17","1","10864","<p><br>Me used the following code to create a AlertDialog.</p><pre><code>     AlertDialog.Builder builder = new AlertDialog.Builder(getApplicationContext()); builder.setMessage(""Are you sure you want to exit?"")        .setCancelable(false)        .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int id) {            }        })        .setNegativeButton(""No"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int id) {                 dialog.cancel();            }        }); AlertDialog alert = builder.create();     alert.show();</code></pre><p>But it shows error on <code>alert.show()</code><br>The error i got is</p><pre><code>02-03 11:36:43.204: WARN/dalvikvm(452): threadid=3: thread exiting with uncaught exception (group=0x4001b188)         02-03 11:36:43.214: ERROR/AndroidRuntime(452): Uncaught handler: thread main exiting due to uncaught exception         02-03 11:36:43.234: ERROR/AndroidRuntime(452): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application         02-03 11:36:43.234: ERROR/AndroidRuntime(452):     at android.view.ViewRoot.setView(ViewRoot.java:472)         02-03 11:36:43.234: ERROR/AndroidRuntime(452):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)</code></pre><p>this class is an activity </p><pre><code>public class HomeTabActivity extends Activity </code></pre><p>This is HomeTabActivity is one the groupActivity since me using each tap as an activity.I called this activity like this</p><pre><code> View view = getLocalActivityManager().startActivity(""hometab"", new                 Intent(this,HomeTabActivity.class)                 .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView();         replaceView(view);</code></pre><p>What did i miss. Thanks in advance </p>","477754","","","","","2011-02-03 07:02:10","AlertDialog error in android","<android><dialog>","3","0","1","",""
"4883179","1","4883231","","2011-02-03 06:49:36","1","1376","<p>What is the difference between <code>EditText</code> and <code>AutoCompleteTextView</code> in Android?</p><p>Can anyone explain with some example?</p><p>Thanks,Balaram</p>","563593","","812149","","2012-07-20 14:18:32","2012-07-20 14:18:32","What is the difference between EditText and AutoCompleteTextView in Android?","<android><edittext><autocompletetextview>","3","0","0","",""
"4883199","1","4883255","","2011-02-03 06:53:05","9","12265","<p>I'm using <code>Intent.ACTION_SEND</code> to send an email. However, when I call the <code>intent</code> it is showing choices to send a message, send an email, and also to send via bluetooth. I want it to only show choices to send an email. How can I do this? </p>","510491","","2581872","","2013-12-23 16:48:27","2014-04-15 10:55:55","Using Android Intent.ACTION_SEND for sending email","<android><email><android-intent>","7","0","6","",""
"4883222","1","4883310","","2011-02-03 06:55:47","2","216","<p>Is there any way to see the printing message <code>(eg: Log.i('', ''))</code> while running Android app in Android phone ? (not in emulator).</p>","221846","","","","","2011-11-18 05:43:42","Is there any way to see the printing message while running Android app?","<android><console>","4","1","","",""
"4883302","1","","","2011-02-03 07:06:26","3","4805","<p>I want to deploy my android application on to real mobile device by using netbeans how can i do it.</p>","579515","","","","","2012-08-24 15:04:49","deploy android application on to real device","<android><netbeans>","3","1","","",""
"4883373","1","","","2011-02-03 07:17:01","0","2549","<p>i started working on android using <code>phonegap</code>.  In <strong>iphone</strong> we use <code>phoneGap.exec(classname.methodname, arguments)</code> to connect to the native application from html. But how can you do it in Android? Can anyone help me in this please?</p><p>Thanks in advance,</p><p>Bharath gangupalli</p>","548616","","703019","","2012-03-04 12:59:47","2012-03-04 12:59:47","How to connect html to native using phonegap in android","<android><phonegap>","1","0","1","",""
"4883477","1","","","2011-02-03 07:32:47","0","457","<p>Fetching an XML from a web service in background and displaying a progress bar in front while the xml is being downloaded in Android</p>","578213","","","","","2011-02-03 08:59:50","Android: Fetching an XML from a web service: Threads","<android>","1","2","","",""
"4883490","1","4883725","","2011-02-03 07:34:19","0","326","<p>I am creating few native apps for Blackberry, Android and Iphone. And I am also planning to publish those on their respective app-stores. I have my own website to promote those apps.</p><p>The information that i need to know is, Is it possible to pull the statistics about my apps from the app stores and show that on my website.</p><p>Is there any API's or something else there to show that..</p><p>(statistics == no. of times downloaded, viewed, purchased etc..)</p><p>Any help would be appreciated.</p><p>Thanks</p>","601124","","","","","2011-02-03 08:12:48","Show my apps statistics on my website from the appstores.?","<iphone><android><blackberry><app-store>","1","0","","",""
"4883492","1","","","2011-02-03 07:34:30","0","398","<p>I have developed a <strong>remote desktop app</strong> in java for windows. </p><p>I am now working on android from a short period of time and trying to develop the same remote desktop app on android platform. I don't have any past android experience.</p><p>I'm facing a problem in desktop simulation because <em>java applets are not supported on android</em>. </p><p>Can anyone Suggest any alternative or any new idea.?</p>","601125","","1489493","","2013-03-04 04:29:29","2013-03-04 04:29:29","remote desktop simulation:android","<android><desktop>","0","2","1","",""
"4883496","1","4883593","","2011-02-03 07:35:10","2","3476","<p>I want to get current location using GPS.</p><p>Here is my scenario. My class definition is:</p><pre><code>public class UseGps extends Activity implements LocationListener</code></pre><p>If Í try to override the LocationListener methods like this</p><p>1)</p><pre><code>@Override public void onLocationChanged(Location loc)</code></pre><p>2)</p><pre><code>@Overridepublic void onProviderDisabled(String provider)</code></pre><p>3)</p><pre><code>@Overridepublic void onProviderEnabled(String provider)</code></pre><p>it is giving me compilation error saying </p><p><code>The method onStatusChanged(String, int, Bundle) of type UseGps must override a superclass method remove override.</code></p><p>Same for 2) and 3)</p><p>What is wrong here?</p>","505580","","418183","","2011-02-03 07:58:24","2011-02-03 08:13:23","Unable to override methods of LocationListener class","<android><override>","2","5","1","",""
"4883576","1","4885629","","2011-02-03 07:47:56","0","1772","<p>I am developing an application in which I used VideoView to play a video. What I want is I need to display some text underneath the playing video and the text should be changed as the video plays I mean depending on elapsed time. Like SRT. So, How to get elapsed time of video in android? And when we pause the video according text should be paused as well and after that when we resume video the text and the following text should be displayed.</p><p>Any help would be appreciated.</p><hr><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.playing);    mVideoView = (VideoView)findViewById(R.id.VideoView);    uri = Uri.parse(""android.resource://com.abhan.video/"" + R.raw.abhan);    Date dt = new Date();    mHours = dt.getHours();    mMinutes = dt.getMinutes();    mSeconds = dt.getSeconds();    String curTime = mHours + "":""+ mMinutes + "":"" + mSeconds;    mVideoView.setVideoURI(uri);    mVideoView.start();    Runnable runnable = new CountDownRunner();    myThread= new Thread(runnable);       myThread.start();    mVideoView.setOnPreparedListener(new OnPreparedListener() {        @Override        public void onPrepared(MediaPlayer mp) {            Log.i(""TAG"", ""On Prepared"");        }    });    mVideoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {        @Override        public void onCompletion(MediaPlayer mp) {        Log.v(""TAG"", ""On Completion"");        myThread.stop();        Intent i = new Intent(Playing.this, VideoPlay.class);        startActivity(i);        finish();        }    });}class CountDownRunner implements Runnable {    public void run() {        while(!Thread.currentThread().isInterrupted()) {            try {                doWork();                Thread.sleep(1000);            } catch (InterruptedException e) {                Thread.currentThread().interrupt();                e.printStackTrace();            } catch(Exception e) {                e.printStackTrace();            }        }    }}public void doWork() {    runOnUiThread(new Runnable() {        public void run()  {            try {                mText = (TextView)findViewById(R.id.SetText);                Date dt = new Date();                int hours = dt.getHours();                int minutes = dt.getMinutes();                int seconds = dt.getSeconds();                String curTime = hours + "":""+ minutes + "":"" + seconds;                if(minutes == mMinutes &amp;&amp; seconds == mSeconds) {                    mText.setText(getString(R.string.one));                } else if(minutes == mMinutes &amp;&amp; seconds == mSeconds+20) {                    mText.setText(getString(R.string.two));                } else if(minutes == mMinutes &amp;&amp; seconds == mSeconds+38) {                    mText.setText(getString(R.string.three));                } else if(minutes == mMinutes &amp;&amp; seconds == mSeconds+47) {                    mText.setText(getString(R.string.four));                } else if(minutes == mMinutes+1 &amp;&amp; seconds == mSeconds2+2) {                    mText.setText(getString(R.string.five));                } else if(minutes == mMinutes+1 &amp;&amp; seconds == mSeconds2+22) {                    mText.setText(getString(R.string.six));                } else if(minutes == mMinutes+2) {                    mText.setText(getString(R.string.seven));                } else if(minutes == mMinutes+2 &amp;&amp; seconds == mSeconds2+2) {                    mText.setText("""");                }            } catch (Exception e) {                e.printStackTrace();            }        }    });}@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    if ((!(android.os.Build.VERSION.SDK_INT &gt; android.os.Build.VERSION_CODES.DONUT)             &amp;&amp;keyCode == KeyEvent.KEYCODE_BACK &amp;&amp; event.getRepeatCount() == 0))    {        onBackPressed();    }    return super.onKeyDown(keyCode, event);}public void onBackPressed() {    Intent intent = new Intent(Playing.this, VideoPlay.class);    intent.setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);    startActivity(intent);    finish();    return;}</code></pre><p>Thanks.</p>","456118","","456118","","2013-04-20 04:05:05","2013-04-20 04:05:05","How to display text underneath playing video in android?","<android><video><get><elapsedtime>","1","0","1","",""
"4883603","1","4883703","","2011-02-03 07:53:53","0","103","<p>I'm looking for advice or critique of a design concept for coalescing Runnable objects posted to a Handler. The case is that I have a background thread that generates small chunks of work that must be done on the event thread. Each chunk is posted to a Handler as a Runnable in the usual way. It turns out that if one of these Runnables has not started executing, it would be easy to modify it to do additional work when it does run instead of constructing and posting another Runnable. This coalescing of work chunks would be both cheaper than constructing another Runnable and would also cut down on the problem of the background thread flooding the event queue.</p><p>There are a couple of problems, though. First, I need to have access to the last Runnable delivered to the event queue. As far as I know, neither Handler nor Looper offer any such function, so I was planning to just keep a reference to the last posted Runnable in my background thread code. I'm just assuming that maintaining a reference like this isn't going to cause problems anywhere in the system.</p><p>The more serious issue is that I'd have to have some way of knowing if a Runnable has been taken off the queue and started. I plan to handle that by adding a flag to my Runnable class and setting at the start of the run() method. There would still be some synchronizing necessary to avoid race conditions between testing the flag and updating the Runnable (background thread) and setting the flag once the Runnable starts executing (event thread).</p><p>Has anyone done anything like this, and if so, how did you do it? Am I overlooking something that I need to deal with?</p>","535871","","","","","2011-02-03 08:08:45","Design problem: coalescing objects sent to a Handler","<android><multithreading><backgroundworker><handler>","1","0","","",""
"4883615","1","","","2011-02-03 07:56:34","0","673","<p>I am making my own application, which fetches data from facebook using facebook graph api. The trouble i am getting is that whenever i start my application and click on login button it redirects to com.facebook.katana and invalid_key error generates. On the other hand when i uninstall the com.facebook.katana application from my phone, my application starts working perfectly fine.</p>","601141","","","","","2011-03-15 02:00:31","Problem in using facebook sdk for android","<android><facebook><sdk>","2","0","","",""
"4883740","1","","","2011-02-03 08:15:01","0","378","<p>i had to develop a app in android for mobile blogging (to update a site by this app).How can i develop this app..pls any one give a overview..</p>","587424","","255905","","2011-02-03 08:16:21","2011-02-03 09:48:03","networking in android","<android><networking>","2","0","","",""
"4883850","1","","","2011-02-03 08:30:06","1","483","<p>I play a very short and basic mp3 sound effect in my application. It sounds great on the AVD emulator but doesn't sound at all on my external device. I use the Android plugin for Eclipse on Mac OSX and my external device is a HTC Desire.</p><p>I am using this code :</p><pre><code>MediaPlayer media_player = MediaPlayer.create(Play.this, R.raw.my_sound);media_player.start();media_player.setVolume(1, 1);</code></pre><p>which is very simple and should work.</p><p>I also tried to use a SoundPool. Again, it sounds as it should on the AVD emulator but again no sound on my mobile device is set.</p><p>Before somebody asks, I of course set my device sound volume to maximum and no silent mode or anything like that.</p><p>Any idea?</p><p>Thanks in advance!</p>","544659","","","","","2011-02-03 08:30:06","Problem sound volume when testing on a device","<android><audio><media-player><device><soundpool>","0","3","0","",""
"4883896","1","4991710","","2011-02-03 08:38:00","0","2166","<p>i tried the example from <a href=""http://www.helloandroid.com/tutorials/using-ksoap2-android-and-parsing-output-data"" rel=""nofollow"">http://www.helloandroid.com/tutorials/using-ksoap2-android-and-parsing-output-data</a> to get request and response from a wsdl service. its working fine when i tried in a proxyless. but when i work behind proxy,i get <strong><em>""The operation timed out:request time failed: java.net.SocketException""</em></strong> is there any way to set proxy to SoapObject or Soap Envelop?</p>","430652","","","","","2012-06-29 21:16:16","ksoap timeout behind proxy in android","<android><proxy><socketexception><ksoap><envelope>","4","0","","",""
"4883907","1","4884130","","2011-02-03 08:40:07","1","5013","<p>I am getting the following errors when trying to run my application:Can you please tell me where I am going wrong :)Oh and also, how can I find out which line in my code the error is occurring? thanks</p><pre><code>    02-03 08:01:31.159: ERROR/AndroidRuntime(281): FATAL EXCEPTION: main02-03 08:01:31.159: ERROR/AndroidRuntime(281): java.lang.RuntimeException: Unable to instantiate application com.android.demo.notepad2.NoteEdit: java.lang.ClassCastException: com.android.demo.notepad2.NoteEdit02-03 08:01:31.159: ERROR/AndroidRuntime(281):     at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:649)02-03 08:01:31.159: ERROR/AndroidRuntime(281):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4232)02-03 08:01:31.159: ERROR/AndroidRuntime(281):     at android.app.ActivityThread.access$3000(ActivityThread.java:125)02-03 08:01:31.159: ERROR/AndroidRuntime(281):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)02-03 08:01:31.159: ERROR/AndroidRuntime(281):     at android.os.Handler.dispatchMessage(Handler.java:99)02-03 08:01:31.159: ERROR/AndroidRuntime(281):     at android.os.Looper.loop(Looper.java:123)02-03 08:01:31.159: ERROR/AndroidRuntime(281):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-03 08:01:31.159: ERROR/AndroidRuntime(281):     at java.lang.reflect.Method.invokeNative(Native Method)02-03 08:01:31.159: ERROR/AndroidRuntime(281):     at java.lang.reflect.Method.invoke(Method.java:521)02-03 08:01:31.159: ERROR/AndroidRuntime(281):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-03 08:01:31.159: ERROR/AndroidRuntime(281):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-03 08:01:31.159: ERROR/AndroidRuntime(281):     at dalvik.system.NativeStart.main(Native Method)02-03 08:01:31.159: ERROR/AndroidRuntime(281): Caused by: java.lang.ClassCastException: com.android.demo.notepad2.NoteEdit02-03 08:01:31.159: ERROR/AndroidRuntime(281):     at android.app.Instrumentation.newApplication(Instrumentation.java:957)02-03 08:01:31.159: ERROR/AndroidRuntime(281):     at android.app.Instrumentation.newApplication(Instrumentation.java:942)02-03 08:01:31.159: ERROR/AndroidRuntime(281):     at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:644)02-03 08:01:31.159: ERROR/AndroidRuntime(281):     ... 11 more</code></pre><p>This is my NoteEdit class:</p><pre><code>package com.android.demo.notepad2;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 NoteEdit extends Activity {    EditText mTitleText;    EditText mBodyText;    Long mRowId;    @Override    protected void onCreate(Bundle savedInstanceState) {        // TODO Auto-generated method stub        super.onCreate(savedInstanceState);        setContentView(R.layout.note_edit);        setTitle(R.string.edit_note);        mTitleText = (EditText) findViewById(R.id.title);        mBodyText = (EditText) findViewById(R.id.body);        Button confirmButton = (Button) findViewById(R.id.confirm);        mRowId = null;        Bundle extras = getIntent().getExtras();        if (extras != null) {            String title = extras.getString(NotesDbAdapter.KEY_TITLE);            String body = extras.getString(NotesDbAdapter.KEY_BODY);            mRowId = extras.getLong(NotesDbAdapter.KEY_ROWID);            if (title != null) {                mTitleText.setText(title);            }            if (body != null) {                mBodyText.setText(body);            }        }        confirmButton.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                // TODO Auto-generated method stub                Bundle bundle = new Bundle();                bundle.putString(NotesDbAdapter.KEY_TITLE, mTitleText.getText()                        .toString());                bundle.putString(NotesDbAdapter.KEY_BODY, mBodyText.getText()                        .toString());                if (mRowId != null) {                    bundle.putLong(NotesDbAdapter.KEY_ROWID, mRowId);                }                Intent mIntent = new Intent();                mIntent.putExtras(bundle);                setResult(RESULT_OK, mIntent);                finish();            }        });    }}</code></pre><p>This is the NoteEdit class 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=""match_parent""    android:layout_height=""match_parent""&gt;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_width=""match_parent""        android:layout_height=""wrap_content""&gt;        &lt;TextView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""@string/title"" /&gt;        &lt;EditText            android:id=""@+id/title""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_weight=""1"" /&gt;    &lt;/LinearLayout&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=""match_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""        android:scrollbars=""vertical"" /&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;</code></pre>","601147","","","","","2011-12-26 21:18:49","ClassCastException Android Eclipse","<android><classcastexception>","2","3","","",""
"4883983","1","4884018","","2011-02-03 08:51:04","1","247","<p>Now that android has a <a href=""http://www.engadget.com/2011/02/02/android-market-gets-a-web-store/"" rel=""nofollow"">web store</a> I was wondering how is this done and how this thing works internally? I think this is really awesome. Is this available on the SDK's? Are all android versions supported? </p><p>Thanks</p>","496042","","","","","2011-08-01 23:27:15","Android Market web store with OTA installations","<android>","1","0","","",""
"4884034","1","","","2011-02-03 08:58:35","2","1363","<p>I want to send one common message say ""Happy new year"" through C2DM to more than one registered device. I have got few ideas about C2DM from the link <a href=""http://code.google.com/android/c2dm/index.html"" rel=""nofollow"">http://code.google.com/android/c2dm/index.html</a> and understood that each devices registered for C2DM they have different auth token and registration id. So is it possible for the third application server to send the same message to all the devices registered with. I am using the sample code for Chrome to phone downloaded from <a href=""http://code.google.com/p/chrometophone/source/checkout"" rel=""nofollow"">http://code.google.com/p/chrometophone/source/checkout</a>.</p><p>So any help from any one would be appreciated. </p>","593564","","21234","","2011-02-03 10:30:22","2011-08-11 05:02:47","How to send one common C2DM message to more than one device","<android><android-c2dm>","1","0","0","",""
"4884117","1","5169288","","2011-02-03 09:05:59","19","9301","<p>Can someone explain the difference between <code>MultiAutoCompleteTextView</code> and  <code>AutoCompleteTextView</code>?</p>","550966","","1401895","","2013-12-31 03:14:15","2013-12-31 03:14:15","Difference between MultiAutoCompleteTextView and AutoCompleteTextView","<android>","2","0","1","",""
"4884134","1","","","2011-02-03 09:08:55","0","116","<p>On android phone, with an application, how is it possible to add some sounds to the rings proposed ?</p><p><strong>EDIT.</strong></p><p>On a phone, man can choose the ring in a list. Some make <em>bip bip bip</em>, other <em>dring dring dring</em>. Is it possible to add some sounds in this list with an android app, like a provider or something else ?</p><p>Thanks.</p>","312025","","312025","","2011-02-03 13:05:06","2011-02-03 13:05:06","Android : Give some sound to ring","<android>","0","2","","",""
"4884180","1","","","2011-02-03 09:13:46","1","1261","<p>I'm stuck with the call_log functionality in Froyo. As many of you know, Froyo logs in call log not only calls but also each outgoing and incomming SMS message. You can chose in options to show all that crap, or only specific types (outgoing calls, incoming calls, sent messages, received messages etc), but since this is radio button, you cannot specify for example only ongoing and incoming calls. Very known and annoing Froyo functionality.</p><p>So I started to write some simple tool to read the call log by myself. Here is the code snippet:</p><pre><code>try {    mCur = getApplicationContext().getContentResolver()               .query(CallLog.Calls.CONTENT_URI, columns, null, null, null );    mCur.moveToFirst();    io = mCur.getColumnIndex(CallLog.Calls._ID);    bo = mCur.getColumnIndex(CallLog.Calls.NUMBER);    no = mCur.getColumnIndex(CallLog.Calls.CACHED_NAME);    to = mCur.getColumnIndex(CallLog.Calls.TYPE);    while (mCur.isAfterLast() == false) {        i = mCur.getString(io);        b = mCur.getString(bo);        n = mCur.getString(no);        t = mCur.getString(to);        Log.i(TAG, ""CallLog: ID=""+i+"" number=""+b+"" name=""+n+"" type=""+t);        mCur.moveToNext();    }} catch (Exception e) {    Log.e(TAG, ""updateCallLog"", e);} finally {    if (mCur != null) {        mCur.close();        mCur = null;    }}</code></pre><p>Surprise, surprise, the call_log provider skips the sms records from the call log. So with the code above I see only call records (incoming or outgoing), all other records are skipped. The little more digging into it revealed that the CallLog provider adds internally filtering to the call log database:</p><pre><code>02-03 09:26:42.348 E/CLCService(28244): android.database.sqlite.SQLiteException: near "")"": syntax error: , while compiling: SELECT _id, name, number, type FROM logs WHERE (logtype=100 OR logtype=500) AND (_ID=)</code></pre><p>Do not look for the syntax error, it was created on purpose to force provider to dump the SQL query by calling <code>query(CallLog.Calls.CONTENT_URI, columns, ""_ID="", null, null ))</code>. The <code>(_ID=)</code> is what is provided in the query, the rest of <code>(logtype=100 OR logtype=500)</code> is apparently added by the call log provider itself.</p><p>So I have two questions:  </p><ol><li>Where I can find in the Android code how the provider is adding the logtype filter? I was looking into <a href=""http://www.google.co.in/codesearch/p?hl=en#uX1GffpyOZk/core/java/android/provider/CallLog.java&amp;q=calllog%20java%20android%20apache&amp;sa=N&amp;cd=1&amp;ct=rc"" rel=""nofollow"">CallLog.java</a> and <a href=""http://www.google.co.in/codesearch/p?hl=en#cbQwy62oRIQ/src/com/android/providers/contacts/CallLogProvider.java&amp;q=calllogProvider%20java%20android%20apache&amp;sa=N&amp;cd=1&amp;ct=rc"" rel=""nofollow"">CallLogProvider.java</a> and cannot find it.  </li><li>How can I read all records from the call log in Froyo? I cannot bypass the call log provider and use my own SQL helper for this until I will not root the phone, which is not an option. Is there any other way to do it?</li></ol>","600733","","331473","","2011-11-26 14:42:21","2011-11-26 15:21:24","Android Froyo: my life with call_log","<android><logging><android-2.2-froyo><cal><calllog>","1","1","","",""
"4884216","1","4886271","","2011-02-03 09:17:14","0","3736","<p>do you know how to capture a picture form camera with a fixed resolution (ex: 400/400) without writing the picture to a file on sdcard and then loading it again? and after I have the image, how to put it in a textview? I've tried with editText.setCompoundDrawables but this is not a solution for me. I want image in upper left corner, not on top. Thanks</p>","517558","","524537","","2011-02-21 01:21:52","2011-02-21 01:21:52","android capture pictures form camera","<android><image><camera><resolution><capture>","2","1","","",""
"4884252","1","","","2011-02-03 09:21:14","0","447","<p>I have a video url (either progressive download or streaming) and I want to determine its format to check if it complies with Android's <a href=""http://developer.android.com/guide/appendix/media-formats.html"" rel=""nofollow"">supported media formats</a>. How can I check this? Is it enough if it works on the emulator?</p><p>(as far as I understand testing it on a device is not a warranty since some Android devices might support formats that others do not)</p>","143378","","143378","","2011-02-03 11:03:43","2011-02-03 11:03:43","Format of video url","<android><url><video><video-streaming><progressive-download>","1","1","","",""
"4884403","1","4884509","","2011-02-03 09:36:39","2","715","<p>Given this code, how do I get the values from the checkbox- and textpreference and store them in the domain object?</p><pre><code>public class MonitorPreferences extends PreferenceActivity {    private PersistenceManager pm;    private Monitor monitor;    private boolean mActive;    private String mName;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        pm = new PersistenceManager(getApplicationContext());        addPreferencesFromResource(R.xml.monitors_pref);        fetchDomainObject();    }    private void fetchDomainObject() {          monitor =  pm.fetchMonitor(getIntent().getLongExtra(SuperListActivity.EXTRA_KEY_MONITOR_ID, -1));    }    private void persistDomainObject(Monitor monitor) {        pm.persist(monitor);    }}</code></pre><hr><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;PreferenceCategory android:title=""General""&gt;        &lt;CheckBoxPreference            android:key=""active_chkbox""            android:title=""Active""            android:defaultValue=""true""            android:persistent=""false""/&gt;        &lt;EditTextPreference            android:key=""name_txt""            android:dependency=""active_chkbox""            android:title=""Name""            android:summary=""Enter a name""            android:dialogTitle=""Enter a name""            android:dialogMessage=""Enter a name""            android:defaultValue=""John Doe""            android:persistent=""false""/&gt;    &lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;</code></pre><p><em><strong>Original question: Creating a normal Activity with the look and feel of a PreferenceActivity</em></strong>My goal is to edit the variables of a domain object from an Activity with the look and feel of stock android preferences. What's the easiest way of accomplishing this?</p><p>Would it be possible to create a a PreferenceActivity and somehow modify it to display/edit the values of a domain object instead of the values from SharedPreferences?</p>","434457","","434457","","2011-02-03 15:32:01","2011-02-03 18:37:32","PreferenceActivity display/edit the values of a domain object","<android><activity><sharedpreferences><preference>","1","0","0","",""
"4884429","1","5037179","","2011-02-03 09:38:47","3","3408","<p>I am on a project that involve facebook integration.<br><br>Following the  <a href=""http://developers.facebook.com/docs/guides/mobile"" rel=""nofollow"">http://developers.facebook.com/docs/guides/mobile</a> i am able to integrate the sdk into my application and it runs pretty smooth as well.</p><p>Its like a portal where i just need to enter my facebook credential and it will open the facebook content for me within my app screen.We cant manipulate anything from here.</p><p><H2>What i want a way to enter my facebook credentials and retrieve my all friends email addresses as list which i can use in my application as i want.like displaying them in a ListView</H2></p><p>Like the yahoo.com which on asking facebook credentials , saves a csv file on to the desktop that has all the list of friends addresses. That means facebook do allow retrieval of friends email after proper authentication. </p><p>I tried FBRocket as well. it didnt seem to work...</p><p>How to programatically achieve this. </p>","467592","","","","","2011-10-19 11:24:50","Export Facebook Friends Email Address Android","<android><facebook>","4","2","8","",""
"4884442","1","","","2011-02-03 09:40:21","0","200","<p>I am developing an Android gane application Bingo.I have impplemented the functionality.I want that when i click on help button.It goes to other activity first and then shows the text displayed on help xml file......</p><p>Here is my java file</p><pre><code>public class FirstScreen extends Activity implements OnClickListener {    Button play1;    Button help1;    Button music1;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.firstscreen);        play1=(Button)findViewById(R.id.play);        help1=(Button)findViewById(R.id.help);        Intent intent = new Intent(FirstScreen.this,Help1.class);        startActivity(intent);        {            music1=(Button)findViewById(R.id.music);            play1.setOnClickListener(this);            music1.setOnClickListener(this);            if(getIntent().getBooleanExtra(""Exit"", false)) {                finish();            }        }    }    @Override    public void onClick(View v) {        switch(v.getId()) {        case R.id.play:            Toast.makeText(this,""Play"", Toast.LENGTH_SHORT).show();            Intent playintent=new Intent(getApplicationContext(),                    RoadTripBingo.class);            startActivity(playintent);            break;        case R.id.help:            Toast.makeText(this,""HELP"", Toast.LENGTH_SHORT).show();            break;        case R.id.music:            Toast.makeText(this,""Music"", Toast.LENGTH_SHORT).show();            break;        default:            break;    }}@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    if (keyCode == KeyEvent.KEYCODE_BACK) {        // your code here        final Intent exit_App=new Intent(getApplicationContext(),               FirstScreen.class);        exit_App.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);        exit_App.putExtra(""Exit"",true);        startActivity(exit_App);        System.out.println(""working"");    //  finish();        return true;    }    return super.onKeyDown(keyCode, event);}}</code></pre><p>Here is my android 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.tli.roadtripbingo""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icons"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".SplashScreen""                  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="".FirstScreen""&gt;&lt;/activity&gt; &lt;activity android:name="".Help1""&gt;&lt;/activity&gt; &lt;activity android:name="".RoadTripBingo""&gt;&lt;/activity&gt; &lt;activity android:name="".Win""&gt;&lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt; </code></pre><p>Thanks in advanceTushar Sahni</p>","475349","","418183","","2011-02-03 09:51:16","2011-02-03 09:51:16","Button going to activity other than that mentioned in the java code","<android><activity><android-intent>","0","6","","",""
"4884456","1","4904432","","2011-02-03 09:41:47","12","10050","<p>Hi AllWhen enabing proguard for android, while building the signed jar I get the following dump:</p><pre><code>[2011-02-03 11:28:27 - VideoCreator] Proguard returned with error code 1. See console[2011-02-03 11:28:27 - VideoCreator] java.io.IOException: Can't read [proguard.ClassPathEntry@49b290] (No such file or directory)[2011-02-03 11:28:27 - VideoCreator]    at proguard.InputReader.readInput(InputReader.java:230)[2011-02-03 11:28:27 - VideoCreator]    at proguard.InputReader.readInput(InputReader.java:200)[2011-02-03 11:28:27 - VideoCreator]    at proguard.InputReader.readInput(InputReader.java:178)[2011-02-03 11:28:27 - VideoCreator]    at proguard.InputReader.execute(InputReader.java:100)[2011-02-03 11:28:27 - VideoCreator]    at proguard.ProGuard.readInput(ProGuard.java:195)[2011-02-03 11:28:27 - VideoCreator]    at proguard.ProGuard.execute(ProGuard.java:78)[2011-02-03 11:28:27 - VideoCreator]    at proguard.ProGuard.main(ProGuard.java:499)</code></pre><p>Could not find anything relevant on the net. Any ideas?</p>","487390","","","","","2012-02-09 20:40:44","Android Proguard java.io.IOException: Can't read [proguard.ClassPathEntry ","<android><proguard>","4","0","4","",""
"4884519","1","","","2011-02-03 09:47:47","4","5766","<p>hi i am new for android application can u tell me how to create jni and android.mk....i know jni purpose but how to create that jni in my project tell me step by step </p>","486554","","","","","2012-07-27 03:07:45","how to create jni and Android.mk?","<android><jni>","3","0","2","",""
"4884644","1","","","2011-02-03 09:58:52","0","71","<p>I have written code where in I am trying to save some data in the DB. When I run the code I get these exceptions:</p><pre><code>02-03 15:14:47.194: ERROR/AndroidRuntime(594): FATAL EXCEPTION: main02-03 15:14:47.194: ERROR/AndroidRuntime(594):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1544)02-03 15:14:47.194: ERROR/AndroidRuntime(594):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)02-03 15:14:47.194: ERROR/AndroidRuntime(594):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)02-03 15:14:47.194: ERROR/AndroidRuntime(594):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)02-03 15:14:47.194: ERROR/AndroidRuntime(594):     at android.app.ActivityThread.main(ActivityThread.java:3647)02-03 15:14:47.194: ERROR/AndroidRuntime(594):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1536)</code></pre><p>Can anyone help me on this?</p><p>1.MyOpenHelper.java</p><pre><code>public class MyOpenHelper extends SQLiteOpenHelper {    public MyOpenHelper(Context context, String name, CursorFactory factory,int version) {        super(context, name, factory, version);    }    /** Called when the activity is first created. */    public void onCreate(SQLiteDatabase POIDetailsDB){        POIDetailsDB.beginTransaction();        POIDetailsDB.execSQL(""CREATE TABLE POIDetails(Lat TEXT,Lon TEXT,POIName TEXT,Radius TEXT,Message TEXT)"");        POIDetailsDB.setTransactionSuccessful();        POIDetailsDB.endTransaction();        Log.d(""TAG"",""Table created succesfully"");    }</code></pre><p>2.SQLDemo.java</p><pre><code>public class SqlDemo extends Activity{    @Override     public void onCreate(Bundle savedInstanceState) {     .........................//     MyOpenHelper openHelper = new MyOpenHelper(getApplicationContext(),""POI"", null, 1);     SQLiteDatabase POIDetailsDB = openHelper.getWritableDatabase();     ContentValues values = new ContentValues();    // POIDetailsDB.insert(""POIDetails"", null, values);     values.put(""Lat"",""18.535"");     values.put(""Lon"",""73.767"");     values.put(""POIName"",""Pune"");     values.put(""Radius"",""5"");     values.put(""Message"",""PUNE"");     String[] columns = new String[]{""Lat"",""Lon"",""POIName"",""Radius"",""Message""};     Cursor cur = POIDetailsDB.query(""POIDetails"", columns, null, null, null, null, null);     cur.moveToFirst();</code></pre>","564493","","324364","","2011-12-21 00:32:11","2011-12-21 00:32:11","Error while running pgm to save the data in the DB","<android>","0","2","","",""
"4884682","1","","","2011-02-03 10:02:17","2","3096","<p>Hey guys.  I'm looking to program an Android app which is simply a print driver that converts a file to postscript and/or PCL and then sends it to a network printer.  My first concern is printing pdf files.  Do any of you know of a Java (or I guess I could use C/C++ and JNI) library for converting pdf to PS/PCL?  The key issue here is that I can't use any of the built-in Java print libraries, since those aren't included on Android.</p><p>I don't have any ambition to sell the app, or distribute it under my name, or anything of that nature, so if you can point me to some open-source converters which I can use directly, that would be great.</p><p>Thanks!</p>","453264","","453264","","2011-02-04 00:54:59","2012-02-02 21:28:48","Postscript driver for Android?","<android><printing><driver><postscript><printer-control-language>","1","5","","",""
"4884863","1","4884982","","2011-02-03 10:19:05","0","1250","<p>Scenario:</p><p>I have a ASP.Net / Silverlight website with webservices for supporting the Silverlight apps with data.  The website uses forms authentication, and thus the webservices can also authenticate requests.</p><p>Now I would like to pull some data from this system to a Android application.  I could implement code for running the forms login, and storing the authentication cookie, but it would actually be much simpler to send the username and password in the webservice url and authenticate each call.  I don't really see a big problem with this as the communication is SSL encrypted, but I'm open to be conviced otherwise ;)</p><p>What do you think ?  Bad idea / not so bad idea ?</p><p>Conclusion:</p><p>After reviewing the answers the only really valid argument against name / pass in the url request string is that it's stored in the server log files.  Granted it's my server and if that server is hacked the the data it stores will also be hacked, but I still don't like passwords showing up in logs.  (Thats why they are stored salted and encrypted)</p><p>Solution:</p><p>I will post the username and passord with the request.  Minimal extra work, and more secure.</p>","37119","","37119","","2011-02-08 09:05:53","2011-03-09 11:25:25","Bad idea to pass username and password in the URL when using SSL?","<asp.net><android><forms-authentication>","4","0","","",""
"4884882","1","5082672","","2011-02-03 10:20:29","20","10083","<p>Can you load a drawable from a sub directory in the <code>assets</code> (not the drawable folder) folder?</p>","601327","","418183","","2011-02-03 11:22:30","2013-07-11 06:48:01","Is it possible to load a drawable from the assets folder?","<android><drawable><assets>","4","0","9","",""
"4884957","1","4885107","","2011-02-03 10:27:06","3","5129","<p>I want to run two threads <code>r1</code>, and <code>r2</code>. First start the <code>r1</code> and after completion of <code>r1</code>, start <code>r2</code> (only after the completion <code>r1</code>). How can this be done, two threads, one after another?</p>","745367","","1267663","","2012-10-11 15:28:41","2012-10-11 15:28:41","how to run one thread after complete another thread","<android><multithreading>","4","1","","",""
"4884960","1","","","2011-02-03 10:27:19","5","3141","<p>How do I get the current translate position from a Canvas? I am trying to draw stuff where my coordinates are a mix of relative (to each other) and absolute (to canvas).</p><p>Lets say I want to do</p><pre><code>canvas.translate(x1, y1);canvas.drawSomething(0, 0); // will show up at (x1, y1), all good// now i want to draw a point at x2,y2canvas.translate(x2, y2);canvas.drawSomething(0, 0); // will show up at (x1+x2, y1+y2)// i could docanvas.drawSomething(-x1, -y1);// but i don't always know those coords</code></pre><p>This works but is dirty:</p><pre><code>private static Point getCurrentTranslate(Canvas canvas) {    float [] pos = new float [2];    canvas.getMatrix().mapPoints(pos);    return new Point((int)pos[0], (int)pos[1]);}...Point p = getCurrentTranslate(canvas);canvas.drawSomething(-p.x, -p.y);</code></pre><p>The canvas has a getMatrix method, it has a <code>setTranslate</code> but no <code>getTranslate</code>. I don't want to use <code>canvas.save()</code> and <code>canvas.restore()</code> because the way I'm drawing things it's a little tricky (and probably messy ...)</p><p>Is there a cleaner way to get these current coordinates?</p>","226434","","","","","2012-02-04 15:37:40","How to find the current translate position in Canvas?","<android><canvas>","1","0","2","",""
"4884980","1","4885480","","2011-02-03 10:29:13","4","5938","<p>I have an ImageView which is written in a layout file and looks like this</p><pre><code>&lt;LinearLayout   android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:orientation=""vertical""&gt;        &lt;ImageView android:id=""@+id/news_image""             android:layout_height=""fill_parent""            android:layout_width=""fill_parent""            android:layout_marginLeft=""18dip""            android:layout_marginRight=""18dip""            android:background=""#aaaaaa"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>How can I read the android:layout_marginLeft attribute in my Activity?</p><p>I tried this following code but <code>LayoutParams</code> of my <code>ImageView</code> doesn't have any margin members (like for example <code>LinearLayout.LayoutParams</code> has).</p><pre><code>ImageView imageView = (ImageView)findViewById(R.id.news_image);LayoutParams lp = imageView.getLayoutParams();int marginLeft = lp.marginLeft; // DON'T do this! It will not work                                 // cause there is no member called marginLeft</code></pre><p>Any suggestions how to get the margin from a <code>ImageView</code>?</p><p>Thank you!</p>","138584","","","","","2011-02-03 11:21:24","How read ImageView margin programmatically?","<android><layout><imageview>","2","0","","",""
"4884981","1","4885207","","2011-02-03 10:29:14","0","1057","<p>I have checked many code snippets, tried with and without buffer and I can't get to download whole file to SD card. The code I use currently is:</p><pre><code>    try {        url = new URL(""http://mywebsite.com/directory/"");    } catch (MalformedURLException e1) { }    String filename = ""someKindOfFile.jpg""; // this won't be .jpg in future    File folder = new File(PATH); // TODO: add checking if folder exist    if (folder.mkdir()) Log.i(""MKDIR"", ""Folder created"");    else Log.i(""MKDIR"", ""Folder not created"");    File file = new File(folder, filename);    try {        conn = url.openConnection();        is = conn.getInputStream();        BufferedInputStream bis = new BufferedInputStream(is);        ByteArrayBuffer baf = new ByteArrayBuffer(50);        int current = 0;        while ((current = bis.read()) != -1) {                baf.append((byte) current);        }        FileOutputStream fos = new FileOutputStream(file);        fos.write(baf.toByteArray());        fos.close();        is.close();    } catch (IOException e) { }</code></pre><p>This code creates directory on SD card but downloads only 77 bytes of files. What might be the problem?</p>","475861","","475861","","2011-02-03 11:02:43","2013-06-29 21:37:34","Android - file download problem - incomplete file","<java><android><file><download>","1","3","","",""
"4885017","1","4885340","","2011-02-03 10:31:53","0","218","<p>I wish to update my SDK 2.3 to the latest revision of 2.3. I don't want to update to 3.0 preview and lose the GPS emulation and have a slow emulator. 2.3 is just fine for me. I've updated the ADT plugin to 9.0.0 by the Eclipse 'check for updates'.</p><p>If I run the AVD manager from Eclipse and look at my installed packages, I have installed :<img src=""http://i.stack.imgur.com/xgxLZ.jpg"" alt=""enter image description here""></p><p>and the available packages with the ones that I <strong><em>think</em></strong> I want checked are:<img src=""http://i.stack.imgur.com/5H6eg.jpg"" alt=""enter image description here""></p><p>My question is: what do I get with the platform tools? Is it just what goes in the platform-tools folder (i.e. the aapt.exe, adb.exe etc)? I don't want to overwrite the tools folder and end up with the slow emulator.</p>","440010","","","","","2011-02-03 11:05:27","Updating SDK 2.3 - what exactly are the SDK Platform tools?","<android>","1","0","","",""
"4885071","1","5990698","","2011-02-03 10:37:54","2","3559","<p>Oh.. i always have error in prepare (of mediarecorder). Error  tell me what prepare failedi can't record not audio, not video ((<br>/*</p><pre><code> ERROR/audio_input(34): unsupported parameter: x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value02-02 12:59:04.813: ERROR/audio_input(34): VerifyAndSetParameter failed</code></pre><p>*/this error what always i have ((( Please can anyone help me.. i realy need help. How to fix this. I tested many examples.. i watch many post's here - but nothing not help me. Guys - Help please :(((( Regards, Peter. p.s. sorry for my bad english - hope you understand me.</p><pre><code>02-02 12:59:04.623: DEBUG/dalvikvm(9334): GC_FOR_MALLOC freed 4 objects / 307296 bytes in 69ms02-02 12:59:04.813: ERROR/audio_input(34): unsupported parameter: x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value02-02 12:59:04.813: ERROR/audio_input(34): VerifyAndSetParameter failed02-02 12:59:04.833: ERROR/CameraInput(34): Unsupported parameter(x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value)02-02 12:59:04.833: ERROR/CameraInput(34): VerifiyAndSetParameter failed on parameter #002-02 12:59:04.873: WARN/AuthorDriver(34): Video encoding bit rate is set to 320000 bps02-02 12:59:04.933: INFO/MediaRecorderJNI(9334): prepare: surface=0x20fad8 (id=1)02-02 12:59:04.943: ERROR/PVOMXEncNode(34): PVMFOMXEncNode-Audio_AMRNB::DoPrepare(): Got Component OMX.PV.amrencnb handle 02-02 12:59:04.973: ERROR/CameraInput(34): Camera is not available02-02 12:59:04.973: ERROR/AuthorDriver(34): Command 13 completed with error -102-02 12:59:04.983: ERROR/MediaRecorder(9334): prepare failed: -102-02 12:59:06.273: DEBUG/dalvikvm(9334): GC_FOR_MALLOC freed 201 objects / 319048 bytes in 190ms</code></pre><p>yeah, sorry forgot about code  : code herefunction :</p><pre><code>private MediaRecorder mediaRecorder;    private File file = null;    static final String PREFIX = ""record"";    static final String EXTENSION = "".3gpp"";    private void startRecording() throws Exception {            mediaRecorder = new MediaRecorder();            mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);            mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);            mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);            if (file == null) {                File rootDir = Environment.getExternalStorageDirectory();                file = File.createTempFile(PREFIX, EXTENSION, rootDir);            }            mediaRecorder.setOutputFile(file.getAbsolutePath());            mediaRecorder.prepare();            mediaRecorder.start();            Log.i(""Start"",""RECORD STARTED"");        }</code></pre><p>so.. i never see message(""record started"") in logcat ((,if add videosurse and videoencode - i have error in IOException - prepare failed.  I always have erros  and can't find anything what can help me to solved this problem :( . I read more post's about it - and more guys have too problem.. but other guys - have not problem and all be ok.Now im try only record audio - my emulator is handsup, and in logcat i see only erros what i write before function code. :'(</p><p>oh.. android v 2.2 im programming in exclipse galileo</p><p>red colors of errors only here :</p><pre><code>02-03 13:36:22.783: ERROR/audio_input(34): unsupported parameter: x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value02-03 13:36:22.783: ERROR/audio_input(34): VerifyAndSetParameter failed02-03 13:36:23.004: ERROR/PVOMXEncNode(34): PVMFOMXEncNode-Audio_AMRNB::DoPrepare(): Got Component OMX.PV.amrencnb handle 02-03 13:36:23.073: ERROR/AudioFlinger(34): Error reading audio input</code></pre><p><strong>p.s. edited :</strong> After updating eclipse and android sdk (all patch's and other function which aviable for downloads. My camera on ""all"" emulators work perfectly . I can test record/capture photo/ just review on camera. One minus -  if bug with preview (green lines or other similar ) than this not showing in emulator. But  bugs with rotation ( when on preview all ok and than click on capture or record video we can see what our screen rotated on 90  degree) can be fixed. Hope it's help :)</p>","562592","","562592","","2011-07-28 09:12:32","2011-07-28 09:12:32","MediaRecorder : IOexception prepare failed error . Help me please","<java><android><media>","1","5","1","",""
"4885156","1","4885266","","2011-02-03 10:44:19","1","523","<p>I`m willing to start mobile programming ... I want to know where do I start, which language to use and where to find good tutorials.</p><p>Shall I work on Android platform, iPhone platform or Windows platform?</p>","348311","","309086","","2012-10-23 10:05:19","2012-10-23 10:05:19","Mobile Programming Basics","<android><iphone><windows-mobile>","5","8","1","2011-02-05 04:16:02",""
"4885213","1","4885388","","2011-02-03 10:50:04","1","706","<p>I have the following layout:</p><pre><code>&lt;AbsoluteLayout android:layout_width=""fill_parent""    android:id=""@+id/absoluteLayout1"" android:layout_height=""wrap_content""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;TextView android:layout_width=""fill_parent"" android:layout_x=""0dip""        android:id=""@+id/textView1"" android:layout_height=""wrap_content""        android:text=""Hello"" android:layout_y=""0dip""&gt;&lt;/TextView&gt;    &lt;ScrollView android:layout_x=""0dip"" android:layout_y=""100dip""        android:id=""@+id/ScrollView01"" android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:scrollbars=""vertical""&gt;        &lt;LinearLayout android:id=""@+id/LinearLayout01""            android:layout_width=""fill_parent"" android:layout_height=""fill_parent""            android:layout_weight=""0"" android:orientation=""vertical""            xmlns:android=""http://schemas.android.com/apk/res/android""&gt;        &lt;/LinearLayout&gt;    &lt;/ScrollView&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>And a short code:</p><pre><code>public class LayoutTest extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        LinearLayout  linerLayout=(LinearLayout)findViewById(R.id.LinearLayout01);        for (int i=1;i&lt;=20;i++) {            Button b=new Button(this);            b.setText(""Button ""+i);            linerLayout.addView(b,0);        }    }}</code></pre><p><strong>My problem is: I don't see the last two button what I generated!</strong> </p><p>I figured out this is because the ScrollView has an Y value in: android:layout_y=""100dip"".</p><p>The 100 pixels is exactly the same what I don't see.</p><p>If I put an empty view after the buttons with 100 pixels height:</p><pre><code>&lt;ScrollView android:layout_x=""0dip"" android:layout_y=""100dip""        android:id=""@+id/ScrollView01"" android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:scrollbars=""vertical""&gt;        &lt;LinearLayout android:id=""@+id/LinearLayout01""            android:layout_width=""fill_parent"" android:layout_height=""fill_parent""            android:layout_weight=""0"" android:orientation=""vertical""            xmlns:android=""http://schemas.android.com/apk/res/android""&gt;            &lt;TextView android:layout_width=""fill_parent"" android:text=""""                android:id=""@+id/TextViewGap"" android:layout_height=""100px""                android:background=""#ff0000""&gt;&lt;/TextView&gt;        &lt;/LinearLayout&gt;    &lt;/ScrollView&gt;</code></pre><p>then I see every button. If I set 101 pixels for the TextView then I see a red line at bottom of the screen.</p><p>My question is: why I don't see the full content of my ScrollView when it has an Y offset on an AbsoluteLayout?</p>","450313","","","","","2011-02-03 11:11:35","Partly missing content problem in ScrollView on an AbsoluteLayout","<android>","1","0","","",""
"4885307","1","4885525","","2011-02-03 11:02:15","0","1646","<p>I want to know if it's possible to do the following using an android device. </p><p>The user is on his android device browsing a site using the native browser. When the user clicks on an particular link or image; is it possible to get a unique ID from the phone? or write a file to the sd card on the phone? or any means of identifying the device later. </p><p>Later when I run a particular application I want to be able to access the information which was stored when the user browsing the website. </p><p>I know cookies are out because they allow me to access the information from another application.</p><p>help?</p>","311001","","","","","2011-12-31 06:09:46","how to recognizing the device from browser and retrieve unique id","<android><browser><native><uniqueidentifier>","1","0","","",""
"4885350","1","4885386","","2011-02-03 11:06:12","15","9056","<p>I am using following code to create an <code>AsyncTask</code>.</p><pre><code>public  class SaveFileToExternalStorage extends AsyncTask&lt;File, Void, Boolean&gt;{    protected Boolean doInBackground(File... file) {        DalCategories c= new  DalCategories();        boolean result  = c.saveObject(customlistobject,file[0]);        return result;        }    protected void onProgressUpdate() {               //setProgressPercent(progress[0]);     }     protected void onPostExecute(boolean result) {             //showDialog(""Downloaded "" + result + "" bytes"");      }}</code></pre><p>Now I want to pass it two parameters <code>customlistobject</code> and <code>File</code> objects with void progress and <code>boolean</code> return type.</p><p>I don't know how to pass that <code>customlistobject</code> to my <code>AsyncTask</code> along with the <code>File</code> object.</p>","249991","","418183","","2011-02-03 11:16:24","2011-02-03 11:23:12","How to pass different objects as a parameter to AsycTask?","<android><android-asynctask>","3","0","3","",""
"4885358","1","","","2011-02-03 11:07:27","2","3927","<p>hey folks, i need your help againwell i have build the map application and is running perfectly, now i want to view my current location in that map. How to go about it? plz suggest</p>","576605","","","","","2011-06-09 12:03:59","Gps coordinates on google map","<android>","2","0","","",""
"4885446","1","","","2011-02-03 11:16:54","1","451","<p>I would like to overlay geolocalized photos over the camera input of a mobile device. The photos should be placed as accurately as possible over the corresponding location, by modifying its size, tilt and rotation.</p><p>Can this be done on iPhone/Android or is the technology not there yet? If the former, are there any frameworks or examples that can be used as a head start?</p>","143378","","","","","2011-02-03 18:10:05","Placing augmented reality photos on mobiles","<iphone><android><image><camera><augmented-reality>","2","0","1","",""
"4885469","1","4886227","","2011-02-03 11:20:12","3","9476","<p>I'm trying to put different images (.jpg , .png) dynamically into a <code>ListView</code>  from r<code>es/drawable</code> .The names from the images I get from a database.The images themselves are in the <code>res/drawable</code> folder.</p><p>This is what I already have, With an error of :D</p><p>String imgName;  --> There are the img names I need from the database</p><pre><code>Drawable drawable;        drawable = Class.appContext.getResources().getDrawable(Class.appContext.getResources().getIdentifier(""com.example.test:drawable/""+imgName,null,null));  </code></pre><p>Then I get this into a <code>ArrayList</code> for every image in the database(+- 200 images):</p><pre><code>ArrayList&lt;HashMap&lt;String, Object&gt;&gt; list = new ArrayList&lt;HashMap&lt;String, Object&gt;&gt;();HashMap&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();map = new HashMap&lt;String, Object&gt;();map.put(""img"",drawable);          map.put(""text"", ""some text"");          list.add(map);</code></pre><p>Now I RETURN list;</p><p>In the Class where I call :</p><pre><code>listReceive = Class.getImages(appContext); listSetup = new SimpleAdapter(this, listReceive, R.layout.row,                        new String[] {""img"", ""text""}, new int[] {R.id.IMG_CELL, R.id.TEXT_CELL});                lvList.setAdapter(listSetup);</code></pre><p>XML row is an <code>ImageView</code> and a <code>TextView</code>.</p><blockquote>  <p>System.out :resolveUri failed on bad  bitmap uri:  android.drawable.bitmapDrawable@405739  resolveUri failed on bad bitmap uri:  android.drawable.bitmapDrawable@405639  resolveUri failed on bad bitmap uri:  android.drawable.bitmapDrawable@405959  resolveUri failed on bad bitmap uri:  android.drawable.bitmapDrawable@405677...  ... ...</p></blockquote><p>I got it working when I saved images into local or SDcard memory, and then put the path inside the arraylist like: </p><pre><code>map.put(""img"",""/data/data/com.example.test/images/"" + imgName);</code></pre><p>I can't use this because then i will need to copy the pictures from <code>res/drawable</code> onto local or SD.This takes up 2 times the memory. can't have that of.</p><p>There must be a way to get images dynamically from the drawable.</p><p>Any one knows what I'm missing here?Thanks.</p>","601302","","457982","","2011-02-03 11:34:28","2013-08-09 14:09:50","Dynamically show images from resource/drawable","<android><listview><uri><dynamic><drawable>","3","0","3","",""
"4885486","1","4885531","","2011-02-03 11:21:46","0","129","<p>I am developing an android application in which i have to add 25 images to imageview in android..Can anybody tell how should i pursue</p><p>Thanks in advanceTushar</p>","475349","","","","","2011-02-03 11:26:04","placing 25 images in view in android","<android>","1","2","1","",""
"4885496","1","5076354","","2011-02-03 11:22:10","0","484","<p>For running my application in emulator, is it possible to increase the rom size for emulator?</p>","504162","","","","","2011-02-22 09:31:47","can we increase the emulator's rom size for loading large applications","<android><android-emulator>","1","0","1","",""
"4885556","1","4885845","","2011-02-03 11:29:45","0","90","<p>At the moment I have just targeted my UI graphics for the hdpi resolutions for android and this works flawlessly, the graphics are designed with 3 resolutions in mind with only the background image being altered really. Problem is the plan was to use the same images for hdpi (480x800 and 480x854) and  as well as mdpi (320x480). But when I test it for mdpi with the images in both the -hdpi and copied into -mdpi it doesn't scale them down, do I have to resize all the images and have them duplicated for the mdpi screens?</p><p>Sorry if this is not very eloquent it is the first time I have done any UI design for android and still don't understand it properly.</p>","400406","","","","","2011-02-03 11:59:34","Having trouble getting my head around UI Graphics android","<java><android><gui>","1","0","","",""
"4885576","1","4885591","","2011-02-03 11:32:05","2","211","<p>I have a listview to which i attach data using an Array adapter.But when i scroll, i find the edges to be dark.</p><p>Why is this happening and how to stop it.Any help please!!</p>","598406","","","","","2011-02-03 11:37:54","List shows black colour","<android><listview>","3","0","1","",""
"4885578","1","4885689","","2011-02-03 11:32:51","3","4713","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3287518/reliable-and-fast-fft-in-java"">Reliable and fast FFT in Java</a>  </p></blockquote><p>i want to implement a fast fourier transformation calculation in java. Is there any library in java to do calculation in fourier transform and i also want to know about the audio libraries in java.</p>","596364","","","","","2011-02-03 11:43:26","Fast Fourier transformation in Java","<java><android><fft>","1","0","2","2011-02-03 23:39:11",""
"4885620","1","4885663","","2011-02-03 11:37:42","66","52017","<p>I'm trying to force the ""portrait"" mode for my application because my application is absolutely not designed for the ""landscape"" mode.</p><p>After reading some forums, I added these lines in my manifest file:</p><pre><code>&lt;application   android:debuggable=""true""  android:icon=""@drawable/icon""   android:label=""@string/app_name""  android:screenOrientation=""portrait""&gt;</code></pre><p>But it doesn't work on my device (HTC Desire). It switches from ""portrait"" lo ""landscape"", ignoring the lines from the manifest file.</p><p>After more forums reading, I tried to add this in my manifest file:</p><pre><code>&lt;application   android:debuggable=""true""  android:icon=""@drawable/icon""   android:label=""@string/app_name""  android:configChanges=""orientation""         android:screenOrientation=""portrait""&gt;</code></pre><p>and this function in my activity class:</p><pre><code>public void onConfigurationChanged(Configuration newConfig){    super.onConfigurationChanged(newConfig);    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);}</code></pre><p>But again, no luck. So, anybody has an idea?</p><p>Thanks in advance!</p>","544659","","3471286","","2014-04-20 03:22:50","2014-04-20 03:22:50","Force ""portrait"" orientation mode","<android><screen><orientation><landscape><portrait>","5","0","11","",""
"4885707","1","4885761","","2011-02-03 11:45:12","1","1242","<p>I'm really stuck with one problem. I'm developing one application which will support multiple screens. I have created three layouts(large,small,medium). I'm testing it. I have two screens sign in and sign up. In sign in it is working fine. But when I click on sign up button then I go to sign up page and if I'm in portrait mode and changes the mode the app gets crashed and there is no something like crash report in the logcat as well.</p><p>Please, help me in this case.</p><p>Thanks.</p>","383597","","473070","","2011-02-03 11:50:45","2011-02-03 12:22:09","Android orientation problem","<android><onconfigurationchanged>","4","0","1","",""
"4885791","1","4886139","","2011-02-03 11:53:18","0","91","<p>I have developed a database class which contains the utility methods like</p><p>1>Create a database</p><p>2>Create a table</p><p>3>Insert values into the table , etc</p><p>sample code</p><p><strong>(Creating the table):</strong></p><pre><code>public void createTable(String createStmt, SQLiteDatabase sqlDB) {        try {            this.createStmt = createStmt;            this.sqlDB = sqlDB;            this.sqlDB.execSQL(createStmt);        } catch (Exception e) {        }    }</code></pre><p><strong>(Deleting the table)</strong></p><pre><code>public void deleteTable(String tableName) throws SQLiteException {        this.tableName = tableName;        this.sqlDB.execSQL(""DELETE FROM "" + tableName);                + tableName + ""'"");    }</code></pre><p>I am aware of the abstract class SQLiteOpenHelper  whose abstract methods like onCreate() &amp; onUpgrade needs to be overriden .I am calling my utility methods to createTable , insertTable &amp; deleteTable from the UI code.</p><p>My question:</p><p>i> Is it necessary to extend the SQLiteOpenHelper ...it will be helpful for Upgrade ? ii> Will extending the SQLiteOpenHelper &amp; then add my own utlity methods to the the class which extends SQliteOpenHelper be a good approach.</p><p>Kindly provide your inputs.</p><p>Warm Regards,</p><p>CB </p>","443141","","180538","","2011-02-03 12:29:55","2011-02-03 12:29:55","Question related to SQLite","<android><database><sqlite>","1","2","","",""
"4885930","1","4886715","","2011-02-03 12:07:35","0","395","<p>I'm playing with android and trying to receive file (pdf book). To do this I wrote Servelt that encode the book into base64 string and put it in the XML document. That document contains name, author and IBSN fields also. I successfully receve it. In case of a small book I can even decode it and open. But if the size is more than 2mb I get OutOfMeoryError.My parser code is:</p><pre><code>public void characters(char[] ch, int start, int length)        throws SAXException {    if(builder==null) builder = new StringBuilder();        builder.append(new String(ch, start, length));</code></pre><p>Then I do the following:</p><pre><code>fos = new FileOutputStream(Environment.getExternalStorageDirectory().toString()+""/book.pdf"", false);            byte[] toWrite = Base64.decode(builder.toString(), Base64.DEFAULT);            fos.write(toWrite);            fos.flush();            fos.close();</code></pre><p>Does anybody know how can I parse it wothout error? I've tried to parse it in characters method (I mean using small buffer) but it fails... Illegal base 64 string.</p>","577841","","","","","2011-02-03 13:31:11","android: parse big portion of data","<android><xml><parsing><base64><sax>","1","0","","",""
"4886034","1","4886120","","2011-02-03 12:16:56","1","576","<p>I have an Android app that deals with GPS data. When a user starts it, it offers to turn on the GPS. </p><p>Is it smart (or is it bad) if I code the app to automatically <strong>turn off</strong> the GPS when a user closes the app? </p><p>What about automatically turning off Wi-Fi or Bluetooth?</p>","437039","","","","","2011-02-03 12:26:50","Is it smart to switch off bt/gps/wifi on app exit?","<android><bluetooth><gps><wifi>","2","0","","",""
"4886056","1","4886931","","2011-02-03 12:19:18","3","1844","<p>I am working with WebView on android and can't seem to figure out how to make that orange highlight that appears in the stock browser to appear on my webview.</p><p>To make it clearer let me give you an example.</p><p>When in android browser if you click on a link/image/video it'll show you a orange colored rectangle overlayed over that object. But when i try the same with my webview it does not show anything and goes onto loading that link</p>","388044","","","","","2011-05-12 13:02:38","Android:Webview with link highlight","<android><webview>","2","0","3","",""
"4886072","1","","","2011-02-03 12:21:21","2","213","<p>I'm trying to implement Google Analytics in my app, and I want to register some events. The label is dynamic, and some of the content has parentheses in their titles. When I check the <code>Event Tracking</code>, it shows up like this: </p><pre><code>""Event Label (Something something""</code></pre><p>When it's supposed to be:</p><pre><code>""Event label (Something something) something else""</code></pre><p>I tried url-encoding it, but of course that makes it show up as:</p><pre><code>""Event+label+%28Something+something%29+something+else""</code></pre><p>Is it possible to get parentheses to show correctly?</p>","397060","","881286","","2013-08-18 02:00:29","2013-08-18 02:00:29","Google Analytics Android SDK event labels don't support end parenthesis?","<android><google-analytics><parentheses>","0","5","","",""
"4886093","1","4886347","","2011-02-03 12:23:57","10","7971","<p>I have custom adapter in which i inflate layout.In adapter i try to change some text value in <strong>TextView</strong> (<em>@id/datetextcal</em>)</p><pre><code>LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);            cellView = inflater.inflate(R.layout.calendarcell, null);         TextView dateText = (TextView) cellView.findViewById(R.id.datetextcal);             dateText.setText(position);</code></pre><p>I think that's all right but i have an error! why ?</p><p>Without modify this value all compiles and work correct.</p><p>code for layout(<em>R.layout.calendarcell</em>):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    android:background=""@drawable/cell""    android:orientation=""vertical""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""40dp""    android:layout_height=""40dp""&gt;    &lt;RelativeLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:gravity=""center_vertical""&gt;        &lt;TextView            android:id=""@+id/datetextcal""            android:text=""2""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" /&gt;        &lt;ImageView            android:layout_alignRight=""@id/datetextcal""            android:paddingRight=""2dp""            android:src=""@drawable/dropper""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" /&gt;    &lt;/RelativeLayout&gt;    &lt;TextView        android:gravity=""center_horizontal""        android:textSize=""9dp""        android:text=""???????""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>code for adapter class:</p><pre><code>package com.android.wcalendar;import java.util.Date;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.TextView;public class ImageAdapter extends BaseAdapter{    private static final String TAG = ""trace"";    private Context             mContext;    public ImageAdapter(Context c)    {        // TODO Auto-generated constructor stub        mContext = c;    }    @Override    public int getCount()    {        // TODO Auto-generated method stub        return 7 * 5;    }    @Override    public Object getItem(int arg0)    {        // TODO Auto-generated method stub        return null;    }    @Override    public long getItemId(int arg0)    {        // TODO Auto-generated method stub        return 0;    }    @Override    // create a new ImageView for each item referenced by the Adapter    public View getView(int position, View convertView, ViewGroup parent)    {        View cellView = convertView;        if (cellView == null)        { // if it's not recycled, initialize some attributes            cellView = new View(mContext);            Log.d(TAG, ""cellView null"");        } else        {            Log.d(TAG, ""cellView not null"");            cellView = (View) convertView;        }        LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        cellView = inflater.inflate(R.layout.calendarcell, null);        // Date date = new Date();        // date.setDate(position);         TextView dateText = (TextView)         cellView.findViewById(R.id.datetextcal);         dateText.setText(position);        return cellView;    }}</code></pre><p>and that errors :</p><pre><code>02-03 11:58:45.774: ERROR/AndroidRuntime(286): Uncaught handler: thread main exiting due to uncaught exception02-03 11:58:45.845: ERROR/AndroidRuntime(286): android.content.res.Resources$NotFoundException: String resource ID #0x002-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.content.res.Resources.getText(Resources.java:200)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.TextView.setText(TextView.java:2813)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at com.android.wcalendar.ImageAdapter.getView(ImageAdapter.java:67)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.AbsListView.obtainView(AbsListView.java:1274)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.GridView.onMeasure(GridView.java:934)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.View.measure(View.java:7964)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:350)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.View.measure(View.java:7964)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:619)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:280)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.View.measure(View.java:7964)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.View.measure(View.java:7964)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.View.measure(View.java:7964)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.View.measure(View.java:7964)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:350)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.View.measure(View.java:7964)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.View.measure(View.java:7964)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.View.measure(View.java:7964)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.View.measure(View.java:7964)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.View.measure(View.java:7964)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.ViewRoot.performTraversals(ViewRoot.java:763)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.os.Handler.dispatchMessage(Handler.java:99)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.os.Looper.loop(Looper.java:123)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at android.app.ActivityThread.main(ActivityThread.java:4363)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at java.lang.reflect.Method.invokeNative(Native Method)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at java.lang.reflect.Method.invoke(Method.java:521)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-03 11:58:45.845: ERROR/AndroidRuntime(286):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","273106","","","","","2012-10-08 20:59:10","Change text value in inflate layout","<android><inflate>","1","0","1","",""
"4886135","1","","","2011-02-03 12:28:08","0","845","<p>I'm trying to add foreground gradient on HorizontallScrollView. Everything works fine but after scroll gradient moves with layout. Here are screenshots of this issue:After appliaction start: <a href=""http://img819.imageshack.us/img819/6622/horizontalscroll.jpg"" rel=""nofollow"">http://img819.imageshack.us/img819/6622/horizontalscroll.jpg</a>and after scrolling: <a href=""http://img709.imageshack.us/img709/388/horizontalscroll2.jpg"" rel=""nofollow"">http://img709.imageshack.us/img709/388/horizontalscroll2.jpg</a></p><p>Main layout in xml:</p><pre><code>&lt;RelativeLayout android:id=""@+id/RelativeLayout01"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""android:background=""@layout/backgroundgradient""&gt;&lt;include layout=""@layout/header"" /&gt;&lt;HorizontalScrollView android:id=""@+id/ScrollView1""                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                    android:scrollbars=""none""                    android:foreground=""@layout/scrollforegrad""                    android:background=""@layout/scrollbgrgrad""                    android:layout_below=""@id/LayoutHeader""                    &gt;                    &lt;LinearLayout                        android:id=""@+id/ThemeContainer""                        android:orientation=""horizontal""                        android:layout_width=""fill_parent""                        android:layout_height=""fill_parent""                        /&gt;&lt;/HorizontalScrollView&gt;</code></pre><p>And gradient xml:</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/mainForegroundGrad""&gt;    &lt;gradient         android:startColor=""@color/scrollForegroundSide""        android:centerColor=""@color/scrollForegroundCenter""        android:endColor=""@color/scrollForegroundSide""        android:angle=""0""     /&gt;    &lt;corners android:radius=""0dp"" /&gt;&lt;/shape&gt;</code></pre><p>If someone had such problem or know how to solve it please share :)Thanks in advance.</p>","598370","","","","","2011-02-03 15:07:13","Foreground on HorizontalScrollView","<android><android-layout><horizontalscrollview>","1","0","","",""
"4886152","1","4886200","","2011-02-03 12:29:39","1","334","<p>What are the diffrent kinds of data that can be passed from an activity to another?</p>","598406","","","","","2011-02-03 15:08:47","Sending data from one activity to the other","<android><android-intent>","3","1","1","",""
"4886177","1","","","2011-02-03 12:32:13","0","376","<p>I am having a problem to get a respond from my webservice. I have something like this:</p><pre><code>&lt;AuthenticateUser xmlns=""http://whatever""&gt;  &lt;request&gt;    &lt;Username&gt;string&lt;/Username&gt;    &lt;Password&gt;string&lt;/Password&gt;    &lt;Partner&gt;string&lt;/Partner&gt;  &lt;/request&gt; &lt;/AuthenticateUser&gt;</code></pre><p>I don't know how to add those tree parameters to object<code>&lt;request&gt;</code></p><p>Anybody can help?</p>","601475","","","","","2012-11-16 18:42:06","Android ksoap2 adding object into object","<java><android><xml><ksoap2>","1","1","","",""
"4886211","1","4886498","","2011-02-03 12:34:56","0","2351","<p>I have saved a transparent PNG image in the SD card. I want to display is now. I was using the follwing code for that.</p><pre><code>selected_photo = (ImageView) findViewById(R.id.selected_photo);Uri photoUri = Uri.parse(photoPath);                        selected_photo.setImageBitmap(MediaStore.Images.Media.getBitmap(getContentResolver(),photoUri));</code></pre><p>But it is giving a not transparent image in display. How to display the PNG image without loosing the transparency?</p>","525004","","","","","2011-02-03 13:05:09","PNG image display from SD card of Android","<android><image><png><transparency><sd-card>","1","0","0","",""
"4886358","1","5937180","","2011-02-03 12:50:42","0","1756","<p>Below is my Code For the TabView Activity. Any one have idea how to set TextColor in the my SetIndicator view for TabView?</p><pre><code>public class TabView 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();        TabHost tabhost=getTabHost();        TabHost.TabSpec restab;        Intent intent;        intent=new Intent().setClass(this, Home.class);        restab=tabhost.newTabSpec(""Home"").setIndicator(""Home"",res.getDrawable(R.drawable.home)).setContent(intent);        tabhost.addTab(restab);        intent=new Intent().setClass(this, Search.class);        restab=tabhost.newTabSpec(""Search"").setIndicator(""Search"",res.getDrawable(R.drawable.search_icon1)).setContent(intent);        tabhost.addTab(restab);        intent=new Intent().setClass(this, Back.class);        restab=tabhost.newTabSpec(""Back"").setIndicator(""Back"",res.getDrawable(R.drawable.back_icon)).setContent(intent);        tabhost.addTab(restab);       for(int i=0;i&lt;tabhost.getTabWidget().getChildCount();i++)       {           tabhost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor(""#CCCCCC""));       }    }}</code></pre>","596725","","12950","","2011-02-03 12:57:13","2013-01-29 06:20:24","How do I set the text color in the SetIndicator view?","<android><tabview>","1","0","","",""
"4886365","1","4886446","","2011-02-03 12:51:13","3","4278","<p>i am creating app. that contains voice Recording and playing. is it possible to get recorded file in MP3 format? because of some reason i need output file as mp3 format. </p><p>Any help?</p><p>Thanks..</p>","472882","","","","","2014-01-05 08:50:53","Android:How To Get Media Recorder Output In MP3 Format?","<android>","2","2","","",""
"4886416","1","","","2011-02-03 12:56:14","0","961","<p>I have written code to go to next view by selecting the perticular item in the list.list contains many items I want to show differnt textview on differnt Item selection.I have a problem regarding the following code..</p><pre><code>listview.setOnItemClickListener(new OnItemClickListener(){      @Override    public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {    temp=a.getItemAtPosition(position).toString();           if (temp==""Aries"")        {             ViewFlipper  viewflipper= (ViewFlipper) findViewById(R.id.viewflipper);                TextView text = (TextView) v.findViewById(R.id.item1);                viewflipper.showNext();        }        if (temp==""Taurus"")        {             ViewFlipper  viewflipper= (ViewFlipper) findViewById(R.id.viewflipper);             viewflipper.showNext();            TextView text = (TextView) v.findViewById(R.id.item2);           } </code></pre><p>xml is..</p><pre><code>&lt;AbsoluteLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;&lt;ViewFlipper android:id=""@+id/viewflipper""     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""     /&gt;   &lt;TextView        android:id=""@+id/item1""        android:background=""@drawable/aries28""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:text=""This is for me""     /&gt;   &lt;TextView        android:id=""@+id/item2""        android:background=""@drawable/t28""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:text=""This is for you""     /&gt; &lt;/ViewFlipper&gt; &lt;/AbsoluteLayout&gt;</code></pre><p>However, when I run this code it is showing same textview in the next view for both the items, i.e. it is showing same thing(""This is for Me""). How can I solve this problem?</p><p>Thanks in advance..  </p>","392406","","12950","","2011-02-03 13:00:14","2011-02-03 13:18:45","how to go to next view of particular item in listview using view flipper","<java><android>","1","0","","",""
"4886449","1","4887455","","2011-02-03 13:00:27","3","131","<p>I'm using the Facebook SDK with Android.  With single sign on, the authentication always expires after only 24 hours. Is there any way to extend this time?  </p><p>I started with their example app, and haven't changed anything related to authentication, except to add a couple of permissions.</p>","506796","","","","","2011-02-03 14:38:43","Can you authenticate with Facebook for more than 24 hours?","<android><facebook><facebook-graph-api>","1","0","","",""
"4886451","1","4887336","","2011-02-03 13:00:35","1","995","<p>Quite simply, I'm looking to make a daily SMS service. More specifically: Once every day -> Connect to the Internet -> Get the text to be sent out + Recipients -> Send(Perhaps scheduled) -> Connect to the Internet with success/failure info.</p><p>A windows SMS gateway solution is simply too expensive as other than the SMS gateway license you have to have a computer running all day, licenses and so on. </p><p>I have a couple of questions regarding this:</p><ul><li><p>1) Is it possible to have a appconnect to the web and get the dataneeded without user interactionperhaps with some notification(If theuser cancels, fine, if not it goesahead)?</p></li><li><p>2) Is it possible to send SMS'swithout user interaction?</p></li></ul><p>Would just like to know if it's possible with the current API before I start for real on trying this out. </p><p>The reason for the andriod app is that it can then be used in a number of countries, where they all just get the data needed from my website database/txt file and send to their local country.</p>","601529","","601529","","2011-02-03 13:15:22","2011-02-03 14:27:25","Automated Daily SMS service(Data from Internet) - Android phone","<android>","1","0","1","",""
"4886469","1","4886712","","2011-02-03 13:01:58","0","2683","<p>I'm extending <code>PreferenceActivity</code> for my settings screen. In this preference activity i have a couple of preferences one of which is custom made. The problem is as follows:</p><p>in this custom preference (which extends from <code>ListPreference</code>) i want to be able to set the default value, so i override the <code>setDefaultValue()</code> method. In this method i do some parsing so it'll take the correct value. When i'm trying to read this value with the <code>getValue()</code> function it just returns <code>null</code>. </p><p>So i figured, what happens when i just put some hardcoded value in there (you know, maybe i did something wrong, wouldn't be the first time). Well, i still get <code>null</code> back.</p><p>Any ideas what i'm doing wrong?  </p><p><strong>Edit:</strong><br>Setting the defaultValue in the xml file isn't really an option because the values aren't known until i retrieve them.</p><p>I made a workaround:</p><ul><li>When app is started for the first time: get data</li><li>Set the values in the preference.</li></ul><p>This way i set the default preference when i'm collection the data</p>","571088","","963396","","2013-01-04 17:46:25","2013-06-13 09:33:17","Calling setDefaultValue() on a custom Preference class does not set the default value. Why?","<android><android-preferences><preferenceactivity><preference><listpreference>","4","2","","",""
"4886482","1","","","2011-02-03 13:03:59","4","2202","<p>I am loading an image from the assets folder to draw on a google map view as an overlay. In my try-catch statement, I attempt to load the image, otherwise return null.</p><p>What i don't understand is, upon stepping through the code time and time again, it gets to the load line and fails, thus returning null, but for some reason, despite returning a null image, the image is actually correctly loaded and drawing...?? </p><p>If i run the program normally, it loads the image and displays it correctly as it should but the function is still returning a null bitmap everytime. Have i missed something here?</p><p>Here is the code I am using to load the image:</p><pre><code>BitmapFactory.decodeStream(myActivity.getAssets().open(""squirrel.jpg""));</code></pre><p>Edit: I tried another random image, this time a .png and it is still doing the same thing but still loaded and drawing correctly.</p>","601327","","256196","","2011-09-16 10:12:23","2011-10-03 14:52:32","Android - Drawing an image from assets, something weird is happening","<java><android><image><null><drawing>","1","4","","",""
"4886521","1","4886586","","2011-02-03 13:09:16","0","2404","<p>My program needs large .txt file to be stored on SD-card (so, I want to redistribute it with .apk, without creation from the program). How I can attach the file (created on PC) to .apk?</p>","497132","","","","","2013-03-21 20:07:37","Adding file to .apk","<android><resources><apk>","3","0","","",""
"4886532","1","5045754","","2011-02-03 13:10:04","0","1361","<p>Anyone know how to using it for mediarecorder ?im using </p><p>recorder.setPreviewDisplay(holder.getSurface)  where holder - it's camera ( i see chest rectangle on my screen of phone) When i runn my app - in logcat i see error  (camera is not aviable) im try to using function setCamera - but it's not help me. Anyone know how to right use it ? </p><p>or maybe  i can record video(only video, without audio) some other way?</p><p>ok SOLVED  </p><p>this code for example</p><pre><code>mediaRecorder = new MediaRecorder();        camera.unlock();        mediaRecorder.setCamera(camera);</code></pre>","562592","","213269","","2011-08-12 09:14:01","2011-08-12 09:14:01","MediaRecorder: setCamera() - error camera is not aviable","<java><android><camera><mediarecorder>","1","0","1","",""
"4886557","1","","","2011-02-03 13:13:58","1","381","<p>I need to find out the Launcher activity in my own Application class and check whether if it was running . What should I do?</p>","238061","","","","","2012-12-13 23:47:29","How to find the launcher activity","<android>","1","1","0","",""
"4886629","1","4920081","","2011-02-03 13:21:36","1","168","<p>I don't get it.</p><p>I have two activities in which i parse an XML-file dat is located in the private data directory of my app.</p><p>I use this method to parse my XML file:</p><pre><code>File file = new File(getFilesDir() + ""/autopech.xml"");        if (file.exists() == true) {            DocumentBuilder builder2 = DocumentBuilderFactory.newInstance().newDocumentBuilder();            Document doc2 = builder2.parse(new FileInputStream(file));            NodeList nl2 = doc2.getElementsByTagName(""verzekeraar"");            for (int i = 0; i &lt; nl2.getLength(); i++) {                Node node = nl2.item(i);                Bank bnk = new Bank();                bnk.setNaam(Xml.innerHtml(Xml.getChildByTagName(node, ""naam"")));                bnk.setTel(Xml.innerHtml(Xml.getChildByTagName(node, ""tel"")));                lijst.add(bnk);            }        }</code></pre><p>This method works in 1 activity, but throws me an <code>02-03 14:18:10.047: WARN/System.err(8221): org.xml.sax.SAXParseException: Unexpected end of document</code>at this line: <code>Document doc2 = builder2.parse(new FileInputStream(file));</code></p><p>I really don't get it. It's EXACT the same.</p>","517460","","","","","2011-02-07 10:15:46","DOM parsing works in one Activity, but not in another with the same code?","<java><android><xml><parsing><dom>","1","0","","",""
"4886633","1","","","2011-02-03 13:21:56","0","224","<p>Can we invoke a application from one android in another android device using bluetooth.If so what is the procedure ???</p>","418271","","","","","2011-02-04 01:29:08","Application invoking using bluetooth","<android><bluetooth>","1","1","","",""
"4886833","1","","","2011-02-03 13:42:57","4","3618","<p>Does anyone know how to configure an Android device (tablet) to appear as a USB HID device when connected to a PC?Is there any other way of getting data from the tablet to the PC (via USB) other than writing it to a file, and have the PC retrieve the (updated) file from the tablet which is acting as a 'mass storage device' for the PC?Can USB carry a TCP/IP end-end connection?Using a tablet as a high-end intelligent 'keyboard' or 'mouse' or similar device would be immensely powerful, and open up lots of possibilities. Controlling a model railway layout is the end I have in mind.Thanks</p>","601587","","601587","","2011-02-03 14:41:12","2012-12-06 21:33:06","Android USB HID Device","<android><usb><hid><emulate>","2","1","5","",""
"4886858","1","4887323","","2011-02-03 13:45:12","16","17746","<p>how can I detect delete(backspace) key event for a editText? I've tried using TextWatcher, but when the editText is empty, when I press delete key, nothing happens. I want to detect delete key press foe an editText even if it has no text. Thanks</p>","517558","","","","","2014-04-08 18:22:03","android EditText delete(backspace) key event","<android><events><delete><key><edittext>","4","0","11","",""
"4886904","1","4887105","","2011-02-03 13:48:59","2","722","<p>I am working on an Android class that contains an ArrayList of generic objects.  I am looking to fire an event in this class whenever an element of said ArrayList is modified.</p><p>In an ideal world, the ArrayList itself should be a private member, and the class would contain the public methods to add/update/delete an element and everything would be all fine and dandy.  </p><p>Unfortunately, the ArrayList is exposed as a public member, so it and its elements are being modified all over the place (application).  Without rewriting a boat load of code and/or going on a wild goose chase in the code, I am hoping I can find way to trigger an event when ArrayList is modified in the class containing the list.  Any ideas?</p>","163757","","","","","2011-02-03 14:18:50","Fire Event When ArrayList Element Modified","<android><events>","1","0","","",""
"4886991","1","","","2011-02-03 13:56:11","0","756","<p>I want to handle ACTION_CAMERA_BUTTON using broadcast receiver. I have added the following in androidmanifest file</p><pre><code>&lt;receiver android:name=""MappedKeysIntentReceiver""&gt;        &lt;intent-filter android:priority = ""999""&gt;            &lt;action android:name=""android.intent.action.ACTION_CAMERA_BUTTON"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;</code></pre><p>But I dont get the broadcast on pressing the camera button, how ever if I register manually then I am receiving the event. Could anyone throw some light on this behavior. I want the receiver to be specified in manifest file instead of registering it manuayyly. I have tried it on lg optimus gt540 and Milestone both are running 2.1 android os.</p><p>Thanks</p>","601614","","","","","2011-05-07 01:00:15","Not receiving ACTION_CAMERA_BUTTON broadcast event","<android>","1","0","","",""
"4887071","1","","","2011-02-03 14:03:29","0","242","<p>Hey, after i get the starting: intent line in my console there now is a new line:</p><pre><code>[2011-02-03 15:00:34 - Versuch] ActivityManager: [1]   Killed                  am start -n vers...</code></pre><p>i guess i killed something, but what did i kill and how?</p><p>my 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=""versuch.datenbank""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".projectshome""                  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.action.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name="".projects""/&gt;        &lt;activity android:name="".Projects_New""/&gt;    &lt;/application&gt;&lt;/manifest&gt;</code></pre><p>main activity, the one that's started first...</p><pre><code>public class projectshome extends Activity {SQLiteDatabase myDB = null; final static String MY_DB_NAME = ""Projects-Database"";final static String MY_DB_TABLE = ""projects"";static final int MENU_PROJECTS = 1;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    onCreateDBAndDBTabled(); //DB und Tables erstellen wenn noch nicht vorhanden    setContentView(R.layout.main);}private void onCreateDBAndDBTabled() {    myDB = this.openOrCreateDatabase(MY_DB_NAME, MODE_PRIVATE, null);    myDB.execSQL(""CREATE TABLE IF NOT EXISTS "" + MY_DB_TABLE                + "" (_id integer primary key autoincrement,""+                       ""Name varchar(100),""+                       ""Comment varchar(128),""+                       ""BookingDetails varchar(255),""+                       ""CustomerProject integer(3),""+                       ""editable integer(3))""                +"";"");    }public boolean onCreateOptionsMenu(Menu menu) {      super.onCreateOptionsMenu(menu);        menu.add(0, MENU_PROJECTS, 0, R.string.menuProjects)        .setShortcut('1', 'f')        .setIcon(R.drawable.icon);         return true;      }public boolean onOptionsItemSelected(MenuItem item){      switch (item.getItemId()) {      case MENU_PROJECTS:        Intent iProjects = new Intent(this, projects.class);        startActivity(iProjects);        return true;      }      return false;    }</code></pre><p>}</p>","582674","","582674","","2011-02-03 14:19:55","2011-02-03 15:21:35","Error in the console after starting: intent","<android><console>","2","1","","",""
"4887164","1","","","2011-02-03 14:10:42","1","287","<p>I am trying to find a way to give a user the possibility to switch between different color schemes (that includes different colors and images). All schemes are predifined, i.e. compiled and located inside the app. As I can see, for drawables I can do this by using level-list where each level corresponds to one scheme. But what about colors? Is there any way to do the same for colors? Or maybe there is a better way to implement color schemes switching?</p>","187186","","","","","2011-11-09 09:26:15","It there any analog of level-list for colors on Android?","<android><skinning>","2","0","","",""
"4887267","1","4902752","","2011-02-03 14:20:03","2","1084","<p>Hey everyone,I'm working an app that includes a webbrowser inside.I've done quite some progress with getting the webview widget to work as necessary, but this thing really puzzles me.</p><p>I can't get the webview to forget my google account, even with deleting cache and history, it still remembers it. Which is really annoying since the application will be used by many users on a single device.</p><p>Any help very much appreciated</p>","567370","","","","","2011-02-04 20:46:43","Android webview and google acount?","<android><webview>","2","0","","",""
"4887284","1","4894149","","2011-02-03 14:21:37","1","710","<p>I'm looking in to creating a game through the NDK using a <code>NativeApplication</code> for Gingerbread. I also want to be able to use the new in-app billing API Google is providing to developers though. I know it's not a finalized API just yet but I haven't seen an example of interacting with it through the NDK. </p><p>Does anyone have an idea of how it could be possible to use the in-app billing through the NDK or should I look into launching another Activity that uses the Java API?</p>","523156","","186035","","2011-02-04 02:59:05","2011-02-04 03:01:36","Will in-app billing be available through the NDK?","<android><android-ndk><google-play><billing>","1","2","2","",""
"4887297","1","4887408","","2011-02-03 14:22:53","1","17071","<p>I am able to load a resource image, from drawable folder, into a bitmap and even scale fine, however now I have a need to load an image from any stored on the SD-Card and I can see this will allow me to view and select;</p><pre><code>    startActivityForResult(new Intent(Intent.ACTION_PICK,         android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI), 1);</code></pre><p>However so far I have been unable to find out exactly what data is returned and how to load it into a bitmap.</p><p>UPDATED:</p><p>This is now what I got;</p><pre><code>@Overrideprotected void onActivityResult(int requestCode, int resultCode,            Intent intent) {  super.onActivityResult(requestCode, resultCode, intent);if (resultCode == RESULT_OK) {    Uri contentURI =  Uri.parse(intent.getDataString());    c = mSurfaceHolder.lockCanvas();    tempCanvas.setBitmap(mDrawing);    Bitmap tempBitmap = null;    ContentResolver cr = getContentResolver();    try {                 InputStream in = cr.openInputStream(contentURI);      BitmapFactory.Options options = new BitmapFactory.Options();      options.inSampleSize=8;      tempBitmap = BitmapFactory.decodeStream(in,null,options);        }    catch (Exception ee) {      tempBitmap = BitmapFactory.decodeResource(getResources(),                    R.drawable.icon);        }    tempCanvas.drawBitmap(tempBitmap, 0, 0, null);    c.drawBitmap(tempBitmap, 0, 0, null);    mSurfaceHolder.unlockCanvasAndPost(c);  }}</code></pre><p>And it errors out with ""app has stopped unexpectedly"" with logcat showing;</p><pre><code>ERROR/AndroidRuntime(24768): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { act=com.htc.HTCAlbum.action.ITEM_PICKER_FROM_COLLECTIONS dat=content://media/external/images/media/185 }} to activity {com.example.colorbook/com.example.colorbook.Colorbook}: java.lang.NullPointerExceptionComplete logcat as it finished gallery view activity and tried to return intent;&lt;br&gt;02-03 10:47:22.042: DEBUG/MainActivity(22984): [HTCAlbum][MainActivity][onPause]: Begin&lt;br&gt;02-03 10:47:22.042: DEBUG/MainActivity(22984): store mCurrentPosition_backup=0&lt;br&gt;02-03 10:47:22.042: DEBUG/DisplayManager(22984): store mCurrentPosition_backup=0&lt;br&gt;02-03 10:47:22.092: DEBUG/dalvikvm(22984): GC_EXPLICIT freed 1459 objects / 91880 bytes in 44ms&lt;br&gt;02-03 10:47:22.102: INFO/AlbumMapper(22984): Create thumbnail for: /mnt/sdcard/workspace/Colorbook/res/drawable/fileload.png&lt;br&gt;02-03 10:47:22.102: DEBUG/ThumbnailWorker(22984): [stopWorking] Stop working, now join #37, /mnt/sdcard/workspace/Colorbook/res/drawable/fileload.png&lt;br&gt;02-03 10:47:22.102: DEBUG/AlbumAdapter(22984): set thread priority to normal&lt;br&gt;02-03 10:47:22.102: DEBUG/AbstractViewGetter(22984): Raise getter prefetcher thread priority to normal.&lt;br&gt;02-03 10:47:22.102: DEBUG/AbstractViewGetter(22984): Join getter prefetch thread&lt;br&gt;02-03 10:47:22.102: DEBUG/AbstractViewGetter(22984): Getter prefetch join time: 2&lt;br&gt;02-03 10:47:22.102: DEBUG/AlbumMapper(22984): cancel current decode operation&lt;br&gt;02-03 10:47:22.182: DEBUG/AndroidRuntime(24768): Shutting down VM&lt;br&gt;02-03 10:47:22.182: WARN/dalvikvm(24768): threadid=1: thread exiting with uncaught exception (group=0x400259f8)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768): FATAL EXCEPTION: main&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { act=com.htc.HTCAlbum.action.ITEM_PICKER_FROM_COLLECTIONS dat=content://media/external/images/media/185 }} to activity {com.example.colorbook/com.example.colorbook.Colorbook}: java.lang.NullPointerException&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3734)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3776)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     at android.app.ActivityThread.access$2800(ActivityThread.java:135)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2166)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     at android.os.Handler.dispatchMessage(Handler.java:99)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     at android.os.Looper.loop(Looper.java:144)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     at android.app.ActivityThread.main(ActivityThread.java:4937)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     at java.lang.reflect.Method.invokeNative(Native Method)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     at java.lang.reflect.Method.invoke(Method.java:521)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     at dalvik.system.NativeStart.main(Native Method)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768): Caused by: java.lang.NullPointerException&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     at com.example.colorbook.Colorbook.loadImageToCanvas(Colorbook.java:524)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     at com.example.colorbook.Colorbook.onActivityResult(Colorbook.java:231)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     at android.app.Activity.dispatchActivityResult(Activity.java:3931)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3730)&lt;br&gt;02-03 10:47:22.182: ERROR/AndroidRuntime(24768):     ... 11 more&lt;br&gt;02-03 10:47:22.202: WARN/ActivityManager(97):   Force finishing activity com.example.colorbook/.Colorbook&lt;br&gt;02-03 10:47:22.704: WARN/ActivityManager(97): Activity pause timeout for HistoryRecord{46207010 com.example.colorbook/.Colorbook}&lt;br&gt;02-03 10:47:22.742: DEBUG/Sensors(97): close_akm, fd=114&lt;br&gt;02-03 10:47:22.852: DEBUG/MainActivity(22984): [HTCAlbum][MainActivity][onStop]: Begin&lt;br&gt;02-03 10:47:22.902: DEBUG/dalvikvm(22984): GC_EXPLICIT freed 398 objects / 23264 bytes in 38ms&lt;br&gt;02-03 10:47:22.902: DEBUG/MainActivity(22984): [HTCAlbum][MainActivity][onDestroy]: Begin&lt;br&gt;02-03 10:47:22.912: DEBUG/OnlineDataCenter(22984): [HTCAlbum][OnlineDataCenter][unbindContext]: Begin&lt;br&gt;02-03 10:47:22.912: DEBUG/OnlineDataCenter(22984): [HTCAlbum][OnlineDataCenter][unbindContext]: com.htc.album.MainActivity@46075ec0context size: 0&lt;br&gt;02-03 10:47:22.912: DEBUG/OnlineDataCenter(22984): [HTCAlbum][OnlineDataCenter][unbindContext]: No more clients. release resources.&lt;br&gt;02-03 10:47:22.912: DEBUG/OnlineDataCenter(22984): [HTCAlbum][OnlineDataCenter][unbindContext]: End 0&lt;br&gt;02-03 10:47:22.912: DEBUG/ThumbnailWorker(22984): [stopWorking] Stop working, now join #-1, Decode Complete!!&lt;br&gt;02-03 10:47:22.912: DEBUG/AlbumAdapter(22984): set thread priority to normal&lt;br&gt;02-03 10:47:22.912: DEBUG/AlbumMapper(22984): cancel current decode operation&lt;br&gt;02-03 10:47:22.912: DEBUG/AlbumMapper(22984): cancel current decode operation&lt;br&gt;02-03 10:47:22.912: DEBUG/ThumbnailWorker(22984): [stopWorking] Stop working, now join #-1, Decode Complete!!&lt;br&gt;02-03 10:47:22.912: DEBUG/AlbumAdapter(22984): set thread priority to normal&lt;br&gt;02-03 10:47:22.912: DEBUG/AlbumAdapter(22984): Join worker thread in destroy&lt;br&gt;02-03 10:47:22.912: DEBUG/AlbumAdapter(22984): Join time: 0&lt;br&gt;02-03 10:47:22.922: INFO/MainActivity(22984): mWorker finishes jobs at onDestroy().&lt;br&gt;02-03 10:47:22.932: DEBUG/CollectionsActivity(22984): [HTCAlbum][CollectionsActivity][onDestroy]: Begin&lt;br&gt;02-03 10:47:22.932: DEBUG/AlbColAdap(22984): [HTCAlbum][AlbumCollectionsAdapter][onDestroy]: Begin&lt;br&gt;02-03 10:47:22.942: INFO/BatteryStatsImpl(97): notePhoneSignalStrengthLocked: 2-&gt;3&lt;br&gt;02-03 10:47:22.952: DEBUG/AlbColAdap(22984): [HTCAlbum][AlbumCollectionsAdapter][onDestroy]: End&lt;br&gt;</code></pre>","556248","","1562548","","2014-01-22 11:06:33","2014-01-22 11:06:33","Android: How to load image into Bitmap","<android><image><load><bitmap><sd-card>","3","0","3","",""
"4887307","1","4887392","","2011-02-03 14:23:48","3","2809","<p>I am writting an android application to talk to a hardware device which is totally outside of my control.</p><p>My application creates a listening socket using listenUsingRfcommWithServiceRecord and the UUID 00001101-0000-1000-8000-00805F9B34FB.  It then calls accept() on that socket to wait for the remote device to connect, but it never does.</p><p>I have spoken to the makers of the hardware device, and they say that their device will ""simply connect to channel 1"" on the remote device.  i.e. it does not do a SDP discovery to find out the correct channel number.  They refuse to change this (even though it is of course wrong)</p><p>My question is are there any ways to force android to use a fixed RFCOMM channel number?  Maybe using reflection, like the trick of directly calling createRfcommSocket when connecting to a client.</p><p>Thanks</p>","464179","","379445","","2011-03-29 02:59:36","2012-10-04 23:04:19","Android RFCOMM socket on fixed channel","<android><bluetooth>","2","0","3","",""
"4887339","1","4887367","","2011-02-03 14:27:36","0","129","<p>If I make a new Android project in Ecplipse and I try, to open one of the samples from android SDK, I have got an error, look like this: </p><blockquote>  <p>R cannot be resolved</p></blockquote><p>What can I do, to be able, to run these files? I tried to delete import android.R; but nothing changed.</p><p>Thanks</p>","590898","","","","","2011-02-07 14:49:27","What can I do with R cannot be resolved problem?","<android><eclipse>","3","1","","",""
"4887360","1","5650436","","2011-02-03 14:28:56","3","1526","<p>I'm starting a 2D game for Android ( and iPhone later ).I want to animate animals on the screen ( think a cartoon dog ). What is the best approach to do so ?Should I use the built in tweening apis from Android, and mix them to obtain the good animation sequence ( scale, translate, rotate ). Is there any tool to help me do that ? Would it be possible to do the animation in flash and ""import"" the animation sequences( through AS3 generation maybe ? )</p><p>Otherwise should I do this ""by hand"", with a blank canvas and write all the draw logic ?</p><p>I'm just trying to get the fastest way to animate my characters ( if I need to code 20hours for 1 complex animation I'm not sure i'll go very far ).</p><p>Thanks :)</p>","601659","","","","","2013-09-20 12:44:46","Complex android animations for a 2D game : what approach?","<android><animation><canvas><tween>","3","0","1","",""
"4887476","1","","","2011-02-03 14:40:51","0","78","<pre><code>&lt;gesmes:Envelope&gt;&lt;gesmes:subject&gt;Reference rates&lt;/gesmes:subject&gt;&lt;gesmes:Sender&gt;&lt;gesmes:name&gt;European Central Bank&lt;/gesmes:name&gt;&lt;/gesmes:Sender&gt; &lt;Cube&gt;&lt;Cube time=""2010-03-26""&gt; &lt;Cube currency=""USD"" rate=""1.3353""/&gt; &lt;Cube currency=""JPY"" rate=""124.00""/&gt; &lt;Cube currency=""BGN"" rate=""1.9558""/&gt; &lt;Cube currency=""CZK"" rate=""25.418""/&gt; ... ... &lt;/Cube&gt; &lt;/Cube&gt; &lt;/gesmes:Envelope&gt; </code></pre><p>What can I do with this kind of structure?</p>","600133","","473070","","2011-02-03 14:48:05","2011-02-03 14:48:05","I don't know how to deal with this kind of xml structure on android","<android><xml>","2","1","","",""
"4887506","1","4887724","","2011-02-03 14:42:45","0","456","<p>I am planning to create an application which can track the location of a certain person using open street maps. But I don't know where to start.</p>","516160","","","","","2011-02-03 15:04:18","create an application which can track the location using open street maps","<java><android><eclipse><gps><openstreetmap>","1","0","","",""
"4887585","1","","","2011-02-03 14:46:54","2","1433","<p>I would like to know if theres any way to open a webview with a stream flash video on fullscreen. </p><p>Right now ive the link of the page. This page has some stuff and a flash video. So i wonder if it would be posible to open the webview only with the stream video. In fullscreen or focused on it, without seing anything else. I mean, only the webview with the video, or the whole page, but with the view focused and zoomed so that i could just see the video.</p><p>Also, since there could get different kind of web pages, the video could come on different ways. But for now, would be enough to know if it would be posible to open it on fullscreen.</p><p>Thanks.</p>","568288","","","","","2011-07-15 21:43:51","Android: open flash video stream on fullscreen","<android><flash><video><stream><fullscreen>","1","1","","",""
"4887807","1","","","2011-02-03 15:04:47","0","481","<p>In jqtouch, I'm calling several pages using ajax, in very vanilla fashion:</p><pre><code>&lt;li class=""arrow""&gt;&lt;a href=""folder/another/somepage.html"" &gt;BRAVIA HDTVs&lt;/a&gt;&lt;small class=""counter""&gt;2&lt;/small&gt;&lt;/li&gt;&lt;/li&gt;</code></pre><p>I'm trying to use a video player (sublime player) on the remote pages.  In order to do that, I use the js provided by sublime: //script type=""text/javascript"" src=""http://cdn.sublimevideo.net/js/something.js""></p><p>Then on my remote pages, to play the video I just put the code in a video class, which is defined by the js.</p><p>When I put this script in the head of my index page, things work great on iOS devices.  But the videos won't play in Android - the javascript isn't being called.  I can only play the video if I put it on the main index page, rather than the remote pages.</p><p>Any help?  Speak to me like the village idiot, please - thanks - </p>","600795","","","","","2012-06-13 22:33:18","jqtouch javascript/ajax combo not working in android","<javascript><android><ajax><jqtouch>","2","0","","",""
"4887848","1","4896619","","2011-02-03 15:08:16","0","762","<p>I have very common situation: activity displays ListView with data from CursorAdapter (items from feed), and cursor is being notified by ContentProvider about changes in data by its URI. </p><p>The problem appears when very many items are inserted (thousands of items), so UI becomes unresponsive after notifications. So i need to set more coarse notifications.</p><p>My ideas are: </p><ol><li>Do not notify, requery by myself, e.g. every 1 second</li><li>Save notification time in ContentProvider, and notify if it is older than 1 sec.</li></ol><p><strong>Any common solutions of this situation?</strong></p><p>Thanks.</p>","12021","","","","","2011-02-04 09:53:06","How not to notify cursor very often after URI data changes","<android><cursor>","1","0","0","",""
"4887919","1","4888105","","2011-02-03 15:14:12","2","1492","<p>I'm writing an application that takes HTML pages and parses them to display on the screen. Specifically, this application pulls HTML from a message board and lists posts made by users.</p><p>The problem is that a lot of the content in posts are pictures in <code>&lt;img&gt;</code> tags, so I need to write a <code>Html.ImageGetter</code> to handle the downloading of the images.</p><p>My <code>textView.setText()</code> method will look like this:</p><pre><code>myTextView.setText(Html.fromHtml(myText, new ImageGetter() {                         @Override        public Drawable getDrawable(String source) {        Drawable d;        // Need to async download image here          return d;        }    }, null));</code></pre><p>Doing this synchronously is trivial, but is there a suggested way to do this asynchronously so that it doesn't lock up my UI thread? I would also like to eventually build in caching of these images, but I imagine that would be pretty simple once the async downloading was there.</p>","97120","","","","","2011-06-11 03:51:33","Asynchronous Html.ImageGetter for setting multiple images in a TextView","<java><android><html><android-image>","4","0","1","",""
"4887926","1","","","2011-02-03 15:14:53","3","797","<p>Is it possible to capture touch events over a WebView in the activity that contains it, without loosing link functionality?</p><p>Consider a WebView showing a webpage with links. If the user taps on a link I would like the WebView to handle the touch event. If the user taps somewhere else I would like the activity to handle the touch event.</p><p>How can this be done?</p>","143378","","143378","","2011-08-14 15:23:08","2012-03-27 02:29:48","Limit WebView touch handling to links","<android><activity><webview><touch>","4","2","1","",""
"4888017","1","4888126","","2011-02-03 15:23:36","0","370","<p>I am developing an android app. I want to know through an event or any other means in my service, whenever user opens a foreground app. I want to collect my own usage statistics, as I can't find a way to know how many times an app has been used. </p><p>Does anyone know of a nice way to do this? Or obtain those statistics, already, if possible?</p>","57847","","1288","","2011-05-13 17:20:40","2011-05-13 17:20:40","Detect whenever user opens a foreground app","<android><events><android-service>","2","2","","",""
"4888031","1","4892523","","2011-02-03 15:24:49","0","1032","<p>I am using a simple BroadcastReceiver and onReceive method to intercept text messages as they come. For some reason, every time I send the text message: the app crashes. When I try to debug the app: I send the text message and the app still crashes but instead of taking me into the Receiver class, it suspends inside of the ""ActivityThreadhandleReceiver(ActivityThread,ActivityThreadReceiverData)"". The Debugging window just says for the Thread: ""(Suspended(exception RuntimeException))"".</p><p>How am I supposed to find out why my app is crashing if it won't allow me to step through my code.</p><p>Here is my Receiver Class: </p><pre><code>public class FinderReciever extends BroadcastReceiver {@Overridepublic void onReceive(Context context, Intent intent){Bundle bundle = intent.getExtras();SmsMessage[ ] msgs = null;String str = """";if (bundle != null){//---retrieve the received message here ---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"";}// ........first show sms here.....Toast.makeText(context, str, Toast.LENGTH_SHORT).show();} </code></pre><p>And here is my Manifest:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p>                 </p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".PhoneFinder_Activity""              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;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;&lt;uses-permission android:name=""android.permission.READ_SMS"" /&gt;&lt;uses-permission android:name=""android.permission.RECEIVE_SMS"" /&gt;</code></pre><p></p><p>Any help would be much appreciated. Thanks! </p><p>EDIT: Even after re-formatting the method to run inside of my main Activity I get the exact same result. This exact same method works upon the sending of texts Intent:</p><pre><code>        String SENT = ""SMS_SENT"";    String DELIVERED = ""SMS_DELIVERED"";    String RECEIVED = ""SMS_RECEIVED"";    PendingIntent sentPI = PendingIntent.getBroadcast(this, 0,        new Intent(SENT), 0);    PendingIntent deliveredPI = PendingIntent.getBroadcast(this, 0,        new Intent(DELIVERED), 0);    PendingIntent receivedPI = PendingIntent.getBroadcast(this, 0, new Intent(RECEIVED), 0);    //---when the SMS has been sent---    registerReceiver(new BroadcastReceiver(){        @Override        public void onReceive(Context arg0, Intent arg1) {            switch (getResultCode())            {                case Activity.RESULT_OK:                    Toast.makeText(getBaseContext(), ""FRIGGEN SMS!"",                             Toast.LENGTH_SHORT).show();                    break;                case SmsManager.RESULT_ERROR_GENERIC_FAILURE:                    Toast.makeText(getBaseContext(), ""Generic failure"",                             Toast.LENGTH_SHORT).show();                    break;                case SmsManager.RESULT_ERROR_NO_SERVICE:                    Toast.makeText(getBaseContext(), ""No service"",                             Toast.LENGTH_SHORT).show();                    break;                case SmsManager.RESULT_ERROR_NULL_PDU:                    Toast.makeText(getBaseContext(), ""Null PDU"",                             Toast.LENGTH_SHORT).show();                    break;                case SmsManager.RESULT_ERROR_RADIO_OFF:                    Toast.makeText(getBaseContext(), ""Radio off"",                             Toast.LENGTH_SHORT).show();                    break;            }        }    }, new IntentFilter(RECEIVED));</code></pre>","600137","","600137","","2011-02-03 15:45:51","2011-02-03 22:33:21","Intercept Text Messages : Debugging Problems","<android><android-manifest>","1","1","","",""
"4888073","1","4888497","","2011-02-03 15:28:43","2","271","<p>I am trying to get a reminder/alarm  Service` working in my note/todo app.  I am able to set a reminder for a particular item and the alarm triggers and displays a notification successfully.  </p><p>My problem is how can my <code>Service</code> know which note/todo item set that particular reminder.  I'd like for the user to be able to click on the notificaiton in the status bar and have the item which trigger it come up.  But I have no way of passing that information to the <code>Service</code> as they don't accept <code>Bundles</code> from the <code>PendingIntent</code>.</p><p>I currently set the alarm with the following:</p><pre><code>private void createAlarm() {     Intent i = new Intent(this, AlarmService.class);     PendingIntent sender = PendingIntent.getService(this, 0, i, 0);     AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);     am.set(AlarmManager.RTC_WAKEUP, mReminderCal.getTimeInMillis(), sender);}</code></pre><p>I just need a way to send along the <code>_id</code> of the item in my database so my Service can launch the item with that same <code>_id</code> when the notification is clicked.</p><p>I hope my question isn't too confusing.</p><p>Thanks!</p>","580556","","","","","2011-02-03 16:06:10","Starting service with an initial value","<android><service><alarmmanager><android-pendingintent>","1","0","","",""
"4888078","1","","","2011-02-03 15:29:19","0","481","<p>i have imageview and i have to display different image in that with time interval, but when i change the ImageResourcethe last image is displayed</p><pre><code> public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ImageView image = (ImageView) findViewById(R.id.test_image);    image.setImageResource(R.drawable.test);  try {        Thread.sleep(2000) ;    } catch (InterruptedException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }image = (ImageView) findViewById(R.id.test_image);image.setImageResource(R.drawable.test2);}</code></pre><p>Kindly Suggest the Right way to do that</p><p>Thanks in Advance</p>","321373","","","","","2011-03-02 20:09:09","Android imageView Switching Problem","<android><imageview>","2","1","","",""
"4888081","1","","","2011-02-03 15:29:28","1","989","<p>As the title says, I would like to create a custom HorizontalScrollView. My HSV will not have a scrollbar, but will have arrows on the sides. So, if there is something to be scrolled in the right side, the right arrow will be displayed. Otherwise it will be invisible. My problem is that I need a listener for the HSV so that I am aware when there's nothing to be scrolled. Otherwise I don't know when to set the arrows states.What would be the best approach for this feature?</p><p>Thanks a lot,</p><p>Gratzi</p>","460611","","","","","2011-02-03 15:29:28","Custom HorizontalScrollView","<android>","0","2","0","",""
"4888240","1","4897542","","2011-02-03 15:43:50","2","1282","<p>I've  been working on designing a few Android apps lately, and one of my next experimental adventures is the first to listen to an external Intent: Google Voice. I was wondering about the potential for a malicious user to create another Intent mostly identical to a pre-existing trusted Intent to inject evil code into my app.</p>","434512","","434512","","2011-02-03 20:04:22","2012-03-22 02:57:51","Android Intent Security","<java><android><security>","1","2","2","",""
"4888251","1","4889995","","2011-02-03 15:45:09","1","997","<p>Is the technology there for the camera of a smartphone to detect a light flashing and to detect it as morse code, at a maximum of 100m? </p>","180825","","180825","","2011-02-03 16:21:46","2012-01-28 15:08:35","Would it be possible for a mobile app to detect a flashing light with its camera, i.e., visual morse code","<android><ios><mobile>","4","2","1","",""
"4888275","1","4889179","","2011-02-03 15:47:30","1","3148","<p>I'm building an app that requires a user to have logged in and obtained a user id.  This id is a member variable of my extended Application class.</p><p>I'd like the application to recognize when/if this variable gets wiped out and, if so, throw up my log in screen and destroy the Activity stack behind it.</p><p>Here's what I think I'm going to do:</p><p>Extend Activity and ListActivity (currently the only two types of Activities I am using).  In the onResume() handler, check to see if the user id is set.  If not, throw up the log in screen and destroy the rest of the Activity stack behind it.  All of my Activities will derive from these new extended Activities.</p><p>My issue here is that I don't know how to destroy the Activity stack behind a particular Activity.  Any ideas?</p><p>One idea is to have a broadcast receive listening for a particular message that tells Activities to kill themselves, but I'm hoping Android already has something in place for a situation like this.</p><p>Update:</p><p>Also, is there a way to clear the entire Activity stack?  I'd like to override the onBackPressed() handler on an Activity and have the Activity stack blown out so the user gets taken back to the Android home screen.</p>","406790","","406790","","2011-02-03 16:41:38","2011-02-03 17:03:09","Destroying the Activity stack","<android><activity>","2","3","","",""
"4888326","1","4888539","","2011-02-03 15:51:00","9","11296","<p>I am searching an ImageViewer library that opens an image in my application for a given URI (the image fetched by a webservice is already stored within my application in a secured place). I really like the ""Samsung Galaxy S"" ImageViewer-Activity because it uses pinch-zoom and ""scrolling"" vertical/horizontal. Also it scales the picture very fast on my samsung phone :)</p><p>I know that I can open an image with an intent like this:</p><pre><code>Intent i = new Intent(Intent.ACTION_VIEW);  i.setDataAndType(uri, ""image/*"");startActivity(i);</code></pre><p>The best suitable viewer is being called, when none is found an ActivityNotFoundException is raised. So thats cool!</p><p>But the problem is that I am not allowed to open an image with an external intent (for security purposes). i.e: The user should not have the posibility to save the opened image via a menu option to his external sd-card or send this picture to another service (email/twitter or s.o.). So I have to write my own ImageViewer-Class (Activity) that can only be called within my application...Unfortunately I am not very skilled transforming images, so is there any open source project (or library) that covers this use case?</p><p>I already asked google and found this one <a href=""http://code.google.com/p/android-pinch/"">http://code.google.com/p/android-pinch/</a> but it didnt work very well (also it has no scroll-functionality).</p><p>Thanks for your tips :)</p>","248755","","","","","2014-01-07 10:48:35","Android ImageViewer class supporting Pinch-Zoom and Scrolling","<android><scroll><transform><imageview><pinch>","2","1","5","",""
"4888394","1","4895246","","2011-02-03 15:56:55","0","870","<p>I'm working on a project creating a fairly simple one-to-many host-to-slave network using a bunch of Android devices.  What would be the best way to go about doing this?</p><p>A friend recommended Bluetooth, which I think would work very well for local small networks.  This is actually one core component of the project we're doing, groups of devices in a maximum area of maybe 50 square meters (a large lecture hall, for example).</p><p>What would be the best way to connect a number of devices at a large distance from each other?  Would rapid polling of the devices be possible?  The project is based around device and user response time (sort of a response time test, in fact).  Will having a host and guest network created on-the-fly be robust enough to detect response times in the milliseconds?</p><p>Thanks for any help, and I'm relatively new to this so if I wasn't clear or if any of my thinking was ridiculous, please let me know.</p>","255394","","213269","","2011-02-04 09:34:19","2011-02-04 09:34:19","Creating a simple ad-hoc/mesh network, what's a good protocol to do it with?","<android><networking><bluetooth><network-protocols><adhoc>","1","0","","",""
"4888451","1","","","2011-02-03 16:01:13","5","156","<p>hey people,I have almost finished writing my first android app.  It is a note taking app with add, edit view screens etc...</p><p>Initially I was handling moving between screens in a single activity by creating new layout objects such as tables etc... and displaying them.However after some more reading I have changed my method of moving between screens by using different activities for different screens.  However each activity that is called as an intent retrieves a large number of variables from the main activity via setExtra and passes back a large number of variables as well.</p><p>Now I want my app to be as efficient as possible and I personally think that handling it all in one activity is less memory hungry and processor intensive although this has the negative of meaning variables are always present (and consuming memory) unlink in a separate activity where they are killed on finish().But you guys are more knowledgeable then me so what do you think is the best way to do it?</p>","597334","","","","","2011-02-03 16:15:55","Android - Which is more efficient?","<android><performance>","2","2","0","",""
"4888481","1","4890166","","2011-02-03 16:04:31","0","1710","<p>I have a drawing canvas with an <code>OnTouchListener</code> from which I call an <code>AlertDialog</code>. </p><p>In the dialog I reset the underlying data for the canvas (or not depending on user). On returning to the canvas with <code>dialog.cancel()</code> the canvas does not redraw and I want it to.<br>This means the user has to click on the canvas to cause it to redraw - not good!  </p><p>Because the dialog runs asynchronously any call to <code>invalidate()</code> in the canvas is completed before the dialog returns the changed underlying data. Any attempt I make to invalidate or reference the canvas from inside the dialog buttons code results in errors. I seem to be in catch 22!</p><p>Can enyone give me advice?</p><p>dialog code:</p><pre><code>case DIALOG_NEW_ID:    AlertDialog.Builder builder5 = new AlertDialog.Builder(this);    builder5.setMessage(""     WARNING"" +            ""\nYour current game will be lost"")    .setCancelable(false)    .setPositiveButton(""Cancel"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int id) {                               dialog.cancel();        }    })                  .setNegativeButton(""Continue"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int id) {            cells.reset();            gameMode = 0;            dialog.cancel();        }    });    AlertDialog alert5 = builder5.create();                 alert5.setOnDismissListener(new DialogInterface.OnDismissListener() {         public void onDismiss( DialogInterface dialog) {             Log.d(TAG, ""Dialog cancelled"");// debug log entry             //myBoard.invalidate();        }    });         dialog = alert5;                    break;</code></pre><p>Dialog calling code <code>onTouch</code> in the canvas:</p><pre><code>    case MODE_SOLUTION:        break;    default:                                    showDialog(DIALOG_NEW_ID);        invalidate();}// end switch  </code></pre><p>The Main Class set up:</p><pre><code>public class SudokuGame extends Activity {static final int DIALOG_OPEN_ID = 0;static final int DIALOG_INFO_ID = 1;static final int DIALOG_FAIL_ID = 2;static final int DIALOG_SAVE_ID = 3;static final int DIALOG_NEW_ID = 4;static final int MODE_ENTRY = 0;static final int MODE_PLAY = 1;static final int MODE_SHOW_ERRORS = 3;static final int MODE_SOLUTION = 4;final String TAG = ""Game"";int  gameMode;SKU cells;View myBoard;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_LEFT_ICON);    View myBoard = new NewBoard(this);            setContentView(myBoard);    setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.ic_launcher);    showDialog(DIALOG_OPEN_ID);        }// end onCreate    protected Dialog onCreateDialog(int id) {</code></pre><p>The Class NewBoard which is nested in the main class:</p><pre><code>    class NewBoard extends View implements OnTouchListener{    int cW;  // canvas width    int cH;  // canvas height    int cellSize,textSize;    int boardX,boardY;      int runner, tX, tY,pX,pY,selectorX,selectorY;    int gap ;    int btn1X,btn1Y, selected;    int infoButtonX, infoButtonY,quitButtonX,quitButtonY;    boolean btn1Pressed, btn2Pressed,  btn3Pressed, btn4Pressed, btn5Pressed;    String btn1,btn2,btn3,btn4,btn5;    public NewBoard(Context context){ // NewBoard Constructor        super(context);        this.setOnTouchListener(this);          cells = new SKU();        readStateStore();    }// end NewBoard Constructor    @Override     protected void onDraw(Canvas canvas) {        super.onDraw(canvas);        Paint paint = new Paint();          Rect textRect = new Rect();     </code></pre>","578689","","578689","","2011-02-03 21:03:20","2011-02-04 00:55:49","How to invalidate() on return from a dialog?","<android><invalidate>","2","1","","",""
"4888590","1","4888743","","2011-02-03 16:13:35","1","1544","<p>want to develop an app that can automatically respond to a received text, include my location using gps/google maps in the returned message, and read out the received message using text to speech.</p><p>My first concern (what this question relates too!) is figuring out howto automatically reply to sms messages received.  I have built a basic GUI and menu option.  There is an EditText field that uses shared_preferences to remember the string so far. </p><p>How do I go about adding this string to an sms message, and making the messege send to whomever just texted me?  I have a decent understanding of java but I havn't been about to find any clear examples and an a bit confused.Any help would be great!Thanks</p><p>(Basically a java oracle version of the app inventor application ""NoTextWhileDriving2"")</p>","600423","","600423","","2012-08-30 15:03:12","2012-08-30 15:03:12","Want to develop an app that can automatically respond to received sms","<java><android><sms><response>","2","0","","",""
"4888624","1","","","2011-02-03 16:15:30","7","17864","<p>I want to use getWidth()/getHeight() to get width/height of my XML-Layout.I read I have to do it in the method onSizeChanged() otherwise I will get 0( <a href=""http://stackoverflow.com/questions/2902640/android-get-the-screen-resolution-pixels-as-integer-values"">Android: Get the screen resolution / pixels as integer values</a> ).</p><p>But I want to do it in a class already extending Activity.So I think it's not possible let the same class extending View.</p><pre><code>public class MyClass extends Activity {    public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          setContentView(R.layout.main);          ViewGroup xml_layout = (ViewGroup) findViewById(R.id.layout_id);          TextView tv = new TextView(this);          tv = (TextView) findViewById(R.id.text_view);          int layout_height = xml_layout.getHeight();          int layout_width = xml_layout.getWidth();    }      protected void onSizeChanged(int w, int h, int oldw, int oldh) {        //Error, because I need to use extends View for class, but I can't do it because I also need extends Activity to use onCreate    }}</code></pre><p>If I use MyClass extends Activity I can use onCreate but not onSizeChanged.<br>If I use MyClass extends View I can use onSizeChangedbut not onCreate.</p><p>How can I solve the problem?</p>","601721","","595204","","2011-02-03 16:22:21","2012-03-23 15:05:17","Android: Need to use onSizeChanged for View.getWidth/Height() in class extending Activity","<android>","5","0","2","",""
"4888653","1","4888983","","2011-02-03 16:18:30","0","1538","<p>I want to know how to open another <code>ListView</code> after one of rows on the previous <code>ListView</code> has been clicked?</p><p>Bee VOA reader could be a good example to see what I'm talking about.</p><pre><code>List A                          List BDeskTop Development    ---&gt;     Buttons                                TextView                                ScrollBarMobile GraphicGame</code></pre><p>So there is one list A on the phone's screen, and there are many topics in the list AIf I clicked on one of the topic,let's say DeskTop Development, then the whole ListViewwill be slided away from the screen and the new List B will be presented.</p><p>So how to implement it?</p>","601862","","244296","","2011-02-03 16:20:02","2011-02-03 17:20:58","How to open another ListView after one of rows on the previous ListView has been clicked?","<android><listview><monodevelop>","2","1","1","",""
"4888660","1","","","2011-02-03 16:18:53","0","489","<p>My application uses some native code in external library. This code is ""black box"" and consumes a lot of memory. Therefore my application starves of memory. Is it any way to run it as an external process with some communication mechanism?</p>","601865","","","","","2011-02-03 16:23:30","Android application IPC mechanism","<android><ipc><android-ndk>","1","0","","",""
"4888746","1","","","2011-02-03 16:28:29","1","1938","<p>I use web service to get image. The service response contains image in base64Binary format. I try to decode response data with Base64.decode() (<a href=""http://iharder.sourceforge.net/current/java/base64/"" rel=""nofollow"">http://iharder.sourceforge.net/current/java/base64/</a>). See my code below:</p><pre><code> byte[] data = Base64.decode(responseString); Bitmap bmp = BitmapFactory.decodeByteArray(data, 0, data.length); imageView.setImageBitmap(bmp);</code></pre><p><b>decodeByteArray</b> always return null.</p><p>I try to save <b>data</b> in .png file. I can open this file on my PC and in the Android File Manager application. But preview activity of File Manager couldn't open this file.</p><p>Then i try to parse this data using .NET client with Convert.Base64() method. And this image have been processing successfully. Then i compare byte array in image created with android client and .NET client. The differences were in sign of bytes. .NET uses unsigned bytes but Java use only signed bytes. Is this is a reason of my problem? </p><p>Is anybody have the same problem in decoding of base64Binary?</p>","601812","","","","","2012-10-01 23:56:30","Android: get image from base64binary format","<android><image><byte><base64><decoding>","1","2","","",""
"4888907","1","4891558","","2011-02-03 16:41:53","3","10480","<p>I am getting an intent delivery error in Logcat, and app stops unexpectedly when I call this;</p><pre><code>startActivityForResult(new Intent(Intent.ACTION_PICK,         android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI), 1);</code></pre><p>or this for that matter;</p><pre><code>startActivityForResult(new Intent(Intent.ACTION_PICK,         android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI), 1);</code></pre><p>and then process it with;</p><pre><code>@Overrideprotected void onActivityResult(int requestCode, int resultCode,            Intent intent) {  super.onActivityResult(requestCode, resultCode, intent);if (resultCode == RESULT_OK) {    Uri contentURI =  Uri.parse(intent.getDataString());    c = mSurfaceHolder.lockCanvas();    tempCanvas.setBitmap(mDrawing);    Bitmap tempBitmap = null;    ContentResolver cr = getContentResolver();    try {                 InputStream in = cr.openInputStream(contentURI);      BitmapFactory.Options options = new BitmapFactory.Options();      options.inSampleSize=8;      tempBitmap = BitmapFactory.decodeStream(in,null,options);        }    catch (Exception ee) {      tempBitmap = BitmapFactory.decodeResource(getResources(),                    R.drawable.icon);        }    tempCanvas.drawBitmap(tempBitmap, 0, 0, null);    c.drawBitmap(tempBitmap, 0, 0, null);    mSurfaceHolder.unlockCanvasAndPost(c);  }}</code></pre><p>Errors out with ""app has stopped unexpectedly"" with logcat showing; </p><pre><code>ERROR/AndroidRuntime(24768): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { act=com.htc.HTCAlbum.action.ITEM_PICKER_FROM_COLLECTIONS dat=content://media/external/images/media/185 }} to activity {com.example.colorbook/com.example.colorbook.Colorbook}: java.lang.NullPointerException    Complete logcat as it finished gallery view activity and tried to return intent;    02-03 10:47:22.042: DEBUG/MainActivity(22984): [HTCAlbum][MainActivity][onPause]: Begin    02-03 10:47:22.042: DEBUG/MainActivity(22984): store mCurrentPosition_backup=0    02-03 10:47:22.042: DEBUG/DisplayManager(22984): store mCurrentPosition_backup=0    02-03 10:47:22.092: DEBUG/dalvikvm(22984): GC_EXPLICIT freed 1459 objects / 91880 bytes in 44ms    02-03 10:47:22.102: INFO/AlbumMapper(22984): Create thumbnail for: /mnt/sdcard/workspace/Colorbook/res/drawable/fileload.png    02-03 10:47:22.102: DEBUG/ThumbnailWorker(22984): [stopWorking] Stop working, now join #37, /mnt/sdcard/workspace/Colorbook/res/drawable/fileload.png    02-03 10:47:22.102: DEBUG/AlbumAdapter(22984): set thread priority to normal    02-03 10:47:22.102: DEBUG/AbstractViewGetter(22984): Raise getter prefetcher thread priority to normal.    02-03 10:47:22.102: DEBUG/AbstractViewGetter(22984): Join getter prefetch thread    02-03 10:47:22.102: DEBUG/AbstractViewGetter(22984): Getter prefetch join time: 2    02-03 10:47:22.102: DEBUG/AlbumMapper(22984): cancel current decode operation    02-03 10:47:22.182: DEBUG/AndroidRuntime(24768): Shutting down VM    02-03 10:47:22.182: WARN/dalvikvm(24768): threadid=1: thread exiting with uncaught exception (group=0x400259f8)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): FATAL EXCEPTION: main    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { act=com.htc.HTCAlbum.action.ITEM_PICKER_FROM_COLLECTIONS dat=content://media/external/images/media/185 }} to activity {com.example.colorbook/com.example.colorbook.Colorbook}: java.lang.NullPointerException    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): at android.app.ActivityThread.deliverResults(ActivityThread.java:3734)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3776)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): at android.app.ActivityThread.access$2800(ActivityThread.java:135)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2166)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): at android.os.Handler.dispatchMessage(Handler.java:99)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): at android.os.Looper.loop(Looper.java:144)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): at android.app.ActivityThread.main(ActivityThread.java:4937)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): at java.lang.reflect.Method.invokeNative(Native Method)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): at java.lang.reflect.Method.invoke(Method.java:521)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): at dalvik.system.NativeStart.main(Native Method)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): Caused by: java.lang.NullPointerException    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): at com.example.colorbook.Colorbook.loadImageToCanvas(Colorbook.java:524)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): at com.example.colorbook.Colorbook.onActivityResult(Colorbook.java:231)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): at android.app.Activity.dispatchActivityResult(Activity.java:3931)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): at android.app.ActivityThread.deliverResults(ActivityThread.java:3730)    02-03 10:47:22.182: ERROR/AndroidRuntime(24768): ... 11 more    02-03 10:47:22.202: WARN/ActivityManager(97): Force finishing activity com.example.colorbook/.Colorbook    02-03 10:47:22.704: WARN/ActivityManager(97): Activity pause timeout for HistoryRecord{46207010 com.example.colorbook/.Colorbook}    02-03 10:47:22.742: DEBUG/Sensors(97): close_akm, fd=114    02-03 10:47:22.852: DEBUG/MainActivity(22984): [HTCAlbum][MainActivity][onStop]: Begin    02-03 10:47:22.902: DEBUG/dalvikvm(22984): GC_EXPLICIT freed 398 objects / 23264 bytes in 38ms    02-03 10:47:22.902: DEBUG/MainActivity(22984): [HTCAlbum][MainActivity][onDestroy]: Begin    02-03 10:47:22.912: DEBUG/OnlineDataCenter(22984): [HTCAlbum][OnlineDataCenter][unbindContext]: Begin    02-03 10:47:22.912: DEBUG/OnlineDataCenter(22984): [HTCAlbum][OnlineDataCenter][unbindContext]: com.htc.album.MainActivity@46075ec0context size: 0    02-03 10:47:22.912: DEBUG/OnlineDataCenter(22984): [HTCAlbum][OnlineDataCenter][unbindContext]: No more clients. release resources.    02-03 10:47:22.912: DEBUG/OnlineDataCenter(22984): [HTCAlbum][OnlineDataCenter][unbindContext]: End 0    02-03 10:47:22.912: DEBUG/ThumbnailWorker(22984): [stopWorking] Stop working, now join #-1, Decode Complete!!    02-03 10:47:22.912: DEBUG/AlbumAdapter(22984): set thread priority to normal    02-03 10:47:22.912: DEBUG/AlbumMapper(22984): cancel current decode operation    02-03 10:47:22.912: DEBUG/AlbumMapper(22984): cancel current decode operation    02-03 10:47:22.912: DEBUG/ThumbnailWorker(22984): [stopWorking] Stop working, now join #-1, Decode Complete!!    02-03 10:47:22.912: DEBUG/AlbumAdapter(22984): set thread priority to normal    02-03 10:47:22.912: DEBUG/AlbumAdapter(22984): Join worker thread in destroy    02-03 10:47:22.912: DEBUG/AlbumAdapter(22984): Join time: 0    02-03 10:47:22.922: INFO/MainActivity(22984): mWorker finishes jobs at onDestroy().    02-03 10:47:22.932: DEBUG/CollectionsActivity(22984): [HTCAlbum][CollectionsActivity][onDestroy]: Begin    02-03 10:47:22.932: DEBUG/AlbColAdap(22984): [HTCAlbum][AlbumCollectionsAdapter][onDestroy]: Begin    02-03 10:47:22.942: INFO/BatteryStatsImpl(97): notePhoneSignalStrengthLocked: 2-&gt;3    02-03 10:47:22.952: DEBUG/AlbColAdap(22984): [HTCAlbum][AlbumCollectionsAdapter][onDestroy]: End</code></pre><p>Line 524 is this;c.drawBitmap(tempBitmap, 0, 0, null);</p>","556248","","556248","","2011-02-03 16:56:42","2011-11-17 14:15:36","Android: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent","<android><image><activity><android-intent><sd-card>","1","5","","",""
"4888929","1","","","2011-02-03 16:43:52","0","121","<p>I have 5 TextViews and 1 ImageView elements in my Android App Activity RelativeLayout. I have a Save button in that Activity. What I am trying to do is that when the User clicks Save button convert the 5 TextViews and 1 ImageView elements together to a PNG image and save it to a folder. </p><p>Is that possible? It works with only the ImageView element since it is already a PNG but cannot get it to work with the TextViews.</p><p>Any clue as to how this can be done will be very helpful.</p>","447886","","","","","2011-07-25 15:07:12","Save TextViews and ImageView together as PNG when button clicked in Android App","<java><android>","0","3","","",""
"4888950","1","4889349","","2011-02-03 16:45:57","2","1173","<p>I'm developing an Android 2.2 app.</p><p>I use a dialog to ask user for his nickname. This is my source code:</p><pre><code>private void showDialog() {    //set up dialog    final Dialog dialog = new Dialog(UserStatsActivity.this);    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);    dialog.setContentView(R.layout.createuserrow);    dialog.setOnDismissListener(this);    //set up button    Button button = (Button) dialog.findViewById(R.id.saveUser);    button.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            TextView nameTextView = (TextView)dialog.findViewById(R.id.userName);            userNickName = nameTextView.getText().toString().trim();            if ((userNickName.length() &gt; 0) &amp;&amp;                (userNickName.length() &lt; 9)){                saveUser = true;                dialog.dismiss();            }        }    });    //now that the dialog is set up, it's time to show it        dialog.show();}public void onDismiss(DialogInterface arg0) {    try {        if (saveUser) {            SharedPreferences prefs =                 PreferenceManager.getDefaultSharedPreferences(getApplicationContext());            User.saveUser(getApplicationContext(), userNickName);            Editor editor = prefs.edit();            editor.putString(USER_NAME, userNickName);            editor.putBoolean(FIRST_TIME_RUN, false);            editor.commit();            loadPreferences();        }    }    catch (Exception ex){        Log.e(Constants.APP_TAG, ""UActivity: "" + ex.getMessage());        showAlert(this.getString(R.string.errorClose));    }}</code></pre><p>If I press home key while dialog is shown. When I start app again, and I click on save button, dialog is shown again.</p><p>I've debug my code and it is working perfectly, but the dialog is still open.</p><p>What's happening?</p><p>Thanks.</p>","68571","","68571","","2011-02-03 17:08:18","2011-02-03 17:35:34","Showing a dialog twice after pressing home key and turn back to app","<android><modal-dialog><android-2.2-froyo>","2","0","2","",""
"4888952","1","4889086","","2011-02-03 16:46:07","1","1739","<p>Here is the problem...</p><p>I'm trying to create an app that allows you to upload an image or sound recording to a database along with some information, The upload part isn't a problem, what I would like to do is have 3 options, take a photo, record a sound and select a file. I decided to tackle select a file first... Is it possible to be able to simply click a button which allows you to select a file then post that to my php script? and pointers on how to start the camera or sound recorder would also be appreciated greatly</p><p>Thanks</p><p>James</p>","601915","","","","","2011-02-04 09:31:08","Select a picture and upload android","<android><android-camera><filepicker><android-file>","1","0","","",""
"4889080","1","4889763","","2011-02-03 16:56:01","9","11812","<p>I'd like to be able to implement this in an Android app, and I thought it was possible with the newest Google Maps API release, but I haven't seen much discussion on the topic. Ideally, you'd be able to download/cache maps for a certain region for later offline use. Is it only possible to do this via the Google Maps 5 application and not the API without violating the ToS? I know OpenStreetMap and others allow this, but I believe Google Maps still offers superior mapping and the most widespread usage.</p><p>Thanks in advance.</p>","483402","","","","","2013-10-14 17:30:59","Downloading/Caching Google Maps for Offline Use","<android><google-maps><offline>","4","0","7","",""
"4889084","1","4935585","","2011-02-03 16:56:12","4","413","<p>I have an activity where the first thing it does is start another activity for result. when the result comes back, it should process it, then finish. I have the <code>startActivityForResult()</code> call in <code>onCreate()</code>.</p><p>What I see is that <em>sometimes</em> when I return from the target activity i started, <code>onCreate()</code> in my activity is called again. this of course re-starts the target activity a second time.</p><p>This makes sense and I understand why this is the case, but I don't understand the correct pattern for what I'm trying to achieve. When I return from the activity i started, i don't want to re-start the target activity again obviously ... I just want to run <code>onActivityResult()</code> and finish.</p><p>I read where someone suggested setting a state preference, but that seems like a good source for bugs, for example, if it got stuck in the wrong state.</p><p>Any thoughts?</p>","337455","","244296","","2011-02-03 17:00:13","2011-02-08 16:29:31","Pattern for activity that starts another activity (for result)","<android>","1","10","0","",""
"4889121","1","4889503","","2011-02-03 16:58:25","0","372","<p>I am developing a facebook oauth app on android on linux and when i runkeytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary| openssl base64for the hash key i get an unreadable text. I tried piping it to a text file, still its unreadable.Please help</p>","601928","","","","","2011-03-15 14:41:04","android hashkey generated for facebook not readable","<android><facebook>","1","1","","",""
"4889215","1","","","2011-02-03 17:05:06","0","1095","<p>I have an app whose default style is to present data in a GridView. When the user presses the Menu button they can choose to present the data as a ListView.</p><p>The problem is that once the first switch happens, it's as though the ListView is simply superimposed above the GridView. The GridView layout doesn't go away. I have to scroll with my finger a little bit before it disappears.</p><p>What I'm doing is basically setting another setContentView call to my XML file that defines the ListView. It's not just a simple matter of changing the adapters.</p><p>I am guessing that I need to completely destroy or remove my GridView--but how do I do this? Note that if I switch from ListView to GridView the problem remains.</p>","213345","","","","","2011-12-07 17:44:34","Trying to alternate between GridView & ListView leaving artificats","<android><listview><gridview>","2","2","","",""
"4889236","1","","","2011-02-03 17:07:00","3","2164","<p>hey, an android noob needs help here.</p><p>i'm trying to get my webview browser to <strong>delete</strong> the browser <strong>history</strong> after the <strong>homepage</strong> has been loaded (so the next user that comes around this public app doesn't see the previous session)</p><p>i've made a webview client and put a</p><pre><code>public void onPageFinished(WebView webView, String Url ) {     Browser.clearHistory();</code></pre><p>but don't know how to change the <em>String Url</em> to the url of the apps  homepage.</p><p><em>I also tried adding a second function to my homebutton onclicklistener, but no luck as well, if someone wants to help i can paste that bit of code as well.</em></p><p>thanks</p>","567370","","","","","2012-01-16 18:52:41","android: delete history after homepage load","<android><browser-history>","3","0","","",""
"4889242","1","4940378","","2011-02-03 17:07:48","2","2463","<p>I am trying to synchronize my own database for tracks and albums (that contains additional data). I have so far successfully pulled albums and tracks from the MediaStore.</p><p>What I cannot manage to do properly is to pull the Genres for the tracks. Could someone post some code? I'd like to avoid querying the database for each track, so if possible some code to load the association (Genre.id &lt;-> Audio.id) would be great.</p><p>What I am struggling on is using the content provider to get the Genres.Members info.</p>","490961","","","","","2012-04-10 09:43:16","Getting efficiently the Genres of the Audio files in the MediaStore","<android><audio><mediastore>","2","0","1","",""
"4889370","1","4889483","","2011-02-03 17:19:49","1","1147","<p>My Android application will be periodically polling a server to check for data.  I want this polling to happen regardless of user interaction with the application, similar (in concept) to how the Gmail and Google Reader apps sync data in the background.  Once the app is installed, these periodic syncs should begin happening.  I do <strong>not</strong> think that scheduling the alarm from inside an <code>Activity</code> is the way to go, because I do not want to wait for the user to open my application.  </p><p><strong>What is the best practice in this case for placing the call to</strong> <code>AlarmManager.setInexactRepeating</code>?</p><p>Some possibilities I could think of are:</p><ul><li>Extend <code>Application</code> and do it in <code>onCreate</code></li><li>Do the scheduling from within a <code>Service</code> that is set to <code>android:enabled=true</code> within the manifest.</li><li>Listen for some particular broadcast message(s), and schedule from within a receiver</li></ul>","3767","","","","","2011-05-07 20:56:43","Where is the best place to schedule AlarmManager to do a periodic background data sync?","<android><alarmmanager>","2","0","1","",""
"4889376","1","4889480","","2011-02-03 17:20:31","0","382","<p>Do any of you know a method that an Android application built using Adobe Flash can access hardware API on the device?</p><p>For example, I launch Flash CS5 and create a new AIR for Android application. The application consists only of a button. When that button is pressed the wireless on the device toggles. This is easy to do in Java by just creating a wifiManager:</p><pre><code>WifiManager wifiManager = (WifiManager)this.getSystemService(Context.WIFI_SERVICE);wifiManager.setWifiEnabled(true/false);</code></pre><p>But how would you do it in an AIR application? Is it even possible?</p><p>Thanks!</p>","450780","","","","","2011-02-03 17:31:05","Android hardware and Adobe AIR","<android><flash><air><hardware><flash-cs5>","1","0","","",""
"4889466","1","5029936","","2011-02-03 17:29:36","2","2032","<p>Can anyone give a comparative information between developing Android mobile applications using Eclipse SDK &amp; Adobe AIR?</p><p>Kindly share your opinion , anyone who has already having any experience on developing Android mobile applications using Adobe AIR.</p><p>I have gone through articles on developing Adobe AIR but wanted to know if anyone found it useful . I am aware that Android mobile applications developed using Adobe AIR is supported for Android 2.1 &amp; 2.2.</p><p>Thanks in advance.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2011-08-02 08:24:37","Using Adobe AIR to develop Android mobile applications","<android>","3","0","1","",""
"4889487","1","","","2011-02-03 17:31:42","1","925","<p>I am testing an Android GPS tracking application in the Emulator and I am running into a problem when trying to figure out if the last known location is stale or not. Getting the system time gives me the correct time, but when I call location.getTime() for the last known location the time returned is off by a few hours. I did some more testing and found out that every time I send a GPS location from the Emulator control tab in Eclipse (similar to geo fix), the location's time is advanced by one second. This makes no sense at all! I would appreciate any insights into this problem.</p>","537152","","207475","","2011-10-27 22:22:23","2012-03-20 04:45:26","Android emulator's GPS location gives wrong time","<android><android-emulator><gps>","1","2","","",""
"4889491","1","","","2011-02-03 17:31:58","1","796","<p>I've got an application which (although I'm not sure why,) requires Android 2.2 at least to work, so after getting Froyo on my phone, I tested the application and although it installs and begins to run, when I carry out a function, it results in the following error:</p><blockquote>  <p>""The application  has stopped unexpected. Please try again.""</p></blockquote><p>It works fine on the emulator which is also running Froyo so I can't figure out what the problem is. The error in adb logcat is the following:</p><blockquote>  <p>W/dalvikvm( 1027): threadid=1: thread exiting with uncaught exception (group=0x2aacc8a0)</p></blockquote><p>And it gives a null pointer exception, except I know that there isn't a null pointer exception as it works fine in the emulator and I can see from the System.out in adb logcat that the value won't be null.</p><p>Does anyone have any idea on what I can do to fix this?</p><p>Thank you for your time!</p><p>Edit: Here is the stack as requested:</p><blockquote>  <p>W/dalvikvm(  861): threadid=1: thread exiting with uncaught exception (group=0x2aacc8a0)  E/AndroidRuntime(  861): FATAL EXCEPTION: main  E/AndroidRuntime(  861): java.lang.NullPointerException  E/AndroidRuntime(  861):    at com.andrWow.wCraftArmory.Armory.updateUI(Armory.java:150)  E/AndroidRuntime(  861):    at com.andrWow.wCraftArmory.Armory.access$2(Armory.java:140)  E/AndroidRuntime(  861):    at com.andrWow.wCraftArmory.Armory$carryOutSearch.onPostExecute(Armory.java:282)  E/AndroidRuntime(  861):    at com.andrWow.wCraftArmory.Armory$carryOutSearch.onPostExecute(Armory.java:1)  E/AndroidRuntime(  861):    at android.os.AsyncTask.finish(AsyncTask.java:417)  E/AndroidRuntime(  861):    at android.os.AsyncTask.access$300(AsyncTask.java:127)  E/AndroidRuntime(  861):    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)  E/AndroidRuntime(  861):    at android.os.Handler.dispatchMessage(Handler.java:99)  E/AndroidRuntime(  861):    at android.os.Looper.loop(Looper.java:123)  E/AndroidRuntime(  861):    at android.app.ActivityThread.main(ActivityThread.java:4627)  E/AndroidRuntime(  861):    at java.lang.reflect.Method.invokeNative(Native Method)  E/AndroidRuntime(  861):    at java.lang.reflect.Method.invoke(Method.java:521)  E/AndroidRuntime(  861):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876)  E/AndroidRuntime(  861):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)  E/AndroidRuntime(  861):    at dalvik.system.NativeStart.main(Native Method)  W/ActivityManager(  123):   Force finishing activity com.andrWow.wCraftArmory/.Armory</p></blockquote><p>Here is the code around line 150 - The second line is line 150:</p><pre><code>PlayerCharacter toon = worker.getToons().get(latestToon[0] + ""&amp;"" + latestToon[1]); LinkedHashMap&lt;String, LinkedHashMap&lt;String, String&gt;&gt; bM = toon.getCategoryMap(""baseStats"");</code></pre><p>It only gets this far if the result of assigning ""toon"" is not going to be null. The result of getCategoryMap with that key also shouldn't be null because it's pretty much hardcoded to adding a value with that key when it is created. getCategoryMap is a getter which checks the HashMap contains that key, if it doesn't, it would give an error into the system.out which isn't there.</p><p><em><strong>Solved edit:</em></strong></p><p>Thanks for your help everyone.I really didn't think it was a fault with the code because I knew it worked on the emulator and I had it running once on the phone too but it turns out it was a fault with my code. After getting FroYo, I set it up which included adding a new keyboard which automatically changed the case of the first letter so it was a matter of me not handling upper/lower cases properly - a silly mistake.</p><p>Thanks for your time, really appreciated!</p>","601975","","601975","","2011-02-03 18:50:27","2011-02-03 18:50:27","Application runs fine on Eclipse emulator but errors on the phone - FroYo","<android><eclipse><exception><emulator><android-2.2-froyo>","1","6","","",""
"4889512","1","4889563","","2011-02-03 17:33:33","1","403","<p>I have seen many posts about this and have tried many of the solutions but for some reason nothing is working.  I just want the buttons to share equal space... Can you please look at my xml code and see if something is wrong? Thanks!</p><p><pre>                                    </p><code>    &lt;ScrollView android:id=""@+id/scrollview1""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;        &lt;LinearLayout android:orientation=""vertical""            android:layout_width=""fill_parent"" android:layout_height=""wrap_content""            android:weightSum=""120""&gt;            &lt;Button android:id=""@+id/btn_mission"" android:layout_width=""0dp""                android:layout_height=""wrap_content"" android:background=""#8D8BB7""                android:layout_weight=""20"" android:text=""Mission""&gt;            &lt;/Button&gt;            &lt;Button android:id=""@+id/btn_news"" android:layout_width=""0dp""                android:layout_height=""wrap_content"" android:background=""#8D8BB7""                android:layout_weight=""20"" android:text=""News/Events""&gt;            &lt;/Button&gt;            &lt;Button android:id=""@+id/btn_studentservices""                android:layout_width=""0dp"" android:layout_height=""wrap_content""                android:background=""#8D8BB7"" android:layout_weight=""20""                android:text=""Student Services""&gt;            &lt;/Button&gt;            &lt;Button android:id=""@+id/btn_facultyservices""                android:layout_width=""0dp"" android:layout_height=""wrap_content""                android:background=""#8D8BB7"" android:layout_weight=""20""                android:text=""Faculty Services""&gt;            &lt;/Button&gt;            &lt;Button android:id=""@+id/btn_staff"" android:layout_width=""0dp""                android:layout_height=""wrap_content"" android:background=""#8D8BB7""                android:layout_weight=""20"" android:text=""Staff""&gt;            &lt;/Button&gt;            &lt;Button android:id=""@+id/btn_library"" android:layout_width=""0dp""                android:layout_height=""wrap_content"" android:background=""#8D8BB7""                android:layout_weight=""20"" android:text=""Library""&gt;            &lt;/Button&gt;        &lt;/LinearLayout&gt;    &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p></p><p>EDIT: It seems to be something to do with setting the background I removed the background and everything shared equal space except you still must scroll.</p>","411224","","411224","","2011-02-03 17:56:00","2011-02-03 18:05:58","ANDROID: Weighted Linear List Buttons disappear","<android><xml><button><android-linearlayout><weighted>","2","1","","",""
"4889579","1","4924495","","2011-02-03 17:40:05","3","1506","<p>I'm trying to record video with camera in android, but any output format i put produces a green and blocky video (though with normal sound)..</p><p>So here are the parameters i set (i tried h264 and mpeg_4_sp too)<code><pre>mediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);</pre></code></p><p>The native camera capture app does save the video ok (and it has h263 in configurations set)</p><p>Any ideas why it may occur in my app? Is there any other special settings to put here?</p><p>ps: my android version i use for test is 2.2.1 with BiffMod v2.1 </p><p>EDIT</p><p>this is how it looks on both Android and PC media players:<img src=""http://i52.tinypic.com/2rcbwau.jpg"" /></p>","266561","","266561","","2011-02-04 10:48:01","2013-04-14 01:16:32","Android camera capture produces green and blocky video","<java><android><video><camera><video-encoding>","1","0","2","",""
"4889618","1","","","2011-02-03 17:43:36","0","10055","<p>Hi i am trying to call a url in android using</p><pre><code>HttpClient mClient= new DefaultHttpClient()HttpGet get = new HttpGet(""www.google.com "");mClient.execute(get); HttpResponse res = mClient.execute(get);</code></pre><p>but i did not get any response..</p><p>plz help me ... how will call url in android..</p><p>thanx</p>","1648247","","","","","2014-03-25 15:22:34","Call external Url from android and get response","<android><url><call>","3","1","1","",""
"4889706","1","","","2011-02-03 17:50:41","0","383","<p>I am trying to use the <code>SearchManager</code> - it works ok but the icon I am specifying in the searchable.xml is not appearing on the bar instead the default ""green android"" button is showing up. I removed the icon line from <code>searchable.xml</code> but the ""green android"" button still shows up. What am I doing wrong here?</p><p><pre><code>android:searchSuggestAuthority=""xyz""android:searchSuggestIntentAction=""android.intent.action.VIEW""android:searchSuggestIntentData=""content://xyz/favorites"" /&gt;</code></pre>","602008","","331473","","2011-11-23 19:47:23","2011-11-23 19:47:23","SearchManager functionality - Icon on the left of the search bar","<android>","1","0","","",""
"4889728","1","4891235","","2011-02-03 17:53:27","0","4383","<p>Ok guys...I need to create a Alert dialog with 3 check boxes. If the top check box is clicked, 2 another one should be clicked and disabled !! I do them clicked, but not disabled. And i have no idea how to do that. </p><pre><code>@Override protected Dialog onCreateDialog (int id) {AlertDialog.Builder builder = new AlertDialog.Builder(this);        builder.setTitle(""AA"");             builder.setMultiChoiceItems(mStrings, mCheckedItems, new DialogInterface.OnMultiChoiceClickListener() {                     public void onClick(final DialogInterface dialog, int which, boolean isChecked) {                        switch (which) {                        case 0: {                        if(isChecked==true)  {                            for (int i = 1; i&lt;=2; i++) {                                                                ((AlertDialog) dialog).getListView().setItemChecked(i, true);                                                        }                        }                        if (isChecked==false) {                            for (int i = 1; i&lt;=2; i++) {                                                                    ((AlertDialog) dialog).getListView().setItemChecked(i, false);                                                           }                             break;                        }</code></pre><p>And this solution is not good to. Some times its not click all checkboxes. Have anybody any idea ?</p>","602011","","","","","2013-01-24 16:51:41","Android : How to disable CheckBox in AlertDialog?","<android>","3","0","","",""
"4889737","1","4890132","","2011-02-03 17:53:51","0","660","<p>I want to get all phone contacts from device in android.i have used the following code.but the problem is it  takes more time to return the results.is there any solution?</p><pre><code>ContentResolver cr = getContentResolver();        int index=0;        Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,                null, null, null, null);        if (cur.getCount() &gt; 0)         {            phoneNames=new String[cur.getCount()];            phoneNumbers=new String[cur.getCount()];        while (cur.moveToNext())        {            String id = cur.getString(                        cur.getColumnIndex(ContactsContract.Contacts._ID));             name = cur.getString(                        cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));        if (Integer.parseInt(cur.getString(cur.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) &gt; 0)        {             phoneNames[index]=name;            Cursor pCur = cr.query(                    ContactsContract.CommonDataKinds.Phone.CONTENT_URI,                     null,                    ContactsContract.CommonDataKinds.Phone.CONTACT_ID +"" = ?"",                     new String[]{id}, null);                    while (pCur.moveToNext())                     {                        phoneIndex++;                        phoneNumbers[index] = pCur.getString(pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));                        index++;                    }                     pCur.close();            }             }  </code></pre>","461972","","","","","2011-02-03 18:33:39","contacts in android","<android>","2","3","","",""
"4889782","1","4890027","","2011-02-03 17:56:53","0","1895","<p>I'm building a really simple Android project in ADT and using Maven. I have included both the slf4j-api and slf4j-android dependencies and I can see that everything is compiling properly. However, when I run or debug the application on my Nexus One, I don't see any log output. Is there a specific place I should be looking for these logs or should they be coming out in the Eclipse console?</p><p>For reference, here's my main activity:</p><pre><code>import org.slf4j.Logger;import org.slf4j.LoggerFactory;import android.app.ListActivity;import android.os.Bundle;public class HomeActivity extends ListActivity {private static Logger logger = LoggerFactory.getLogger(HomeActivity.class);@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        logger.debug(""onCreate"");    }}</code></pre>","128967","","","","","2011-12-30 10:56:02","Android: Can't get logs with SLF4J-Android","<android><slf4j>","2","0","0","",""
"4889842","1","4892026","","2011-02-03 18:02:26","0","3883","<p>I have problem sharing stream between JAVA and C with JNI. I am trying to call a java method from C. But I am getting a nosuchmethodfound exception, when I am trying to get GetObjectMethodID. My code is as follows : </p><p>C Code :</p><pre><code>jclass cls = (*env)-&gt;GetObjectClass(env,obj);jmethodID aMethodID = (*env)-&gt;GetMethodID(env, cls, ""callbackmethod"", ""(I)V"");if(aMethodID == 0) {     log(""Unable to get methodID""); //Always getting aMethodID as 0}int myvar=7;(*env)-&gt;CallVoidMethod(env,obj,aMethodID, myvar);</code></pre><p>Java Code</p><pre><code>public class myclass extends activity {       private void callbackmethod(int i) {            Log.d(""Tag"", ""In Java code"");         }             -------              more code   }</code></pre><p>Now I am always getting an error Ljava/lang/NoSuchMethodError;: callbackmethod</p><p>Everything looks fine, but my code doesn't work. What is the problem. Please suggest me some Ideas, I am running out of them.</p><p>Thanks in advance.</p>","574911","","545691","","2011-02-03 18:10:11","2011-02-03 21:37:06","Problem calling JAVA method from C through JNI with exeption NOSUCHMETHODERROR","<java><android><jni><android-ndk>","2","4","1","",""
"4889961","1","4890118","","2011-02-03 18:13:30","2","4115","<p>I'm creating animations to show and hide a side bar of my apk. But when the event occurs both animations get executed.</p><p>My switch anim code is </p><pre><code>private boolean showingBar = true;private void switchSideBar() {        if (showingBar) {            sideBar.startAnimation(hideBar);            Toast.makeText(this, ""Showing"", Toast.LENGTH_SHORT).show();            showingBar = false;        } else {            showingBar = true;            Toast.makeText(this, ""Hiding"", Toast.LENGTH_SHORT).show();            sideBar.startAnimation(showBar);        }    }</code></pre><p>I added those Toasts to see whats happening, and when the event occurs only one text is showed.</p><p>The code of the animations is that</p><p>showBar</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;translate xmlns:android=""http://schemas.android.com/apk/res/android""    android:fromXDelta=""-50"" android:toXDelta=""0""    android:duration=""300"" /&gt;</code></pre><p>hideBar</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;translate xmlns:android=""http://schemas.android.com/apk/res/android""    android:fromXDelta=""0"" android:toXDelta=""-50""    android:duration=""300"" /&gt;</code></pre><p>What's happening?</p>","558433","","","","","2011-11-02 06:24:23","Hide/show animation on one View, when happens occurs both - Android","<android><animation><view>","1","0","1","",""
"4890195","1","4890462","","2011-02-03 18:34:30","0","1003","<p>I need to create alert dialog with 3 check boxes....And when top check box is cliked, 2 another one should be clicked and Disabled....How to do that? I tried to do that with onMultiChoiseItems()...but a cannot disable items there....Have you any idea ?</p><p>Thanks in advance !</p>","602011","","","","","2011-05-08 16:28:20","How to disable check box in alert dialog","<android>","2","0","","",""
"4890273","1","","","2011-02-03 18:41:19","2","2855","<p>Here is my interpretation of the Encryption API found in HoneyComb preview SDK. I would like to know if the community thinks the same.</p><p>As a device admin, an application first has to check weather Encryption is supported by the tablet (in hardware). I don't think there is software encryption algorithm in honeycomb (it will defenitely slow down the tablet). So, if there is hardware support, the admin app can call the start encryption method (setStorageEncryption). This will trigger the hardware encryption process. According the honeycomb preview api documentation, this will encrypt only the application storage area (i.e. all the internal memory - my guess) and not the external memory (sd card).</p><p>SDK:</p><p>This policy controls encryption of the secure (application data) storage area. Data written to other areas (e.g. the directory returned by getExternalStorageDirectory() may or may not be encrypted.</p><p>I came across an engaget <a href=""http://www.engadget.com/2011/02/02/android-3-0-honeycomb-can-encrypt-all-your-data-needs-a-full/"" rel=""nofollow"">article</a> that says that the motorola xoom has an option to encrypt the entire tablet. This is a bit incomplete and misleading. Does this mean that Motorola has extended honeycomb to encrypt the SD card as well ?</p><p>Also, can anyone comment on my interpretation above ? Let me know if anyone has different ideas about encryption from the preview SDK or any other ""sources"" !</p><p>Since this question is closed, you can comment on this article <a href=""http://techtej.blogspot.com/2011/02/android-30-encryption-initial-thoughts.html"" rel=""nofollow"">here</a>.</p>","517940","","750987","","2011-05-29 06:47:19","2011-05-29 06:47:19","About encryption in Android 3.0 (Honeycomb)","<android><encryption><android-3.0-honeycomb>","0","1","","2011-02-06 22:31:04",""
"4890387","1","4890522","","2011-02-03 18:52:11","3","3178","<p>Is there any API or framework or anything that I can use in my Android app to detect other Android devices nearby that also have my app running on them?</p>","534101","","","","","2011-02-03 20:06:09","Use Android to detect other devices running my app nearby","<android><gps>","3","2","1","",""
"4890435","1","","","2011-02-03 18:57:55","0","290","<blockquote>  <p>Android requires .class compatibility set to 5.0. Please fix project properties.</p></blockquote><p>Thanks,Nahum</p>","564230","","189950","","2011-02-03 19:03:02","2011-02-03 19:05:22","How to fix the following compilation error?","<android>","1","1","","",""
"4890444","1","4949426","","2011-02-03 18:59:00","0","243","<p>I'm trying to put in RelativeLayout an image and text, and would like the text was down but over the image.</p><p><strong>My code</strong>:</p><pre><code>        RelativeLayout rl;        //        rl = new RelativeLayout(mContext);        rl.setLayoutParams(new GridView.LayoutParams(85, 85));        rl.setGravity(Gravity.CENTER);        ImageView imageView = new ImageView(mContext);        imageView.setId(1);        TextView textView = new TextView(mContext);        textView.setId(2);        //                      imageView.setImageResource(mThumbIds[position]);        textView.setText(mTextMenu[position]);        //        rl.addView(imageView);        //        RelativeLayout.LayoutParams mParams = new RelativeLayout.LayoutParams(                LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);        //                          mParams.addRule(RelativeLayout.ALIGN_BOTTOM, imageView.getId());                    rl.addView(textView, mParams);</code></pre>","532567","","750613","","2012-06-27 06:59:38","2012-06-27 06:59:38","Positioning text below image","<java><android><layout>","2","2","1","",""
"4890467","1","","","2011-02-03 19:01:22","1","1179","<p>I'm having problems inflating an AlertDialog with a custom XML. The problem is that it doesn't respect the width/height I've specified.</p><p><strong>volume.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:paddingLeft=""6dp"" android:gravity=""center""    android:layout_gravity=""center_horizontal"" android:orientation=""vertical""    android:layout_height=""wrap_content"" android:layout_width=""250dip""    android:id=""@+id/layoutRoot""&gt;    &lt;TextView android:layout_width=""wrap_content""        android:layout_gravity=""left"" android:id=""@+id/textView1""        android:layout_height=""wrap_content"" android:text=""Volume:""        android:layout_marginBottom=""10dp"" android:textSize=""22dp""        android:layout_marginTop=""10dp""&gt;&lt;/TextView&gt;    &lt;SeekBar android:layout_height=""wrap_content""        android:layout_width=""fill_parent"" android:id=""@+id/volumeBar""        android:minHeight=""10dp"" android:maxHeight=""15dp"" android:paddingLeft=""10dp""&gt;&lt;/SeekBar&gt;    &lt;TextView android:layout_width=""wrap_content""        android:layout_gravity=""left"" android:layout_height=""wrap_content""        android:layout_marginBottom=""10dp"" android:textSize=""22dp""        android:text=""20%"" android:id=""@+id/volumeText""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>Code:</strong></p><pre><code>    Builder alertbox = new AlertDialog.Builder(this);    AlertDialog alertDialog;    LayoutInflater mInflater = (LayoutInflater) this    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);    View VolumeView = mInflater.inflate(            R.layout.volume, (ViewGroup) findViewById(R.id.layoutRoot));    alertbox.setView(VolumeView);    alertDialog = alertbox.create();    alertDialog.show();</code></pre>","564468","","750613","","2012-06-27 07:01:36","2012-06-27 07:01:36","Wrong width/height inflating AlertDialog from XML","<android><layout><android-alertdialog>","1","2","","",""
"4890616","1","4890670","","2011-02-03 19:18:58","6","2300","<p>How can I get the minimum value of an database column? I need to find the minimum <code>_id</code> of a SQLite table.</p><p>I tried the following, but had no success: </p><pre><code>Cursor c = db.query(MY_DATABASE_TABLE_LAST_REQUEST, new String[] { ""min("" + KEY_ROWID + "")"" }, null, null,                    null, null, null);int rowID = c.getInt(0);</code></pre><p>What am I doing wrong? </p>","566904","","","","","2011-02-03 19:24:24","Get minimum from SQLite database column?","<android><sqlite>","1","2","1","",""
"4890797","1","4958122","","2011-02-03 19:37:18","2","1277","<p>Folks, when viewing a contact, you can press on the address to view that address in a map application (such as Google Maps or VZW Navigator). I would like define an intent-filter such that my app will show up in the list of apps that can handle said intent. Any ideas?</p><p>Thanks in advance.</p><p>From logcat, I see the following from ActivityManager:</p><pre><code>Starting activity: Intent { act=android.intent.action.VIEW dat=content://com.android.contacts/data/6792 cmp=android/com.android.internal.app.ResolverActivity }</code></pre><p>I've tried a several combinations of intent-filters, e.g.:</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=”geo” /&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.DEFAULT” /&gt;  &lt;category android:name=”android.intent.category.BROWSABLE” /&gt;  &lt;data android:scheme=”content” android:host=”com.android.contacts” android:pathPattern=”/data/*” /&gt;&lt;/intent-filter&gt;</code></pre>","534045","","","","","2013-07-30 05:06:11","Intent Filter for handling address press in Contact?","<android><filter><map><android-intent><contacts>","4","0","","",""
"4890858","1","4891023","","2011-02-03 19:42:20","1","456","<p>Ist there a possibility to do something like that:</p><pre><code>int selected_value = Dialog(""This dialog show a combobox, i want to know which item is selected"")</code></pre><p>Or</p><pre><code>String typed_chars = Dialog(""This Dialog show a TextBox, i want to know the typed chars"")</code></pre><p>It is strongly recommended, that the code will stop while the dialog is shown and resume after dismissing the dialog, like the ""showdialogforresult"" method in c# or vb.net, I have to show lots of Dialogs and every dialog depends on former choices, I will become crazy if i have to code this with listener or callbacks...</p>","432657","","512958","","2011-02-03 19:44:42","2011-02-03 19:59:36","Dialog Problem (result without onclicklistener?)","<android><dialog>","1","2","","",""
"4890877","1","","","2011-02-03 19:44:11","1","1868","<p>I know there is a way to restrict the orientation within an app, but is there a way in code of a web page (whether it be <code>HTML, CSS or JS</code>) to restrict the web view to only potrait?</p>","602130","","750613","","2012-06-27 06:57:00","2012-07-26 13:29:29","Disable landscape orientation in Android Browser?","<javascript><android><mobile><orientation>","4","0","","",""
"4890891","1","4891060","","2011-02-03 19:45:30","0","290","<p>Hello i have problem with my sms aplication.</p><pre><code>import java.util.ArrayList;import java.util.List;import android.app.Activity;import android.database.Cursor;import android.net.Uri;import android.os.Bundle;import android.telephony.SmsManager;import android.view.View;import android.widget.AdapterView;import android.widget.AdapterView.OnItemClickListener;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;public class Smsfive extends Activity {    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState, ListView messages) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        ListView list = (ListView) findViewById(R.id.list);        List&lt;String&gt; msgList = getSMS();        for(int i = 0; i&lt;msgList.size(); i++) {            System.out.println(msgList.get(i));        }        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,R.layout.main, msgList);     list.setAdapter(adapter);       list.setOnItemClickListener(new OnItemClickListener()     {            @Override        public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,                    long arg3) {                SmsManager m = SmsManager.getDefault();            String destinationNumber=(String) ((TextView)view).getText();                           m.sendTextMessage(destinationNumber, null, destinationNumber, null, null);        **there is Error ((TextView)view)**         }               });  }    public List&lt;String&gt; getSMS() {              List&lt;String&gt; list = new ArrayList&lt;String&gt;();        Uri uri = Uri.parse(""content://sms/inbox"");        Cursor c = null;        try{            c = getApplicationContext().getContentResolver().query(uri, null, null ,null,null);         }catch(Exception e){            e.printStackTrace();        }        try{            for (boolean hasData = c.moveToFirst(); hasData; hasData = c.moveToNext()) {                final String address = c.getString(c.getColumnIndex(""address""));                final String body = c.getString(c.getColumnIndexOrThrow(""body""));                list.add(""Number: "" + address + "". Message: "" + body);            }        }catch(Exception e){            e.printStackTrace();        }     c.close();      return list;    }}</code></pre><p>XML :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutandroid:id=""@+id/widget30""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:orientation=""vertical""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ListViewandroid:id=""@+id/list""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>Error:</strong> Description  Resource    Path    Location    Typeview cannot be resolved to a variable   Smsfive.java    /Sms5/src/sms/five  line 43 Java Problem.</p><p>Can somebody help me please?</p>","600468","","844882","","2012-06-27 13:46:30","2012-06-27 13:46:30","Sms aplication - Error","<android><sms>","1","0","","",""
"4890929","1","4949029","","2011-02-03 19:49:52","0","448","<p>I'm trying to build a sound toy for Android, and I'm the most familiar with <a href=""http://processing.org/"" rel=""nofollow"">Processing</a> for the visual side, which has been ported for Android. I want to use <a href=""http://puredata.info/"" rel=""nofollow"">Puredata</a> for sound, because at the moment it seems like the best option for dsp on Android. <a href=""http://forum.processing.org/topic/can-anyone-give-me-an-idea-of-how-to-use-puredata-with-processing-for-android"" rel=""nofollow"">I've been told on the Processing forums</a> that the best way to communicate with Processing through Puredata is to use TCP or UDP messages. I have no idea how to do this, because I am creating the .apk in the Processing environment and I don't see how I can launch the Puredata patch through Processing. Would this only be possible in pure Java? Or would I somehow have to launch a separate Puredata app at the same time. And are there any good resources for learning how to send TCP/UDP messages? Any help would be appreciated, and I can clarify if it makes it easier.</p><p>EDIT: It seems as if OSC uses the TCP protocol, so I'm not really sure why I can't use OSC. The only part I'm confused about is how to package the Processing sketch and the Puredata patch into one APK.</p><p>Thanks</p>","191726","","191726","","2011-02-03 23:52:18","2011-02-09 18:38:06","I'm trying to make an Android app using Android Processing for the visual side, and puredata for sound synthesis. Is this feasible?","<java><android><tcp><udp><processing>","1","0","","",""
"4890972","1","4928110","","2011-02-03 19:53:25","0","1711","<p>I have an application in which there are two buttons side-by-side at the bottom (in a TableLayout inside a RelativeLayout). This looks fine on small screens, but on larger screens there is an ugly black space left at the bottom. I want to expand the buttons vertically to fill the space, but can't work out how!</p><p>I've included the code below (with the contents of the RelativeLayout removed for simplicity; the below behaves in exactly the same way as the version with it)</p><pre><code>&lt;RelativeLayout android:id=""@+id/RelativeLayout01""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;TableLayout android:id=""@+id/TableLayout01"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;        &lt;TableRow android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;            &lt;Button android:layout_width=""wrap_content"" android:id=""@+id/Button01"" android:text=""@string/Button01"" android:layout_weight=""50"" android:layout_height=""fill_parent""&gt;&lt;/Button&gt;            &lt;Button android:layout_width=""wrap_content"" android:id=""@+id/Button02"" android:text=""@string/Button02"" android:layout_weight=""50"" android:layout_height=""fill_parent""&gt;&lt;/Button&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>Anyone have any idea how to stretch the buttons in the current layout, or a different layout that will allow me to do this more easily?</p><p>Thanks,</p>","586734","","586734","","2011-02-07 20:15:00","2011-02-07 23:52:32","Android: vertically stretching buttons","<android><layout><button><stretch>","2","0","","",""
"4891043","1","4891236","","2011-02-03 20:01:26","0","129","<p>If I build and distribute an Android app with a mysql database, it's pretty straightforward for someone to copy the database, and use it as a basis for their own app, on Android or elsewhere.</p><p>I see my options as:</p><p>Store data in the cloud instead, downloaded as needed</p><p>Accept it'll get ripped off, take the risk, focus on making my app great</p><p>Obfuscate the data (perhaps on a char-by-char basis so I can move in either direction, as I need to perform searches on my dataset)</p><p>Are there any better ways?</p>","477415","","477415","","2011-02-03 20:09:47","2011-02-03 20:17:59","How to distribute data with Android app, but reduce the ease of it being copied?","<android>","1","2","","",""
"4891044","1","","","2011-02-03 20:01:27","2","1028","<p>I'm developing a software that connects to a server using a Socket;</p><pre><code>connectionThread = new Thread(new Runnable( ) {    public void run() {        InetAddress serverAddress = InetAddress.getByName(ip);        serverSocket = new Socket(serverAddress, port);        //do more stuff        }    });connectionThread.start();</code></pre><p>When the client does not connect to the server the Thread keeps waiting for the return of the new Socket until timeout is reached.</p><p>I want to enable the user to cancel that action. I tried then to call <code>connectionThread.interrupt()</code> when the user clicks the back button. But the thread keeps running.</p><p>I could let the thread runs until the new Socket timeout, but I think that It's not very good. </p>","214562","","","","","2011-11-26 10:01:15","In Android how to stop a thread that is wating for a new Socket","<android><multithreading><sockets><interrupt>","1","0","1","",""
"4891058","1","4923553","","2011-02-03 20:02:54","0","523","<p>We have a multimedia application that allows users to download wallpapers and watch video clips. As of now we just have a limited number of pictures and videos stored within the application bundle (which drives the app size up). Now we are going to set up a webserver to house the content, and the application will be accessing the content over the internet. </p><p>I have never worked on or setup a webserver, but our client said he would rather add the content to their server anyways. Is there a certain way it needs to be setup? Is all I need is a url to access each picture and video? I apologize if I didn't explain that too good. I'm not too familiar with the server end of things. Thanks for any help.</p><p>We will have over 100 pictures and probably around 20 video clips. Does each image and video clip need to be setup with its own url? Or is there another way to do it?</p>","469194","","469194","","2011-02-03 21:20:41","2013-05-08 06:26:25","Setting up webserver to access media content for Android, Blackberry, and iPhone applications","<iphone><android><webserver>","3","0","","",""
"4891092","1","","","2011-02-03 20:05:59","0","1264","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1691569/findviewbyid-returns-null-for-custom-component-in-layout-xml-not-for-other-com"">findViewById() returns null for custom component in layout XML, not for other components</a>  </p></blockquote><p>Hi!I cant reach my custom view with findViewById(). The reason I need to reach it, is because I want to make a menu from class A that interacts with class B. </p><p>The setup:I got two classes A and B. A extends Activity and B extends View. I want to reach the B class from A, but when I use findViewById() on class B, it returns null. I have seen similar questions, but most of them just used the wrong .xml file. Here I am quite sure I use the right .xml file (R.layout.main) and in main.xml layes my viewTest. It runs smoothly and does what I want, unless I want to do something from class A to class B.. And, as far as I know, I need to use class A to create a menu I want.</p><p>Here is the piece from class A, in which I try to use findViewByID():</p><pre><code>viewTest viewTest;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    viewTest = (ViewTest) findViewById(R.id.snakes);}</code></pre><p>Here is the .xml file, from which I try to get the id snakes from:</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;com.Test.ViewTest     android:id=""@+id/snakes""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent"" /&gt;&lt;/FrameLayout&gt;</code></pre><p>This has really been bugging me and I think the answer is right under my nose, I just can't see it >.&lt; Thanks in advance for any answer that can get me closer to solving this! :D</p>","602167","","53501","","2011-02-03 20:10:35","2011-02-03 20:10:35","FindViewByID on custom view returns null?","<android>","0","2","","2011-02-04 00:06:18",""
"4891100","1","4891638","","2011-02-03 20:06:51","3","3677","<p>At this point I'm quite frustrated. I've been researching this for a few days and cannot even isolate anything beyond a cursor problem. I am extending ListActivity and using startManagingCursor(newcursor) in the OnCreate method. Here is the code (the database is already filled) that runs and crashes upon hitting the home button:</p><pre><code>private void loadAlbums() {    try {        newcursor = mDbHelper.getAlbumTitlesCursor();        dbalbumadapter = new AlbumListCursorAdapter(this, newcursor);        setListAdapter(dbalbumadapter);        }    catch (SQLiteException s) {        newcursor = null;        fetchalbums = new FetchAlbumsTask().execute();        }    current_view = ALBUMTITLE_VIEW;}</code></pre><p>Here is the error log:</p><pre><code>02-03 13:41:42.379: WARN/dalvikvm(340): threadid=3: thread exiting with uncaught exception (group=0x4001b188)02-03 13:41:42.389: ERROR/AndroidRuntime(340): Uncaught handler: thread main exiting due to uncaught exception02-03 13:41:42.590: ERROR/AndroidRuntime(340): java.lang.RuntimeException: Unable to stop activity {com.skip.ngRCv2/com.skip.ngRCv2.ngRC}: java.lang.RuntimeException: Unable to stop activity {com.skip.ngRCv2/com.skip.ngRCv2.MusicLibraryActivity}: java.lang.NullPointerException02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3227)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3272)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.app.ActivityThread.access$2500(ActivityThread.java:119)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1880)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.os.Handler.dispatchMessage(Handler.java:99)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.os.Looper.loop(Looper.java:123)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.app.ActivityThread.main(ActivityThread.java:4363)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at java.lang.reflect.Method.invokeNative(Native Method)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at java.lang.reflect.Method.invoke(Method.java:521)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at dalvik.system.NativeStart.main(Native Method) 02-03 13:41:42.590: ERROR/AndroidRuntime(340): Caused by: java.lang.RuntimeException: Unable to stop activity {com.skip.ngRCv2/com.skip.ngRCv2.MusicLibraryActivity}: java.lang.NullPointerException02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3227)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.app.ActivityThread.performStopActivity(ActivityThread.java:3174)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:176)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.app.LocalActivityManager.dispatchStop(LocalActivityManager.java:572)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.app.ActivityGroup.onStop(ActivityGroup.java:79)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1169)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.app.Activity.performStop(Activity.java:3797)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3224)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     ... 11 more02-03 13:41:42.590: ERROR/AndroidRuntime(340): Caused by: java.lang.NullPointerException02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.app.Activity.performStop(Activity.java:3808)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3224)02-03 13:41:42.590: ERROR/AndroidRuntime(340):     ... 18 more</code></pre><p>There is a NullPointerException at Activity.performStop(Activity.java:3808), which seems to come from this method in Activity.java even though I can't cross-verify that with the line number:</p><pre><code>final void performStop() {     if (!mStopped) {         if (mWindow != null) {             mWindow.closeAllPanels();         }         mCalled = false;         mInstrumentation.callActivityOnStop(this);         if (!mCalled) {             throw new SuperNotCalledException(                 ""Activity "" + mComponent.toShortString() +                 "" did not call through to super.onStop()"");         }         synchronized (mManagedCursors) {             final int N = mManagedCursors.size();             for (int i=; i&lt;N; i++) {                 ManagedCursor mc = mManagedCursors.get(i);                 if (!mc.mReleased) {                     mc.mCursor.deactivate();                     mc.mReleased = true;                 }             }         }         mStopped = true;     }     mResumed = false; }</code></pre><p>I have tried closing and deactivating my cursor in the OnStop method as well as setting the list adapter to null. I was under the impression that none of this was necessary when letting the activity manage the cursor as I indicated. I am passing the cursor to my custom adapter but none of the examples I've found do any managing inside the adapter.</p><p>If you can help me at least narrow down what is throwing this exception, I would be grateful!</p>","599122","","512958","","2011-02-03 20:18:32","2011-02-03 23:03:09","Why is my activity crashing when hitting the home button?","<android><cursor><nullpointerexception><listactivity><runtimeexception>","2","2","1","",""
"4891103","1","4891452","","2011-02-03 20:07:04","0","528","<p>Can anyone tell me how to <strong>Stream</strong> from a <strong>HTTPS</strong> (note the S) video source on Android?!</p><pre><code>VideoView mVideoView = (VideoView) findViewById(R.id.videoplayback_videoView);... Uri videouri = Uri.parse(""https://myvideo.mp4"");  mVideoView.setVideoURI(videouri);  mVideoView.start();</code></pre><p>This type of approach does not work. If i remove the ""S"" it works.</p>","396993","","","","","2014-03-27 08:24:33","Can anyone tell me how to Stream from a HTTPS (note the S) video source on Android","<android><video><https><streaming>","2","2","","",""
"4891105","1","4892810","","2011-02-03 20:07:06","3","575","<p>For my app, I have a fairly complex set of configuration options that user can pick from. I'm currently using a PreferenceActivity as my user interface for these options and the options are stored using shared preferences. As an example of some of the settings I have to accommodate:</p><ul><li><p>Lists of pairs: to select a background pattern, the user can select to use from 1 to 5 different shapes (where each shape is a .png file) and assign each shape an int color. For example, the user could pick an orange square, a green triangle and a red rectangle.</p></li><li><p>Hierarchical data: one part of my app can be configured to use one of five modes. Each mode has a few associated unique settings e.g. one mode requires two integers to be chosen the other mode might require one boolean to be chosen.</p></li></ul><p>However, my feeling is PreferenceActivity doesn't work well with settings like the above because:</p><ul><li>Shared preferences cannot store lists.</li><li>Shared preferences cannot store hierarchical data.</li><li>Boiling my preference interface down to e.g. individual preference buttons for configuring each color and using dependent preferences to disable preferences that aren't applicable with the current mode is going to make for a messy and hard to use interface.</li></ul><p>I could write my own Preference classes for configuring the lists, but I find these really laborious to implement compared to implementing a typical View and I've still got to deal with the storage issues.</p><p>My plan was:</p><ul><li>Just implement a custom activity with a custom GUI. This gives me much more freedom for doing a nice interface for configuring the lists and I can do intelligent hiding of options that aren't applicable to the current mode.</li><li>Store all my settings in either an XML file or by serialising a Java object. This means I can easily support hierarchical  data and variable length lists, which allows room for further extensions.</li></ul><p><b>Does this plan seem reasonable?</b> I'm concerned I'm not doing things the Android way, but it seems to me that shared preferences and PreferenceActivity aren't suited to my needs here.</p>","580100","","580100","","2011-02-03 21:13:50","2011-02-03 23:07:10","Best way to implement a complex preference screen?","<java><android><user-interface><mobile>","1","0","1","",""
"4891164","1","4997698","","2011-02-03 20:12:37","1","505","<p>When running Android JUnit tests the values of text in TextView can not be accessed  by .getText().toString() causing tests to fail.</p><p><a href=""http://www.android10.org/index.php/articlesother/203-unit-testing-with-the-junit-testing-framework"" rel=""nofollow"">http://www.android10.org/index.php/articlesother/203-unit-testing-with-the-junit-testing-framework</a></p><p>I  downloaded  the code  from the  above web-page and  ran the  unit  tests.</p><p>All unit tests  failed. The  framework did  not  return any  values from the   result.getText().toString();</p><p>Why  should this be?</p>CODE<p>// get result</p><pre><code>String mathResult = result.getText().toString();assertTrue(""Add result should be 98 "" + ADD_RESULT + "" but was ""+ mathResult, mathResult.equals(ADD_RESULT));}public void testAddDecimalValues() {sendKeys(NUMBER_5_DOT_5 + NUMBER_74 + ""ENTER"");String mathResult = result.getText().toString();assertTrue(""Add result should be "" + ADD_DECIMAL_RESULT + "" but was ""+ mathResult, mathResult.equals(ADD_DECIMAL_RESULT));}</code></pre>TRACE<blockquote><pre><code>junit.framework.AssertionFailedError:</code></pre>    <p>Add result should be 79.5 but was      at com.mamlambo.article.simplecalc.test.MathValidation.testAddDecimalValues(MathValidation.java:57)      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)</p></blockquote>","179285","","","","","2011-02-14 21:52:29","When running Android JUnit tests the values of text in TextView can not be accessed by .getText().toString() causing tests to fail","<android><unit-testing><junit>","1","0","","",""
"4891241","1","","","2011-02-03 20:18:36","0","1064","<p>hey people,I have been reading the first answer <a href=""http://stackoverflow.com/questions/708012/android-how-to-declare-global-variables"">here</a> to setup a class to hold my global variables.I have created the following class within my applications java file, my main activity follows it:</p><pre><code>class GlobalStore extends Application {    String str;}public class todo extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);                GlobalStore appState = (GlobalStore) getApplicationContext();        String tmpstr = appState.str;    }}</code></pre><p>My manifest.xml file has the following tag:</p><pre><code>&lt;application android:icon=""@drawable/icon""    android:label=""@string/app_name""    android:name=""GlobalStore""&gt;</code></pre><p>I'm pretty sure I followed the instructions correctly however my app force closes when it starts. Hopefully someone can point out what I have done wrong as I can't work it out.  Thanks.</p>","597334","","418183","","2011-02-03 20:27:44","2012-10-07 05:29:49","Extending Application for global variables","<android><android-manifest>","2","1","","",""
"4891267","1","4891414","","2011-02-03 20:21:10","0","632","<p>I'm still rather new to Java programming, so maybe there is an obvious answer to this but I've searched my code and the web and can't find the root of this problem. I have created this method in a layout file for my application:</p><pre><code>    public void setNumLabels(char[] labels){    int niCC = getChildCount();    for(int c = 0;c &lt; niCC; c++){        if(getChildAt(c) instanceof TableRow){            TableRow tr = (TableRow) getChildAt(c);            int trCC = tr.getChildCount();            for(int rc = 0;rc &lt; trCC;rc++){                if(tr.getChildAt(rc) instanceof Button){                    ((Button) tr.getChildAt(rc)).setText(labels[c*3+rc],1);                }            }        }    }</code></pre><p>The problem I'm having is that the compiler (and apparently <code>Dalvik</code>) sees ""<strong>labels[c*3+rc]</strong>"" in the setText as an int instead of a char. What am I missing? For now, I've read the char[] element into a String and used that for setText but that seems kinda inelegant.</p>","571876","","750613","","2012-06-27 06:51:40","2012-06-27 06:51:40","Android SDK setText confusing char[] element with int","<android><android-widget>","2","0","","",""
"4891276","1","","","2011-02-03 20:21:52","6","1427","<p>I am trying to test my app using the <a href=""http://developer.android.com/guide/developing/tools/monkeyrunner_concepts.html"" rel=""nofollow"">MonkeyRunner</a> tool.  I am trying to add an EXTRA to my activity.  The python script executes without error:</p><pre><code>device = MonkeyRunner.waitForConnection()device.wake()extra = {'MY_EXTRA', True}device.startActivity(component=""org.mycompany.myapp/.activity.Show"",extras=extra)</code></pre><p>But when I inspect the intent in my app I do not get the value passed:</p><pre><code>boolean myExtra = i.getBooleanExtra(""MY_EXTRA"", false);</code></pre><p>What am I missing?  Am I passing in the intent wrong?  Am I inspecting the value in the Android app wrong?</p>","225","","225","","2011-03-21 16:14:17","2012-12-26 03:53:50","How can I pass an Extra to an Android intent using MonkeyRunner?","<android><monkeyrunner>","1","0","2","",""
"4891420","1","","","2011-02-03 20:36:06","0","379","<p>I have implemented a App Widget to launch my activity when clicked. </p><p><code>onUpdate()</code> method of <code>WidgetProvider</code>:</p><pre><code>public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {    super.onUpdate(context, appWidgetManager, appWidgetIds);    final int N = appWidgetIds.length;    for (int i=0; i&lt;N; i++) {        int appWidgetId = appWidgetIds[i];        RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.mywidgetprovider_layout);        // ....update updateViews here        appWidgetManager.updateAppWidget(appWidgetId, updateViews);        Intent onClickedIntent = new Intent(context,MyActivity.class);        PendingIntent pi = PendingIntent.getActivity(context, 0, onClickedIntent, 0);        updateViews.setOnClickPendingIntent(R.id.myView, pi);        appWidgetManager.updateAppWidget(appWidgetId, updateViews);     }}</code></pre><p>It work as expected after the widget added on home screen.</p><p>But after sometimes, it cannot launch the activity again! I have to remove the widget and add again.</p><p>How can I fix it? please help.</p>","573528","","750613","","2012-06-27 06:55:27","2013-01-14 06:09:23","Launching activity from widget fail after sometimes","<android><activity><launch><appwidget><homescreen>","2","0","","",""
"4891598","1","4980286","","2011-02-03 20:51:56","4","4753","<p>I'm currently working on an app to display the battery status and I'd like to use Android-drawables instead of own images to reduce the app size.</p><p>I've found this page which lists available images and the availability for each SDK-version:<br /><a href=""http://www.fixedd.com/projects/android_drawables_display"" rel=""nofollow"">http://www.fixedd.com/projects/android_drawables_display</a></p><p>My question: How can I access the ""system""-drawables? If you click on the link and choose the tab ""Status"", there are some battery-drawables like ""stat_sys_battery_0"", but I can't access it, Eclipse doesn't offer intellisense for it and won't compile the app if I use one of those drawables.</p><p>As those drawables are part of all SDK-versions, I'd think I should be able to use them, or are those ""special"" drawables protected in a way so they can only be used by system-functions (and not apps)?</p><p>Any idea is appreciated.</p><p>Select0r</p>","255905","","21234","","2011-02-03 23:52:31","2011-02-28 23:49:27","Android: access ""system""-drawables","<android><drawable>","3","0","","",""
"4891603","1","4892178","","2011-02-03 20:52:18","6","227","<p>I had my first NullPointerExceptions in my app and it showed up on the Developer Console.</p><p>While I was starting to ask for advice here I realised what the problem was, but it brought to the front of my mind something that's been bothering me for some time - how to make it as easy as possible to debug my code when the only thing I have access to is the developer console and the stack traces present there.</p><p>In other words, is there anything I can do as a developer to improve the feedback I get when my app crashes in the wild? Maybe it's Google Analytics, maybe the Instrumentation classes, but there must be a better way to get more context to help me debug my app when I don't have access to the user or their device for debugging?</p>","318465","","318465","","2011-02-03 21:07:13","2011-02-03 21:56:02","How do I improve quality of debug data when my app crashes in the wild?","<android><remote-debugging>","2","0","0","",""
"4891621","1","","","2011-02-03 20:54:28","3","467","<p>I have an Activity that pops up an AlertDialog under certain circumstances.</p><p>However, if you rotate the device, the Activity gets destroyed and recreated and the AlertDialog is gone.</p><p>How are people handling this?</p><p>It would be easy enough to save some flag to savedInstanceState letting the Activity know to throw the AlertDialog again upon creation, but what if your AlertDialog needs lots of data and that data is dynamic?  That's going to get ugly really fast.</p><p>Especially in my case:</p><p>When my app wants to make a web service call, it boots up an IntentService, passes an Intent with the necessary data (credentials and data to send to the web service) and starts.  If the Intent being processed by the IntentService fails due to a log in error, it broadcasts a message which my Activities will hear.  I've extended Activity and ListActivity and added a BroadcastReceiver to them.  My app's Activities extend from these.  They then pop up an AlertDialog requesting the user's credentials.  The original Intent's extras also get passed along so, after a successful login, it can get re-processed.  Unfortunately, when the user changes the screen orientation (for example, by pulling out the hardware keyboard) the AlertDialog is going to disappear.</p>","406790","","","","","2011-02-04 09:20:34","Retaining an AlertDialog","<android><alertdialog><activity-lifecycle>","0","0","","",""
"4891695","1","4891726","","2011-02-03 21:02:14","0","296","<p>Is there any decent API to read xml string data like we do using JQuery or with DOM?</p>","355507","","460368","","2011-02-04 09:50:12","2011-02-04 09:50:12","Java/Android Decent XML Reading API","<java><android><xml><api>","2","1","","",""
"4891711","1","4892344","","2011-02-03 21:03:17","3","4057","<p>Is it possible to programatically, or via xml configuration (and not via 9patch png), to achieve the effects as seen on Springpad widget:</p><p><img src=""http://i.stack.imgur.com/8pNRq.jpg"" alt=""enter image description here""></p><p>If you look closely, there's a sharp border/line between the upper (brighter) and lower (darker) gradients. Also, there are inner and outer shadows for that embossed area on the right.</p><p>I know how to set gradient background on a button, but that gradient is constant, without that sharp line in the middle. Also, I couldn't find any reference on shadow creation and manipulation.</p><p>Thanks.</p>","501638","","593709","","2012-04-10 10:05:27","2012-04-10 10:05:27","Gradients and shadows on buttons","<android><android-widget>","2","1","2","",""
"4891857","1","5423732","","2011-02-03 21:18:53","1","128","<p>I am writing an application for Android that needs to respond as fast as possible. The app basically grabs content from a website (<code>HTML, not XHTML</code>) and parses some of its information using <code>XPATH</code> queries. I want the user to be able to hit cancel and abort the request, returning to the previous activity.</p><p>Right now my code looks like this (I use the htmlcleaner jar from <a href=""http://htmlcleaner.sourceforge.net/"" rel=""nofollow"">http://htmlcleaner.sourceforge.net/</a> to <code>convert html to xhtml</code>):</p><pre><code>   //this is called from the doInBackground() method embedded in an ASyncTask   HtmlCleaner cleaner = new HtmlCleaner();   CleanerProperties props = cleaner.getProperties();   props.setAllowHtmlInsideAttributes(true);   props.setAllowMultiWordAttributes(true);   props.setRecognizeUnicodeChars(true);   props.setOmitComments(true);   try {        URL url = new URL(""---my-url-goes-here---"");        URLConnection conn = url.openConnection();        TagNode node = cleaner.clean(new InputStreamReader(conn.getInputStream()));        return node;   } catch (Exception e) {       failed = true;   }</code></pre><p>I am not sure if the downloading in my code is actually abortable, let alone that I would know how to accomplish this. Am I on the right way or should I go for a different approach?</p>","602251","","750613","","2012-06-27 06:32:14","2012-06-27 06:32:14","Getting a web page in an abortable process on Android. What is the most responsive way?","<android><uri><httprequest><android-asynctask><abort>","1","1","0","",""
"4891876","1","","","2011-02-03 21:21:02","3","9453","<p>I have built a simple custom app that we would like to push out to our sales reps phones.  I developed it using Eclipse with the Android SDK and it is written for Android version to 1.5 and the min SDK is set to 3.  I have compiled the app with a private key (not the debug key) and everything compiles without errors.  When I send the .apk file to a few users via email to test, they receive a parse error when clicking on the .apk file.  The following is the content from the log:</p><p>WARN/PackageInstaller(2873): Parse error when parsing manifest. Discontinuing installation</p><p>However, when one user opened the message in Gmail, they were given the option to Install the .apk and it installs and runs without any problems.</p><p>Can anyone tell me if it is possible to email the .apk file to the desired people and have it install directly from an email?  We also saved the .apk file to the SD card and tried to install it from there with the same result.  I found several suggestions about installing a file manager to the phone and using that to install from the SD card.  However, the fewer steps the better when pushing this out to our reps.</p><p>Any help would really be appreciated.</p>","602258","","255721","","2012-09-10 11:21:35","2012-10-04 05:50:11","Parse Error Installing custom built .apk","<android><parsing><android-install-apk>","4","0","1","",""
"4891960","1","","","2011-02-03 21:31:12","4","659","<p>I have a listview that contains some values with the multipleChoice enabled in my xml file.I want to be able to save what has been checked by the user when the app is exited, then re-check what they have selected upon opening again. My code works for a radio group, but I can't seem to get it to work for this.</p><p><strong>EDIT:</strong> Got this working by using some for loop trickery at the end. </p>","602279","","750613","","2012-06-27 06:32:30","2012-06-27 06:32:30","Android save state of listview with multipleChoice","<java><android>","2","2","","",""
"4892111","1","","","2011-02-03 21:46:24","21","5546","<p>I am having some trouble getting the selection from a WebView in Android.</p><p>I can get the WebView to go into selection mode. I can even get it to copy the text to the ClipBoard. But what I really want to do is highlight the selection permanently. </p><p>So the idea is put the WebView in select mode. Let the user select the text, and then fire something to highlight that text. I can get it to work by getting the selected text from the clipboard, and then search for it in Javascript and highlight it. The problem occurs when the user selects a real common word. I have to either highlight them all or somehow figure out where the selection is to get the right one. </p><p>I have tried this JavaScript which works on the iPhone. Bu getSelection() does not seem to work on the Android. </p><pre><code>function highlight(colour) {    var range, sel;    if (window.getSelection) {            // Non-IE case        sel = window.getSelection();        if (sel.getRangeAt) {            range = sel.getRangeAt(0);        }        document.designMode = ""on"";        if (range) {            sel.removeAllRanges();            sel.addRange(range);        }            // Use HiliteColor since some browsers apply BackColor to the whole block        if ( !document.execCommand(""HiliteColor"", false, colour) ) {            document.execCommand(""BackColor"", false, colour);        }        document.designMode = ""off"";    } else if (document.selection &amp;&amp; document.selection.createRange) {            // IE case        range = document.selection.createRange();        range.execCommand(""BackColor"", false, colour);    }}</code></pre><p>Any suggestions?</p>","548762","","","","","2013-11-05 12:31:15","Android WebView Javascript getSelection","<javascript><android><webview>","3","1","5","",""
"4892179","1","7341546","","2011-02-03 21:56:08","26","16291","<p>I've implemented the commonly-pointed-to VerticalSeekBar post <a href=""http://stackoverflow.com/questions/631238/modifying-the-android-seekbar-widget-to-operate-vertically"">here</a>. As it is, the SeekBar operates a little quirky. Here is my slightly adapted <code>onTouchEvent()</code> from that example:</p><pre><code>public boolean onTouchEvent(MotionEvent event)    {            xPos = event.getX();            yPos = event.getY();            oOffset = this.getThumbOffset();            oProgress = this.getProgress();            //Code from example - Not working            //this.setThumbOffset( progress * (this.getBottom()-this.getTop()) );            this.setProgress((int)(29*yPos/this.getBottom()));            return true;    }</code></pre><p>I've managed to implement one VerticalSeekBar in which the progress updates as expected and is fully-functional, but the thumb does not follow suit. This is only a graphical glitch, so I'm overlooking it for now. But, it <em>would</em> be nice to have that working. This SeekBar has <code>max = 20</code>.</p><p>However, I tried implementing another VerticalSeekBar with <code>max = 1000</code>. Obviously, it uses the same code, so you'd assume the same behavior. I'm only able to achieve a progress of 0~35, even as my finger slides beyond the SeekBar and eventually off the screen. If I just tap near the end of the progress bar (which <em>should</em> be <code>progress ~ 900</code>) it returns a progress of about 35 and the yellow progress bar reflects that value by staying near the top.</p><p>My question is: Does anyone have a link to a working vertical SeekBar, <em>or</em> know how to adapt this particular example?</p>","408178","","435093","","2012-12-02 15:09:46","2013-12-17 11:52:49","How can I get a working vertical SeekBar in Android?","<android><seekbar>","6","1","24","",""
"4892365","1","4892399","","2011-02-03 22:15:43","4","6206","<p>Hi guys I am trying to make an app that once the user taps on a map it gets the coordinates of that specific point. </p><p>Among others i have also read that: <a href=""http://stackoverflow.com/questions/4177305/get-coordinates-on-tapping-map-in-android"">Get coordinates on tapping map in android</a></p><p>It seems like the most relevant post but what I want to do is to be able to tap anywhere on the map not on an marker/overlay item. In fact I want to create a marker in that specific point that the user tapped and get the coordinates of it.</p><p>Is that possible? </p><p>Thanks</p><p>Mike</p>","582665","","750613","","2012-06-27 06:31:23","2012-06-27 06:31:23","Android tap on map and get coordinates","<android><overlay><coordinates><android-mapview><google-maps-markers>","3","0","1","",""
"4892487","1","4902845","","2011-02-03 22:29:18","2","4772","<p>Im having trouble getting this to work, here´s a quick overview of the idea.</p><p>First, I cant change the logic behind this, it was a specific requirement from the customer, I realize that with any tool such as AnyCut it could be bypassed but that doesnt matter really.</p><p>My customer offers a suite of apps, the idea is that all applications bellonging to the suite would be launched from a ""Dashboard app"", so that I only show the Dashboard app in the main launcher and not all app icons.</p><p>Lets take two Apps to get the idea solved. The Dashboard App (A) and the Recieving App (B).</p><p>I want to establish an intent filter (I think) on app B so that whenever I go into app A, and click the app B icon the app will be either launched or started from where it let of (brought to front).</p><p>Is this even possible? If so, how can I do it? I managed to get it to launch by specifically launching one activity in the app using:</p><pre><code>Intent i = new Intent();i.setClassName(""PACKAGE_NAME"",""SPECIFIC_CLASS"");startActivity(i);</code></pre><p>But that isnt the behaviour that I want, as it always starts app B in the same spot.</p><p>Thanx in advance,                Stefano</p><p>Edit: Added some new information. I was taking a look at the DDMS.</p><p>If I launch the application from scratch through the main Android launcher the intent is exactly the same as when I leave the home button pressed and then only bring the app to front, what ever activity im in. So I was trying to reproduce, unsucsesfully until now, this intent.</p><pre><code>INFO/ActivityManager(1292): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example.package/.uiPackage.Activity}</code></pre><p>This is how AnyCut does it</p><pre><code>Intent { act=android.intent.action.VIEW flg=0x10000000 cmp=com.example.package/.uiPackage.Activity bnds=[125,242][235,360]}</code></pre><p>Any idea how I could go about creating that exact same intent? I cant even find that flag in the Intent API.</p>","474883","","474883","","2011-02-04 20:44:15","2011-02-07 19:49:52","Android Launching or bringing to front another application via Intent","<android><android-intent><launch><intentfilter>","3","0","1","",""
"4892499","1","4892544","","2011-02-03 22:30:01","2","876","<p>I a view have for which I would like to show a ContextMenu on a longPress. I was able to get this ContextMenu to display using the recommended method of: calling activity.registerForContextmenu and overriding onCreateContextMenu(...).</p><p>However, I would like to do other things on other touch events, so my view has a TouchHandler assigned to it.  When this touch handler is set, the onCreateContextMenu() never gets called (presumably because my TouchHandler is eating the longPress).  So, is there anyway for me to instantiate and show a ContextMenu without the onCreateContenxtMenu() method being called?  </p><p>Alternatively, I could just show my own custom dialog with my ""menu"" items.  Is there any disadvantage to using a custom dialog instead of the ContextMenu?</p>","426493","","","","","2011-02-03 22:36:43","Android: show ContextMenu on longPress for a view?","<android><contextmenu>","2","0","1","",""
"4892547","1","","","2011-02-03 22:36:39","15","3204","<p>Admittedly, my question is basically the same as this one, but it seems to have been left unanswered:</p><p><a href=""http://stackoverflow.com/questions/3513859/nullpointerexception-in-handlestopactivity-no-reference-to-my-code-in-stack-tr"">NullPointerException in handleStopActivity -- No reference to my code in stack trace</a></p><p>Downloaded Eclipse Helios, Android Developer Tools Plugin, and the JDK all within the last week.  I was messing around with an app on my device, ran it in Debug mode, and it unexpectedly terminated.  I realized I had caused a NullPointerException and the problem itself was not an issue for very long.</p><p>What is an issue, however, is that the debugger seems unable to identify where in my code the exception was thrown.  The stack trace does not reference my code.</p><p>Indeed, if I put the following in the <code>OnCreate()</code> method, I get the same problem</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    //lI(""onCreate()"");  //A silly logging thing I messed around with    Integer iDareYou = null;    iDareYou.byteValue();</code></pre><p>Much to its credit, Eclipse certainly warns me that the code is likely to blow up in my face.  But when I actually run this on my device, the stack trace returned is the following:</p><pre><code>Thread [&lt;1&gt; main] (Suspended (exception RuntimeException))  ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2787  ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2803   ActivityThread.access$2300(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 135 ActivityThread$H.handleMessage(Message) line: 2136  ActivityThread$H(Handler).dispatchMessage(Message) line: 99 Looper.loop() line: 144 ActivityThread.main(String[]) line: 4937    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>I searched around for some answers and unfortunately all I could come up with were questions of the 'Why is my Android app causing a NullPointerException'? variety.</p><p>I'm hoping to find out what I should be doing differently in order to be able to find the point in my code where I caused the exception.... because I'm sure this ability would come in handy at some point in the future!</p><hr><p>Going to edit this to add some information.  As the first comment below mentions, the state in which the debugger suspends the thread is not the 'final' state of the application.  Pressing 'resume' a couple times moves the process along to the point where the process actually terminates, although unfortunately no helpful stack trace is displayed in the Eclipse/ADT Debug window.  <em>However</em>, at this point the stack trace I pasted above <em>Followed By</em> the first 3 unique lines of the stack trace of the NPE in my code is output to LogCat.  I had previously looked to see if LogCat had anything I could use, but most likely it was before I had pressed 'resume' in the debugger to move the process to this state.  Unfortunately though, doing it this way never displays a stack trace of the NPE in my code in the actual debugger.</p><p>But the news isnt all bad - from the information in the 'Variables' window on the right, I can see that there is an NPE in the thread's current scope, so that would at least give me a clue that an NPE is going on (and of course there is LogCat).</p><p>So based on a suggestion in a different topic, the best work around I've found is to add a ""Caught and Uncaught"" breakpoint for NullPointerException.  When I do this and relaunch, the debugger displays the stack trace of the NPE in my code, and moves the edit window straight to the line where I caused the NPE.</p><p>At the moment I believe this is because the NPE is being caught (and presumably, thrown again) by the Android framework.  <strong>It appears the original dilemma was caused by the fact that the Eclipse/ADT/DalvikVM Debug Stack Trace window does not include the 'caused by' information (as far as I can tell) that is displayed in the stack trace ""later"" appearing in LogCat</strong>.  I will investigate further as to whether this can be remedied :)</p><p>I appreciate Bert F's suggestion, as I was not fully aware that the thread was not yet in its 'final' state.  While it is true that the stack trace is [later] displayed in LogCat, I did not 'miss' it in LogCat because it was not [yet] there, what I did miss was hitting 'resume' which would have caused the stack trace to be output in LogCat.  </p><p>Even though I originally got the debugger to stop at the line in my code using a breakpoint, there is a case for the fact that I could have ultimately obtained the stack trace in LogCat after resuming the thread, which would have effectively solved the problem.  The only other thing I could really ask for would be to have the debugger stop at the line in my code causing the exception, instead of it being caught and later re-thrown by the Android framework.  But I believe that would be a different question :)  And Eclipse, being useful as it is, will send me there if I click on the appropriate line in the stack trace displayed in the LogCat window.</p>","602347","","750613","","2012-06-27 06:26:36","2013-06-03 02:51:21","Eclipse Android Debugger - Where in my code did I cause the exception?","<android><eclipse><debugging>","4","4","3","",""
"4892740","1","4892959","","2011-02-03 22:57:30","2","2301","<p>I am reading the intent filter of the android, and having a few question need to ask.</p><p>1) Do they match the filter within the same application or all of the applications?</p><p>2) The scheme within the data tag, I have looked on the documentation on the android sdk website but no idea what it mean. It say <strong>scheme://host:port/path</strong> or <strong>pathPrefix</strong> or <strong>pathPattern</strong></p><p>what is the host port and path .... What does the path relate to?</p>","186820","","750613","","2012-06-27 06:27:00","2012-06-27 06:27:00","Intent Filter on Android","<android><data><filter><android-intent>","2","0","","",""
"4892825","1","","","2011-02-03 23:09:23","1","378","<p>i created a small widget app. Yesterday i decided add more functionality to the program, so i need an activity, because the widget looks good but i want to serve more information in my app for the users (listview, buttons that's what i need).So in the /layout folder i created a ""config.xml"" for the graphical design of the activity. This has only a textview, no need for coding.</p><p>Then i created the MainActivity.java, which looks easy as hell:</p><pre><code>    public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.config);     TextView txt = (TextView) findViewById(R.id.TextView01);       txt.setText(""Something""); }}</code></pre><p>AndroidManifest.xml:</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  package=""com.bfarago.hellowidget""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;receiver android:name="".HelloWidget"" android:label=""@string/app_name""&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/hello_widget_provider"" /&gt;    &lt;/receiver&gt;    &lt;service android:enabled=""true"" android:name="".UpdateService"" /&gt;    &lt;activity android:name="".MainActivity""                      android:label=""@string/hello""&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><p></p><p> </p><p>Problem is, when i launch the app I cannot see it's icon among the other application.What do i miss?</p>","571648","","213269","","2011-02-03 23:12:54","2012-06-27 06:27:33","How to add an activity to a widget","<android><activity><widget>","1","0","","",""
"4892944","1","4893024","","2011-02-03 23:25:54","0","1561","<p>I'm new to java and I'm trying to run a method once a button is clicked and I am unsure if I'm on the right track. I am selecting 10 questions from a Sqlite database and would like to cycle through each question 0-9 everytime the button is clicked. Once all 10 questions are asked I will move to another activity. I have the app displaying the first question fine but I am having trouble calling the showQuestions method and increasing the questionNum int by one when the button is clicked and passing this onto the method. Any help would be appreciated!</p><p>This is the showQuestions method which I am trying to call.</p><pre><code>public void showQuestions(Cursor cursor) {    cursor.moveToPosition(questionNum);    while (cursor.moveToNext()) {        // Collect String Values from Query        StringBuilder questiontxt = new StringBuilder("""");        StringBuilder answertxt1 = new StringBuilder("""");        StringBuilder answertxt2 = new StringBuilder("""");        StringBuilder answertxt3 = new StringBuilder("""");        StringBuilder answertxt4 = new StringBuilder("""");        String question = cursor.getString(2);        String answer = cursor.getString(3);        String option1 = cursor.getString(4);        String option2 = cursor.getString(5);        String option3 = cursor.getString(6);        questiontxt.append(question).append("""");        answertxt1.append(answer).append("""");        answertxt2.append(option1).append("""");        answertxt3.append(option2).append("""");        answertxt4.append(option3).append("""");    }}</code></pre><p>This is the code for the button which I am working on. There are 4 buttons.</p><pre><code>public void onClick(View v) {    switch (v.getId()) {        case R.id.option1_button:        if (questionNum&lt;9) {            questionNum ++;        }        Questions.this.showQuestions(null);        break;    }</code></pre><p>And this is the XML code for the buttons.</p><pre><code>&lt;Button    android:id=""@+id/option1_button""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_above=""@+id/option3_button""/&gt;</code></pre><p>OnClick Listener for the button</p><pre><code>View option1_button = findViewById(R.id.option1_button);option1_button.setOnClickListener(this);</code></pre><p>Database Query and Allocation to Cursor</p><pre><code>//Get the questions and allocate them to the Cursorpublic Cursor getQuestions() {//Select Query String loadQuestions = ""SELECT * FROM questionlist ORDER BY QID LIMIT 10"";SQLiteDatabase db = questions.getReadableDatabase();Cursor cursor = db.rawQuery(loadQuestions, null);startManagingCursor(cursor);return cursor;}</code></pre><p>Thanks in advance.</p>","576576","","576576","","2011-02-03 23:51:02","2011-02-04 00:14:00","Calling a Method from button click","<java><android>","1","3","","",""
"4892979","1","4900546","","2011-02-03 23:31:25","1","942","<p>I am trying to retrieve JPGs from an MJPG Stream using an async task. I first thought, i could let the task continuously be running and just letting the buffered JPGs pop up in the onProgressUpdate() method. But this doesn't seem to work, because the method only displays integers, no drawables...what I tried:</p><pre><code>private class StreamTask extends AsyncTask&lt;String, Void, String&gt; {    @Override    protected String doInBackground(String... params) {        image = readMJPGStream();        return null;    }    @Override    protected void onPostExecute(String result) {    }    @Override    protected void onPreExecute() {    }    @Override    protected void onProgressUpdate(Void... values) {        imView.setImageDrawable(image); // &lt;&lt; doesn't work    }}</code></pre><p>Do you have any ideas? What approach should I try?</p><p>Thank you very much in advance!</p><p>Huck</p>","449366","","","","","2011-02-04 16:43:44","Android: display image during async background streaming task","<android><stream><android-asynctask>","2","0","","",""
"4893045","1","","","2011-02-03 23:42:12","40","29346","<p>I have been trying to determine how the viewport -- and the contents within -- are affected by the viewport meta tag used for drawing content with WebView or with the native browser.</p><p>What I have run in to are some apparent inconsistencies. I created a small page (see below) with an image and some javascript for displaying the viewport size so I can visually see the scaling with the image as well as get the exact numbers.</p><p>First, a some observations: </p><ol><li>None of the viewport width numbers are exactly what I expected, just close. </li><li>When the numbers are close to the device pixel count, the drawing is actually done one-for-one -- or at least is visibly looks that way.</li><li>If the page size (document size) is under that of the viewport size, the viewport numbers shrink. That is, the viewport doesn't always necessarily represent the maximum possible visible space -- just the current visible space.</li><li>Likewise, in the native browser, the viewport size is adjusted by the top bar. The size increases as it scrolls off the screen. The numbers given are for full screen display.</li></ol><p>Device #1: Physical screen is 1024x600 and it's running Android 2.2.</p><ol><li>initial-scale=1.0 => 676x400</li><li>initial-scale=1.0, width=device-width => 676x400</li><li>initial-scale=2, width=device-width => 338x200</li><li>initial-scale=2, width=device-width, target-densitydpi=device-dpi=> 507x300</li><li>initial-scale=0.5, width=device-width,target-densitydpi=device-dpi => 800x473</li><li>initial-scale=0.9, width=device-width,target-densitydpi=device-dpi => 800x473</li><li>width=device-width, target-densitydpi=device-dpi => 1014x600</li><li>initial-scale=1.0, width=device-width,target-densitydpi=device-dpi => 1014x600</li><li>initial-scale=0.5, width=device-width,target-densitydpi=device-dpi, minimum-scale=0.1 => 2028x768</li><li>initial-scale=0.5, width=device-width,target-densitydpi=device-dpi, minimum-scale=0.1, user-scalable=no =>1014x600</li></ol><p>Device #2: Physical screen is 800x480 and it's running Android 2.3.2.</p><ol><li>initial-scale=1.0 => 527x320</li><li>initial-scale=1.0, width=device-width => 527x320</li><li>initial-scale=2, width=device-width => 263x160</li><li>initial-scale=2, width=device-width, target-densitydpi=device-dpi=> 395x240</li><li>initial-scale=0.5, width=device-width,target-densitydpi=device-dpi => 790x480</li><li>initial-scale=1.0, width=device-width,target-densitydpi=device-dpi => 790x480</li><li>initial-scale=0.5, width=device-width,target-densitydpi=device-dpi, minimum-scale=0.1 => 1580x768</li><li>initial-scale=0.5, width=device-width,target-densitydpi=device-dpi, minimum-scale=0.1, user-scalable=no =>790x480</li><li>width=1580, target-densitydpi=device-dpi =&gt; 790x480</li><li>width=1580, target-densitydpi=device-dpi =&gt; 790x480</li><li>width=1580, target-densitydpi=device-dpi, minimum-scale=0.1=&gt;790x480<br></ol><p>Of these results, the following don't make sense:</p><ol><li>Device #1, items 5, 6, and 10</li><li>Device #2, items 5, 8, 10, 11, 12</li></ol><p>Does anyone know what's going on with those that don't make sense?</p><p>Does anyone know why many of the values are 10 pixels shy of match the physical pixels, but that result is as if they match? (e.g. 1.7 and 2.6)</p><p>Am I doing something wrong, or does it appear that it's impossible to zoom out beyond 1.0 unless the user is also allowed to scale and the minimum-scale value is set?</p><p>That is, even though the valid values are 0.01 to 10, initial-scale values under 1.0 are ignored unless you can also set the minimum scale.</p><p>The <a href=""http://developer.android.com/guide/webapps/targeting.html"">Android docs do</a> say when user-scalable is no that the min/max scale values are ignored. That doesn't seem very useful. And 2.9-2.11 seem to show that you can't just calculate it yourself and set the width.</p><p>Finally, the HTML I'm using:</p><pre><code>&lt;html&gt;&lt;script src=""http://code.jquery.com/jquery-1.4.4.js""&gt;&lt;/script&gt;&lt;head&gt;    &lt;meta name=""viewport"" content=""initial-scale=0.5, width=device-width, target-densitydpi=device-dpi, minimum-scale=0.1, user-scalable=no"" /&gt;&lt;/head&gt;&lt;body style=""margin:0;""&gt;&lt;div id=""bld"" class=""bld"" style=""position:absolute; width:250px; height:125px; left:50px; background-color:#ccccff;""&gt;Hello world.&lt;/div&gt;&lt;img id=""bl1"" src=""http://commondatastorage.googleapis.com/kf6nvr/images/1024x768.png"" /&gt;&lt;script&gt; $(""#bl1"").click(function(){    var pageWidth = $(document).width();    var pageHeight = $(document).height();    var viewportWidth = $(window).width();    var viewportHeight = $(window).height();     $(""#bld"").html(""Page width: ""+pageWidth+""&lt;br /&gt;pageHeight: ""+pageHeight+""&lt;br /&gt;port width: ""+viewportWidth+""&lt;br /&gt;port height: ""+viewportHeight);});&lt;/script&gt; &lt;/body&gt;&lt;/html&gt;</code></pre><p>So... what am I missing?</p>","91165","","497356","","2011-09-24 16:15:39","2013-01-17 04:54:42","Making Sense of Android meta-viewport scaling: What am I missing?","<android><html><scaling>","2","5","24","",""
"4893065","1","4893121","","2011-02-03 23:45:41","3","1596","<p>Is it possible to add something to the list of items that shows up when a user long presses on any Edit Text? (Cut, copy paste, select text, select all, input method) I want to add another option to this menu, but cannot figure it out.</p><p>There is a duplicate of this question <a href=""http://stackoverflow.com/questions/559405/android-add-item-to-global-context-menu"">here</a>, and the last comment for the first answer says it's 'possible, but not pretty'. Then the thread dies.</p><p>I'd really like to see any working example, dirty or not :)</p>","602384","","","","","2013-06-21 12:46:07","How to add options to Android's native 'Edit text' context menu","<java><android><menu><contextmenu>","2","0","1","",""
"4893171","1","","","2011-02-03 23:59:01","0","418","<p>Hello I am trying to place acouple bitmaps on the screen and rotate them. I can get this to work by doing  </p><pre><code>canvas.drawBitmap(pic2, rotatePic, null);</code></pre><p><code>rotatePic</code> is matrix with</p><pre><code>postRotate(5, pic2.getHieght()/2, pic2.getWidth()/2) </code></pre><p>this rotates the pic and puts it at <code>0, 0</code> so to place it i tried </p><pre><code>Bitmap topPic = Bitmap.createBitmap(pic2, 0, 0, pic2.getWidth(),         pic2.getHeight(), rotatePic, false); </code></pre><p>than place with </p><pre><code>canvas.drawBitmap(topPic, 200, 100, null);</code></pre><p>it places it correctley but it no longer rotates correctley it looks like it is bouncing and spinning I've tried everthing </p>","602434","","19750","","2011-03-31 15:39:31","2011-10-18 09:04:42","placeing bitmaps in live wallpapers","<android><canvas><live-wallpaper>","1","0","","",""
"4893224","1","4985090","","2011-02-04 00:06:18","0","209","<p>I have a 3d object that I created in autodesk 3d max, and I don't want to have to recreate by hand. is there any way to just import it into android?</p>","599402","","","","","2011-02-13 15:44:14","Is there a way to use 3d graphics in android other than OpenGL (like importing a 3d file)","<android><3d>","1","1","","",""
"4893326","1","","","2011-02-04 00:23:48","5","3204","<p>Is it possible for me to programmatically access a smartphone's sensors (e.g. accelerometer, compass, etc. on an Android or iPhone device) through a browser webpage and JavaScript? I know that the W3C Devices standard can allow access to the camera. </p>","307099","","","","","2014-03-03 10:18:50","Can I programmatically access a smartphone's sensors through the browser and JavaScript?","<iphone><android><html5><browser>","4","0","","",""
"4893334","1","4893423","","2011-02-04 00:24:27","0","2673","<p>When I use a SimpleCursorAdapter, Eclipse says The constructor SimpleCursorAdapter(<strong>ShoppingList, int, Cursor, SQLiteDatabase, ListView</strong>) is undefined.</p><p>Here is my .java:</p><pre><code>package com.shoppinglist;import java.util.Locale;import android.app.Dialog;import android.app.ListActivity;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.ListAdapter;import android.widget.ListView;import android.widget.SimpleCursorAdapter;public class ShoppingList extends ListActivity {    /** Called when the activity is first created. */    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        ListView listview = (ListView) findViewById(android.R.id.list);        SQLiteDatabase db;        db = openOrCreateDatabase(""Items.db"", SQLiteDatabase.CREATE_IF_NECESSARY, null);        db.setVersion(1);        db.setLocale(Locale.getDefault());        db.setLockingEnabled(true);        final String CREATE_TABLE_ITEMS =             ""CREATE TABLE tbl_items (""            + ""id INTEGER PRIMARY KEY AUTOINCREMENT,""
            + ""item_name TEXT);"";        db.execSQL(CREATE_TABLE_ITEMS);        Cursor c = db.query(CREATE_TABLE_ITEMS, null, null, null, null, null, null);        startManagingCursor(c);        ListAdapter adapter = new SimpleCursorAdapter(this,                R.layout.rowlayout, c, db, listview);        setListAdapter(adapter);        Button button1main = (Button) findViewById(R.id.add);        button1main.setOnClickListener(new OnClickListener()  {            @Override            public void onClick(View v)  {            final Dialog additem = new Dialog(ShoppingList.this);            additem.setContentView(R.layout.maindialog);            final EditText et = (EditText)additem.findViewById(R.id.edittext);            additem.setTitle(""Type your item"");            additem.setCancelable(true);            et.setHint(""Type the name of an item..."");            Button button = (Button) additem.findViewById(R.id.cancel);            button.setOnClickListener(new OnClickListener()  {                @Override                public void onClick(View v)  {                    additem.dismiss();                }            });            additem.show();            Button ok = (Button) additem.findViewById(R.id.ok);            ok.setOnClickListener(new OnClickListener() {                @Override                public void onClick(View v) {                    final String text = et.getText().toString();                    additem.dismiss();                    et.setText("""");                }            });       }        });    }}</code></pre>","560096","","750613","","2012-06-27 06:22:26","2012-06-27 06:22:26","The constructor SimpleCursorAdapter(ShoppingList, int, Cursor, SQLiteDatabase, ListView) is undefined","<android><sqlite><cursor><listactivity><simplecursoradapter>","1","0","","",""
"4893354","1","","","2011-02-04 00:28:27","2","686","<p>I'm making an Android live wallpaper using OpenGL. </p><p>I would like to let the user pick an image to use for the background. Can someone give me any advice on an easy way to do this?</p><p>I know that I need to down sample bitmaps before loading them to avoid using huge amounts of memory for large bitmaps.</p><p>I also know OpenGL only supports texture sizes that are powers of two. It looks like messy work having to calculate the down scale factor then calculate the closest good texture size and then scale a quad with that texture appropriately to the screen. </p><p>It would also be nice to have the wallpaper panning feature when homescreens change.</p><p>Is there any easier way than doing all of the above myself? If not, is there sample code available for what appears to be a very common task?</p>","580100","","881286","","2013-08-18 01:58:33","2013-08-18 01:58:33","Showing background image for OpenGL live wallpaper","<java><android><mobile><opengl-es>","0","2","","",""
"4893392","1","","","2011-02-04 00:34:49","0","1061","<p>I've created a simple web server that runs on the Android device that basically response with Hello World that used to work prior to Preview 11. Was there any major change that causes this to no longer work or am I doing something wrong? The application crashes on context.Response.OutputStream.Write( buffer, 0, buffer.Length );</p><p>Code:</p><pre><code>public class Activity1 : Activity{    private HttpListener listener;    protected override void OnCreate( Bundle bundle )    {        base.OnCreate( bundle );        // Set our view from the ""main"" layout resource        SetContentView( Resource.Layout.Main );        // Get our button from the layout resource,        // and attach an event to it        var button = FindViewById&lt;Button&gt;( Resource.Id.MyButton );        button.Click += button_Click;    }    private void button_Click( object sender, EventArgs e )    {        try        {            if ( !HttpListener.IsSupported )                return;            listener = new HttpListener();            listener.Prefixes.Add( ""http://+:8001/"" );            listener.Start();            listener.BeginGetContext( HandleRequest, listener );        }        catch ( Exception )        {            throw;        }    }    private void HandleRequest( IAsyncResult result )    {        HttpListenerContext context = listener.EndGetContext( result );        string response = ""&lt;html&gt;Hello World&lt;/html&gt;"";        byte [] buffer = Encoding.UTF8.GetBytes( response );        context.Response.ContentLength64 = buffer.Length;        context.Response.OutputStream.Write( buffer, 0, buffer.Length );        context.Response.OutputStream.Close();        listener.BeginGetContext( HandleRequest, listener );    }}</code></pre><p>log:</p><p>I/ActivityManager(  112): Process torqsoftware.testwebserver (pid 3044) has died.</p><p>I/WindowManager(  112): WIN DEATH: Window{44d15120 torqsoftware.testwebserver/monodroidwebservertest.Activity1 paused=false}</p><p>D/Zygote  (   58): Process 3044 terminated by signal (4)</p><p>V/RenderScript_jni(  199): surfaceCreated</p><p>V/RenderScript_jni(  199): surfaceChanged</p><p>I/UsageStats(  112): Unexpected resume of com.android.launcher while already resumed in torqsoftware.testwebserver</p><p>W/InputManagerService(  112): Got RemoteException sending setActive(false) notification to pid 3044 uid 10062</p><p>ThanksLeo</p>","448981","","448981","","2011-02-04 06:09:25","2011-03-07 10:14:47","MonoDroid simple web server","<android><mono><monodroid>","1","2","","",""
"4893403","1","4931170","","2011-02-04 00:36:30","46","33229","<p>When I try to include any C++ class like vector in my Android NDK project (using NDK r5b, the latest), I get an error like the following...</p><p><code>Compile++ thumb  : test-libstl &lt;= test-libstl.cpp/Users/nitrex88/Desktop/Programming/EclipseProjects/STLTest/jni/test-libstl.cpp:3:18: error: vector: No such file or directory</code></p><p>Other people who reported this issue online have claimed success by adding</p><p><code>APP_STL := stlport_static</code></p><p>to their Application.mk file. I have done this as well as tried every other possible value for APP_STL. I've cleaned to project, ran ndk-build clean, deleted the obj and libs folders, and still when I compile it cannot find the vector class. I've been working on this for a number of weeks now (since NDK r5 came out) and would really appreciate if someone has any advice. Thanks!</p>","418925","","","","","2013-12-18 09:42:16","Can't include C++ headers like vector in Android NDK","<android><stl><vector><android-ndk>","3","6","26","",""
"4893442","1","4893542","","2011-02-04 00:43:33","8","2819","<p>I have some requirements to protect some sensitive data. The data is downloaded as a PDF from a URL and saved as an Application Private file using the following code:</p><pre><code>public File downloadPDF(final Context fileContext, Uri reportUri, final String fileName){    try    {        HttpGet get = new HttpGet(reportUri.toString());        File file = httpClient.execute(get, new ResponseHandler&lt;File&gt;()        {            @Override            public File handleResponse(HttpResponse response) throws ClientProtocolException, IOException            {                if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK)                {                    response.getEntity().writeTo(fileContext.openFileOutput(fileName, Context.MODE_WORLD_READABLE));                    return fileContext.getFileStreamPath(fileName);                }                return null;            }        });        return file;    }    catch (IOException e)    {        Log.e(TAG, ""Unable to download report."", e);    }    return null;}</code></pre><p>Now, what I'd like to do is change this to using Context.MODE_PRIVATE and create a ContentProvider so that my application has complete control over the sharing of this file to a PDF reader such as Adobe Reader. Is this possible? I currently use code like the following to pass the report URI to the currently configured PDF reader. </p><pre><code>    // Fire up a PDF viewer intent for the URL.    Intent intent = new Intent(Intent.ACTION_VIEW);    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    intent.setDataAndType(uri, ""application/pdf"");    startActivity(intent);</code></pre><p>Would the same work through a ContentProvider type URI? A content://package/fileid type URI? I'll be trying a little spike tomorrow to see if I can, but if anyone knows that only file:// URIs are allowed, it would be really helpful.</p><hr><p><strong>UPDATE</strong></p><p>I was able to solve my problem satisfactorily by implementing a ContentProvider subclass with the following method overridden:</p><pre><code>@Overridepublic ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {    // The filename is the path in the URI without the initial slash.    String fileName = uri.getPath().substring(1);    File file = getContext().getFileStreamPath(fileName);    return ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);}</code></pre><p>Then, when I fire off the viewing intent, it is rewritten something like the following:</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);Uri uri = Uri.withAppendedPath(Uri.parse(""content://providername/""),filePath);intent.setData(uri);startActivity(intent);</code></pre><p>And in my case, I use Adobe Reader, which properly implements the loading from <code>content://</code> URIs.</p>","453083","","453083","","2011-02-04 23:33:27","2013-08-25 07:22:16","VIEW intent from a Content Provider URI?","<android><android-contentprovider>","2","0","4","",""
"4893488","1","4897712","","2011-02-04 00:53:59","0","1051","<p>Setting up a MediaRecorder as a simple Audio recorder, my ""recorderName.prepare()"" is being showing by Eclipse as an ""Unhandled IOException"".</p><p>If I put in place some error exception the program runs but obviously the .prepare statement doesn't work.    </p><p>As far as I can make out I have declared everything for the MediaRecorder:</p><p>AudioSourceOutPutFormatEncoderOutputFile</p><p>I have also declared RECORD_AUDIO and WRITE_EXTERNAL_STORAGE permissions in the manifest.</p><pre><code>import android.media.MediaRecorder;private MediaRecorder mRec;  //Gobal...public void StartRec() {            mRec = new MediaRecorder();            mRec.setAudioSource(MediaRecorder.AudioSource.MIC);            mRec.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);            mRec.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);            mRec.setOutputFile(Environment.getExternalStorageDirectory().getAbsolutePath()+""/test.3gp"");            mRec.prepare(); //Underlined as an Unhandled Exception             mRec.start();}</code></pre><p>Eclipse recommends surrounding it a try and catch or adding a declaration to the method.</p><p>As for a stack trace, which is produced from the emulator?, I cannot compile the application. </p><p>Also please bear in mind I have been at this for less than two weeks.</p><p>This question may be acheingly easy, but considering I have been only just started out on Android I feel justified in opting out and asking for help :(</p><p>Thank You</p>","602470","","602470","","2011-02-04 11:49:03","2014-03-17 07:24:04","Android MediaRecorder .prepare Unhandled IOEception","<android><audio><media><volume><prepare>","1","1","","",""
"4893496","1","","","2011-02-04 00:55:43","1","412","<p>I started off with the notepad example on the android website. what i did was add another table to the database and make it accessable in the NotePad class (added another inner class called Table that extended BaseColumns). anyways it appears the database is being read correctly, and i can launch my view directly, however when i try to launch it the same way google launches NoteEditor (via the ACTION_INSERT intent) the application crashes. </p><p>I have an updated URI for the new table, and the intent filter for the activity i want to launch is in the manifest (with the proper mimetype). however, it seems to not be able to find and launch the activity i want.</p><p>any suggestions or questions are welcome, i can post my code if that would be helpful. </p><p>here's the output that is relevant:</p><p>02-04 01:13:54.964: DEBUG/AndroidRuntime(342): Shutting down VM02-04 01:13:54.964: WARN/dalvikvm(342): threadid=1: thread exiting with uncaught exception (group=0x40015560)02-04 01:13:54.984: ERROR/AndroidRuntime(342): FATAL EXCEPTION: main<strong>02-04 01:13:54.984: ERROR/AndroidRuntime(342): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.INSERT dat=content://com.google.provider.NotePad/courses }</strong>02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.app.Activity.startActivityForResult(Activity.java:2827)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.app.Activity.startActivity(Activity.java:2933)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at com.example.android.notepad.CoursesList.onOptionsItemSelected(CoursesList.java:154)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.app.Activity.onMenuItemSelected(Activity.java:2205)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:748)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:532)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.view.View$PerformClick.run(View.java:9080)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.os.Handler.handleCallback(Handler.java:587)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.os.Handler.dispatchMessage(Handler.java:92)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.os.Looper.loop(Looper.java:123)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.app.ActivityThread.main(ActivityThread.java:3647)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at java.lang.reflect.Method.invokeNative(Native Method)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at java.lang.reflect.Method.invoke(Method.java:507)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at dalvik.system.NativeStart.main(Native Method)02-04 01:13:55.014: WARN/ActivityManager(61):   Force finishing activity com.example.android.notepad/.CoursesList</p><p>but i have the intent-filter in my manifest:</p><pre><code>   &lt;activity android:name=""AddCourseView""        android:theme=""@android:style/Theme.Light""        android:label=""@string/title_note""        android:screenOrientation=""sensor""        android:configChanges=""keyboardHidden|orientation""    &gt;        &lt;!-- This filter says that we can view or edit the data of             a single note --&gt;        &lt;intent-filter android:label=""@string/resolve_course_edit""&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;action android:name=""android.intent.action.EDIT"" /&gt;            &lt;action android:name=""com.android.notepad.action.EDIT_COURSE"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:mimeType=""vnd.android.cursor.item/vnd.google.course"" /&gt;        &lt;/intent-filter&gt;        &lt;!-- This filter says that we can create a new note inside             of a directory of notes. --&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.google.course"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre>","602478","","602478","","2011-02-04 01:19:40","2011-02-04 01:19:40","Problem launching an activity Android notepad example","<android><phone>","0","1","","",""
"4893557","1","","","2011-02-04 01:08:09","0","459","<p>I have a TabActivity class which uses Intents to populate the content view. Under certain conditions, I would like to intercept a tab selection event, put up a message dialog, suppress the selected Intent, and revert to the original tab selected.</p><p>I want the TabActivity content to remain Intent driven (rather than using Views). </p><p>I suspect this may require extension of the LocalActivityManager.</p><p>Has anyone ever accomplished this or done a similiar thing?</p><pre><code>// simple example of current code:TabHost tabHost = getTabHost();TabSpec ts = tabHost.newTabSpec(tag);ts.setIndicator(tabview);ts.setContent(new Intent().setClass(this, AHome.class));tabHost.addTab(ts);</code></pre><p>Thanks!</p>","491066","","","","","2011-02-19 19:51:46","Android: TabActivity which performs a check before populating the content view","<android><android-tabhost><tabactivity>","2","4","","",""
"4893576","1","","","2011-02-04 01:10:55","0","204","<p>I would like to modify the existing image by adding additional tags or logos or pictures in android. Can we do customize an existing image technically ?</p><p>Thanks &amp; Regards,Serenity.</p>","519750","","","","","2011-02-04 06:27:59","Can we embed user defined images to the existing image in android application?","<android><android-layout>","1","2","0","",""
"4893612","1","4894234","","2011-02-04 01:16:35","0","847","<p>Recently I published my first Android App on the Market Place (Trophy-to-Gamerscore Converter). It's a licensed app that worked perfectly during testing and once I publish it - that is to say I was able to access and use my own app on my Android Phone which syncs with my developer account.</p><p>I recently accidentally unpublished the app but quickly fixed this and got it straight back on the Market however no when I try and run my app I get a ""Unlicensed"" message. I tried re-installing and had a play around and found it is responding to the testing environment responses. I installed the exact .APK I uploaded and that is currently published so surely it should be running through Market License Management, see I am the developer and ultimately allowing me access right?</p><p>Can anyone help?</p>","602491","","","","","2011-02-04 03:18:04","Android App not allow licensed access to my own App (using the developer account)","<android><licensing><publish><google-play>","1","0","","",""
"4893635","1","","","2011-02-04 01:21:43","4","696","<p>I'm having trouble getting a LocationListener to call the onLocationChanged() callback on my phone. When I run my code in the emulator, it works fine, the callback is called each time I do a geo fix.</p><p>When I run the application on my phone, nothing at all happens. The callback is never called. I have location enabled by both GPS and by Wireless in my settings. The application has all of the uses-permissions for location permissions.</p><p>Also, when I call getLastKnownLocation() on a LocationManager object, my application crashes. (Still, only on my stupid phone). Even if I try to catch an exception that's causing it to crash, it still just crashes, so I can't even get any information on what is causing it to crash. This is extremely frustrating.</p><p>LocationManager.getBestProvider() is returning GPS, and when I open google maps it finds my location in no time at all. What the heck is going on here? Is there some way I can figure out why it's crashing on my phone?</p><pre><code>    private void setupLocListener(){        Criteria c = new Criteria();    c.setAccuracy(Criteria.ACCURACY_FINE);    c.setAltitudeRequired(false);    c.setBearingRequired(false);    c.setSpeedRequired(false);    c.setCostAllowed(false);    lm.requestLocationUpdates(lm.getBestProvider(c,true), 0, 0, new LocationListener() {        @Override        public void onLocationChanged(Location arg0) {            map.setLocation(arg0);        }        public void onProviderDisabled(String arg0) {           }        public void onProviderEnabled(String arg0) {            }        public void onStatusChanged(String arg0, int arg1, Bundle arg2) {   }    });}</code></pre>","602496","","","","","2011-10-12 11:46:32","LocationListener works on emulator, not on phone","<android><geolocation><gps><locationlistener>","2","1","1","",""
"4893638","1","4895108","","2011-02-04 01:22:15","2","1137","<p>I have and android layout with two edittexts one for Qty and one for rate and a textview for total amount.now what i want to do is change/update the total amount whenever the user changes the rate or quantity fields.</p><p>what is the edittext event i am looking for and can i set it from the layout xml properties like i can set OnClick?</p>","599044","","","","","2011-02-04 06:15:25","what is the event when and edittext is updated?","<android><edittext>","1","0","","",""
"4893673","1","4899039","","2011-02-04 01:28:44","0","198","<p>I have a search field that I want to autocomplete with data that I collect from two different places: a local database (sqlite), and a remote search API. I'd like to show the local options immediately, and then after a pause (so that I'm not making API requests on every keypress), start the API request.</p><p>The problem comes when the API request returns. <strong>How do I add those entries to the (already visible) dropdown for the <code>AutoCompleteTextArea</code>?</strong> Right now, I have a class that extends <code>BaseAdapter</code>:</p><pre><code>private class MyAutoCompleteAdapter extends BaseAdapter implements Filterable {    private List&lt;String&gt; resultList;    private MySearchFilter filter;    public BeerAutoCompleteAdapter() {        super();        results = new ArrayList&lt;String&gt;();        filter = new MySearchFilter();    }    // getView, getCount, getItem overridden    private void add(String newResult) {        results.add(newResult);        notifyDataSetChanged();    }    private class MySearchFilter extends Filter {        // performFiltering and publishResults overridden    }}</code></pre><p>Everything works 90%. When I call <code>add(newResult)</code>, the new result gets added to the bottom of the dropdown. Unfortunately, the <em>height</em> of the dropdown doesn't change. If there were two results before the API request, and one comes back from the API, all that happens is that I get a scrollbar on the dropdown. As soon as I scroll, the UI decides ""oh, yeah, there's room for that one too"" and shows it.</p><p>I've tried <code>forceLayout()</code> and <code>requestLayout()</code> on my AutoCompleteTextArea, as well as <code>notifyDataSetInvalidated()</code>. No dice.</p>","53060","","53060","","2011-02-04 01:36:46","2011-02-04 14:23:19","Adding results to a visible AutoCompleteTextArea dropdown","<android><user-interface><asynchronous><autocomplete>","2","1","1","",""
"4893783","1","4894955","","2011-02-04 01:50:22","0","555","<p>I am using the following XML for tabs and this displays the tab at the bottom. However the tabs are being overlapped by the list and i cannot access any tab feature. The picture might be able to explain it better.<img src=""http://i.stack.imgur.com/s0W7o.png"" alt=""enter image description here""></p><p>The list is draw over the tab. I appreciate any suggestions of bringing the tab to the frontXML:</p><pre><code>![&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;RelativeLayout android:orientation=""vertical""            android:layout_width=""fill_parent"" android:layout_height=""fill_parent""            &gt;            &lt;View android:layout_width=""fill_parent"" android:layout_height=""0.5dip""                android:background=""#000""/&gt;            &lt;TabWidget android:id=""@android:id/tabs""                android:layout_width=""fill_parent"" android:layout_height=""wrap_content""                android:layout_marginLeft=""0dip"" android:layout_marginRight=""0dip""                  android:layout_alignParentBottom=""true""                /&gt;            &lt;View android:layout_width=""fill_parent"" android:layout_height=""2dip""                android:background=""#696969"" /&gt;            &lt;View android:layout_width=""fill_parent"" android:layout_height=""2dip""                android:background=""#000"" /&gt;            &lt;FrameLayout android:id=""@android:id/tabcontent""                android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" /&gt;        &lt;/RelativeLayout&gt;    &lt;/TabHost&gt;][1]</code></pre>","539401","","","","","2013-10-22 13:54:14","Android + Bringing Tab to Front","<android><gui><tabs>","2","0","","",""
"4893867","1","4893886","","2011-02-04 02:07:08","5","5042","<p>Is there a way to remove the banner that appears at the top of my new Android application that has the application name in it? I think I need to do something in the AndroidManifest.xml file, but I'm not sure what to do. </p>","128967","","","","","2011-02-04 03:40:54","Android - Remove top banner in new application?","<android>","1","0","","",""
"4893953","1","10236938","","2011-02-04 02:23:38","116","46411","<p>I thought there was a way to test your applications in development over WiFi, is this accurate? I'd love to be able to untether my phone and develop wirelessly. </p>","128967","","2319589","","2014-01-21 12:49:22","2014-04-02 13:22:23","Android - Run/install/debug applications over WiFi?","<android><wifi><wireless><tethering>","3","1","80","",""
"4893959","1","4893990","","2011-02-04 02:24:48","1","456","<p>I would like to add an <code>ImageView</code> under my <code>ListView</code> in my <code>ListActivity</code>.  So that when the user scrolls to the end of the list, the <code>ImageView</code> shows.</p><p>I can't seem to get my layout correct.  Either the <code>ImageView</code> is not displayed at all, or if I use layout_weights, then both the <code>ListView</code> and <code>ImageView</code> get 50% of the screen.  Any ideas how I can get what I want?  Thanks.</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/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/list_no_items"" /&gt;    &lt;ImageView        android:id=""@+id/instruct_image""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:src=""@drawable/instructions""/&gt;&lt;/LinearLayout&gt;</code></pre>","432209","","","","","2011-02-04 02:32:30","Add ImageView to a ListActivity","<android><listview><layout><listactivity>","1","0","","",""
"4893974","1","","","2011-02-04 02:28:36","0","337","<p>i am making an app that will instal an apk. file on to the phone by the click of a button. Does anyone know how to do this?</p><p>EXAMPLE</p><p>APP 1 -</p><p>Button1 clicked = Install APP2.apk</p>","583952","","","","","2011-02-04 03:07:08","How to install an open through another app?","<android>","1","0","2","",""
"4893995","1","4894403","","2011-02-04 02:32:48","1","926","<p>Another question about my implementation. I am fairly new to java/android coming from a c/c++ back ground. I already have this implemented in my code, i am just having a couple issues with it and was also wondering if this was the best solution and if anyone had any suggestions or could help me with my problem. Here is the problem and my questions:  </p><blockquote>  <p>My android application needs to have  the capabilities of loading settings  from an xml file and the application  needs to allow the user to change  those settings and remember the  changed settings. I also need my  application to reference those changes  and detect when the user has changed  one of the settings.  </p></blockquote><p>I currently have the above working, except that i want the default settings loaded from my xml file instead of the method used in my code (view the code to see what im talking about). I have searched around for this and can not seem to find a solution.  </p><blockquote>  <p>Once a change is detected i need it to  load the value into my DataRobot class  variables. I have accessor functions  for this (see code). However, when i  attempt to change any of the settings  it does not change the value in my  DataRobot class.  </p></blockquote><p>Those two block quotes are explaining what i need, basically. I am using android preferences to solve this problem currently. Would this be the best way to solve this problem?</p><p>If you need any additional information please let me know. Thanks for your assistance in advance, it is greatly appreciated!</p><hr><p>Also, i am currently experiencing a few errors with the current setup, listed below is an explanation of when the error is occurring and the log cat of said error.</p><p>The log cat output below happens when the application is first launching. It appears that it is having trouble converting a string and threw a ClassCastException. I am not sure where or why this is occurring. All the code is at the bottom of the post.</p><pre><code>02-03 20:05:50.731: INFO/System.out(279): debugger has settled (1384)02-03 20:05:52.080: INFO/ActivityManager(59): Displayed activity com.android.launcher/com.android.launcher2.Launcher: 38755 ms (total 38755 ms)02-03 20:05:52.480: WARN/Resources(279): Converting to string: TypedValue{t=0x10/d=0x3c a=-1}02-03 20:05:52.669: WARN/System.err(279): java.lang.ClassCastException: java.lang.String02-03 20:05:52.689: WARN/System.err(279):     at android.app.ContextImpl$SharedPreferencesImpl.getInt(ContextImpl.java:2706)02-03 20:05:52.689: WARN/System.err(279):     at cpe495.smartapp.SmartApp.onCreate(SmartApp.java:61)02-03 20:05:52.701: WARN/System.err(279):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-03 20:05:52.715: WARN/System.err(279):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)02-03 20:05:52.720: WARN/System.err(279):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)02-03 20:05:52.729: WARN/System.err(279):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)02-03 20:05:52.729: WARN/System.err(279):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)02-03 20:05:52.750: WARN/System.err(279):     at android.os.Handler.dispatchMessage(Handler.java:99)02-03 20:05:52.750: WARN/System.err(279):     at android.os.Looper.loop(Looper.java:123)02-03 20:05:52.760: WARN/System.err(279):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-03 20:05:52.771: WARN/System.err(279):     at java.lang.reflect.Method.invokeNative(Native Method)02-03 20:05:52.781: WARN/System.err(279):     at java.lang.reflect.Method.invoke(Method.java:521)02-03 20:05:52.781: WARN/System.err(279):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-03 20:05:52.799: WARN/System.err(279):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-03 20:05:52.799: WARN/System.err(279):     at dalvik.system.NativeStart.main(Native Method)02-03 20:05:57.439: DEBUG/KeyguardViewMediator(59): pokeWakelock(5000)02-03 20:05:57.630: DEBUG/KeyguardViewMediator(59): pokeWakelock(5000)02-03 20:05:57.759: INFO/ActivityManager(59): Displayed activity cpe495.smartapp/.SmartApp: 10694 ms (total 10694 ms)02-03 20:05:57.940: INFO/ARMAssembler(59): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x2bd108:0x2bd214] in 2142171 ns02-03 20:05:58.029: INFO/ARMAssembler(59): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x2bd218:0x2bd3e0] in 1052927 ns   </code></pre><hr><p>The log cat below is printed out after the user uses the preferences menu to change the HeartRateBase value in the preferences. It appears to be happening inside the onpreferenceschanged function.</p><pre><code>02-03 20:06:19.000: VERBOSE/onsharedpreferencechanged(279): inside02-03 20:06:19.009: WARN/System.err(279): java.lang.ClassCastException: java.lang.String02-03 20:06:19.019: WARN/System.err(279):     at android.app.ContextImpl$SharedPreferencesImpl.getInt(ContextImpl.java:2706)02-03 20:06:19.031: WARN/System.err(279):     at cpe495.smartapp.SmartApp.onSharedPreferenceChanged(SmartApp.java:131)02-03 20:06:19.040: WARN/System.err(279):     at android.app.ContextImpl$SharedPreferencesImpl$EditorImpl.commit(ContextImpl.java:2830)02-03 20:06:19.040: WARN/System.err(279):     at android.preference.Preference.tryCommit(Preference.java:1198)02-03 20:06:19.050: WARN/System.err(279):     at android.preference.Preference.persistString(Preference.java:1225)02-03 20:06:19.060: WARN/System.err(279):     at android.preference.ListPreference.setValue(ListPreference.java:126)02-03 20:06:19.070: WARN/System.err(279):     at android.preference.ListPreference.onDialogClosed(ListPreference.java:220)02-03 20:06:19.120: WARN/System.err(279):     at android.preference.DialogPreference.onDismiss(DialogPreference.java:384)02-03 20:06:19.139: WARN/System.err(279):     at android.app.Dialog$ListenersHandler.handleMessage(Dialog.java:1047)02-03 20:06:19.149: WARN/System.err(279):     at android.os.Handler.dispatchMessage(Handler.java:99)02-03 20:06:19.149: WARN/System.err(279):     at android.os.Looper.loop(Looper.java:123)02-03 20:06:19.170: WARN/System.err(279):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-03 20:06:19.170: WARN/System.err(279):     at java.lang.reflect.Method.invokeNative(Native Method)02-03 20:06:19.180: WARN/System.err(279):     at java.lang.reflect.Method.invoke(Method.java:521)02-03 20:06:19.190: WARN/System.err(279):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-03 20:06:19.200: WARN/System.err(279):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-03 20:06:19.200: WARN/System.err(279):     at dalvik.system.NativeStart.main(Native Method)02-03 20:06:19.320: WARN/InputManagerService(59): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43e60f18   </code></pre><hr><p>Starting here is the code that i have for these issues.</p><hr><pre><code>//The Main Class, mainly my gui classpublic class SmartApp extends Activity implements OnSharedPreferenceChangeListener {    private DataRobot dR = new DataRobot();    public SmartApp() {}    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.intro);        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);        PreferenceManager.setDefaultValues(this, R.xml.settings, false);        prefs.registerOnSharedPreferenceChangeListener(this);        //set remembered preferences        try {            dR.sethRB(prefs.getInt(""heartRateBaseKey"", 60));            dR.sethRVMax(prefs.getInt(""hRVMaxKey"", 100));            dR.sethRVMin(prefs.getInt(""hRVMinKey"", 0));            dR.setsI1(prefs.getInt(""sI1Key"", 50));            dR.setsI2(prefs.getInt(""sI2Key"", 80));            dR.setW1(prefs.getInt(""weight1Key"", 20));            dR.setW2(prefs.getInt(""weight2Key"", 40));            dR.setW3(prefs.getInt(""weight3Key"", 60));        }        catch (ClassCastException e) {            e.printStackTrace();        }        final Button smartConnectionSettingsButton = (Button) findViewById(R.id.smartConnectionSettingsButton);        smartConnectionSettingsButton.setOnClickListener(                new View.OnClickListener() {                    @Override                    public void onClick(View v) {                        // TODO Auto-generated method stub                        Intent settingsIntent = new Intent(v.getContext(), Settings.class);                        startActivityForResult(settingsIntent, 0);                    }                });    }    @Override    public void onSharedPreferenceChanged(SharedPreferences prefs,            String key) {        // TODO Auto-generated method stub        Log.v(""onsharedpreferencechanged"", ""inside"");        try {            if(key.equals(""heartRateBaseKey"")) {                dR.sethRB(prefs.getInt(""heartRateBaseKey"", 60));            }            else if(key.equals(""hRVMaxKey"")) {                dR.sethRVMax(prefs.getInt(""hRVMaxKey"", 100));            }            else if(key.equals(""hRVMinKey"")) {                dR.sethRVMin(prefs.getInt(""hRVMinKey"", 0));            }            else if(key.equals(""sI1Key"")) {                dR.setsI1(prefs.getInt(""sI1Key"", 50));            }            else if(key.equals(""sI2Key"")) {                dR.setsI2(prefs.getInt(""sI2Key"", 80));            }            else if(key.equals(""weight1Key"")) {                dR.setW1(prefs.getInt(""weight1Key"", 20));            }            else if(key.equals(""weight2Key"")) {                dR.setW2(prefs.getInt(""weight2Key"", 40));            }            else if(key.equals(""weight3Key"")) {                dR.setW3(prefs.getInt(""weight3Key"", 60));            }        }        catch (ClassCastException e) {            e.printStackTrace();        }    }}    </code></pre><hr><p>This class is where i am analyzing the data and i need the privates here to be set at application launch time. Currently i am doing that in the onCreate method in SmartApp. I also need the values changed in real time if a user changes any of the preferences during run time.</p><pre><code>public class DataRobot {    /* This class is for analyzing the data */    private SmartDataObject data;    private int sI1;    private int sI2;    private int w1;    private int w2;    private int w3;    private int hRB;    private int hRVMin;    private int hRVMax;    public boolean analyzeData(SmartDataObject temp) {}    public void setsI1(int temp) {        sI1 = temp;    }    public void setsI2(int temp) {        sI2 = temp;    }    public void setW1(int temp) {        w1 = temp;    }    public void setW2(int temp) {        w2 = temp;    }    public void setW3(int temp) {        w3 = temp;    }    public void sethRB(int temp) {        hRB = temp;    }    public void sethRVMin(int temp) {        hRVMin = temp;    }    public void sethRVMax(int temp) {        hRVMax = temp;    }}   </code></pre><hr><p>Below is the preferences class   </p><pre><code>import android.os.Bundle;import android.preference.PreferenceActivity;public class Preferences extends PreferenceActivity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.xml.settings);    }}</code></pre><hr><p>Below is the XML file for my preferences named ""settings.xml"".   </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;PreferenceCategory android:title=""Profile Settings""&gt;&lt;EditTextPreference android:title=""First Name"" android:key=""firstNameKey"" android:selectable=""false""&gt;&lt;/EditTextPreference&gt;&lt;EditTextPreference android:title=""Last Name"" android:key=""lastNameKey"" android:selectable=""false""&gt;&lt;/EditTextPreference&gt;&lt;EditTextPreference android:title=""User Name"" android:key=""userNameKey"" android:selectable=""false""&gt;&lt;/EditTextPreference&gt;&lt;EditTextPreference android:title=""Birth Date"" android:key=""birthDateKey"" android:selectable=""false""&gt;&lt;/EditTextPreference&gt;&lt;/PreferenceCategory&gt;&lt;PreferenceCategory android:title=""Configuration Settings""&gt;&lt;ListPreference android:title=""Medium Stress Index Threshold"" android:entryValues=""@array/sI1Values"" android:entries=""@array/sI1Array"" android:key=""sI1Key""&gt;&lt;/ListPreference&gt;&lt;ListPreference android:title=""High Stress Index Threshold"" android:entryValues=""@array/sI1Values"" android:entries=""@array/sI1Array"" android:key=""sI2Key""&gt;&lt;/ListPreference&gt;&lt;EditTextPreference android:title=""Weight 1"" android:key=""weight1Key""&gt;&lt;/EditTextPreference&gt;&lt;EditTextPreference android:title=""Weight 2"" android:key=""weight2Key""&gt;&lt;/EditTextPreference&gt;&lt;EditTextPreference android:title=""Weight 3"" android:key=""weight3Key""&gt;&lt;/EditTextPreference&gt;    &lt;ListPreferenceandroid:entryValues=""@array/heartRateBaseValues"" android:entries=""@array/heartRateBaseArray"" android:defaultValue=""60"" android:key=""heartRateBaseKey"" android:title=""Heart Rate Base""&gt;&lt;/ListPreference&gt;&lt;EditTextPreference android:title=""Heart Rate Variability Minimum"" android:key=""hRVMinKey""&gt;&lt;/EditTextPreference&gt;&lt;EditTextPreference android:title=""Heart Rate Variability Maximum"" android:key=""hRVMaxKey""&gt;&lt;/EditTextPreference&gt;    &lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;   </code></pre><hr><p>Below is the ""arrayValues.xml"" file that holds some values for some stuff.   </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;&lt;string-array name=""heartRateBaseArray""&gt;&lt;item&gt;10 bpm&lt;/item&gt;&lt;item&gt;20 bpm&lt;/item&gt;&lt;item&gt;30 bpm&lt;/item&gt;&lt;item&gt;40 bpm&lt;/item&gt;&lt;item&gt;50 bpm&lt;/item&gt;&lt;item&gt;60 bpm&lt;/item&gt;&lt;item&gt;70 bpm&lt;/item&gt;&lt;item&gt;80 bpm&lt;/item&gt;&lt;item&gt;90 bpm&lt;/item&gt;&lt;item&gt;100 bpm&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name=""heartRateBaseValues""&gt;&lt;item&gt;10&lt;/item&gt;&lt;item&gt;20&lt;/item&gt;&lt;item&gt;30&lt;/item&gt;&lt;item&gt;40&lt;/item&gt;&lt;item&gt;50&lt;/item&gt;&lt;item&gt;60&lt;/item&gt;&lt;item&gt;70&lt;/item&gt;&lt;item&gt;80&lt;/item&gt;&lt;item&gt;90&lt;/item&gt;&lt;item&gt;100&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name=""sI1Array""&gt;&lt;item&gt;0&lt;/item&gt;&lt;item&gt;5&lt;/item&gt;&lt;item&gt;10&lt;/item&gt;&lt;item&gt;15&lt;/item&gt;&lt;item&gt;20&lt;/item&gt;&lt;item&gt;25&lt;/item&gt;&lt;item&gt;30&lt;/item&gt;&lt;item&gt;35&lt;/item&gt;&lt;item&gt;40&lt;/item&gt;&lt;item&gt;45&lt;/item&gt;&lt;item&gt;50&lt;/item&gt;&lt;item&gt;55&lt;/item&gt;&lt;item&gt;60&lt;/item&gt;&lt;item&gt;65&lt;/item&gt;&lt;item&gt;70&lt;/item&gt;&lt;item&gt;75&lt;/item&gt;&lt;item&gt;80&lt;/item&gt;&lt;item&gt;85&lt;/item&gt;&lt;item&gt;90&lt;/item&gt;&lt;item&gt;95&lt;/item&gt;&lt;item&gt;100&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name=""sI1Values""&gt;&lt;item&gt;0&lt;/item&gt;&lt;item&gt;5&lt;/item&gt;&lt;item&gt;10&lt;/item&gt;&lt;item&gt;15&lt;/item&gt;&lt;item&gt;20&lt;/item&gt;&lt;item&gt;25&lt;/item&gt;&lt;item&gt;30&lt;/item&gt;&lt;item&gt;35&lt;/item&gt;&lt;item&gt;40&lt;/item&gt;&lt;item&gt;45&lt;/item&gt;&lt;item&gt;50&lt;/item&gt;&lt;item&gt;55&lt;/item&gt;&lt;item&gt;60&lt;/item&gt;&lt;item&gt;65&lt;/item&gt;&lt;item&gt;70&lt;/item&gt;&lt;item&gt;75&lt;/item&gt;&lt;item&gt;80&lt;/item&gt;&lt;item&gt;85&lt;/item&gt;&lt;item&gt;90&lt;/item&gt;&lt;item&gt;95&lt;/item&gt;&lt;item&gt;100&lt;/item&gt;&lt;/string-array&gt;&lt;/resources&gt;   </code></pre><hr>","427763","","427763","","2011-02-04 02:37:51","2011-02-04 22:23:39","android preferences problems and assistance needed","<java><android><preferences><android-preferences>","2","2","1","",""
"4894006","1","","","2011-02-04 02:35:27","4","267","<p>I have run into this issue where asynchronous functions do not execute when the soft keyboard is open in the android browser.</p><p>For example:</p><pre><code>&lt;input type='text' id='foo'/&gt;....document.getElementById(""foo"").addEventListener(""keyup"", function() {window.setTimeout(function() { alert(""1""); }, 20);}, false);</code></pre><p>You will never see the alert as long as you remain focused on the text input. This is true for xhr callbacks as well. If you attempt to make an ajax request, the request is sent, but the oncomplete callback is never fired until after you type another character in the textbox.</p><p>Does anyone know a workaround? You can see that Google obviously has a working example with their search suggestions, though I've not yet been able to figure out what exactly their solution is yet by looking at the minified/obfuscated source.</p><p>Any insight appreciated, Thanks</p>","600938","","","","","2011-09-08 20:10:04","android browser timers when keyboard is open","<android><ajax><asynchronous><xmlhttprequest>","1","0","1","",""
"4894026","1","4894093","","2011-02-04 02:37:44","0","937","<p>I have an App (Mini file manager) on my phone that has a button ""Rate it 5 Stars"" and clicking this button launches the market and fills in a 5 star rating automatically. How do I achieve this in my App? Thanx</p>","329034","","","","","2011-02-04 02:51:51","Android rate App Intent?","<android><android-intent><google-play>","1","0","","",""
"4894116","1","4894868","","2011-02-04 02:56:11","6","5610","<p>I'm trying to figure out how to include common pieces of code in multiple activities.</p><p>More specifically, I have a context menu that I would like to include in several activities.I saw this, but just don't understand how to extend to multiple activities.<a href=""http://developer.android.com/guide/topics/ui/menus.html"">http://developer.android.com/guide/topics/ui/menus.html</a></p><p>I have this set up as Menu.java</p><pre><code>    public class Menu extends Activity{    // bottom menus    public static final int Menu1 = 1;    public static final int Menu2 = 2;    public static final int Menu3 = 3;    public static final int Menu4 = 4;    public static final int Menu5 = 5;    public static final int Menu6 = 6;    public static final int Menu7 = 7;    // / Creates the menu items    public boolean onCreateOptionsMenu(Menu menu) {        menu.add(0, Menu3, 0, ""Create Profile"").setIcon(                this.getResources().getDrawable(R.drawable.ic_menu_add));        menu.add(0, Menu5, 0, ""Log In"").setIcon(                this.getResources().getDrawable(R.drawable.ic_menu_login));        menu.add(0, Menu2, 0, ""Settings"").setIcon(                this.getResources().getDrawable(R.drawable.ic_menu_preferences));        menu.add(0, Menu4, 0, ""About"").setIcon(                this.getResources().getDrawable(R.drawable.ic_menu_help));        menu.add(0, Menu1, 0, ""Report A Bug"").setIcon(                this.getResources().getDrawable(R.drawable.ic_menu_start_conversation));        menu.add(0, Menu6, 0, ""New Stuff"").setIcon(                this.getResources().getDrawable(R.drawable.ic_menu_view));        return true;    }    private MenuItem add(int i, int menu32, int j, String string) {        // TODO Auto-generated method stub        return null;    }    // Handles item selections from preference menu    @Override    public boolean onOptionsItemSelected(MenuItem item) {        switch (item.getItemId()) {        case Menu1:            startActivity(new Intent(this, Bug.class));            return true;        case Menu2:            startActivity(new Intent(this, EditPreferences.class));            return true;        case Menu3:            startActivity(new Intent(this, CreateAccount.class));            return true;        case Menu4:            startActivity(new Intent(this, About.class));            return true;        case Menu5:            startActivity(new Intent(this, Login.class));            return true;        case Menu6:            startActivity(new Intent(this, NewAdditions.class));            return true;        }        return false;    }}</code></pre>","401183","","","","","2011-08-16 11:34:58","Adding the same context menu to multiple activities","<android><activity><contextmenu><extend>","3","0","3","",""
"4894221","1","","","2011-02-04 03:15:47","3","1267","<p>I am trying to set a ringtone from a sound I saved onto the SD card from within my app.  After going through every post I could find on this, I believe I am close, and just not defining the URI's right.</p><pre><code>       File ringPath = new File(path, filename);       ContentValues values = new ContentValues();       values.put(MediaStore.MediaColumns.DATA, ringPath.getAbsolutePath());       values.put(MediaStore.MediaColumns.TITLE, ""temptitle"");       values.put(MediaStore.MediaColumns.SIZE, ringPath.length());       values.put(MediaStore.MediaColumns.MIME_TYPE, ""audio/ogg"");       values.put(MediaStore.Audio.Media.ARTIST, ""tempartist"");       values.put(MediaStore.Audio.Media.IS_RINGTONE, true);       uri = Uri.fromFile(ringPath);       RingtoneManager.setActualDefaultRingtoneUri(this, RingtoneManager.TYPE_RINGTONE, uri);</code></pre><p>Typically the URI is defined more like :</p><pre><code>Uri uri = MediaStore.Audio.Media.getContentUriForPath(ringPath.getAbsolutePath());Uri newUri = main.getContentResolver().insert(uri, values);</code></pre><p>But I didn't quite see the point in all of that, and it gave me rather nasty errors (Not that they were likely any worse than my current one).  I am sure that is the required way to do it, but the uri in my code actually returns the proper path (And the other doesn't, granted likely due to my misuse), so I don't see why it wouldn't work.  Though to be honest I don't see the point in having to using URI's for this anyway, rather than specifying the paths.</p><p>If anybody could give me a little explanation, or link me somewhere that would, so I could really comprehend this and get around this issue I'd be very grateful.</p>","602571","","","","","2011-02-24 04:39:00","Android : Setting a sound from SD card as Ringtone","<android><path><audio><uri><ringtone>","2","2","1","",""
"4894230","1","4894607","","2011-02-04 03:17:06","3","8941","<p>The code that follows comes from p.58-61 of the book ""Android Developer's Cookbook"".  The book introduces the code in the context of messages being a way to pass information between threads.  It describes the code by saying: ""The timer is run in a background thread so it does not block the UI thread, but it needs to update the UI whenever the time changes.""</p><p>I'm confused because I don't see two threads.  To me it seems that the main UI thread posts a runnable message to its own message queue (and that message then re-posts itself with a time-delay).  Am I missing something?</p><pre><code>package com.cookbook.background_timer;import android.app.Activity;import android.os.Bundle;import android.os.Handler;import android.os.SystemClock;import android.view.View;import android.widget.Button;import android.widget.TextView;public class BackgroundTimer extends Activity {    //keep track of button presses, a main thread task    private int buttonPress=0;    TextView mButtonLabel;    //counter of time since app started, a background task    private long mStartTime = 0L;    private TextView mTimeLabel;    //Handler to handle the message to the timer task    private Handler mHandler = new Handler();    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);                if (mStartTime == 0L) {            mStartTime = SystemClock.uptimeMillis();             mHandler.removeCallbacks(mUpdateTimeTask);            mHandler.postDelayed(mUpdateTimeTask, 100);        }        mTimeLabel = (TextView) findViewById(R.id.text);        mButtonLabel = (TextView) findViewById(R.id.trigger);        Button startButton = (Button) findViewById(R.id.trigger);        startButton.setOnClickListener(new View.OnClickListener() {            public void onClick(View view){                mButtonLabel.setText(""Pressed "" + ++buttonPress + "" times"");            }        });            }    private Runnable mUpdateTimeTask = new Runnable() {        public void run() {            final long start = mStartTime;            long millis = SystemClock.uptimeMillis() - start;            int seconds = (int) (millis / 1000);            int minutes = seconds / 60;            seconds     = seconds % 60;            mTimeLabel.setText("""" + minutes + "":"" + String.format(""%02d"",seconds));            mHandler.postDelayed(this, 200);        }    };    @Override    protected void onPause() {        mHandler.removeCallbacks(mUpdateTimeTask);        super.onPause();    }    @Override    protected void onResume() {        super.onResume();        mHandler.postDelayed(mUpdateTimeTask, 100);    }}</code></pre>","592503","","","","","2012-09-26 13:05:30","Android UI thread and message handler confusion","<android>","4","0","0","",""
"4894274","1","4899304","","2011-02-04 03:27:05","2","626","<p><img src=""http://i.stack.imgur.com/L6sKD.png"" alt=""enter image description here""></p><p>How do I reproduce the two buttons at the bottom of the Twitter app in this screenshot (Update and Cancel)?  You can see a similar design pattern in the official Facebook app too when creating a Facebook message.  Are they created with 9 patch images or is it something easier than that (setting a background color and somehow keeping border/state press color changes to orange).</p><p>This would be really simple if Twitter had open sourced their official Android app like they said they would (but never did).</p>","396","","","","","2011-02-04 14:48:24","How can I reproduce these buttons found in the official Twitter app?","<android><image><design><button>","2","0","1","",""
"4894294","1","","","2011-02-04 03:31:10","0","150","<p>I'm developing an Android-based scorekeeping application for the game ""Spades"".  </p><p>Currently I am saving the results of each hand to a ""Hand History"" tab in text format.</p><p>I am wondering how I could export this information (via e-mail or other means) so that I can keep track of long-term stats?  Is there a better way to be doing this?</p><p>Cheers,K.H.</p>","602583","","","","","2011-02-04 03:38:37","Creating/Exporting Hand History for Android Scorekeeper","<android><mysql><export><history>","2","1","","",""
"4894367","1","","","2011-02-04 03:45:50","1","116","<p>For some reason my custom listview doesn't look like most. At this point it is a single TextView (I play on added more later), but there are 2 problems.</p><p>1) The selected item only selects the inner TextView, not the entire View row (why?).</p><p>2) When scrolling the page, the View TextViews go all black.  This only happens during the scroll event.</p><p>Here are the relevant views.  In the main activity:</p><pre><code>&lt;ListView xmlns:android=""http://schemas.android.com/apk/res/android""     android:background=""#ffffff""        android:id=""@+id/chapterList""        android:layout_width=""fill_parent""         android:layout_height=""fill_parent""&gt;    </code></pre><p>And the chapter list (individual items).</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/widget44""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:orientation=""vertical""    android:paddingTop=""5px""    android:paddingBottom=""5px""    android:gravity=""center_horizontal""&gt;&lt;TextView    android:id=""@+id/chapter_text""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textColor=""#000000""    android:textColorHighlight=""#656565""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre>","550587","","","","","2011-02-04 04:19:37","Customer ListView not behaving as expected","<android><listview>","1","0","","",""
"4894653","1","4894747","","2011-02-04 04:44:40","1","2506","<p>I'm trying to retrieve an instance of a LocationManager class (do get some GPS related information). I have used wrote a simple class to do so, but it end up giving me an error </p><pre><code>Cannot make a static reference to the non-static method getSystemService(String) from the type Context</code></pre><p>here's my class</p><pre><code>public class LocationManagerHelper {    static Location location = null;    public static Location getLocation () {        LocationManager manager = (LocationManager) Context.getSystemService(Context.LOCATION_SERVICE);        if(manager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {            Location location = manager.getLastKnownLocation(LocationManager.GPS_PROVIDER);        } else {            System.out.println(""Provider is disabled"");        }        return location;    }}</code></pre><p>Thanks.</p>","87072","","","","","2011-02-04 05:08:30","Android location manager compilation error","<java><android>","1","0","1","",""
"4894818","1","4918344","","2011-02-04 05:17:51","0","1340","<p>I have created one game which uses images and my game is in portrait and landscape mode.I have 2 different layout for thatWhen i switch from 1 orientation to other, after doing this 5 6 times, it gives force close error Error is like :</p><p>Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget</p><p>Anyone know the solution? is there any way to clean up all images in switching orientation ?thanks in advance</p>","543022","","","","","2012-03-02 21:52:08","OutofMemory error in Android","<android>","2","2","","",""
"4894840","1","","","2011-02-04 05:23:44","0","106","<p>how to get the wsdd xml script for google map?</p>","602629","","602629","","2011-02-08 06:52:53","2011-02-08 06:52:53","android with web services","<android><web-services>","1","0","","",""
"4894885","1","4894936","","2011-02-04 05:32:35","9","19990","<p>In my application, when we browse the file from sdcard the file will be .text, .jpg and mpeg4ie video file.  I want to store each file type into a particular folder.  For example, .text files go to the text folder.  My question is when I select the file, how do I check the file extension?</p>","597981","","53926","","2013-06-18 23:31:46","2014-04-07 21:29:18","How to check file extension in android","<android>","10","0","1","",""
"4894984","1","","","2011-02-04 05:48:53","1","336","<p>I have an Android application which also uses Google map apis.The map seems to work perfectly fine on Samsung,Nexus phones.But it throws an exception in Micromax A60.</p><p>Is there any config/setting on Micromax to enable map apis?</p><p>Log trace:</p><pre><code>02-03 16:14:19.068: WARN/ResourceType(5712): Failure getting entry for 0x01080215 (t=7 e=533) in package 0: 0xffffffb502-03 16:14:19.068: WARN/dalvikvm(5712): threadid=3: thread exiting with uncaught exception (group=0x4001e170)02-03 16:14:19.068: ERROR/AndroidRuntime(5712): Uncaught handler: thread main exiting due to uncaught exception02-03 16:14:19.078: ERROR/AndroidRuntime(5712): java.lang.RuntimeException: Unable to start activity ComponentInfo{main.java.in.verse.em.item.android/main.java.in.verse.em.item.android.UserLocationMaps}: android.view.InflateException: Binary XML file line #10: Error inflating class com.google.android.maps.MapView02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.os.Handler.dispatchMessage(Handler.java:99)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.os.Looper.loop(Looper.java:123)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.app.ActivityThread.main(ActivityThread.java:4363)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at java.lang.reflect.Method.invokeNative(Native Method)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at java.lang.reflect.Method.invoke(Method.java:521)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at dalvik.system.NativeStart.main(Native Method)02-03 16:14:19.078: ERROR/AndroidRuntime(5712): Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class com.google.android.maps.MapView02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.app.Activity.setContentView(Activity.java:1622)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at main.java.in.verse.em.item.android.UserLocationMaps.onCreate(UserLocationMaps.java:34)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     ... 11 more02-03 16:14:19.078: ERROR/AndroidRuntime(5712): Caused by: java.lang.reflect.InvocationTargetException02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at com.google.android.maps.MapView.&lt;init&gt;(MapView.java:238)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at java.lang.reflect.Constructor.constructNative(Native Method)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     ... 21 more02-03 16:14:19.078: ERROR/AndroidRuntime(5712): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x108021502-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.content.res.Resources.getValue(Resources.java:891)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at android.content.res.Resources.getDrawable(Resources.java:579)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at com.google.android.maps.MapView.&lt;init&gt;(MapView.java:286)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     at com.google.android.maps.MapView.&lt;init&gt;(MapView.java:255)02-03 16:14:19.078: ERROR/AndroidRuntime(5712):     ... 25 more02-03 16:14:28.928: WARN/ActivityManager(1137): Launch timeout has expired, giving up wake lock!02-03 16:14:28.938: WARN/ActivityManager(1137): Activity idle timeout for HistoryRecord{45378bd8 main.java.in.verse.em.item.android/.UserLocationMaps}</code></pre>","88071","","250259","","2011-11-29 21:11:40","2011-11-29 21:11:40","MapActivity does not work on Micromax A60","<android><google-maps-api-3>","1","1","","",""
"4894994","1","","","2011-02-04 05:52:30","0","3602","<p>I am working on android SDK using JAVA as base programming language. One of the requirement is that I need to perform edge detection on an image. Is there any third party api that can be integrated with my development code.</p><p>Any free or paid api is appreciated.</p><p>Regards,Puneet</p>","602682","","168868","","2012-11-29 18:36:04","2012-11-29 18:36:04","Android - Edge detection on mobile","<java><android><edge-detection>","1","0","1","",""
"4894996","1","4895982","","2011-02-04 05:52:47","0","839","<p>I am seeing a strange problem in my Android application, illustrated by this screen shot:</p><p><img src=""http://lavadip.com/media/skeyeProblemDrawTexi.png""/></p><p>The labels are being drawn using <code>GL11Ext.glDrawTexiOES</code>. They have a transparent background, and the transparency works fine over the OpenGL surface.</p><p>But between the labels themselves, the transparency doesn't work. If you see closely, the ""Alnilam"" label is blocking the ""Mintaka"" and ""Alnitak"" labels.</p><p>But the ORION label is not blocking out the underlying lines.</p><p>Is this a common problem with a known solution?</p>","161257","","44729","","2011-02-04 15:42:44","2011-02-04 15:42:44","glDrawTexiOES and transparency","<android><opengl-es><textures>","1","0","1","",""
"4895002","1","","","2011-02-04 05:53:12","4","3042","<p>I am currently working on an Android app and that means learning Java. I've toyed around with Python for a few years, but decided it was time to step up now that I have an android phone. The app basically displays a list of video games stored in an XML file locally. Right now, the structure of the XML file is basically games>game (Multiple)>name (Plus other things not important now). I am currently trying to get a list of the names of the games. I've looked up tutorials and info but none of it seems to be quite what I need. I want to actually understand how it works, not just have a working piece of code I can copy/paste. Also, keep in mind that the list of names has to end up as an array of strings for Android to use it. Here's the function I have right now (Copy/pasted from a tutorial and heavily edited, so it's not readable. I'll fix that once it's actually working.) Right now the listview shows up as empty. At least it's better than before and it doesn't crash anymore though...</p><pre><code>public static String[] parse(String filename) {      ArrayList&lt;String&gt; gamesList = new ArrayList&lt;String&gt;();      try {      File file = new File(filename);      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();      DocumentBuilder db = dbf.newDocumentBuilder();      Document doc = db.parse(file);      doc.getDocumentElement().normalize();      NodeList nodeList = doc.getElementsByTagName(""game"");      for (int s = 0; s &lt; nodeList.getLength(); s++) {        Node fstNode = nodeList.item(s);        //if (fstNode.getNodeType() == Node.ELEMENT_NODE) {          Element name = (Element) fstNode;               Element fstElmnt = (Element) fstNode;          NodeList fstNmElmntLst = fstElmnt.getElementsByTagName(""name"");          Element fstNmElmnt = (Element) fstNmElmntLst.item(0);          NodeList fstNm = fstNmElmnt.getChildNodes();          gamesList.add(fstNmElmnt.toString());        //}      }      } catch (Exception e) {        e.printStackTrace();      }    String[] gamesArray;    gamesArray = (String[]) gamesList.toArray(new String[0]);    return gamesArray;     }</code></pre>","602684","","956975","","2013-03-18 14:12:13","2013-03-18 14:20:29","Parsing an XML file in Java to get a list of names","<java><android><xml><xml-parsing>","3","4","","",""
"4895052","1","4895123","","2011-02-04 06:03:58","0","51","<p>in my project i have a several activities.. but i have a one (parent) activity... from that activity i intend to other activities for getting data from other activities.. my problem is while indent back to my parent activity all details entered before were gone...can any one assist me how preserve those data's... thanks in advance..</p>","569553","","","","","2011-02-04 06:17:19","Preventing any Activity from vanish while intent from activty to activity","<android>","1","0","","",""
"4895067","1","","","2011-02-04 06:06:52","0","875","<p>I only want to send an html form by post method to a https resource from an Android activity.I have (only for development and testing) an Lighttpd server with it own certificate to make handshaking, so there MUST happen authentication at least from server (client authentication is optional but desirable).I have seen, lots of forums with different ways to make it, but I am a little confused, I do not know which could be the correct way to make it.Please show me a chunk of code.Thank you very very much.</p>","576931","","","","","2011-02-04 10:16:55","How to send html form using to https resource in Android?","<android><https><ssl-certificate><x509certificate>","2","0","","",""
"4895084","1","4895168","","2011-02-04 06:09:46","0","71","<p>I am developing an android application.Its showing no errors in xml or java file.iTS displaying message Your project contains errors.Please fix them before running applicationwhat should i do next.How should i pursue.</p><p>Thanks in advanceTushar sahni</p>","475349","","","","","2011-02-04 06:24:42","cross sign in android project appearing","<android>","1","0","","2011-04-30 16:14:05",""
"4895089","1","4897705","","2011-02-04 06:10:31","5","19048","<p>I'm using below code to travers my list it is working fine if List Items are visible.</p><p>If List is scrollable then non visible items are not accessing using this code. How to traverse all the list items which are visble + non visible items.</p><pre><code>for(int i=0;i&lt;list.getCount;i++){   View v = list.getChildAt(i);   TextView tv= (TextView) v.findViewById(R.id.item);   Log.d("""",""ListItem :""+tv.getText());}</code></pre>","486216","","68805","","2011-02-10 14:08:13","2011-02-10 14:08:13","How to get a count of list items from Listview?","<android><listview>","2","0","1","",""
"4895116","1","4902132","","2011-02-04 06:16:23","6","11901","<p>I'm writing a library class to encapsulate some of my logic in my first Android app. One of the functions which I want to encapsulate is a function which queries the address book. As such, it needs a <code>ContentResolver</code>. I'm trying to figure out how to keep the library functions black-boxed... that is, to avoid having each <code>Activity</code> pass in its own context to get a <code>ContentResolver</code>. </p><p>Problem is I cannot for the life of me figure out how to get a <code>ContentResolver</code> from within my library function. I can't find an import that contains <code>getContentResolver</code>. Googling said to use <code>getContext</code> to get a <code>Context</code> on which to call <code>getContentResolver</code>, but I can't find an import containing <code>getContext</code> either. Next posts said to use <code>getSystemService</code> to get an object to call <code>getContext</code>. BUT - I can't find any import containing <code>getSystemService</code> either! </p><p>So I'm stuck wondering, how can I get a ContentResolver within an encapsulated library function, or am I pretty much stuck having every calling <code>Activity</code> pass in a reference to its own context?</p><p>My code is something basically like this: </p><pre><code>public final class MyLibrary {    private MyLibrary() {  }    // take MyGroupItem as a class representing a projection    // containing information from the address book groups    public static ArrayList&lt;MyGroupItem&gt; getGroups() {        // do work here that would access the contacts        // thus requiring the ContentResolver    }}</code></pre><p>getGroups is the method where I was looking to avoid having to pass in a <code>Context</code> or <code>ContentResolver</code> if I could, as I was hoping to have it cleanly black-boxed.</p>","80209","","80209","","2011-02-04 21:43:05","2013-10-11 07:37:40","How can I call getContentResolver in android?","<android><context><android-contentresolver>","4","0","2","",""
"4895134","1","","","2011-02-04 06:18:24","0","878","<p><br>I don't know if it's a usual problem, but my media player delays it's start when kept idle for some time, also some time it does not plays the audio.<br>Earlier i used setDataSource(), but this time i am using create(), don't know what's the real reason for the problem........<br><br></p><p>For reference this is the code i am using.......<br><br></p><pre><code>AssetFileDescriptor afd = _context.getResources().openRawResourceFd(this._soundResource.get(this._toBePlayed));        mp = new MediaPlayer();        mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());        afd.close();        mp.setOnPreparedListener(new OnPreparedListener(){            @Override            public void onPrepared(MediaPlayer mp) {                mp.start();            }        });        mp.setOnCompletionListener(new OnCompletionListener(){            @Override            public void onCompletion(MediaPlayer mp) {                mp.reset();                mp.release();            }        });        mp.prepareAsync();</code></pre>","405521","","","","","2013-08-01 09:37:27","Android: Media Player delayed start","<android><media><player>","3","0","","",""
"4895151","1","4897344","","2011-02-04 06:20:25","2","4056","<p>I wonder if Admob has gone really rotten. When I try on my and my friends phones I am very rarly able to get an ad. I know that it works but it seems like Admob never has an ad to show. Yesterday I had a fillrate of 10% and I starting to feel a little bit cheated now. </p><p>I know about how to place the ad, the problem is that no ads are delivered. My application have had the ads for several month now so I the ""startuptime"" shouldn't be an issue eiter. </p><p>The only thing that I feel I can do to make a change is to change the keyword-string. It is ""drink alcohol wiskey rum soda"" now but I have not seen any ads related to those values anyway to I don't think that they are related.</p><p>Any thoughts? Should I change ad-engine?</p><p>Thanks in advanceRoland </p>","435267","","","","","2012-02-22 11:35:44","Admob, really bad fillrate","<android><admob><ads>","4","1","2","2014-01-22 13:16:17",""
"4895188","1","4895853","","2011-02-04 06:27:21","10","16732","<p>I have found many threads discussing the support of  tag on Android. So far it looks, that even Android Froyo 2.2 cannot play audio (i have made tests on nexus One). </p><p>According to the www.html5test.com web page, the tag itself is supported, but no codecs are in the browser (mp3, ogg..). So how I can solve the problem?</p><p>So far I see only one solution, use the embedded Flex or Flash player, which can stream mp3. Is that correct? Is that the only way I can play the .mp3 or other audio stream in Android web browser?</p><p>Does Android 2.3 Gingerbread support some audio stream???</p><p>Thanks a lotBRSTeN</p><p><em><strong>Added later</strong>:The working solution I finally used is a small Flex .swf for streaming. It can be pretty easily integrated with the HTML web page (Flex-Javascript communication works pretty well). The only problem is that on some phones the Flash Player is not reinstalled and must be downloaded from Android Market first.</em> </p><p><em><strong>Added even later</strong>: Well, the <code>&lt;audio&gt;</code> element is buggy even on Android 2.3 - I do not know what are doing in Google that such a simple thing is a problem. Using the Flex Player is okey, but the problem is that on some phones the Adobe Flash player cannot be installed from Android market, because there are some Adobe HW requirements like 1Ghz CPU, etc. Some vendors like HTC are providing the own Flash players, but those are pretty bad and do not work correctly with the AS 3.0... So far everything works perfectly especially on Samsung phones (like Nexus S or Galaxy S).</em></p>","384115","","384115","","2011-03-08 05:03:14","2011-03-08 05:03:14","HTML5 <audio> tag on Android","<android><html5><google-chrome><audio>","2","1","4","",""
"4895201","1","4895231","","2011-02-04 06:30:04","4","4380","<p>A very good morning to all</p><p>I am trying to create a from application, in the app I have a lengthy form which I want to be in a scroll view, But when I add EditText to the scrollView ..the eclipse shows some error in its designer view.</p><pre><code>error!IllegalStateException: ScrollView can host only one direct childException details are logged in Window &gt; Show View &gt; Error Log</code></pre><p>Any one have an idea to crack it out?</p><hr><p>I have included this code after getting a solution for the above trouble..!</p><p>Now the EditText is not showing any typed text, it just gives some suggestions...!</p><p>I have the following XML :</p><pre><code>&lt;ScrollViewandroid:id=""@+id/widget64""android:layout_width=""320px""android:layout_height=""358px""android:fillViewport=""true""android:isScrollContainer=""true""android:saveEnabled=""true""&gt;&lt;TableLayoutandroid:id=""@+id/widget58""android:layout_width=""320px""android:layout_height=""65px""android:orientation=""vertical""&gt;&lt;TableRowandroid:id=""@+id/widget60""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:orientation=""horizontal""&gt;&lt;TextViewandroid:id=""@+id/user""android:text=""User""android:textColor=""#000000""&gt;&lt;/TextView&gt;&lt;/TableRow&gt;&lt;TableRowandroid:id=""@+id/widget60""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:orientation=""horizontal""android:gravity=""center""&gt;&lt;EditTextandroid:id=""@+id/users_first_name"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:hint=""First Name""android:focusable=""true""android:inputType=""textPersonName""android:enabled=""true""android:ems=""15""&gt;&lt;/EditText&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;/ScrollView&gt;</code></pre><hr><p>Found the trouble.....My emulator key was set to Chinese instead of English...Sorry :)thanks for spending time on it.... </p>","573700","","573700","","2011-12-14 05:37:46","2013-05-22 14:10:18","EditText in scroll view in android","<android><edittext>","2","0","1","",""
"4895228","1","4895545","","2011-02-04 06:36:16","2","244","<p>I got a bulk of text in a file that has to be displayed in the textviewThe text should fit exactly in the screen and the remaining text in next page and so on !</p><p>Now the problem is how to get the position of the text when it has come to the end of the screen ? </p><p>Is there any possibility of getting the X and Y coordinates of the text ?</p><p>I did that by getting the width and height of the screen using window.getWidth() and window.getHeight() and tried calculating Pixel Vs Text and displayed accordingly..But the problem with that was ,when the bufferreader encounters a new line, it is taking the new line as a single character and so the text is going out of the screen.</p><p>Forgive me if there are any mistakes or errors in the above problem !!!</p><p>Thanks,Siva Kumar</p>","598331","","","","","2011-02-04 07:25:47","Android:Problem in displaying text","<java><android><textview>","1","5","","",""
"4895279","1","","","2011-02-04 06:44:42","1","4149","<p>I am new to creating WebServices for Android Application using eclipse,can i create webservices or not if it is possible please let me know the step how to create that steps.Thanks in advance</p>","591812","","","","","2013-05-23 17:33:19","Creating Web Services for Android Application","<android><web-services><for-loop>","2","1","","",""
"4895396","1","4956119","","2011-02-04 07:02:22","1","4235","<p>I am only able to connect internet through emulator browser. I am not able to connect to Internet through application code even after setting proxy in emulator and also inserting values to system table. It is throwing unknown host exception. I tried with one more option that setting proxy in application Run Configuration. But it is throwing Authentication scheme ntlm not supported error. I have given Internet permission in manifest also. Please let me know some solution for connecting Internet through code. </p><p>Code</p><pre><code>public class WebActivity extends Activity {    /** Called when the activity is first created. */    WebView mWebView;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mWebView = (WebView) findViewById(R.id.webView1);        mWebView.getSettings().setJavaScriptEnabled(true);        mWebView.loadUrl(""google.com"";);    }}</code></pre><p>Exception thrown</p><pre><code>02-04 12:33:23.230: ERROR/CheckinTask(177): Checkin failed: https://android.clients.google.com/checkin (request #0)02-04 12:33:23.230: ERROR/CheckinTask(177): org.apache.http.conn.ConnectTimeoutException: Connect to /209.85.153.100:443 timed out02-04 12:33:23.230: ERROR/CheckinTask(177):     at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:121)</code></pre>","467567","","418183","","2011-02-04 08:46:20","2013-01-02 05:51:04","I am not able to connect to Internet through application code even after setting proxy in emulator","<android>","4","4","","",""
"4895398","1","","","2011-02-04 07:02:37","-1","3137","<p>Last week i used andengine to use tmx map format to run as a game back ground.but the and engine is pretty complex to understand.i m wondering if could do it with out any engine.</p><p>So please spare some time for me and help me with this Thank you!</p>","508309","","1864222","","2013-05-17 16:14:50","2013-05-17 16:14:50","How to use TMX map in android game","<android><andengine>","2","0","","2013-05-18 04:17:53",""
"4895404","1","","","2011-02-04 07:03:33","1","3038","<p>I am trying to pass an image which is from the mobile media. I am able to get the image from the media but I need to send that image to the next activity. How can I send that? </p><p>And can anyone give me the sample code to make the image to base64 string and vice versa in android.</p><p>Please help me I am stuck with this for two days...</p><p>Thanks in advance...</p><p>sita. </p>","552215","","72746","","2011-02-04 07:11:44","2012-04-14 13:50:01","Passing an image from one activity to other activity","<android><activity>","3","1","1","",""
"4895510","1","4895618","","2011-02-04 07:20:53","0","1183","<p>i am new to android help me pls,i have 4 editbox and i button i want to store  the contents of the all the 4 edittext when i click the save button.when click the detail button already stored edittext value in the database is to view in another activity in a list view..pls help   </p>","555910","","","","","2011-02-04 07:47:09","insert data in to database which is in edittext","<android><sqlite><button><insert><edittext>","1","1","","2012-08-17 16:03:31",""
"4895528","1","4895573","","2011-02-04 07:22:41","1","679","<p>hey everyone,I have no errors in my app-code what so ever, but when i try to run in on either my cell or my emulator/the avd in eclipse i can't run it because it doesn't show up on either one.this is my console output:</p><pre><code>[2011-02-04 08:14:58 - Versuch] Uploading Versuch.apk onto device 'CB511L2WTB'[2011-02-04 08:14:58 - Versuch] Installing Versuch.apk...[2011-02-04 08:15:01 - Versuch] Success![2011-02-04 08:15:01 - Versuch] \Versuch\bin\Versuch.apk installed on device[2011-02-04 08:15:01 - Versuch] Done!</code></pre><p>and this is my LogCat output, which tells me nothing, but you are the experts ;)</p><pre><code>    02-04 08:18:10.020: DEBUG/dalvikvm(22167): GC freed 2576 objects / 559120 bytes in 37ms02-04 08:18:10.700: DEBUG/dalvikvm(6709): GC freed 7692 objects / 478912 bytes in 41ms02-04 08:18:11.170: DEBUG/dalvikvm(31774): GC freed 3367 objects / 163464 bytes in 122ms02-04 08:18:13.230: DEBUG/dalvikvm(22167): GC freed 2790 objects / 552328 bytes in 38ms02-04 08:18:14.650: DEBUG/dalvikvm(6709): GC freed 8443 objects / 540440 bytes in 39ms02-04 08:18:16.260: DEBUG/dalvikvm(31921): GC freed 214 objects / 9824 bytes in 216ms02-04 08:18:16.670: DEBUG/dalvikvm(22167): GC freed 3232 objects / 561256 bytes in 40ms02-04 08:18:18.600: DEBUG/dalvikvm(6709): GC freed 7718 objects / 481952 bytes in 39ms02-04 08:18:19.210: DEBUG/dalvikvm(1129): GC freed 6898 objects / 275328 bytes in 109ms02-04 08:18:19.690: DEBUG/dalvikvm(22167): GC freed 2968 objects / 571232 bytes in 39ms02-04 08:18:21.440: DEBUG/dalvikvm(1212): GC freed 1020 objects / 49328 bytes in 395ms02-04 08:18:22.570: DEBUG/dalvikvm(6709): GC freed 7893 objects / 495616 bytes in 40ms02-04 08:18:23.060: DEBUG/dalvikvm(22167): GC freed 3117 objects / 561912 bytes in 41ms02-04 08:18:25.860: DEBUG/dalvikvm(22167): GC freed 2924 objects / 558448 bytes in 36ms02-04 08:18:26.350: DEBUG/dalvikvm(32098): GC freed 4662 objects / 495496 bytes in 290ms02-04 08:18:26.410: DEBUG/dalvikvm(22167): GC freed 1077 objects / 130680 bytes in 33ms02-04 08:18:27.080: DEBUG/dalvikvm(6709): GC freed 7912 objects / 485368 bytes in 40ms02-04 08:18:28.190: DEBUG/dalvikvm(22167): GC freed 953 objects / 767272 bytes in 33ms02-04 08:18:29.500: DEBUG/dalvikvm(1129): GC freed 6756 objects / 270480 bytes in 105ms02-04 08:18:30.500: WARN/System.err(22536): java.lang.Exception: You must call com.mercuryintermedia.productconfiguration.initialize() first02-04 08:18:30.670: WARN/System.err(22536):     at com.mercuryintermedia.ProductConfiguration.getProductName(ProductConfiguration.java:136)02-04 08:18:30.670: WARN/System.err(22536):     at com.mercuryintermedia.api.rest.Item.getPublishingContainersItems(Item.java:15)02-04 08:18:30.670: WARN/System.err(22536):     at com.mercuryintermedia.mflow.ContainerHelper.getContainerFromServer(ContainerHelper.java:68)02-04 08:18:30.670: WARN/System.err(22536):     at com.mercuryintermedia.mflow.ContainerHelper.run(ContainerHelper.java:46)02-04 08:18:31.090: DEBUG/dalvikvm(6709): GC freed 10545 objects / 682480 bytes in 49ms02-04 08:18:31.120: DEBUG/dalvikvm(1813): GC freed 5970 objects / 310912 bytes in 60ms02-04 08:18:31.320: DEBUG/dalvikvm(22167): GC freed 2468 objects / 539520 bytes in 39ms02-04 08:18:34.110: DEBUG/dalvikvm(22167): GC freed 2879 objects / 569008 bytes in 35ms02-04 08:18:34.920: DEBUG/dalvikvm(6709): GC freed 7029 objects / 424632 bytes in 35ms02-04 08:18:36.150: DEBUG/dalvikvm(9060): GC freed 564 objects / 27840 bytes in 89ms02-04 08:18:36.630: DEBUG/dalvikvm(22167): GC freed 2437 objects / 554000 bytes in 35ms02-04 08:18:38.760: DEBUG/dalvikvm(6709): GC freed 8309 objects / 545032 bytes in 36ms02-04 08:18:39.270: DEBUG/dalvikvm(1129): GC freed 6958 objects / 278352 bytes in 107ms02-04 08:18:39.970: DEBUG/dalvikvm(22167): GC freed 2915 objects / 560312 bytes in 38ms02-04 08:18:41.260: DEBUG/dalvikvm(6184): GC freed 373 objects / 26152 bytes in 205ms02-04 08:18:42.780: DEBUG/dalvikvm(6709): GC freed 7212 objects / 447696 bytes in 36ms02-04 08:18:43.160: DEBUG/dalvikvm(22167): GC freed 3106 objects / 561824 bytes in 39ms02-04 08:18:46.310: DEBUG/dalvikvm(22167): GC freed 3110 objects / 564080 bytes in 45ms02-04 08:18:46.650: DEBUG/dalvikvm(6709): GC freed 7508 objects / 468832 bytes in 36ms02-04 08:18:48.820: DEBUG/dalvikvm(31712): GC freed 13795 objects / 828232 bytes in 203ms02-04 08:18:49.040: DEBUG/dalvikvm(1129): GC freed 6918 objects / 276224 bytes in 109ms02-04 08:18:49.640: DEBUG/dalvikvm(22167): GC freed 2952 objects / 562168 bytes in 37ms02-04 08:18:50.630: DEBUG/dalvikvm(6709): GC freed 8332 objects / 549680 bytes in 35ms02-04 08:18:52.770: DEBUG/dalvikvm(22167): GC freed 3108 objects / 563192 bytes in 37ms02-04 08:18:54.400: DEBUG/dalvikvm(6709): GC freed 7509 objects / 469016 bytes in 35ms02-04 08:18:55.900: DEBUG/dalvikvm(22167): GC freed 3121 objects / 572920 bytes in 38ms02-04 08:18:58.150: DEBUG/dalvikvm(6709): GC freed 7408 objects / 465456 bytes in 35ms02-04 08:18:58.710: DEBUG/dalvikvm(1129): GC freed 6908 objects / 276440 bytes in 107ms02-04 08:18:59.190: DEBUG/dalvikvm(22167): GC freed 3160 objects / 563144 bytes in 38ms02-04 08:19:02.080: DEBUG/dalvikvm(6709): GC freed 7436 objects / 468040 bytes in 36ms02-04 08:19:02.380: DEBUG/dalvikvm(22167): GC freed 3104 objects / 557600 bytes in 39ms02-04 08:19:05.050: DEBUG/dalvikvm(22167): GC freed 2860 objects / 570072 bytes in 35ms02-04 08:19:05.810: DEBUG/dalvikvm(6709): GC freed 7508 objects / 469080 bytes in 35ms02-04 08:19:06.500: DEBUG/skia(22167): --- decoder-&gt;decode returned false02-04 08:19:07.960: DEBUG/dalvikvm(22167): GC freed 2747 objects / 520008 bytes in 36ms02-04 08:19:08.180: DEBUG/dalvikvm(1129): GC freed 7866 objects / 317304 bytes in 107ms02-04 08:19:09.540: DEBUG/dalvikvm(6709): GC freed 8220 objects / 539688 bytes in 36ms02-04 08:19:10.810: DEBUG/dalvikvm(22167): GC freed 2898 objects / 596824 bytes in 37ms02-04 08:19:13.360: DEBUG/dalvikvm(22167): GC freed 2503 objects / 398936 bytes in 35ms02-04 08:19:13.370: INFO/dalvikvm-heap(22167): Grow heap (frag case) to 5.029MB for 570264-byte allocation02-04 08:19:13.400: DEBUG/dalvikvm(22167): GC freed 702 objects / 24976 bytes in 31ms02-04 08:19:13.400: DEBUG/skia(22167): --- decoder-&gt;decode returned false02-04 08:19:13.540: DEBUG/dalvikvm(6709): GC freed 7481 objects / 466544 bytes in 36ms02-04 08:19:15.600: DEBUG/WifiService(1129): got ACTION_DEVICE_IDLE02-04 08:19:15.960: INFO/wpa_supplicant(2522): CTRL-EVENT-DRIVER-STATE STOPPED02-04 08:19:15.960: VERBOSE/WifiMonitor(1129): Event [CTRL-EVENT-DRIVER-STATE STOPPED]02-04 08:19:17.270: DEBUG/dalvikvm(22167): GC freed 2372 objects / 1266992 bytes in 36ms02-04 08:19:17.520: DEBUG/dalvikvm(6709): GC freed 7996 objects / 519128 bytes in 37ms02-04 08:19:18.150: DEBUG/dalvikvm(1129): GC freed 7110 objects / 285032 bytes in 108ms02-04 08:19:20.460: DEBUG/dalvikvm(22167): GC freed 3327 objects / 565264 bytes in 36ms02-04 08:19:21.250: DEBUG/dalvikvm(6709): GC freed 7632 objects / 486024 bytes in 37ms02-04 08:19:26.470: DEBUG/dalvikvm(31774): GC freed 345 objects / 16160 bytes in 96ms02-04 08:19:30.423: WARN/System.err(22536): java.lang.Exception: You must call com.mercuryintermedia.productconfiguration.initialize() first02-04 08:19:30.423: WARN/System.err(22536):     at com.mercuryintermedia.ProductConfiguration.getProductName(ProductConfiguration.java:136)02-04 08:19:30.423: WARN/System.err(22536):     at com.mercuryintermedia.api.rest.Item.getPublishingContainersItems(Item.java:15)02-04 08:19:30.423: WARN/System.err(22536):     at com.mercuryintermedia.mflow.ContainerHelper.getContainerFromServer(ContainerHelper.java:68)02-04 08:19:30.423: WARN/System.err(22536):     at com.mercuryintermedia.mflow.ContainerHelper.run(ContainerHelper.java:46)02-04 08:20:05.280: DEBUG/dalvikvm(1813): GC freed 741 objects / 36840 bytes in 91ms02-04 08:20:23.580: DEBUG/WifiService(1129): ACTION_BATTERY_CHANGED pluggedType: 202-04 08:20:30.423: WARN/System.err(22536): java.lang.Exception: You must call com.mercuryintermedia.productconfiguration.initialize() first02-04 08:20:30.423: WARN/System.err(22536):     at com.mercuryintermedia.ProductConfiguration.getProductName(ProductConfiguration.java:136)02-04 08:20:30.423: WARN/System.err(22536):     at com.mercuryintermedia.api.rest.Item.getPublishingContainersItems(Item.java:15)02-04 08:20:30.423: WARN/System.err(22536):     at com.mercuryintermedia.mflow.ContainerHelper.getContainerFromServer(ContainerHelper.java:68)02-04 08:20:30.423: WARN/System.err(22536):     at com.mercuryintermedia.mflow.ContainerHelper.run(ContainerHelper.java:46)02-04 08:20:53.970: INFO/FastDormancyManager(1129): Fast Dormant executed. ExecuteCount:2683 NonExecuteCount:25773</code></pre><p>I really hope you can help me.</p>","582674","","","","","2011-02-04 07:31:17","android app does not show up on my device or the emulator in eclipse","<android><console><logcat>","2","0","","",""
"4895674","1","","","2011-02-04 07:48:04","0","1271","<p>My program is working properly, but in the middle of the program running, user clicks on the BACK button, and the functionality of the back button does not work. But after completing the executing, BACK button functionality is working.</p><p>please observe my code here.</p><pre><code>package com.sampleexample;import android.app.Activity;import android.app.AlertDialog;import android.app.Dialog;import android.app.ProgressDialog;import android.content.DialogInterface;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.util.Log;import android.view.KeyEvent;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.TextView;import android.widget.Toast;public class SampleExample extends Activity {    static final int PROGRESS_DIALOG = 0;    Button button;    TextView download;    ProgressThread progressThread;    ProgressDialog progressDialog;    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);       Log.d(""SampleExample"", ""======= onCreate()====Start===="");        // Setup the button that starts the progress dialog        download = (TextView) findViewById(R.id.download);        button = (Button) findViewById(R.id.progressDialog);        button.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                Log.d(""SampleExample"", ""======= onClick()==Start======"");                showDialog(PROGRESS_DIALOG);                Log.d(""SampleExample"", ""======= onClick()===End====="");            }        });        Log.d(""SampleExample"", ""======= onCreate()====End===="");    }    @Override    public boolean onKeyDown(int keyCode, KeyEvent event) {        // Handle the back button        if (keyCode == KeyEvent.KEYCODE_BACK) {            // Ask the user if they want to quit            Log.d(""SampleExample"", "" ------- Back Button onKeyDown()----Start--"");            new AlertDialog.Builder(this).setIcon(                    android.R.drawable.ic_dialog_alert).setTitle(""Exit"")                    .setMessage(""Are you sure you want to leave?"")                    .setNegativeButton(android.R.string.cancel, null)                    .setPositiveButton(android.R.string.ok,                            new DialogInterface.OnClickListener() {                                public void onClick(DialogInterface dialog,                                        int which) {                                    // Exit the activity                                    SampleExample.this.finish();                                }                            }).show();            // Say that we've consumed the event            Log.d(""SampleExample"", "" ------BackButton-onKeyDown()----End--"");            return true;        }        return super.onKeyDown(keyCode, event);    }    // Toast.makeText(SampleExample.this, ""U have pressed the Back Button"",    // Toast.LENGTH_SHORT).show();    // Log.d(this.getClass().getName(),    // ""*********back button pressed----------"");    protected Dialog onCreateDialog(int id) {        Log.d(""SampleExample"", ""99999 onCreateDialog () 999 Start"");        switch (id) {        case PROGRESS_DIALOG:            progressDialog = new ProgressDialog(SampleExample.this);            progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);            progressDialog.setMessage(""Loading..."");            download.setText(""Now downloading......."");            progressThread = new ProgressThread(handler);            progressThread.start();            return progressDialog;        default:            return null;        }    }    // Define the Handler that receives messages from the thread and update the    // progress    final Handler handler = new Handler() {        public void handleMessage(Message msg) {            Log.d(""SampleExample"", ""8888 handleMessage () 8888 Start"");            int total = msg.getData().getInt(""total"");            progressDialog.setProgress(total);            if (total &gt;= 100) {                // Toast.makeText(SampleExample.this, ""Download is completed"",                // Toast.LENGTH_SHORT).show();                download.setText("" download is completed."");                dismissDialog(PROGRESS_DIALOG);                progressThread.setState(ProgressThread.STATE_DONE);            }        }    };    /** Nested class that performs progress calculations (counting) */    private class ProgressThread extends Thread {        Handler mHandler;        final static int STATE_DONE = 0;        final static int STATE_RUNNING = 1;        int mState;        int total;        ProgressThread(Handler h) {            mHandler = h;        }        public void run() {            mState = STATE_RUNNING;            total = 0;            Log.d(""SampleExample"", ""7777 run () 7777 Start"");            while (mState == STATE_RUNNING) {                try {                    Thread.sleep(100);                } catch (InterruptedException e) {                    Log.e(""ERROR"", ""Thread Interrupted"");                }                Message msg = mHandler.obtainMessage();                Bundle b = new Bundle();                b.putInt(""total"", total);                msg.setData(b);                mHandler.sendMessage(msg);                total++;            }            Log.d(""SampleExample"", ""6666 run () 6666 End"");        }        /*         * sets the current state for the thread, used to stop the thread         */        public void setState(int state) {            mState = state;        }    }}</code></pre>","606052","","496830","","2011-02-04 08:37:42","2011-12-27 19:07:28","Back button functionality not workin,while running my program(Android)","<android>","3","2","","",""
"4895721","1","4922874","","2011-02-04 07:53:56","1","1287","<p>I have a strange problem that recently appeared. At first I was loading all items in my ListView. It was scrolling all fine. Items were clickable and all was working fine. </p><p>Then in the getView of my adapter I added that: </p><pre><code>if(pos == getCount() - 1){    Log.i(""Load"", ""Load database"");    load_database(getCount(), 5);}</code></pre><p>and here is load_database()</p><pre><code>private void load_database(long offset, long count) {    ArrayList&lt;VKContent&gt; objs = BaseApplication.db.get_all(Message.class, MessageHandler.COLUMN_MAILBOX + "" = "" + mailbox, count, offset);    for(VKContent obj: objs){        adp.add((Message)obj);    }}</code></pre><p>The problem appeared right after that. On load it calls load_database once and everything is nice. ListView works fine. Clicks are handled. But once I reach ""pos == getCount() - 1"". It loads new data but it is now impossible to click items. When I scroll and do a flinch, a touch on the screen won't stop the flinch. When I try to scroll during a flinch it doesn't have any effect until the flinch stopped. </p><p>If I switch to a different Tab the listview behavior is restored. If I try use my scroll ball to focus items, the normal behavior come back too. </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""   android:layout_width=""match_parent""     android:layout_height=""match_parent""     android:id=""@android:id/tabhost""&gt;      &lt;LinearLayout   android:orientation=""vertical""  android:layout_height=""match_parent""  android:layout_width=""match_parent""&gt;         &lt;TabWidget android:id=""@android:id/tabs""             android:layout_height=""wrap_content""             android:layout_width=""fill_parent"" /&gt;         &lt;FrameLayout android:id=""@android:id/tabcontent""             android:layout_height=""fill_parent""             android:layout_width=""fill_parent""             android:layout_weight=""1""&gt;            &lt;LinearLayout android:id=""@+id/tab2""                android:orientation=""vertical""                android:layout_height=""fill_parent""                android:layout_width=""fill_parent""&gt;                &lt;ListView android:id=""@+id/lv""                    android:layout_height=""fill_parent""                    android:layout_width=""fill_parent""                    android:clickable=""true"" /&gt;            &lt;/LinearLayout&gt;         &lt;/FrameLayout&gt;      &lt;/LinearLayout&gt;&lt;/TabHost&gt; </code></pre><p><strong>Edit</strong></p><p>I did try to invalidate(), forceLayout(), requestLayout(), isFocusable()... bringToFront... and others after load_database. But nothing helped. </p><p><strong>Edit2</strong>Almost forgot that piece of code. </p><pre><code>    tabHost.setCurrentTab(1);    tabHost.setCurrentTab(0);</code></pre><p>For some reasons, there is a problem with TabHost. My ListView is shared by all tabs. When the view is first loaded it didn't display anything. So I had to switch from second to first tab.</p>","54606","","54606","","2011-02-04 08:56:46","2011-02-07 15:13:31","ListView in TabHost scroll/click problems","<android><scroll><android-listview><android-tabhost>","1","0","","",""
"4895722","1","4895763","","2011-02-04 07:54:05","0","868","<p>I am designing a dialer pad application . In GUI I am using <code>Button,ImageButton EditText, TextView</code> As Android provide by default framework for them.</p><p>I want to show Buttons look  as we look in web designing.</p><p>Please tell me on which tool using we give a good GUI.</p><p>May i take the help of Adobe Photoshop foe designing these buttons or</p><p>Android provide any default tools to do that.</p><p>Please Help me. </p><p>ThanksAnshu</p>","587090","","100957","","2011-02-10 13:44:03","2011-02-10 13:44:03","How to design a good and nice GUI for an Android application?","<android><gui>","1","1","","",""
"4895823","1","","","2011-02-04 08:10:24","2","2505","<p>i try to make a configuration activity using PreferenceActivity...</p><p>i found some working examples like </p><p>""WiFi Advanced Configuration Editor""</p><p>and</p><p>""Wifi Config Editor Pro""</p><p>but the code i wrote waits for 10-15 seconds on the line editor.commit()...it must be very simple but i cant figure out.</p><p>here is the brief code;</p><p>...</p><pre><code>SharedPreferences prefs = PreferenceManager                .getDefaultSharedPreferences(v.getContext());prefs.registerOnSharedPreferenceChangeListener(ClassConfig.this);    SharedPreferences.Editor editor = prefs.edit();editor.clear();editor.putString(""key1"", value1);editor.putString(""key2"", value2);editor.putBoolean(""key3"", value3);    ...    //i got nearly 35 keys here    ...    editor.putString(""key33"", value33);editor.putBoolean(""key34"", value34);editor.putBoolean(""key35"", value35);    editor.commit();</code></pre><p>any ideas??</p><p>Update: one more thing. i saw these warnings in the log file</p><blockquote>  <p>W/BackupManagerService(1914)  dataChanged but no participant  pkg='com.android.providers.settings'  uid=10046</p></blockquote>","602800","","602800","","2011-02-07 14:53:13","2013-08-01 21:31:14","SharedPreferences Editor commit takes so much time","<android><preferences><sharedpreferences>","3","1","","",""
"4895844","1","","","2011-02-04 08:13:47","0","153","<p>I can read this Node and its child noes easily but when it comes to get innerText of the node it gives error. Say I have ""n"" number of ""usr"" nodes from ""DocumentElement"" node and I want to get user_name, user_password, user_id, all these child nodes in their string variables what should I do?</p><pre><code>    &lt;DocumentElement xmlns=""""&gt;      &lt;usr diffgr:id=""usr1"" msdata:rowOrder=""0""&gt;        &lt;user_name&gt;chris     &lt;/user_name&gt;        &lt;user_password&gt;harvey    &lt;/user_password&gt;        &lt;user_id&gt;1         &lt;/user_id&gt;        &lt;store&gt;NYFH&lt;/store&gt;        &lt;email&gt;chris@ny-furniture.com&lt;/email&gt;      &lt;/usr&gt;    &lt;/DocumentElement&gt;</code></pre><p>I am using Android DOM API to read XML. I am currently trying to get the innerText by node.getNodeValue() but this is not working. </p>","355507","","355507","","2011-02-04 09:49:48","2011-02-04 09:49:48","What is wrong with this XML?","<javascript><android><xml><saxparser>","0","6","","",""
"4895903","1","4896099","","2011-02-04 08:22:53","2","3468","<p>I am using shared preference to store password but when ever my application starts it again ask preference value .i want once i have entered the  preference password it should be fixed it should  ask me again and again.</p>","584493","","401025","","2012-01-29 10:33:25","2012-01-29 10:33:25","storing password using shared preference in android","<android><preferences>","1","4","","",""
"4896086","1","4896285","","2011-02-04 08:48:47","3","128","<p>Is this correct?</p><p>SharedPreferrences are stored in databases?</p>","597981","","418183","","2011-02-04 09:08:41","2011-02-04 09:37:13","Are SharedPreferrences stored in databases?","<android><sharedpreferences>","3","3","2","",""
"4896117","1","","","2011-02-04 08:53:02","1","471","<p>my widget registers a service on update event.</p><p>this service (lets say serviceA) has two broadcast receivers and starts another service (serviceB), which updates the widget, in onreceive method. </p><p>serviceB also has a 10 second timer (actually using alarm manager) that re-run itself. </p><p>i wrote these services with the combination of some source codes that i found on the web</p><p>after some time of usage, widget makes the phone unresponsive for some seconds.How can i improve the performance???</p><pre><code>public class ServiceA extends Service implements Runnable {    @Override    public void onStart(Intent intent, int startId) {        super.onStart(intent, startId);    Context cntx = getApplicationContext();    cntx.registerReceiver(receiver, new IntentFilter(ACTION_ONE));    cntx.registerReceiver(receiver, new IntentFilter(ACTION_TWO));    }    private static BroadcastReceiver receiver= new BroadcastReceiver() {        @Override        public void onReceive(Context context, Intent intent) {            AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);            appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(context,MyWidget.class));            ServiceB.requestUpdate(appWidgetIds);            context.startService(new Intent(context, ServiceB.class));        }    };}public class ServiceB extends Service implements Runnable {    private static Object sLock = new Object();    private static Queue&lt;Integer&gt; sAppWidgetIds = new LinkedList&lt;Integer&gt;();    public static void requestUpdate(int[] appWidgetIds) {        synchronized (sLock) {            for (int appWidgetId : appWidgetIds) {                if (!sAppWidgetIds.contains(appWidgetId))                    sAppWidgetIds.add(appWidgetId);            }        }    }    private static int getNextUpdate() {        synchronized (sLock) {            if (sAppWidgetIds.peek() == null) {                return AppWidgetManager.INVALID_APPWIDGET_ID;            } else {                return sAppWidgetIds.poll();            }        }    }    private static boolean sThreadRunning = false;    @Override    public void onStart(Intent intent, int startId) {        super.onStart(intent, startId);        AppWidgetManager manager = AppWidgetManager.getInstance(this);        requestUpdate(manager.getAppWidgetIds(new ComponentName(this,                MyWidget.class)));        synchronized (sLock) {            if (!sThreadRunning) {                sThreadRunning = true;                new Thread(this).start();            }        }    }    private static boolean hasMoreUpdates() {        synchronized (sLock) {            boolean hasMore = !sAppWidgetIds.isEmpty();            if (!hasMore) {                sThreadRunning = false;            }            return hasMore;        }    }    @Override    public void run() {        AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this);        while (hasMoreUpdates()) {            int appWidgetId = getNextUpdate();            RemoteViews updateViews = null;            updateViews = MyWidget.buildUpdate(this);            appWidgetManager.updateAppWidget(appWidgetId, updateViews);        }        Time time = new Time();        /*        * some code to calculate next run time        */        Intent updateIntent = new Intent(""MY_WIDGET_UPDATE"");        updateIntent.setClass(this, WidgetUpdateService.class);        PendingIntent pendingIntent = PendingIntent.getService(this, 0,                updateIntent, 0);        AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);        alarmManager.set(AlarmManager.RTC_WAKEUP, nextUpdate, pendingIntent);        stopSelf();    }}</code></pre><p>UPDATE: I'm running out of time. So I quit using the second service and find another way.</p>","602800","","602800","","2011-02-08 11:09:57","2011-02-08 11:09:57","widget performance issue","<android><performance><service><android-widget>","0","1","","",""
"4896157","1","","","2011-02-04 08:57:53","0","250","<p>I am dealing with a overlays on mapview.</p><p>I have 2 types of them, lets say type <em>""One""</em> and <em>""Two""</em></p><p>They both are overlayed on same or diffrent condition.</p><p>When are overlayed on same condition one overlaps the other. and earlier one hides behind the latter one.</p><p>I want to give option to user to cycle through these overlapped overlays if this overlapping case occurs.</p><p>Any solution?</p><p>Can overlay handle double taps ?</p><p><img src=""http://i.stack.imgur.com/SHoGS.png"" alt=""Example""></p>","447238","","447238","","2011-02-04 09:36:05","2011-02-04 09:52:46","Rotating map overlays","<android><overlay><hide><android-mapview>","1","2","","",""
"4896193","1","4896347","","2011-02-04 09:03:10","3","6545","<p>I would like to integrate Twitter into my Android application so that I can post messages to Twitter.</p><p>thanks in advance </p>","254790","","100957","","2011-02-04 09:11:06","2013-10-30 19:55:18","How to post message on twitter wall using twitter integrate android app","<android><twitter>","6","1","6","",""
"4896223","1","","","2011-02-04 09:06:50","22","19104","<p>I need to open an intent to view an image as follows:</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);Uri uri = Uri.parse(""@drawable/sample_1.jpg"");intent.setData(uri);startActivity(intent);</code></pre><p>The problem is that <code>Uri uri = Uri.parse(""@drawable/sample_1.jpg"");</code> is incorrect.</p>","602874","","72746","","2011-02-04 09:08:18","2012-12-04 14:34:33","how to get an uri of an image resource in android","<android><uri>","1","0","4","",""
"4896255","1","","","2011-02-04 09:10:14","1","1003","<p>I have a problem regarding the following:   </p><pre><code>public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {    temp=a.getItemAtPosition(position).toString();    Toast.makeText(ne.this, temp, Toast.LENGTH_SHORT).show();     if (temp==""Aries"")     {         ViewFlipper  viewflipper= (ViewFlipper) findViewById(R.id.viewflipper);        Toast.makeText(ne.this, temp, Toast.LENGTH_SHORT).show();     }       if (temp==""Taurus"")     {         ViewFlipper  viewflipper= (ViewFlipper) findViewById(R.id.viewflipper);        Toast.makeText(ne.this, temp, Toast.LENGTH_SHORT).show();     }     if (temp==""Libra"")     {         ViewFlipper  viewflipper= (ViewFlipper) findViewById(R.id.viewflipper);        Toast.makeText(ne.this, temp, Toast.LENGTH_SHORT).show();     }  </code></pre><p>when I click on the item it shows me the string on first view.but I am not going on to the second view. and also on first view when I click other item still it  shows first  output.</p><p>i.e. if I select Aries in the first view It shows me aries in the toast window but doesn't go to the second view.and again I am pressing other item say Taurus, still it shows Aries to me.   </p>","392406","","72746","","2011-02-04 09:13:44","2011-02-04 10:55:25","how to pass variable to the next view using viewflipper","<android><viewflipper>","2","0","","",""
"4896275","1","","","2011-02-04 09:12:29","2","4696","<p>I have a navigation bar in my app, the thing is that I want the navbar to be available in all activities. I suppose that I have to set contentView two times, but that doesn't work, of course.   </p><p>I've been looking at  and  but I dont get it to work. I have a super class, can I set this second layout from my super class?</p>","526924","","469983","","2012-12-10 11:21:55","2012-12-10 11:21:55","2 layouts 1 activity android","<android>","3","0","1","",""
"4896315","1","4896334","","2011-02-04 09:17:01","4","11290","<p>I have a static method titled chooseDialog(String s, int i) in which I want to call another method within the same class (Dialogs.class) based on the parameters provided to chooseDialog. s is the name of the desired method and i is it's single parameter.</p><p>I have tried numerous tutorials and have spent a few hours reading up on the subject but I can't seem to get a firm grasp as to what exactly I need to do.</p><p>Any ideas?</p><p>Thanks!</p>","599429","","","","","2011-08-04 10:18:23","Android/Java: Calling a method using reflection?","<java><android><reflection><methods>","3","3","1","",""
"4896457","1","4896527","","2011-02-04 09:34:08","4","3863","<p>In my application downloading loads of files from web they were around 200Mb files(Zipped). So can any one tell me best way to download files. Actually my concern is about performance of code. Please gimme an idea or some code if possible to download . How to handle errors and network problem in between .</p><p>Thanking you,Srinivas</p>","414777","","","","","2011-02-04 09:50:42","What is best way to download files from net programatically in android?","<android><file-download>","3","0","5","",""
"4896466","1","","","2011-02-04 09:35:34","1","517","<p>I've been having some issues with getting the proper Context when building dinamically a ExpandableListActivity.</p><p>My first version worked like this in terms of context passing betweeen classes (I'm skipping the rest of the code):</p><p>public class mainActivity extends MapActivity {    private MapView mapView;    ... </p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    mapView = new MapView(this,MAPS_KEY);    ...}    public class GeoUpdateHandler implements LocationListener {        @Override        public void onLocationChanged(Location location) {            CustomItemOverlay customItemOverlay = new CustomItemOverlay(drawable,mapView.getContext());            ...    }}</code></pre><p>}</p><hr><pre><code>public class CustomItemOverlay extends ItemizedOverlay{    Context mContext;    ...    public CustomItemOverlay(Drawable defaultMarker,Context ctx) {        super(boundCenterBottom(defaultMarker));        mContext = ctx;    }    public boolean onTap(int index){        Intent intent = new Intent();        intent.setClass(mContext, ExpandableCategories.class);        intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);        mContext.startActivity(intent);    }}</code></pre><hr><pre><code>public class ExpandableCategories extends ExpandableListActivity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        mAdapter = new MyExpandableListAdapter(getApplicationContext());        setListAdapter(mAdapter);        registerForContextMenu(getExpandableListView());    }    public class MyExpandableListAdapter extends BaseExpandableListAdapter{        private Context context;        private LayoutInflater mInflater;        ...             public MyExpandableListAdapter(Context ctx){            this.context = ctx;            this.mInflater = LayoutInflater.from(this.context);         }    }}</code></pre><p>This works perfectly. However, I extended Application in order to be able pass data easily between activities (such as login data for external services).</p><pre><code>public class MyApplication extends Application {    private static MyApplication app;    ...    @Override    public void onCreate() {    app = this;    }    public static MyApplication get() {    return app;    }    ...}</code></pre><p>Adding this makes the app to crash while trying to do <code>setListAdapter(mAdapter)</code> on ExpandableCategories. I guess is some kind of issue for having extended the Application and context not being properly moved from Acitivity to Activity.</p><p>I've found this post <a href=""http://stackoverflow.com/questions/987072/using-application-context-everywhere"">Using Application context everywhere?</a> that particularly puts <code>LayoutInflator</code> as an example of somewhere where proper Context management is needed.</p><p>Any thoughts?</p><p>Thanks!</p>","259425","","544537","","2011-02-04 10:39:29","2011-02-04 10:39:29","Context management with multiple activities and extended application","<android><layout><context>","0","1","","",""
"4896556","1","","","2011-02-04 09:46:45","1","1397","<p>I want to start manage application(Settings->Application->manage application) screen programatically. I am unable to do it. Can anyone please help me?</p><p>Thanks in advance.</p>","519846","","","","","2011-02-04 09:58:00","How to start manage application screen in android","<android>","2","0","","",""
"4896565","1","4896659","","2011-02-04 09:47:26","3","1321","<p>So I'm still mucking around with this Google Analytics SDK. According to <a href=""http://analytics.blogspot.com/2010/12/custom-variables-for-your-android.html"" rel=""nofollow"">this</a>, I should be able to send custom vars with a visitor scope that include the app version, and the phone model. </p><p>Using tracker.getVisitorCustomVar(i) I can see that the information is indeed stored, and the log shows NetWorkRequestUtil/ConstructPageviewRequestPath with a message that contains the custom vars. </p><p>But it does not show up in the analytics report along with the other tracking information. I thought I would find it under Visitors->Custom Variables, but that only says</p><blockquote>  <p>There is no data for this view. </p></blockquote><p>Where can I see the custom variables? :(</p>","397060","","","","","2011-02-04 09:56:45","Google Analytics Android SDK custom vars not registered/not showing?","<android><google-analytics>","1","2","1","",""
"4896677","1","","","2011-02-04 09:58:03","3","1414","<p>I created a database in Android using below line of code-</p><p>SQLiteDatabase sampleDB = this.openOrCreateDatabase(""SAMPLE_DB_NAME"",                MODE_PRIVATE, null);</p><p>Now, i want to know what would be the Uri for this database or how to find the Uri of the created database.Please help me out.</p><p>Thanks in AdvanceManoj</p>","563954","","","","","2012-10-12 10:21:20","Android- URI of a Created SQLite Database","<android><sqlite><uri>","1","1","2","",""
"4896705","1","4918102","","2011-02-04 10:01:12","1","248","<p>I already know how to stop thread but my present scenario is somewhat different, I am listening for data from server in thread</p><pre><code>while (connected) {    byte[] buffer = new byte[1024];    if(in.read(buffer) &gt; 0)// waits on this line    {        //do something      } }</code></pre><p>now the problem is that although I set connected = false; then also it not stopping because it waits  on in.read so , I also tried to Thread.interrupt but no luck</p>","517247","","","","","2011-02-07 04:40:21","Android Thread problem","<android><multithreading>","3","3","","",""
"4896711","1","4896770","","2011-02-04 10:02:53","0","694","<p>Hi I want  to set the animation to an activity without xml file.Please give me some suggestions on this topic.Thanks in advance</p>","479027","","","","","2011-02-04 10:10:10","set the animation to the activity without xml file","<android>","2","1","","",""
"4896715","1","4896754","","2011-02-04 10:04:01","2","6813","<p>I want to get mobile number of own mobile.</p><p>I searched android telephony class but i can not find any useful function over there.</p><p>thanks in advance for your help.</p>","582571","","","","","2014-01-11 23:55:46","How to fetch own mobile number in android","<android>","3","0","0","2013-09-05 20:13:32",""
"4896782","1","","","2011-02-04 10:11:39","0","309","<p>I am developing an Android  game application named Bingo.I have implemented the basic functionality.I have done tapping part also.Problem is that when i click on reset all the tapped images should be changed randomly.Can anybody tell me how should i pursue</p><p>Thanks in advanceTushar</p>","475349","","","","","2011-02-04 10:28:00","getting random images on click of reset button in android","<android>","1","0","","",""
"4896823","1","7203177","","2011-02-04 10:16:18","0","349","<p>I have managed to connect to msn through jml library on android by adding the getpropertyaction class in my project. On android 2.2 works just fine, I can login, get the contacts, send and receive messages and other..</p><p>On android 2.1 when I press the login button It doesn't log me in... I don't get any errors in the log (DDMS).. it just stay's</p>","449310","","","","","2011-08-26 10:10:17","android: jml library for msn don't work on android 2.1?","<android><msn><jml><instantmessenger>","2","0","0","",""
"4896864","1","4897003","","2011-02-04 10:21:42","0","3215","<p>I am very new to Android development and I am facing a little problem here.I want to create a custom TextView class by extending TextView and use this class in ListView(every row of ListView contains this class' object).</p><p>I have created my custom class like this</p><pre><code>public class CustomTextView extends TextView{Context context;Paint mPaint;String text;public CustomTextView(Context context, AttributeSet attrs, int defStyle) {    super(context, attrs, defStyle);    init();}public CustomTextView(Context context, AttributeSet attrs) {    super(context, attrs);    init();}public CustomTextView(Context context) {    super(context);    init();}private void init(){    setPadding(3, 3, 3, 3);    mPaint.setTextSize(16);    mPaint.setColor(Color.GREEN);    mPaint.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));}@Overridepublic void setText(CharSequence text, BufferType type) {    this.text = (String) text;    super.setText(text, type);}@Override  protected void onDraw(Canvas canvas) {    super.onDraw(canvas);    Rect rect = new Rect();    Paint paint = new Paint();    paint.setStyle(Paint.Style.STROKE);    paint.setColor(Color.WHITE);    paint.setStrokeWidth(3);    getLocalVisibleRect(rect);    canvas.drawRect(rect, paint);       }@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {    super.onMeasure(widthMeasureSpec, heightMeasureSpec);    int reqWidth;    int reqHeight;    // width &amp; height mode    int widthMode = MeasureSpec.getMode(widthMeasureSpec);    int heightMode = MeasureSpec.getMode(heightMeasureSpec);    // specified width &amp; height    int widthSize = MeasureSpec.getSize(widthMeasureSpec);    int heightSize = MeasureSpec.getSize(heightMeasureSpec);    // find out Width based on widthMode    if(widthMode == MeasureSpec.EXACTLY)        // set user specified Width        reqWidth = widthSize;    else        // find out the total pixel size required for first and last text        reqWidth = (int)(mPaint.measureText(text)) ;    // find out Height based on heightMode    if(heightMode == MeasureSpec.EXACTLY)        // set user specified Height        reqHeight = heightSize;    else        // get the default height of the Font        reqHeight = (int) mPaint.getTextSize();    // set the calculated width and height of your drawing area    setMeasuredDimension(reqWidth, reqHeight);}}</code></pre><p>and for each row ofmy ListView I have created a xml structure consisting of a TextView,My custom class, and an image</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_height=""wrap_content""  android:gravity=""left|center"" android:layout_width=""wrap_content""  android:paddingBottom=""5px"" android:paddingTop=""5px""  android:paddingLeft=""5px""&gt; &lt;TextView android:id=""@+id/TextView01""  android:layout_width=""wrap_content"" android:layout_height=""wrap_content""  android:layout_marginRight=""5dip"" android:gravity=""center"" android:background=""@drawable/bg""  android:textColor=""#FFFF00"" android:text=""hi""/&gt;&lt;!--&lt;TextView android:id=""@+id/TextView02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""android:layout_marginLeft=""10px"" android:text=""hi""/&gt;--&gt;&lt;com.example.CustomTextView      android:id=""@+id/TextView02""    android:layout_width=""fill_parent""     android:layout_height=""50px""/&gt;   &lt;ImageView android:id = ""@+id/image""android:src=""@drawable/icon""android:layout_width = ""50dip""android:layout_height = ""50dip""/&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>In the Adapter class of my ListView I am retrieving the structure like this</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {        ViewHolder holder;        if (convertView == null) {         convertView =  mInflator.inflate(R.layout.listview, null);         convertView.setMinimumHeight(80);         holder = new ViewHolder();         holder.text = (TextView) convertView         .findViewById(R.id.TextView01);         holder.text2 = (CustomTextView) convertView         .findViewById(R.id.TextView02);}</code></pre><p>But I am getting inflate exception on </p><pre><code> convertView =  mInflator.inflate(R.layout.listview, null);</code></pre><p>However, if instead of my custom view , I add a simple textView in layout.xml(layout structure of each row of listview) then everything works fine</p><p>I have searched forums but I am not getting what i am doing wrong.</p><p>Please help me in this case.</p>","565090","","457982","","2011-02-04 10:26:55","2011-02-04 10:35:28","Getting inflate exception in Android","<android><layout><inflate>","1","1","","",""
"4896889","1","","","2011-02-04 10:24:17","1","454","<p>how can we block previous activity ""if one go from ActivityA to ActivityB then he want come back previous activity means ActivityA so he should not able to come back"" in android</p>","432559","","","","","2011-02-04 10:55:09","how can we block previous activity","<android>","2","2","","",""
"4896908","1","4897882","","2011-02-04 10:26:10","5","1582","<p>I'm developing a reminder app in which I'm running a background process and I want to keep it running always so that even if the phone is switched off, the service should remind the user of the reminders that were scheduled for that particular time after the phone is switched on.</p><p>Is it possible or I need to manage it myself?</p><p>Can anybody please help?</p><p>Thanx in advance.</p>","227943","","","","","2011-02-04 12:19:03","Keep service running even if the phone is switched off","<android><service>","2","3","3","",""
"4896949","1","4896988","","2011-02-04 10:29:01","8","11112","<p>i'm having issues with uploading images in android.</p><p>i'm using apache httpmime 4.1 libthe code is like this:</p><pre><code>MultipartEntity reqEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);reqEntity.addPart(""image"", new FileBody(new File(AndorraApplication.getPhotosPath() + ""/"" + entity.getFileName()), ""image/jpeg""));resp = NetworkUtils.sendHttpRequestMultipart(EXPORT_PHOTOS_URI, reqEntity);</code></pre><p>NetworkUtils class:</p><pre><code>public class NetworkUtils {    public static final int REGISTRATION_TIMEOUT = 3 * 1000;     public static final int WAIT_TIMEOUT = 5 * 1000;    public static HttpResponse sendHttpRequestMultipart(String uri, MultipartEntity entity) {        HttpClient mHttpClient = new DefaultHttpClient();        final HttpParams params = mHttpClient.getParams();        HttpConnectionParams.setConnectionTimeout(params, REGISTRATION_TIMEOUT);        HttpConnectionParams.setSoTimeout(params, WAIT_TIMEOUT);        ConnManagerParams.setTimeout(params, WAIT_TIMEOUT);        HttpPost post = new HttpPost(uri);        post.addHeader(entity.getContentType());        post.setEntity(entity);        HttpResponse resp = mHttpClient.execute(post);    }}</code></pre><p>sometimes everything works fine, but sometimes (especially on a slow connection) the image is uploaded very corrupted. the example is here: <a href=""http://pixelbirthcloud.com/574_orig.jpg"">http://pixelbirthcloud.com/574_orig.jpg</a></p><p>it doesn't throw any exceptions. the lenght of the uploaded file is same as the original one.. tried to change mime type to application/octet-stream or remove it at all. tries playing with timeouts. still same result. end users upload corrupted images almost all the time (although i managed to get bronem images just 2 times only).. the image size was 2.5 megs at first, but then i reduced it to 500-700 kb. didn't fix the problem though. </p><p>haven't tried to change the apache's library.. maybe it is the problem.. but as far as i read the net, nobody was experiencing this with httpmime library.</p><p>what can it be? i'm completely lost now :(</p><p>the other issue is that timeouts sometimes not working.</p><p>like when it comes to this line:    HttpResponse resp = mHttpClient.execute(post);and i disable 3g connection it just waits for like 17-20 minutes instead of 3 or 5 seconds.. and only then throws exception. tried different methods. like this:</p><pre><code>        HttpParams params = new BasicHttpParams();        HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);        HttpProtocolParams.setContentCharset(params, HTTP.UTF_8);        HttpProtocolParams.setUseExpectContinue(params, false);          HttpConnectionParams.setConnectionTimeout(params, 10000);        HttpConnectionParams.setSoTimeout(params, 10000);        ConnManagerParams.setMaxTotalConnections(params, 5);        ConnManagerParams.setTimeout(params, 30000);        SchemeRegistry registry = new SchemeRegistry();        registry.register(new Scheme(""http"",PlainSocketFactory.getSocketFactory(), 80));        registry.register(new Scheme(""https"",PlainSocketFactory.getSocketFactory(), 80));        ThreadSafeClientConnManager manager = new ThreadSafeClientConnManager(params, registry);        HttpClient httpclient = new DefaultHttpClient(manager, params);</code></pre><p>but still doesn't work :)</p>","602945","","","","","2014-04-13 19:44:03","Android httpclient file upload data corruption and timeout issues","<android><http><post><timeout>","3","0","3","",""
"4897004","1","4898846","","2011-02-04 10:35:32","1","5686","<p>Hello i am trying to create SMS aplication witch shows me SMS Inbox in ListView.But if i open this aplication there is no action.I can see only black screen with name of aplication :( .Can somebody check my source code and tell me where is the problem? Thank you.</p><p>There is source code:</p><pre><code>package sms.five;import java.util.ArrayList;import java.util.List;import android.app.Activity;import android.database.Cursor;import android.net.Uri;import android.os.Bundle;import android.telephony.SmsManager;import android.view.View;import android.widget.AdapterView;import android.widget.AdapterView.OnItemClickListener;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;public class Smsfive extends Activity {    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState, ListView messages) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        ListView list = (ListView) findViewById(R.id.list);        List&lt;String&gt; msgList = getSMS();        for(int i = 0; i&lt;msgList.size(); i++) {            System.out.println(msgList.get(i));       }        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,R.layout.main, msgList);         list.setAdapter(adapter);        list.setOnItemClickListener(new OnItemClickListener()       {        @Override    public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position,long id) {         SmsManager m = SmsManager.getDefault();         String destinationNumber=(String) ((TextView)view).getText();                       m.sendTextMessage(destinationNumber, null, destinationNumber, null, null);       }                   });       }    public List&lt;String&gt; getSMS() {              List&lt;String&gt; list = new ArrayList&lt;String&gt;();        Uri uri = Uri.parse(""content://sms/inbox"");        Cursor c = null;        try{            c = getApplicationContext().getContentResolver().query(uri, null, null ,null,null);         }catch(Exception e){            e.printStackTrace();        }        try{            for (boolean hasData = c.moveToFirst(); hasData; hasData = c.moveToNext()) {                final String address = c.getString(c.getColumnIndex(""address""));                final String body = c.getString(c.getColumnIndexOrThrow(""body""));                list.add(""Number: "" + address + "" .Message: "" + body);            }        }catch(Exception e){            e.printStackTrace();        }     c.close();      return list;    }}</code></pre><p>XML File(main.xml):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutandroid:id=""@+id/widget30""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:orientation=""vertical""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ListViewandroid:id=""@+id/list""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><p>AndroidManifest.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=""sms.five""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".Smsfive""                  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.READ_SMS""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt; </code></pre>","600468","","","","","2013-08-31 01:41:04","SMS INBOX - LISTVIEW","<android>","3","5","","",""
"4897114","1","4898448","","2011-02-04 10:49:11","1","209","<p><em>(This question is indirectly related to a programming issue I'm having; if you think this question is off-topic, let me know, I remove it. Thanks).</em></p><p>I try to activate WifiAP from within my app via reflection, as somewhere stated in this forum. It works on several devices, like Nexus One 2.2.1, HTC Desire 2.2, Huawei Ideos 2.2.But it doesn't run on SGS 2.2.1.</p><p>Checking the number of methods of <code>net.android.wifi.WifiConfiguration</code>, I see that the regular class (as it comes on Nexus One, Desire, etc.) has 37 methods, while the SGS version has 57. (The WifiConfiguration class is the class where the methods are being invoked.)</p><p>So obviously Samsung changed this class, and I'd assume they'd be part of their published open source under <a href=""http://opensource.samsung.com"" rel=""nofollow"">http://opensource.samsung.com</a>, but having downloaded GT-I9000_Kernel.tar.gz and GT-I9000_Platform.tar.gz, I don't find any related Wifi related classes, except the lower level wireless drivers in the kernel.I made a fulltext search through all files regarding wifi, etc.</p><p>Some methods that are part of the WifiConfiguration class on SGS, which are not on the regular distribution:</p><pre><code>checkWpsInProgresscreateMulticastLockgetCurrentTimegetProgressLapseTimegetProgressModegetProgressPinNumbershowApDialog...</code></pre><p>and some more.</p><p>Anybody working closely with Samsung devices who has a clue? Where to find the complete modifications done by Samsung?</p>","241475","","","","","2011-02-04 13:22:50","Where to find the complete SGS I-9000 froyo source code?","<android><android-sdk-2.2><android-2.2-froyo><android-wifi>","1","0","","",""
"4897183","1","4897350","","2011-02-04 10:54:59","0","854","<p>Ok guys..I have a problem...I need to create a dialog with 3 CheckedTextView. And when i open a dialog, second item should be checked...How to do that ? Code ...</p><pre><code>@Overrideprotected Dialog onCreateDialog (int id) {        AlertDialog.Builder builder = new AlertDialog.Builder(this);                    builder.setTitle(""Something.."");        builder.setInverseBackgroundForced(true);        ListView listView = new ListView(this);        listView .setAdapter(new ArrayAdapter(Settings.this, android.R.layout.select_dialog_multichoice, new String {a ,b, c}));        builder.setView(listView );</code></pre>","602011","","602011","","2011-02-04 11:02:22","2011-02-04 11:22:10","Android: Alert Dialog with CheckedTextView","<android>","2","0","","",""
"4897209","1","","","2011-02-04 10:57:46","3","615","<p>I have a function in my application to allow user to send sms then logging it's usage. But instead of developing our own SMSHandler, we opt to let user choose whatever SMS app they want to use. It all seems fine but I couldn't find a way to getting response from the other SMS application like delivered PendingIntent mention in this article.</p><p><a href=""http://www.android10.org/index.php/articlesfullapplications/241-sms-messaging-in-android-send-and-receive"" rel=""nofollow"">http://www.android10.org/index.php/articlesfullapplications/241-sms-messaging-in-android-send-and-receive</a></p><p>Is there a way to do it? This is how I request SMS Activity.</p><pre><code>    Intent sendIntent = new Intent(Intent.ACTION_VIEW);    sendIntent.putExtra(""sms_body"", ""Hello SMS"");     sendIntent.setType(""vnd.android-dir/mms-sms"");    startActivity(sendIntent);</code></pre>","271736","","","","","2011-02-04 10:57:46","Is it possible to get SMS sending result from other Activity?","<android><sms>","0","0","","",""
"4897241","1","","","2011-02-04 11:00:19","0","1922","<p>I am using a HTC Desire with Android 2.2 and the HTC headset for phone conferencing. The headset has three buttons. &lt;&lt;, >, >>. During a phone call, the play button hangs up the call, the other two buttons are without function. During the call, the microphone should be muted most of the time (in order to keep background noise down for the other particicpants) unless I need to speak myself. It would be very handy to mute/unmute the phone with one of the headset buttons without taking the phone out of the pocket and unmuting it via the screen.</p><p>So my questions are:<br>- Has someone already successfully tried this? I did not find any existing app in my searches.<br>- How would you go about writing an app to do this? I have seen that there some apps that remap headset buttons for media playing, but I am new to android and would need some basic understanding what we are talking about and whether it's possible at all.</p><p>thanks               Klaus</p>","603020","","","","","2014-01-17 11:01:38","Android: How to mute during phone call with headset buttons","<android><button><phone><mute><headset>","0","1","","",""
"4897349","1","4897412","","2011-02-04 11:13:06","21","16970","<p>I am looking to change the text of a TextView view via the .setText("""") method while also coloring a part of the text (or making it bold, italic, transparent, etc.)and not the rest. For example:</p><pre><code>title.setText(""Your big island &lt;b&gt;ADVENTURE!&lt;/b&gt;"";</code></pre><p>I know the above code is incorrect but it helps illustrate what I would like to achieve.</p><p>How would I go about doing this?</p><p>Thanks!</p>","599429","","","","","2012-07-24 21:36:19","Android: Coloring part of a string using TextView.setText()?","<android><textview>","4","0","8","",""
"4897400","1","","","2011-02-04 11:18:26","1","464","<p>hallo,</p><p>how can i integrate sygic cfi on Android app?</p><p>I received the trial <strong>SDK</strong> from <strong>sygic</strong>, </p><p>but I don't know <strong>how to use it on an Android application</strong>.</p><p>Where can I find some examples?</p><p>thanks</p>","603025","","","","","2011-02-04 11:18:26","integrate sygic sdk into android apps","<android>","0","0","","",""
"4897449","1","","","2011-02-04 11:23:55","0","420","<p>we used back key by calling </p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    if (keyCode == KeyEvent.KEYCODE_BACK) {        moveTaskToBack(true);        return true;    }    return super.onKeyDown(keyCode, event);}</code></pre><p>but,we used 4 classes in our application.if we gives back button,its  working well and returning to application home page.but wen we go next time  its in same class.(we used above back key coding in 3 rd class,its remains same page).</p><p>is there  any alternative method.if anybody knows pls reply. </p>","603055","","473070","","2011-02-04 11:25:25","2012-11-19 11:33:48","how to use back key to home application page","<android>","3","0","","",""
"4897466","1","4897527","","2011-02-04 11:25:38","0","937","<p>I'm really a beginner, I'm reading many different Android books as I would like to learn how to develop my own app.</p><p>The app I've in mind is going to access to a remote database in order the write and read data. I would like to ask your advise about how this is usually done, best practices.</p><p>I want to learnt about databases as I actually know so little (just how to make some sql queries and procedures) and I would like to focus my learning towards Android integration.</p><p>Thanks a lot.</p>","600080","","468793","","2011-07-29 09:51:30","2011-07-29 09:51:30","Remote Database access","<android><database>","1","0","1","",""
"4897469","1","4897501","","2011-02-04 11:26:02","0","304","<p>I have a <code>ListView</code> with 3 items and an <code>OnItemClickListener</code>.</p><p>How can I get a <code>View</code> of the second item?</p><p>I need to change the text in the second item when I click on the first item.</p><pre><code>listView.setOnItemClickListener(new OnItemClickListener() {    public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1,                int arg2, long arg3) {        // TODO Auto-generated method stub        switch (arg2) {            case 0:            ((TextView)/*here i need a view of second item*/).setText();});</code></pre>","602011","","418183","","2011-02-04 11:56:13","2011-02-04 11:56:13","Obtaining a certain view in the ListView","<android><listview>","2","0","","",""
"4897480","1","4897545","","2011-02-04 11:27:33","0","2262","<p>I feel a bit stupid as i can't find the answer to this question, which makes me think i'm actually asking the <em>wrong</em> question. However, here goes...</p><p>I have a list view, and a listviewitem defined in xml, with a couple of fields, nothing special. All set to visible.</p><p>Then I bind to my ListView using a custom ArrayAdapter, and want to hide one of my text views, on row 5. However, it seems to be hiding my TextView on item 0 and item 5. Which is a bit odd? I've simplified the code, to reproduce the <em>problem</em> and hopefully someone will be able to help me...</p><p><strong>My Adapter</strong></p><pre><code>public class MenuScreenAdapter extends ArrayAdapter&lt;String&gt;{    private List&lt;String&gt; _items;    private Context _context;    public MenuScreenAdapter(Context context, List&lt;String&gt; items)    {        super(context, R.layout.list_menu_item, items);        _context = context;        _items = items;    }    private MenuScreenAdapter(Context context, int textViewResourceId)    {        super(context, textViewResourceId);     }    @Override    public View getView(int position, View convertView, ViewGroup parent)    {        View v = convertView;        if (v == null)        {            LayoutInflater vi = (LayoutInflater) _context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);            v = vi.inflate(R.layout.list_menu_item, null);        }        String o = _items.get(position);            if (o != null)        {            TextView tt = (TextView) v.findViewById(R.id.list_menu_item_name);            if (tt != null)                tt.setText(o);            if (position == 5)                tt.setVisibility(View.GONE);        }        return v;    }}</code></pre><p><strong>My Binding Code</strong></p><pre><code>    // Load everything up that we need    List&lt;String&gt; items = new ArrayList&lt;String&gt;();    items.add(""One"");    items.add(""Two"");    items.add(""Three"");    items.add(""Four"");    items.add(""Five"");    items.add(""Six"");    items.add(""Seven"");    items.add(""Eight"");    items.add(""Nine"");    items.add(""Ten"");    // Get the ListView, and set it's adapter. The HomeScreenAdapter    // takes care of the rest    ListView homeScreenListView = (ListView) _mainActivity.findViewById(R.id.view_home_list);    homeScreenListView.setOnItemClickListener(ItemSelected);    homeScreenListView.setAdapter(new MenuScreenAdapter(_mainActivity.getBaseContext(), items));</code></pre><p>Thanks in advance!</p>","383035","","","","","2011-02-04 11:35:13","ListView ArrayAdapter, hiding children inside Row?","<android><android-layout><android-listview><android-adapter>","1","0","","",""
"4897490","1","4897512","","2011-02-04 11:28:18","1","907","<p>I have a little problem when I try to run my Android application. The problem occurs when I push &amp; release a button on my main View. The application is to behave like a portophone (push the button to talk, release to stop).</p><p>To notify that the button is pressed or released, I've tried 2 options:- Adding an onClickListener,- Adding an onTouchListener.</p><p>The first only looks for the button being pressed, so it's not a viable solution. The second solution is able to differentiate between pushed &amp; released, so it's the one I'm using now. The code looks like this:</p><pre><code>// Initialise handler for Push To Talk button    Button button = (Button) findViewById(R.id.buttonPTT);    button.setOnTouchListener(new OnTouchListener(){        @Override        public boolean onTouch(View v, MotionEvent me){            switch(me.getAction()){            case MotionEvent.ACTION_DOWN:                Toast.makeText(getApplicationContext(), ""PTT pressed"", Toast.LENGTH_LONG).show();                // TODO: Activate Push To Talk                break;            case MotionEvent.ACTION_UP:                Toast.makeText(getApplicationContext(), ""PTT released"", Toast.LENGTH_LONG).show();                // TODO: End Push To Talk                break;            }            return false;        }    });</code></pre><p>The problem lies in the ACTION_UP case of the switch. While running, it will only work when you press the button, move the cursor/finger/etc, and then release the button. What I want it to do is press it, and being able to release it without having to move my cursor/finger/etc.</p><p>Anybody have any ideas?</p>","603059","","","","","2011-02-04 11:30:55","How to know if a button is being pressed or released?","<java><android>","1","0","1","",""
"4897499","1","","","2011-02-04 11:29:12","0","515","<p>as asked in question I am using following code I dont know why it send the sms two times</p><pre><code>sendButton.setOnClickListener(new OnClickListener()     {           @Override        public void onClick(View v)         {            msg = messgeText.getText().toString();            no = phoneNumber.getText().toString();            if(msg.length() &gt; 0 &amp;&amp; no.length() &gt; 0)                sendSMS(no, msg);        }    });</code></pre><p>and here sendSMS</p><pre><code>private void sendSMS(String phoneNumber, String message){                           SmsManager.getDefault().sendTextMessage(phoneNumber, null, message, null, null);      Log.d(""Insend"", ""sms sent"");    Toast.makeText(SendSMS.this, ""SMS Successfully sent."", Toast.LENGTH_SHORT).show();    finish();}</code></pre>","517247","","517247","","2011-02-04 12:06:59","2012-01-24 07:34:20","Android sends the same message two times","<android><sms>","2","4","","",""
"4897526","1","","","2011-02-04 11:32:43","-1","736","<p>please give me list of android temporary files or give me list of temporary file extension in android....</p>","603066","","","","","2011-02-04 13:26:57","Android temporary files","<android>","2","2","1","2011-08-01 04:15:37",""
"4897635","1","4897804","","2011-02-04 11:48:48","0","2074","<p>I have a <code>ListActivity</code> which gets its data from a database query. I also have a custom adapter which extends simple cursor adapter.</p><p>To show the customised content, I have overridden the <code>newView</code> and bindView methods. </p><p>Each element of the view has:</p><ol><li><code>TextView</code> containing a title</li><li><code>ImageView</code> containing number of stars - the image shown is changed based on a value obtained from the database </li><li>A button - the button text changes on clicks (Favourite/Make Favourite), and triggers a database update event.</li></ol><p>My problem is this -  when I scroll the <code>ListView</code>, the changes I made seem to disappear .. for instance, the first item is marked favourite, and the list is scrolled ... when I come back to the first item, the text reverts back to its previous value, although internally the db has been updated.</p><p>I read that the <code>notifyDatasetChanged()</code> is not right for this case as the adapter should be notified of the database changes. I am trying to use the <code>reQuery()</code> method, but do not know where to place it. </p><p>Should I place the <code>reQuery()</code> in the <code>onClick</code> method of the button? If not, where should it be placed?</p>","579705","","15168","","2012-05-06 22:48:05","2012-05-06 22:48:36","Android - updating the simpleCursorAdapter","<android><android-listview><android-adapter>","3","0","","",""
"4897665","1","4897686","","2011-02-04 11:53:09","1","7282","<p>How can I set Android Chronometer format to HH:MM:SS??</p>","388088","","72746","","2011-02-07 12:29:47","2013-08-01 00:50:48","Android Chronometer format","<android>","4","1","","",""
"4897732","1","5139374","","2011-02-04 12:02:13","5","1021","<p>I was just curious if anyone has used <code>SyncML (Synchronization Markup Language)</code> and if it's a good standard to use.</p><p>We'd need it for synchronising information from a tablet device to a web server (via web service) and vice versa.</p><p>Is SyncML too bloated? I was looking at some of the SyncML APIs and was quite daunting. So the big choice is to use this standard or build an in-house solution.</p><p>Even if I did do it in-house, we'd have to create some sort of way to define the data we're sending up, so definitely looking at building an XML schema, or alternatively use JSON.</p><p>Any opinions? Ideas?</p>","380579","","","","","2012-11-25 14:31:12","SyncML with Android and PHP Web Service","<php><android><xml><sync><syncml>","2","1","2","",""
"4897774","1","","","2011-02-04 12:07:03","28","17438","<p>Is there an equivalent to iOS's keychain on Android? </p><p>My understanding of the <strong>Preferences API</strong> is that it is not encrypted. For my application it doesn't matter wether these credentials are persisted across devices (i.e. a different use-case to <a href=""http://stackoverflow.com/questions/2411281/iphone-like-keychain-in-android"">iPhone-like Keychain in Android?</a>)</p><p>I also looked at the <strong>KeyStore API</strong> but it seems to leave the actual storage of user credentials up to the application developer. </p><p>Thanks for your help!</p>","460549","","","","","2014-01-15 08:12:36","Android Keychain for user credentials","<android><keychain>","4","0","8","",""
"4897786","1","","","2011-02-04 12:08:39","0","1007","<p>How can we insert date in content://sms/inbox.i m using this code</p><pre><code>ContentValues sms = new ContentValues();sms.put(""date"", long date);objContext.getContentResolver().insert( Uri.parse(""content://sms/inbox""),sms);</code></pre><p>plz give me any solution.</p><p>Thanxkhan</p>","603112","","489261","","2011-02-04 12:11:39","2011-09-14 12:16:25","android SMS Inbox","<android>","1","2","","",""
"4897790","1","4897835","","2011-02-04 12:09:15","5","6597","<p>I want to create a jar file with my own classes. </p><p>Can anyone give me sample code for creating a simple jar file in Android?</p>","479027","","469983","","2011-11-21 10:38:45","2011-11-21 10:38:45","Creating a jar file in Android","<android>","3","2","1","",""
"4897800","1","","","2011-02-04 12:10:04","0","716","<p>hey, now i can save data in my db, but it doesn't show up in the database activity itself. </p><p>@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        onCreateDBAndDBTabled(); //DB und Tables erstellen wenn noch nicht vorhanden        setContentView(R.layout.main);    }</p><pre><code>private void onCreateDBAndDBTabled() {    myDB = this.openOrCreateDatabase(MY_DB_NAME, Context.MODE_PRIVATE, null);    myDB.execSQL(""CREATE TABLE IF NOT EXISTS "" + MY_DB_TABLE                + "" ( id integer primary key autoincrement,""+                       ""Name varchar(100),""+                       ""Comment varchar(128),""+                       ""BookingDetails varchar(255),""+                       ""CustomerProject integer(3),""+                       ""editable varchar(15))""                +"";"");    }public boolean onCreateOptionsMenu(Menu menu) {      super.onCreateOptionsMenu(menu);        menu.add(0, MENU_PROJECTS, 0, R.string.menuProjects)        .setShortcut('1', 'f')        .setIcon(R.drawable.icon);         return true;      }public boolean onOptionsItemSelected(MenuItem item){      switch (item.getItemId()) {      case MENU_PROJECTS:        Intent iProjects = new Intent(this, Projects.class);        startActivity(iProjects);        return true;      }      return false;    }</code></pre><p>}</p><p>This is the insert statement         </p><p>{       </p><pre><code>                        ContentValues cv = new ContentValues();                         cv.put ( ""Name"", Name.getText().toString() );                         cv.put ( ""Comment"", Comment.getText().toString() );                         cv.put ( ""BookingDetails"", BookingDetails.getText().toString() );                         cv.put ( ""Project_kind"", i );                         cv.put ( ""Editable"", Editable.getText().toString() );                         myDB.insert ( Projectshome.MY_DB_TABLE , null, cv);                     }                    finish();                    return true;this is my manifest:</code></pre><p>                                                                                                                                            </p><pre><code>&lt;/manifest&gt; </code></pre><p>here is my LogCat-output the moment i hit the save-button:</p><pre><code>02-09 11:41:53.850: ERROR/Database(719): Error inserting BookingDetails=BookingDetails Project_kind=0 Name=Name Editable=Editable Comment=Comment02-09 11:41:53.850: ERROR/Database(719): android.database.sqlite.SQLiteException: table projects has no column named Project_kind: , while compiling: INSERT INTO projects(BookingDetails, Project_kind, Name, Editable, Comment) VALUES(?, ?, ?, ?, ?);02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteProgram.native_compile(Native Method)02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteProgram.compile(SQLiteProgram.java:110)02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:59)02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteStatement.&lt;init&gt;(SQLiteStatement.java:41)02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:925)02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1300)02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1173)02-09 11:41:53.850: ERROR/Database(719):     at versuch.datenbank.Projects_New.onOptionsItemSelected(Projects_New.java:132)02-09 11:41:53.850: ERROR/Database(719):     at android.app.Activity.onMenuItemSelected(Activity.java:2085)02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:820)02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:139)02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:813)02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:519)02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)02-09 11:41:53.850: ERROR/Database(719):     at android.view.View.onTouchEvent(View.java:3828)02-09 11:41:53.850: ERROR/Database(719):     at android.widget.TextView.onTouchEvent(TextView.java:6291)02-09 11:41:53.850: ERROR/Database(719):     at android.view.View.dispatchTouchEvent(View.java:3368)02-09 11:41:53.850: ERROR/Database(719):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)02-09 11:41:53.850: ERROR/Database(719):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1691)02-09 11:41:53.850: ERROR/Database(719):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1525)02-09 11:41:53.850: ERROR/Database(719):     at android.os.Handler.dispatchMessage(Handler.java:99)02-09 11:41:53.850: ERROR/Database(719):     at android.os.Looper.loop(Looper.java:123)02-09 11:41:53.850: ERROR/Database(719):     at android.app.ActivityThread.main(ActivityThread.java:3948)02-09 11:41:53.850: ERROR/Database(719):     at java.lang.reflect.Method.invokeNative(Native Method)02-09 11:41:53.850: ERROR/Database(719):     at java.lang.reflect.Method.invoke(Method.java:521)02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)02-09 11:41:53.850: ERROR/Database(719):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>hope you can help me again :)</p>","582674","","582674","","2011-02-09 10:48:08","2011-02-10 23:38:00","show data in my android app(saving works just fine now)","<android><sql><save><insert-update>","4","7","","",""
"4897824","1","4897908","","2011-02-04 12:12:53","0","2285","<p>Device: Samsung Galaxy Tab</p><p>I followed this guide: <a href=""http://developer.android.com/resources/articles/window-bg-speed.html"" rel=""nofollow"">http://developer.android.com/resources/articles/window-bg-speed.html</a></p><p>I put the background image in a theme to improve performance and i works really good in portrait orientation.</p><p>Theme:</p><pre><code>&lt;resources&gt;    &lt;style name=""Theme.xxxx"" parent=""android:Theme""&gt;    &lt;item name=""android:windowBackground""&gt;@drawable/background_xxxx&lt;/item&gt;    &lt;item name=""android:windowNoTitle""&gt;true&lt;/item&gt;    &lt;/style&gt;&lt;/resources&gt;</code></pre><p>I attach the theme in the Manifest file to the activity.</p><pre><code>    &lt;activity android:name="".main"" android:label=""@string/app_name"" android:theme=""@style/Theme.xxxx""&gt;</code></pre><p>In drawable directory i create the file background_xxxx.xml:</p><pre><code>&lt;bitmap xmlns:android=""http://schemas.android.com/apk/res/android""    android:src=""@drawable/background_image""    android:tileMode=""disabled"" /&gt;</code></pre><p>In drawable-hdpi directory i put my image 600x1024 px called background_image.png</p><p>In drawable-large-land directory i put my image 1024x600 px called background_image.png for the landscape orientation</p><p>When i start my app in portrait orientation, i see it with the background image in hight definition, but if i rotate it i see the image put in drawable-large-land directory put in low resolution.</p><p>Where do I have to put the landscape image to see it in hight resolution?</p><p>Thanks.</p>","603064","","","","","2011-02-05 03:16:31","Android Window Background Landscape appear in low resolution","<android><image><background><themes><galaxy>","2","1","","",""
"4897959","1","4898428","","2011-02-04 12:29:00","0","72","<p>I built an API and facing a force close in it and this is the following waring that i am getting at console side.</p><pre><code>[2011-02-04 17:49:05 - RMALiteTesting] 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.)</code></pre>","510617","","","","","2011-02-04 13:20:41","Facing Force Close and the problem is in InnerClasses attribute","<android>","1","0","","",""
"4898009","1","","","2011-02-04 12:33:33","0","658","<p>Following the guide at <a href=""http://mihaifonoage.blogspot.com/2009/09/displaying-images-from-sd-card-in.html"" rel=""nofollow"">http://mihaifonoage.blogspot.com/2009/09/displaying-images-from-sd-card-in.html</a>, how can I show only image files following a pattern [EDIT] <strong>in a Gallery widget</strong> [/EDIT]? I'm using a dedicated directory on the sdcard and I have to use the following filename pattern to store images:</p><pre><code>/sdcard/[MYDIRECTORY]/[APPNAME]_[AN-ID]_[ANOTHER-ID]_[DATE].jpg</code></pre><p>Now, I'd like to show only those pictures where <em>[AN-ID] == x</em>.</p><p>I believe that I have to manipulate the ContentResolver, but I have no idea how to do this. I know it would be much easier to just save all associated pictures in a single folder, but I'm not able to do this.</p>","603111","","603111","","2011-02-04 12:52:25","2011-02-04 12:52:25","How to display _only specific_ images from SD card in a GalleryView?","<android><android-sdcard><galleryview>","1","0","1","",""
"4898041","1","4901246","","2011-02-04 12:36:53","1","4105","<p>I am sending data from android to a Generic handler .ashx page in asp.net using http post. But the handler is not able to recieve data. The thing works with httpGet but not with httppost</p><p>The android code</p><pre><code>package com.postApp;/* * HTTP POST and BasicNameValuePair * */import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.io.UnsupportedEncodingException;import java.util.ArrayList;import java.util.List;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.HttpPost;import org.apache.http.entity.StringEntity;import org.apache.http.impl.client.DefaultHttpClient;import org.apache.http.message.BasicNameValuePair;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 postAct extends Activity {    /** Called when the activity is first created. */    class login{        public        String uname;        public String pass;    }    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        setContentView(R.layout.main);            login l=new login();        HttpClient client1 = new DefaultHttpClient();        HttpPost request = new HttpPost(""http://10.0.2.2:18089/POC_login/Handler.ashx"");             l.uname=""piyush"";       l.pass=""gupta"";              List&lt;NameValuePair&gt; postParameters = new ArrayList&lt;NameValuePair&gt;(3);            postParameters.add(new BasicNameValuePair(""uname"", l.uname));            postParameters.add(new BasicNameValuePair(""pass"", l.pass));       try {            request.setEntity(new UrlEncodedFormEntity(postParameters));            UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(postParameters);            request.setEntity(formEntity);          HttpResponse response;          response = client1.execute(request);         BufferedReader in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));         String line;         String page="""";         line = in.readLine();         while(line!=null)         {             page=page+line;             line=in.readLine();         }         TextView tv = (TextView) findViewById(R.id.textview);         tv.setText(page);         in.close();        } catch (ClientProtocolException e) {            e.printStackTrace();        } catch (IOException e) {            e.printStackTrace();        }                        }}   </code></pre><p>The ashx code</p><pre><code>&lt;%@ WebHandler Language=""C#"" Class=""Handler"" %&gt;using System;using System.Web;using System.Linq;public class Handler : IHttpHandler {    public void ProcessRequest (HttpContext context)     {        context.Request.ContentType = ""text/plain"";       // context.Request.ContentType = ""text/html"";        string username=context.Request.QueryString[""uname""];        string password = context.Request.QueryString[""pass""];        context.Response.Write(""Hello Piyush"");        NorthwindDataContext db = new NorthwindDataContext();        var found = (from p in db.Catergories                    where p.cat_ID == 1                    select p.cat_name).SingleOrDefault();    }    public bool IsReusable {        get {            return false;        }    }}</code></pre><p>Please Help!</p>","603125","","1104926","","2011-12-19 13:25:33","2011-12-19 13:25:33","http post request sent from android to ashx in asp.net. cannot receive data","<asp.net><android><http-post><ashx>","2","2","","",""
"4898042","1","4905272","","2011-02-04 12:37:04","2","2351","<p>I saw <a href=""http://www.howardforums.com/showthread.php/1689618-Huawei-Ascend-sync-with-Facebook-problem"" rel=""nofollow"">here</a> that someone listed the contents of the manifest of the official Facebook app's APK.  Is there a way to decompile that, or is that info available elsewhere?</p>","506796","","477415","","2011-02-04 13:32:49","2011-10-18 11:35:11","Is there a way to view the contents of a manifest file from an APK?","<android><facebook><android-manifest>","2","1","1","",""
"4898053","1","9397392","","2011-02-04 12:37:47","4","4257","<p>This is my problem, I have the main view which only shows one button, pressing this button another view is shown. This view has only another button, when this button is push this current view finishs and the control backs to the previous view.</p><p>To show the second view I use startActivityForResult, I put the code here.</p><pre><code>private void startNewview() {           Intent it = new Intent(getApplicationContext(), newView.class);    startActivityForResult(it,VIEW_ID);}</code></pre><p>The view called only has a button event, here is the code</p><pre><code>Button b = (Button) findViewById(R.id.close);    b.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            setResult(RESULT_OK);                           finish();        }    });</code></pre><p>And finally, the method onActivityResult in the main view, here is the code</p><pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {    super.onActivityResult(requestCode, resultCode, data);    if(requestCode == VIEW_ID &amp;&amp; resultCode == RESULT_OK) {        tv = (TextView) findViewById(R.id.tv);        tv.setText(""The result ok is  here :)"");    }}</code></pre><p>The problem is resultCode always is 0 = RESULT_CANCELED and I do not know how to solve it, can anyone help me?</p><p>Thank you very much!</p>","603142","","","","","2012-02-22 17:25:47","Android Getting RESULT_CANCELED when I expecifically add RESULT_OK","<android>","2","1","1","",""
"4898093","1","4967947","","2011-02-04 12:42:41","1","2086","<p>I am using the progress bar for the web view.I need to stop progress bar before the page load.I press the back button but not working in between loading.</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);         requestWindowFeature(Window.FEATURE_NO_TITLE);         setContentView(R.layout.webview);        mWebView = (WebView) findViewById(R.id.webview);        mWebView.getSettings().setJavaScriptEnabled(true);        mWebView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);        final AlertDialog alertDialog = new AlertDialog.Builder(this).create();        progressBar =new ProgressDialog(this);        progressBar.setCancelable(true);        progressBar.show();        mWebView.setWebViewClient(new WebViewClient() {            public boolean shouldOverrideUrlLoading(WebView view, String url) {                Log.i(""TEST"", ""Processing webview url click..."");                view.loadUrl(url);                return true;            }            public void onPageFinished(WebView view, String url) {                Log.i(""TEST"", ""Finished loading URL: "" +url);                if (progressBar.isShowing()) {                    progressBar.dismiss();                }            }            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {                Log.e(""TEST"", ""Error: "" + description);                Toast.makeText(getApplicationContext(), ""Oh no! "" + description, Toast.LENGTH_SHORT).show();                alertDialog.setTitle(""Error"");                alertDialog.setMessage(description);                alertDialog.setButton(""OK"", new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int which) {                        return;                    }                });                alertDialog.show();            }        });        mWebView.loadUrl(""http://www.google.com"");}</code></pre><p>For back button test I use this</p><pre><code>@Override    public boolean onKeyDown(int keyCode, KeyEvent event)  {        if (keyCode == KeyEvent.KEYCODE_BACK &amp;&amp; event.getRepeatCount() == 0) {            Toast.makeText(getApplicationContext(),""hi"", Toast.LENGTH_LONG).show();            return true;        }        return super.onKeyDown(keyCode, event);    }</code></pre>","256612","","79061","","2011-02-04 12:44:05","2011-05-10 10:37:33","how to dismiss the progressbar before the loading using the back button?","<android><android-progressbar>","3","0","2","",""
"4898119","1","7094700","","2011-02-04 12:45:33","0","458","<p>Has anyone tried this flag for wipeData()?I think <a href=""http://developer.android.com/reference/android/app/admin/DevicePolicyManager.html#WIPE_EXTERNAL_STORAGE"" rel=""nofollow"">WIPE_EXTERNAL_STORAGE</a> flag doesn't work because after calling the function, it will reset the phone to factory settings leaving the previous data on the external storage device. I hope someone can confirm about this one. </p><p>Thanks</p>","496042","","","","","2011-08-17 14:39:47","Wipe external storage doesn't work","<android>","1","0","","",""
"4898186","1","4898252","","2011-02-04 12:54:26","3","8042","<p>I have 2 activities. The 2nd .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;ListView             android:id=""@+id/TrainsListView""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""         /&gt;&lt;/LinearLayout&gt;</code></pre><p>Part of manifest:</p><p>                                            </p><pre><code>&lt;activity android:name=""TrainsActivity""&gt;&lt;/activity&gt;</code></pre><p>And I'm trying to get TrainsListView:</p><pre><code>mListView = (ListView) findViewById(R.id.TrainsListView);</code></pre><p>But after this mlistView is null. Why?</p>","497132","","477415","","2011-02-04 13:32:10","2011-02-04 14:50:26","Can not get element from layout","<android><layout><android-layout><android-intent>","2","2","1","",""
"4898198","1","","","2011-02-04 12:55:36","1","492","<p>I have a weather application that is crashing if, while downloading weather data, the user goes out of range of all connectivity, the application hangs and then crashes.  I have implemented a BroadcastReceiver within the MainActivity to detect when there is a connectivity change. I register it in onStart and unregister it in onStop.  When this occurs I cancel all messages and try to display a dialog that informs the user that the connection has been lost.  It appears that the receiver is not being called in time to cancel the handlers.  Is there any way to force priority that the receiver be called upon?  </p><p>I am not sure what code to include, but below is my code for handling the receiver:</p><pre><code> public BroadcastReceiver mReceiver = new BroadcastReceiver() {    @Override    public void onReceive(Context context, Intent intent) {        Log.d(""#########"", ""mReciver onReceive MA"");        if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {            Log.d(""#####"", ""connectivity action MA mReceiver"");            if (mHandler != null) {                mHandler.removeMessages(ACCUWX.Messages.DATA_LOADED_FROM_DATABASE);                mHandler.removeMessages(ACCUWX.Messages.DATAFEED_DOWNLOAD_COMPLETE);                mHandler.removeMessages(ACCUWX.Messages.DATAFEED_DOWNLOAD_FAILED);                mHandler.removeMessages(ACCUWX.Messages.DATAFEED_DOWNLOAD_FROM_GPS);                mHandler.removeMessages(ACCUWX.Messages.GPS_TIMEOUT_OCCURRED);                mHandler.removeMessages(ACCUWX.Messages.LOCATION_CODE_FAILED_FROM_COORDS);                mHandler.removeMessages(ACCUWX.Messages.LOCATION_CODE_FOUND_FROM_COORDS);                mHandler.removeMessages(ACCUWX.Messages.LOCATION_SEARCH_COMPLETE);                mHandler.removeMessages(ACCUWX.Messages.LOCATION_SEARCH_FAILED);                 mHandler.sendEmptyMessage(ACCUWX.Messages.CONNECTIVITY_CHANGE);            }        }    } };    </code></pre><p>From here the message handler:</p><pre><code>case ACCUWX.Messages.CONNECTIVITY_CHANGE:                Log.d(""!#!#@!#$!@$!@#$@!#$@!"", ""CONNECTIVITY CHANGE MSG"");                if (!isNetworkReachable()){                    Log.d(""@!$#@$#!@$@!$#"", ""network not reachable in CONNECTIVITY CHANGE MA MSG"");                    if (mLocationSearchDialog != null) mLocationSearchDialog.dismiss();                    if (mProgressDialog != null) mProgressDialog.dismiss();                    showConnectivityAlertDialog();                }                break;</code></pre><p>And from within this, this method is called to detect connectivity state:</p><pre><code> private boolean isNetworkReachable() {    Log.d(""#########"", ""isNetworkReachable MA"");     boolean airplaneMode = false;     boolean mobileConnected;     boolean wifiConnected;     NetworkInfo wifi, mobile;     boolean result = false;     ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);     try {         int airplaneValue = Settings.System.getInt(this.getContentResolver(), Settings.System.AIRPLANE_MODE_ON);         airplaneMode = (airplaneValue != 0);     } catch (SettingNotFoundException e) {         e.printStackTrace();     }     mobile = cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);     wifi = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI);     mobileConnected = mobile.isConnected();     wifiConnected = wifi.isConnected();     Log.d(""##########"", ""airplaneMode in MA "" + airplaneMode);     Log.d(""##########"", ""mobileConnected in MA "" + mobileConnected);     Log.d(""##########"", ""wifiConnected in MA "" + wifiConnected);     if (airplaneMode)         result = false;     else  {         if (mobileConnected || wifiConnected)             result = true;     }     return result; }</code></pre><p>Any idea how I can stop my application from crashing and let the user know that they lost their connection?</p><p>My error logs are not consistent.  Here are two separate reports:</p><pre> <code> 02-04 08:01:02.889: ERROR/AndroidRuntime(6565): FATAL EXCEPTION: main02-04 08:01:02.889: ERROR/AndroidRuntime(6565): java.lang.RuntimeException: Unable to start receiver com.accuweather.android.simpleweatherlite.dellstreak.widget.WidgetProvider: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2821)02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at android.app.ActivityThread.access$3200(ActivityThread.java:125)02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2083)02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at android.os.Handler.dispatchMessage(Handler.java:99)02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at android.os.Looper.loop(Looper.java:123)02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at java.lang.reflect.Method.invokeNative(Native Method)02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at java.lang.reflect.Method.invoke(Method.java:521)02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at dalvik.system.NativeStart.main(Native Method)02-04 08:01:02.889: ERROR/AndroidRuntime(6565): Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at android.view.ViewRoot.setView(ViewRoot.java:509)02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at android.app.Dialog.show(Dialog.java:241)02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at com.accuweather.android.simpleweatherlite.dellstreak.widget.WidgetProvider.showConnectivityAlertDialog(WidgetProvider.java:127)02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at com.accuweather.android.simpleweatherlite.dellstreak.widget.WidgetProvider.onReceive(WidgetProvider.java:174)02-04 08:01:02.889: ERROR/AndroidRuntime(6565):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2810)</code></pre><p>and another:</p><pre><code>02-04 07:40:07.330: ERROR/AndroidRuntime(6316): FATAL EXCEPTION: main02-04 07:40:07.330: ERROR/AndroidRuntime(6316): java.lang.ArrayIndexOutOfBoundsException02-04 07:40:07.330: ERROR/AndroidRuntime(6316):     at com.accuweather.android.simpleweatherlite.dellstreak.MainActivity$10.handleMessage(MainActivity.java:2067)02-04 07:40:07.330: ERROR/AndroidRuntime(6316):     at android.os.Handler.dispatchMessage(Handler.java:99)02-04 07:40:07.330: ERROR/AndroidRuntime(6316):     at android.os.Looper.loop(Looper.java:123)02-04 07:40:07.330: ERROR/AndroidRuntime(6316):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-04 07:40:07.330: ERROR/AndroidRuntime(6316):     at java.lang.reflect.Method.invokeNative(Native Method)02-04 07:40:07.330: ERROR/AndroidRuntime(6316):     at java.lang.reflect.Method.invoke(Method.java:521)02-04 07:40:07.330: ERROR/AndroidRuntime(6316):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)02-04 07:40:07.330: ERROR/AndroidRuntime(6316):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)02-04 07:40:07.330: ERROR/AndroidRuntime(6316):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","2186261","","2186261","","2011-02-04 13:17:01","2011-02-04 14:51:43","Lose All Connections and My Application Crashes Android","<android>","1","3","","",""
"4898217","1","4936202","","2011-02-04 12:59:04","0","674","<p>I have a WebView that launches a local HTML-file. The URL has an anchor suffix to an anchor point in the HTML. It works fine opening up the WebView the first time, the view is scrolled down to the anchor point correctly. But the next time I open it it fails and the scroll is moved several lines below where I want it to be... </p><p>This is how I write it:</p><pre><code>public void createFaqWebView(String url){    faqDialog = null;    faqBuilder = null;    faqWebView.removeAllViews();    faqWebView = (WebView) getLayoutInflater().inflate(        R.layout.am_faq_info_popup, null );    faqWebView.loadUrl( url );    faqBuilder = new AlertDialog.Builder(           AMImapExchange.this );    faqBuilder.setIcon( R.drawable.info_button_header );    faqBuilder.setTitle( R.string.info_pop_title );    faqBuilder.setInverseBackgroundForced( true );    faqBuilder.setView( faqWebView );    faqBuilder.setPositiveButton( getText( R.string.ok ),        new DialogInterface.OnClickListener()        {            @Override            public void onClick( DialogInterface dialog, int which )            {                imapInfoButton.setEnabled( true );                imapInfoButtonHolder.setEnabled( true );                exchangeButton.setEnabled( true );                exchangeInfoButtonHolder.setEnabled( true );            }        } );    faqBuilder.setOnCancelListener( new DialogInterface.OnCancelListener()    {        @Override        public void onCancel( DialogInterface dialog )        {            imapInfoButton.setEnabled( true );            imapInfoButtonHolder.setEnabled( true );            exchangeButton.setEnabled( true );            exchangeInfoButtonHolder.setEnabled( true );        }    });    faqDialog = faqBuilder.create();    faqDialog.show();}</code></pre><p>I try and ""neutralizing"" all parameters of the WebView when it is opened so that opening it again is like opening it for the first time, but I don't seem to get it to work. =(</p><p>Anyone have any ideas of how I can sort this out?!?! Would be greatly appreciated!</p>","603151","","","","","2011-02-08 17:26:33","Anchor point skipped when re-opening WebView + android","<android><url><scrolling><webview><anchor>","1","0","0","",""
